Tuesday, February 17, 2015

Difficult decision

Well, I don't fully like this decision, but for sake of the game performance I decided to create standard set of the hardcoded organs in the game engine, on the base of current code of the scripted organs.

They still can be replaced with scripted version, but performance of native java code is much better than scripts. Right now scripts processing take 95-98% of CPU time taken by application. If I planing to expand game to more than 100-150 characters at one game session, performance of scripted organs in characters will become a major issue. (Right now, on my machine "Next Day" with 150 characters take 2-5 seconds - it's too much I think.)

It's can be done fast - early versions of game already started with this support, and I not removed it from code. I just need to create classes for standart organs, and copy scripts code to them.

Pro: game will be working very fast.
Cons: For modders it's will be slightly harder to change behavior of the characters body. But in the worst case - they still can just replace harcoded organs with scripted version. Source code of hardcoded organs will be open right with the released version.

17 comments:

  1. Don't scare me like that! I saw "Difficult decision" and the first thought I had was "oh no, he's giving up on development."

    ReplyDelete
  2. Hmm... That makes me strike a question with your decision. Well, that's "if" you do go along with making it load faster. Will this also make the game more or less stable, or affect the stability at all? Either way, I feel that my game is somewhat sluggish at times (not always, just randomly slower) when I wait a day at a time. It can take up to 10 seconds to load. But that may be my computer.

    On a different note: Not quite sure if it's a known issue but, I also notice my proxy isn't selectable and is deselected if I make the proxy go swimming or running as the first task of the day.

    ReplyDelete
    Replies
    1. Stability may be better, or at least it's will be easier to catch bugs in organs code.

      >Not quite sure if it's a known issue but, I also notice my proxy isn't selectable and is deselected if I make the proxy go swimming or running as the first task of the day.

      This is not a bug - task start at 6:00 day start at 7:00. If task need to be out of house (running, swimming) then proxy will be out before 7:00 and will return later. Press "Next Hour" few times.

      Delete
    2. Well you answered yourself with the decision of game performance. I think you shouldn't worry too much about the modders situation as I'm sure it's still easy to mod and this game is still in development. It definitely has come a long way. I've been seeing improvements all over. I must credit that you've done what a lot of people are unable to do. I applaud you for what you have achieved so far. Cheers!

      Also regarding the swimming/running, that makes sense. Thank you for clearing that up for me. :)

      Delete
  3. Do the current scripted organs stay available? I created some a new organ to handle eggs in proxy body, just wondering if this also works with the new version.

    Putting an extra barrier for modders to change the organs, will most likely increase compatibility with new versions and different mods. I hope the code for the organs stay easily accessible. Some stats like a negative speed and dexterity are extremely confusing if you can’t find out what is causing them.

    Also, that title, scared for a moment you stopped working on the game.

    ReplyDelete
    Replies
    1. Yes scripted organs will be available. I will update released sources by adding these organs classes right with the release of this new version.

      About title - for me it's somewhat of step back, as I can't optimize script processing enough so game stay responsible with 100-200 characters... So it's been really difficult for me to decide this, but I don't see other way for optimization, at least right now.

      Delete
  4. I roughly finished transfering code, and tested prototype with hardcoded organs. It's seems no errors so far. And stress test with creating 100 futanari characters now take 1-2 sec, (before it take about 30-40 sec. on my machine).

    "Next Day" with these 200 characters working the same as with 5-10 characters before.

    ReplyDelete
  5. would it be possible to simply Hardcode the characters that aren't Proxies, instead of the organs? or maybe use the Hardcoded organs solely on the non-proxy characters?

    ReplyDelete
    Replies
    1. Game engine don't threat differently characters for proxy and NPC. Any character can be NPC and can be proxy, so this question don't have sense. :)

      Delete
  6. From a coding standpoint, is it easier on this game engine to deal with a priority based series of templates or to code them all together into a single template as a nested series of if() {then} queries?
    I've been working on some description overhauls, with a primary focus on a responsetext += ""; setup.

    ReplyDelete
    Replies
    1. From engine standpoint it's almost no different, but variant with templates is more flexible from side modders standpoint.

      If you working with descriptions I recommend you to use templates - this way is much easier will be to expand them later.

      Delete
  7. Games like Neverwinter Nights 1 and 2 had a lot of hardcoded stuff under the hood that was out of reach of the modders. However, you could chain in scripts and then tie those into the game with 2da files which were basically like database spreadsheets. The format of those files reminded me of Microsoft Office Access.

    That aside I was kinda going off on a tangent there but my main point is that even with hardcoded organs in play you can still tie in organ mods. What you would need to do to make that more accessible is to create a 'hooked' script basically that hook would call up the primary organs and the mod scripts would call up the 'hook' in their script.

    What this means is that you can lay the framework for mods in the hook and let the modders basically create their own scripts that all have to include the calling for that hook (usually at the top of their script somewhere).

    Its just a suggestion.

    ReplyDelete
    Replies
    1. For now, for role of the hooks can be used temporary added organs (example of these is tmp_bloat_venom.organ). They can respond to the same actiona as "primary" organs. And organ itself do not store data - all data in the character genes, so it acessible from all organs too.

      Delete
  8. How much is 5 liter bottle for the Tentacle Beast semen is?

    ReplyDelete
    Replies
    1. ??? I don't understand this question...

      "How much" what? And no 5 litter bottles in the game.

      Delete
    2. He asks about Tentacle Beast quest.
      Answer each bottle of semen is 0.5 liter so you need 10 of them.

      Delete