XXX4Fans
ShadowRx from patreon
ShadowRx

patreon


HardLife - Unified Object Structures (v0.27+)

 If I had it to do over...

we would have started with a root in-game-object type, with base properties like objectID(instance), objectLocation(x,y,z,map), objectMass, objectVolume, ...which would then be split into the ENTITIES, LOCATIONS, and ITEMS subtypes, and so on, each sub-classification defining additional properties that object possesses either directly, or through inheritance from its prototype and/or parent instance/prototype.

And, I would have probably tried a more object-oriented approach (though, since we don't have proper classes in javascript, it would still be messy), instead of using objects as data-structures only, in what is a mostly procedural approach.

Now, I'm trying to find a way to refactor every-thing into the same basic data-tree, so we can treat all objects with the same consistent logic and functions. (not nearly as scary as it sounds, as right now we only have 2 kinds of things: characters and simple items. We don't actually have cars, just car-encounters that imagine cars are present... that is a prime example of what needs to change.)

A unified object structure would let us:
* target anything or anyone within our power/range
* take any action on that target:
 - lift/carry/grapple
 - throw/catch
 - stand/climb on
 - squeeze/crush
 - hit/stab/shoot
 - talk-to
 - put something inside/take it out
 - break/rip/cut apart
 - or otherwise interact with
* keep better track of what objects were in what locations
* allow things to move/be moved, including buildings/vehicles
* show specific objects on the map, at their actual location

So, it wouldn't matter if it were a person, an otter, a pack of chewing gum, a 747, or a skyscraper, or a planet, it would obey the same physics and allow for the same base interactions.

Anyway, we don't need full object physics, just basic, but we should still have shared actions on any type of possible target...

You can always talk to a wall... but I'd be worried if it spoke back.

This design consideration relates to both the Item and Encounter/Action system refactors, and likely the Time system as well, all slated for engine v0.27.

The CHAR data structure will likely remain mostly unchanged by this, but it will need to be wrapped into a root object structure (or given root-object properties) for use in Actions/Encounters.

All objects, regardless of type, can act as containers/hold other objects. The parent object behaves as both the inertial reference frame for movement, and the selection-frame for targeting. I'm going to try my damnedest to keep the interface uncluttered, but still let you target anything in the same room/chamber/local-reference-frame.

All Objects will have properties like Durability/Integrity, but only Entities will have full stats/ability-scores, and thus a dynamic Durability score.

Item-type Objects need a Qty field, which might also be interesting for Entity types, as this effectively sets the base for handling Swarm Encounters, and might even allow for a replication/mirroring type powers. This saves a ton of space/memory for large numbers of essentially identical objects.

Down the road we can also use this new structure to expand on the description system for all object sub-types... to describe the mass of a car, the scale of a building, the muscle-tone of an animal, etc.

Don't run for the hills yet, this just means taking an extra day or two to plan out a unified data structure for all in-world objects, including characters, and to tweak the CHAR data-structure to include basic object properties.

Then, as we build on the support, we convert the CHAR-only actions to be compatible with any object instead, while keeping any Entity-only effects (such as wild-surges).

This is the time to do it, while the impact on existing content is still minimal, and the affected systems are already under renovation.

A Unified Object Structure will also make it easier to integrate into the CMS. 


Related Creators