[SOLVED] How many scenes Can I build?

  • #1, z juansirlinkFriday, 07. October 2016, 18:36 hodinky 8 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!!

    Bažant

    46 Posts


  • #2, z afrlmeFriday, 07. October 2016, 18:55 hodinky 8 years ago
    Theoretically as many as you like...

    Imperátor

    7285 Posts

  • #3, z MachtnixSaturday, 08. October 2016, 02:24 hodinky 8 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.

    Kapitán

    1097 Posts

  • #4, z afrlmeSaturday, 08. October 2016, 02:40 hodinky 8 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).

    Imperátor

    7285 Posts

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

    Kapitán

    2346 Posts

  • #6, z afrlmeSaturday, 08. October 2016, 13:25 hodinky 8 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.

    Imperátor

    7285 Posts

  • #7, z juansirlinkSaturday, 08. October 2016, 16:26 hodinky 8 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.

    Bažant

    46 Posts

  • #8, z sebastianSaturday, 08. October 2016, 16:38 hodinky 8 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..

    Kapitán

    2346 Posts

  • #9, z afrlmeSaturday, 08. October 2016, 17:04 hodinky 8 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

    Imperátor

    7285 Posts

  • #10, z juansirlinkSunday, 09. October 2016, 17:14 hodinky 8 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?

    Bažant

    46 Posts

  • #11, z caligarimarteSunday, 09. October 2016, 17:34 hodinky 8 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).

    Fanoušek fóra

    145 Posts