Friday, October 18, 2013

Progress report.

Today I finished changes in the DNA and RNA objects classes, and in gene editor too. Now any gene can be set in self maintaining mode. What is it?

It's simple soft cap for the changes. If value of gene that have check box "return to natural value" turned on, will be every hour change it's value toward some "natural" value. It's calculated in parallel with working one, but it's affected only by the character natural growth, and nothing more. Example:

If we have stat that after character growth finished at value 50 then after some time it's eventually return to the 50. How fast - controlled by the "Return force (every hour)" field. This value will be added or subtracted every game hour. Second field "Return force range multiplier" control, will it be linear process or not.

 Actual formula (for case that value < natural value):
value = value + return_force * (Math.abs(value - natural_value) * return_force_range_multiplier)


But it's only one side of it. Best of this feature, that it's not break ability of genes to change as character grow/age. "Natural" value automatically will be changing as it supposed to be, based on the other parameters of gene.

With this finished, I can do a final balance of existing events and tasks for actual gameplay, at they intended to be. For example, "Fitness" not supposed to add 5 to STR immediately and slow but indefinitely increase END. After rebalance character supposed gain something like ten point to the END and 5-7 to STR - this will take several days with slow change. But if character do more than one fitness task in day she can gain more (but not 2x more). But if she cease her regular workouts, stats will slowly go down to her natural value.

The only downside - in new version you will be need to start a new game. Old saves will be unplayable. I'm sorry for this.

4 comments:

  1. Hi! I like the game but I discovered something and wanted to ask about it.

    Is it possible to reduce the weight and speed of the actual save file? Opening it up (I wanted to cheat, sorry.), there seems to be a lot of code inside to process conditions and I don't understand why they would be in a save file. It should be purely data, but for what should be a data file there's a huge amount of runnable stuff!

    There's all these calculations that are going on, and they all have to be written to and read from the xml file, but that makes both writing and reading take longer!

    Looking forward to updates!

    ReplyDelete
    Replies
    1. Short answer is: no, it's not possible.

      Long answer: save contains data as a serialized to the XML objects. Actualy game save contain only one big object - "game world", that contains all others: lists with the characters, global flags, etc. Any character is contains many smaller objects - organs, lists with RNA and DNA genes, personal flags, effects that attached to RNA genes. Full DNA of single character - can be more than 200 objects (so with RNA that have at least that many too - its can be more than 400). Scripts that you see - from the organs and effects. Their scripts not readed from disk any time that they used - copy of script is a part of the object, so it's need to be readed only one single time. After character, effect, organ, etc is created as object, its not read anything from the game files anymore - files only a template for creating actual game object.

      But if you think that loading and saving game this way is a long operation - you are very wrong. It's actualy pretty fast. Almost all waiting at time of loading game comes from initialization of the game engine before it begin to load data from save - the same way as at the regular new game start. And 95% of processor time that game use - it's for executing scripts. They not as fast as native Java code. But pretty fast too. For scripts. :)

      Benefits of this system - I do not need to worry about breaking something in save/load mechanic after change in one single varible somewhere. Process is fully automated. Save will be always compatible at least with the version were they saved, and in most cases - in newer versions.

      Downside of this - after character is created, if I change (fix) something in the scripts used in organs, this will not affect already created characters - they will contain old version of the organs scripts - form the times that they are created. Child of this character will have new version of scripts in the organs (at time of birth new organs objects created from templates on disk for new character, they not clones of memory objects as it for genes), but old version of DNA chain - it's formed only from the DNA of the parents (by selecting them form parents and clone selected objects in memory). This mix can cause issues (as wrong working stats changes), but it can be easily predicted.

      But if you like to cheat - your selected wrong tool for this. "Use dev mode Luke". :)

      Delete
    2. Significant improvement! If I understood correctly, this soft cap is exactly what I have been waiting for from the beginning! Now I dare use fx. fitness without fearing that proxies turn into super beings! And, if I happen to like them very strong, I can still have them like that, I imagine.
      Very curious to see what can be done with certain organs, too. :)
      Fascinating!

      Delete
    3. Actualy it's the cause of so little attention to management side so far. I've been just not sure how to implement this, and how tasks and events will need to be balanced after it. Now I can really finish this aspect of game engine, and gameplay will be much more like it intended to be from the beginning. :) It's still be 0.95 beta version, but game engine itself looks more like it closing to 1.0 release state. :) But few improvements still in my plans before it.

      Delete