Home Artists Posts Import Register
Join the new SimpleX Chat Group!

Content

 Planning a BIG change to STAT implementation...
we're at the limits of what an array of primitives can do;
what I need to decide, is whether to build a STAT class, or just use generic object nesting.

I was hoping by using classes I could minimize the change to the code interface, using default properties for the class which should intercept the arithmetic operators (like increment and decrement, and for that matter assigning a primitive/numeric value), but it doesn't look like javascript supports this as of ECMAScript6.

I guess that's not surprising, not many languages do support default properties for objects/classes shorthand.

Anyway, instead of STATS.STR being changed, it would be STATS.STR.base that interfaces with the setter, and STATS.STR.cached that interfaces with the getter, and of course, any change to base or modifiers will invalidate the cache and cause it to be rebuilt.

But, it looks like I'm going to have to do this the long way... so I've got quite a bit of code to change.


Why? What do we gain by doing this?
* we can prevent stats from EVER becoming NaN, and as a result also help prevent energies from doing the same.
* we can create Buffs/Debuffs for stats that affect energy maximums and regeneration as though the stat were actually that level, eg Proper Buffs/Debuffs for stats.
* likewise, this opens the door for stat-based powers (like super-strength)
* we can begin spending current-stat units as elemental energy to activate powers (ie spend 2 SPD as 2 FIRE to activate a 'blazing fist' power for the duration of the fight)
* we can setup passive/reactive powers that keep an amount of elemental energy allocated for as long as they are on, and also allow passive powers to be shut off, thus freeing the energy/stat points
* we can start introducing powers to the game, in general, which of course means that draining and healing could be officially implemented, with variations, and that certain characters will finally reach their intended power-levels and unlock their true potential

We're still a little ways out, but this is coming soon. (sometime between now and engine v0.34+ which adds elemental energies and resistances, right before powers go in with v0.35)

So there's time, but we need to start planning out exactly how the stat structure will change. I think I'll want to separate modifiers into temporary and permanent groupings, to limit the amount of time we spend rebuilding the cache.


I'm also looking into the exploration system a bit, possibly allowing you to enter x, y coordinates for travel - or some other means of discovering places. I don't know yet, but I want to add a secret shop that you can learn about in game- but then, after the place is discovered, I want you to be able to get back there easily in a new game... perhaps I'll store the discovery outside the saves.

Actually, there are a bunch of hidden locations I want to add soon... but I need to figure out how I want to implement it first.

If I do use coordinates, then that basically makes the design map a cheat to find these places (which I suppose it technically should be, at least for common locations that would be on the map), but remembering/entering coords isn't the friendliest interface.

If I use an extra-save unlocking system, then I need to figure out how/why you can't just walk to x,y to find it... perhaps the locations are split into 2 groups... those that are ON the map, and thus always in the same place... and those that are randomly positioned/move between new games- which would still be on the production map, but not at a guaranteed coordinate during play.

I need to create a rooms system for all buildings, especially for the housing plans... that's still pretty early in planning, but I'm thinking about using a room capacity value split into 3 tiers: large, medium, and small objects.

Large objects take up the full amount of space, reducing the available square footage of the room, but in some cases add capacity- usually at a smaller scale. A table would be a great example, it takes X amount of large item capacity, but returns 2X amount of medium item capacity (above and below the table).

You'll also need to keep a certain percentage of free-space, in order to use the room.

This will limit the number of slaves, exercise machines, etc. that can fit in a room... and it will make furniture useful. It will also make it worthwhile to upgrade your housing accommodations.

And the work on a room system will be reused in Kendra's game, to which rooms are a key feature. (getting us closer to having a 0.1 beta on that game)


Hotfix 2 will be coming out soon, but I'm still trying to figure out what I can add to it content-wise, that won't delay this week's release. 

Comments

No comments found for this post.