Saturday, August 29, 2015

Facing the big problem

It's time to go back to work. And now I must face a big issue I've been avoiding for months: I must create an algorithm that supports different zones. The issue started when the map grew too much. Now it's so big that adding more space produces performance problems, as making game slower and FPS reduce (mainly in old computers). For now is OK, but I need more space for new enemies and quests. Thus, before adding more stuff, I must fix it.

I've thought about creating different zones, so when you go out from zone A to enter zone B, the game must delete all elements in zone A. So players keep feeling the map as a continous zone, with no FPS reduction.


Imagining it is easy, making it real is hard. So, it's time to work.

-------------------------------------------------

- Update 1: The algorithms to detect where Beth is, and the Algorithm to swap zones are perfectly working! The next steps are:
  • Delete sprites in the zone Beth is going out. But only the not important sprites. Bosses and items with state (such as chests or quest items) must not be deleted in order to mantain their states.
  • Divide the map details into zones and between zones.
 - Update 2: Deleting sprites task finished. Now I'm proceding with the final step to get the algorithm ready.

- Update 3: Algorithm es basically done and working. I'm finally polishing a couple of bugs.

-------------------------------------------------

The algorithm is finished. Game works perfect. The game performance is supposed to have been improved for slow computers. The only difference other users will find is some slight pauses when Beth gets into a new zone due to the creation of the new area.

That's why next update bar has progressed to 70%.

^_^

54 comments:

  1. Yay an update. I almost lost hope. I love the concept of zones and removing enemies and npcs from other zones to help with performance. I'm not a programmer, so unfortunately I am unable to assist. Just support.

    ReplyDelete
  2. The cheap and common way is to use transition areas which cannot see very far - caves, tunnels, that sort of stuff.
    Those would typically use a very small amount of graphic data, memory-wise, so it's fine to load one main area + all the transition ones. The extreme is to always use the same tiles for every transition area, so all you need is the current area + transition sets.

    When the character enters a transition area, you preload all the data for the target main area but you don't free the previous one yet - in case the player turns back. Only when you enter a main area do you free the other main area (where applicable, i.e. the player didn't turn back).
    If you have different transition tilesets, you can also free all of them and reload the current area's transition tilesets.

    Of course all this is much easier said than done, and I'm not versed in AS so I'm not entirely sure what you can actually do with it.
    Looking forward to your progress !

    ReplyDelete
  3. Here's sort of and idea I don't know how AS work's so im just going out on a long shot here but say when you go to a new zone could you just load transfer to a new map or zone or a cell I should call it.

    ReplyDelete
  4. Currently, the game tends to crash when the player gets close to the bridge, most likely due to the number spawned "mini-me" enemies. Unloading assets from zones the player leaves will probably help with that.

    ReplyDelete
    Replies
    1. It crashed even if I kill all ants, including «big mom». There must be some other reason for crash (probably, too many active zones).
      Sometimes (not often, but still) game also crash in other locations, such slime’s cave, where only 3 slimes and 1 lizard (and slime boss).
      —————
      For now, only way to evade that bug — save before go to bridge, and load that save after crush. But all crashes in cave appeared after returning from bridge.

      I hope, new system can fix that.

      Delete
    2. I can't assure that the new algorithm will fix those issues. So, we'll still have to test it in a future.

      Delete
  5. Yo, welcome back!

    ReplyDelete
  6. Why go with the limitations you're facing when better options are out there? Why not use Unity 2D or something else? Why not just close the game off and give quick fade screens to load levels?

    ReplyDelete
    Replies
    1. Using Unity would be like starting the game from 0
      :(

      Delete
    2. Unity can’t guaranty anything; sometimes it glitch and lag even more then flash (if it is even possible).

      Delete
  7. Im happy to see you are continuing the project, I was unaware of the limitations you were currently facing but am glad you are brainstorming a fix before the problem becomes a problem.

    I look forward to future releases of additional content.

    ReplyDelete
  8. Not familiar with this platform either, but I agree with several of these folks: seems the easiest option is to separate the zones and have them load individually. I can't imagine it would take more than a few seconds? Doesn't seem like a big deal to me.

    ReplyDelete
    Replies
    1. That's what I'm trying to. The problem is that not all items can be destroyed and reloaded, because they will loose their properties. For example, if I destroy the rat boss when you go out of the zone it is, when you come back it will be totally regenerated (and it's supposed to not appear any more once defeated).
      So, some items must stay no matter where Beth is.

      Delete
    2. Is it possible to use cookies to save changes done in certain area and load this area with stored data? Like some kind of autosave?

      Delete
    3. Yes, but it could be a real headache for me. Some people are having saved game issues due to Flash cookies management. That proves I'm not very efficient using those cookies.
      xD

      Delete
    4. Seems to me that all entities in the zone are going to need to be saved either way - couldn't you serialise all the relevant properties - health, location, alive, etc. and store them in memory, saving to flash when a normal save is done? Using an object-oriented approach is the way forward.

      Delete
    5. I'm keeping only the information for some quest related enemies and items (rat boss and elven ring, for example). The rest of the stuff is destroyed when you leave the zone and regenerated when you come back (such as regular rats and mushrooms).

      Delete
  9. i'm pretty noob with this kind of thing but couldn't hurt to try to help with a possible idea:

    Is it possible to have a code which is carried with beth, and in it records of what was done? and "instruct" the map to not generate some things based on this code?

    But yet again i'm noob on this, and you probably already have thought something of the sort :P

    ReplyDelete
    Replies
    1. In some way, that is what I've done.
      :)

      Delete
  10. Always glad to hear the project is still alive

    ReplyDelete
  11. THE PROGRESS BAR IS ALIVE! WITNESS!

    ReplyDelete
  12. Almost year since previous 10%, but at long last, there is it!
    —————
    What’s for last 30%?

    ReplyDelete
    Replies
    1. Basically:

      Creating a new zone - 10%
      Creating a new Enemy - 5%
      Creating a new NPC - 5%
      New quests - 5%
      New H-event - 5%

      Delete
    2. Is the New H-Event the scene with the Ent showcased a while back? or is this going to be something unrelated?

      Delete
    3. The ent and H-event will be in the next update.

      Delete
  13. Hello HNyarly, I'm glad that you are still working on this great game. I must say that idea of a better platform is really good, because someone could help you recode game so your time spend is minimized, without that someone actually making anything new and the game remains 100% yours. New platform would be a huge payoff in the future.

    ReplyDelete
  14. yay glad to see progress, now to just continue patiently waiting. looking forward to the next update

    ReplyDelete
  15. Only problem i can forsee is massive lag transitioning between zones, as one must simultaneously be deleted as the second is spawning. I suggest a sidescroller-type, when you load the huge/static files in transition areas(eg. background, trees, rocks), with smaller, dynamic ones (enemies, items) spawning in an area around the main character (this case "beth"). This area is larger than that of the viewing port. This area can also be adjusted by the player, i.e. "best mode" loads a greater area around Beth per unit of movement.

    You may also want to consider a "key map". For example represent the entire map as coordinates with basic characters representing objects. Have the engine retrieve the coordinates of objects from this file, using a key to recognise which file to load. This allows you to store, and retrieve, relatively massive amounts of info with practically zero lag.

    Hope this helps :)

    ReplyDelete
    Replies
    1. Yes, as you predicted there is some lag that freezes the game when the character is doing the transition from a zone to another. However, is a couple of seconds, and game doesn't change to zone frequently, so it's ok.

      It is finished and working perfect!

      Delete
  16. Heeeey, HNyarly,tell us, how is your life treating you, are you still busy a lot? Or should we set our hopes high for 100%?

    ReplyDelete
    Replies
    1. Hi!
      I'm having peaks of busy time, but in my lapses of free time I'm working in the game (and playing Gauntlet Slayer Edition, hahaha). The good news are that I've finished the hardest part for the next update: the zone swap algorithm. So the tasks I have to finish for the next update are easy (but still need time).

      ^_^

      Delete
    2. xD Just keep having fun making this game, I think that's what makes it so great.

      Delete
  17. its just an idea
    what if you make loading screen between the zones? you know what i mean :) ^^
    and can be trigger by a teleport or gate or something or just hit the action button on a mark :D

    ReplyDelete
    Replies
    1. Well, I somehow did it.
      When you walk from a zone to another, I made transition zones, so the game just stops for a few seconds (and so you don't see the new background appearing from the void). But when Beth just teleports, she appears in a blank zone that must be re-created.

      So, I used a blue screen until the items in the new zone are ready. I thought about making some kind of loading screen, and I'll probably do it. But as long as it's a secondary task and it's not really needed for the next update, I prefer to focus in other features I want in the next update.

      Delete
    2. so what you think? Raper enemys :D ? xD

      Delete
  18. will the new female character be featured in the upcoming update?

    ReplyDelete
  19. I'm sorry, but I have to ask if you have done anything about saving issue or with the way of saving?

    ReplyDelete
    Replies
    1. Nope. I was trying bit I was unable to fix that (for the moment)
      :-(

      Delete
    2. OK, when you release next version I'll run it on VM and use save state.

      Delete
  20. Thank you for updating, I was legitimately worried that something had happened to you!

    ReplyDelete
  21. And the sex vaginal points the wolf reaper boss ?

    ReplyDelete
    Replies
    1. I'm not sure if I should add points this way. I mean, should she increase her sex skills when she's not supposing to try to please someone? She's not doing an action able to be improved by practise.

      Delete
    2. I'd say maybe award a point or two if she cums. It'd be a nice bonus and could repersent the posable beginnings on beth ' s road to beastality

      Delete
    3. Make sure whe'll get some sluttyness points for that, hehehe.

      Delete
  22. Can't you store only the state of important objects, rather than keeping the sprites loaded even if you move out of the area ?

    ReplyDelete
    Replies
    1. Well, the really important items are so few that it's not a problem to keep them in memory.
      The problem is that there are so much items that can't keep them all.

      Delete
  23. When the next update is approximately going to be completed? You've done such a perfect work, I was always dreaming about such a type of game! please keep us updated about the time remaining before next update ;)

    ReplyDelete
    Replies
    1. Those days I had time to fix a bug and making some background items... No idea for the update.

      I want to make some more progress this weekend, and maybe posting something.

      ;)

      Delete
    2. Any progress? :3
      What was the bug about?

      Delete
    3. Game crashed sometimes. Testers said to me that it doesn't happen with the new zone algorithm.
      ^_^

      Right now I'm making more background items.

      Delete
  24. Seeems that new algorithm is doing wonders for the game.
    I'm guessing thats why you are adding more bg content now?

    ReplyDelete