XXX4Fans
ShadowRx from patreon
ShadowRx

patreon


HL: Housing, Furnishings, Locations, & Actions [via TAGS]

 I've got it: TAGS. I've figured out how to get the exercises, housing, & locations refactored into raw data!

Any furnishings/equipment/appliances in a room can obviously be directly targeted and used via the new-UI, but we didn't have a way to enable/disable ACTIONS based on what was present.

So, for example, using the Walk/Jog/Run exercise actions will now require you are in a location/room with either the "OUTDOORS" tag or the "TREADMILL" tag.

This means we'll be able to add a functional home-gym and basic furnishing pretty soon after housing & rooms are working.

We'll add the available actions for tags in the current room, and a secondary set below that with all tags in the building/location (that aren't in the current room), which will trigger navigation to the nearest room with that tag prior to the action. (We aren't worried about tracking your position inside the room yet, that would be something to consider later for more advanced combat tactics, but not until we have overhead tactical room maps/layouts to work with. Probably not until around engine v0.8)

Now, while we are using these as TAGS, we have need of additional relevant information, so they will actually be implemented as flat property trees... perhaps the term "bush" would be more apt, as they will only have 1 branch level.

So, back to "TREADMILL":{'count':5, 'busy':3, 'broken':1, 'available':1}. Sub-level information like condition and load settings & capacities, will be retrieved from the individual objects as selected/targeted, rather than being stored at the room-tags level. So what we're checking for is:

if(TAGS.OUTDOORS || (TAGS.TREADMILL && TAGS.TREADMILL.available)) { ... }

which we can shorten with a function to:

if(sX.has(TAGS, 'OUTDOORS|TREADMILL/available'))

especially if we decide that all TAGS will contain a single property-level, and in particular the 'available' property, for any object-type that is supposed to be usable.

Let's say you add a couch, loveseat, & recliner to a room. That should result in the tag: "SEATS":{'count':6, ...}, meaning there are 6 places to sit, hopefully at least 1 of which will be available. Now, do we care about sitting? Not really at the moment... perhaps there are some tasks that would be easier with that option, but nothing the game needs at this time... but the principle is sound and can be used for other things. (And, perhaps we will come back to seating when it comes to restaurants, theaters, and vehicles/mass-transit. Not to mention, some activities & variants require sitting positions... :plotting:)

So, housing & actions (exercise/rest) first, then the TAGS can be put to work converting other locations to the new room/data structure. (eventually getting us to a proper gym with plates-- bonus is each machine we design/add for the gym can also be owned for a home gym) 


Related Creators