[SOLVED] How many scenes Can I build?

  • #1, by juansirlinkFriday, 07. October 2016, 18:36 4 years ago
    Hi there!

    I have a little doubt... Are there some limit as to the maximum of scenes I can build with VS 4.2.5? Now, I have 40 screens aprox (for the demo and the prelude), and I think for all the game I will need about 300 scenes. Do you know if exist any known issue if you build a lot of scenes?

    Thanks!!

    Newbie

    46 Posts


  • #2, by afrlmeFriday, 07. October 2016, 18:55 4 years ago
    Theoretically as many as you like...

    Imperator

    6862 Posts

  • #3, by MachtnixSaturday, 08. October 2016, 02:24 4 years ago
    Hm, I'm not a coder, but I would think like one. So it could be safe to use max 255 scenes. If they work ... the next step should be 611 or 1023.

    I don't know how the engine works, but my dual core win7-PC runs slowly down using 30, 40 scenes one after another. Maybe there is a trick to load one part after another and delete the old ones, so you should haven't not more than 10, 20 scenes in memory. The problem is to safe the current player data up to the end of the game. As a player you only move on max. 10 scenes, mostly only 3-5, so you can build levels into blocks. I think reloading by Lua or another trick is very important.

    Thread Captain

    1088 Posts

  • #4, by afrlmeSaturday, 08. October 2016, 02:40 4 years ago
    You need to take care when using keep scene in memory & preloaded animations. Preloaded animations need to be manually unloaded when you no longer need them otherwise the cache keeps on filling up & up & eventually starts eating into your RAM (I believe that's what I was told a while back) which in turn causes the game to run slower & slower. There's an at end of scene action you can create. You could use that to unload preloaded animations if they are no longer needed.

    It's all about optimization anyway. Don't fill each scene up with tons of animations. Try not to go overkill on the amount of frames you use for each animation. There are plenty of tricks you can do to create smooth-ish looking animations without resorting to tons of frames or duplicated frames.

    Converting your images & animations to webp format with xnconvert for example will reduce required hdd space for your game & reduce loading times for animations, it will however not reduce the required amount of VRAM/RAM your game needs to run.

    https://wiki.visionaire-tracker.net/wiki/Game_Optimization
    https://wiki.visionaire-tracker.net/wiki/Image_Encoding

    P.S: @Machtnix: I believe you can adjust the cache size via Lua script. I'm not really sure on what the recommended settings are off the top of my head. The data structure fields are: VGamePicBufferSize, VGamePictureCacheSize, VGamePreloadPicThreads & VGamePreloadedPicBufferSize. You can also adjust the cache in the game tab (cog icon).

    Imperator

    6862 Posts

  • #5, by sebastianSaturday, 08. October 2016, 13:21 4 years ago
    theoretically only one scene should be loaded at the same time (if not otherwise forced to stay in memory by the developer).

    Thread Captain

    2340 Posts

  • #6, by afrlmeSaturday, 08. October 2016, 13:25 4 years ago
    Yeah though cache may still retain various animations in the cache until they are ousted - as long as previous scene wasn't forced to be kept in memory & you manually unloaded any preloaded animations linked to the previous scene.

    Imperator

    6862 Posts

  • #7, by juansirlinkSaturday, 08. October 2016, 16:26 4 years ago
    I'm developing the game divided in episodes. Each episode usually has bewteen 1 and 8 scenes (plus 1 or 2 puzzle scenes). For now, I have got 40 scenes in my VS and the program runs well...I'm not sure if with more scenes it will run slowly.

    Guys, if I have an animation in a scene (but It has not been preload before), when I finish the scene... is this animation unload automatically? I only unload those animations that I have previously preloaded.

    Newbie

    46 Posts

  • #8, by sebastianSaturday, 08. October 2016, 16:38 4 years ago
    the animations should be unloaded after a short time when not used anymore.
    in game you can press TAB and type in SHOW ANIMATIONDETAILS ON. Press PAGE UP/DOWN to scroll through all currently active animations.

    What i recognized in my project is that infinite animations are still available in scenes where they are not used... Maybe they need to be unloaded manually or the will disappear in a much greater timespan than i thought..

    Thread Captain

    2340 Posts

  • #9, by afrlmeSaturday, 08. October 2016, 17:04 4 years ago
    Any animation that was naturally loaded by the engine without preloading should automatically be purged from the temp cache after a while.

    To be honest, you're game seeing as it's pixel art & I'm assuming has quite a low default resolution, you shouldn't really need to bother with preloading any of your animations. Try converting your images & animations to webp format to decrease loading times & required hdd space & your game should run nice & smooth.

    By episodes do you mean that you will be distributing your game in parts or are you talking about chapters in a single feature length game?

    Quick tip: if you press Home (inicio) key on your keyboard while running your game via the VS editor, it will display an overlay with information about how much ram, vram & so on various different aspects of your game are using. It updates more or less in real time, so you can see what is happening when a specific script is executed or when a new animation starts, etc. Very useful. wink

    Imperator

    6862 Posts

  • #10, by juansirlinkSunday, 09. October 2016, 17:14 4 years ago
    Yes, It has a 1024x768 resolution. You're right, the game runs smoothly but I have a scene with lots of animation where it sometimes slows down (I want to reduce the animation size and use the code to scale these).

    Chapters in a single feature length game with some different characters.

    Thanks for the tip, I had no idea. When I push the button some lines with colors appears. I assume that the pink line is about memory used by animations, isn't it?

    Newbie

    46 Posts

  • #11, by caligarimarteSunday, 09. October 2016, 17:34 4 years ago
    Also, if you have any of those Pseudo-While-Actions (utilizing the "Jump to Actionpart"-Actionpart), make sure to quit that Action at the End of the Scene, because otherwise those will also remain running (or at Least the "Home Key"-Overlay says so).

    Forum Fan

    145 Posts

Write post