Trimming graphics and GPU questions (best practices)

  • #10, by MachtnixWednesday, 13. January 2016, 18:48 8 years ago
    Preloading should work even if an animation isn't running. Unless it just keeps it in the cache permanently after being run once until manually unloaded.


    Hm, I'm not quite sure about this. F.e.: At the start of the scene I set an action "preload animation xy", and after them I start it. Worked fine in 3.7 and 4 beta.
    So it wasn't running while using "preload". That seams logical to me, but the animation doesn't start (or isn't seen any more) now. So I kicked this "preload" out. I think there are some changings in the final 4.2 version.

    Machnix

    Thread Captain

    1097 Posts


  • #11, by F_KalWednesday, 13. January 2016, 19:50 8 years ago
    @machtnix, AFRLme interesting points!
    I guess a "chapter X screen" would is a good place to hide the preloading for some of the resources...
    I wonder if in a future version of VS it would be possible to have the pre-caching done on a different cpu thread! That would be useful, and hopefully not causing the game to freeze while this happens.

    Forum Fan

    107 Posts

  • #12, by F_KalWednesday, 13. January 2016, 19:54 8 years ago

    Hm, I'm not quite sure about this. F.e.: At the start of the scene I set an action "preload animation xy", and after them I start it. Worked fine in 3.7 and 4 beta.
    So it wasn't running while using "preload". That seams logical to me, but the animation doesn't start (or isn't seen any more) now. So I kicked this "preload" out. I think there are some changings in the final 4.2 version.
    Machnix


    hmm, maybe start of the scene is a bit too late for preloading?
    Here's a question I'd like to ask: when is the start of the scene event called? Is it before the scene is drawn or is it after it's been drawn?

    Forum Fan

    107 Posts

  • #13, by afrlmeWednesday, 13. January 2016, 21:08 8 years ago
    It's pretty much as soon as the scene in shown I believe after the first system loop. The reason I say after the first is because sometimes you need to add a small pause action part before triggering certain events as they don't always fire when added at the top of the at begin of scene action list.

    I think the best method for preloading would be to...

    a. create a loading screen to preload the required animations for the next scene. You could use if queries or a table or whatever to do this. or...

    b. set the brightness to 0 at begin of scene & disable interaction with the hide mouse cursor action part, then fade it back in & re-enable interaction after x time as passed.

    Quick note: there is no method currently available for checking when everything is done loading, so it's hard to gauge how long you should show a loading screen for or how long before you should fade in the next scene. Also the loading time will vary on each machine the game is played on. My current laptop loads the animations / data much faster than my previous one.

    Imperator

    7278 Posts

  • #14, by MachtnixWednesday, 13. January 2016, 21:25 8 years ago
    hmm, maybe start of the scene is a bit too late for preloading?
    Here's a question I'd like to ask: when is the start of the scene event called? Is it before the scene is drawn or is it after it's been drawn?
    Ok, that sounds interesting. Maybe its too late. I should set the preload function into the game start action. Yes, I usually use pauses between two actions, because I'm not sure what ecactly happens inside the engine... I want my actions one after another... ;-)

    @AFRLme: I tried No a. and b. weeks ago (brightness to zero is a good idea, but I want to show an hourglass), - the mistake could be setting the preload into the wrong place. I will change it.

    Thread Captain

    1097 Posts

  • #15, by F_KalWednesday, 13. January 2016, 21:42 8 years ago
    hmm, if it's after the scene is shown, then it makes sense that preloading... doesn't preload. What about At end of Scene? Is it triggered after the scene disappears, or before it starts unloading?

    Forum Fan

    107 Posts

  • #16, by F_KalWednesday, 13. January 2016, 22:03 8 years ago

    Quick note: there is no method currently available for checking when everything is done loading, so it's hard to gauge how long you should show a loading screen for or how long before you should fade in the next scene. Also the loading time will vary on each machine the game is played on. My current laptop loads the animations / data much faster than my previous one.


    yes, that would be useful - it's useful to know when everything is done loading...
    probably 4 events should also replace the end of scene and start of scene[/] - they are a bit too vague, and - eg.:

    • before unload scene
    • scene unloaded
    • before load scene
    • scene loaded


    the "loading screen" approach is not bad -
    @AFRLme, do you suggest implementing it as a black scene/menu that will act and a buffer between any two scenes? with if clauses, it will unload the preloaded resources of the last scene, preload the ones of the next and only when done load the next scene? Or is there some other way of creating loading screen?

    Forum Fan

    107 Posts

  • #17, by afrlmeThursday, 14. January 2016, 01:01 8 years ago
    No that's about the only way of creating a loading screen. You could of course set the brightness of the game to 0 while you are unloading / preloading then fade it back to whatever value it was at after x time has passed. Either way they won't exactly be accurate as there's no way of knowing when everything has finished loading.

    As for at end of scene... I believe it triggers when the scene unloads. So some of the actions could potentially spill into the next scene.

    P.S: I spoke to Simon earlier who reminded me that there is a method to specify the amount of preload threads via Lua script, but he said he didn't recommend more than 1 thread anyway as it has been known to cause issues (sometimes) or something.

    Imperator

    7278 Posts

  • #18, by F_KalThursday, 14. January 2016, 14:53 8 years ago
    thank you @AFRLme!

    Forum Fan

    107 Posts

  • #19, by afrlmeThursday, 14. January 2016, 15:15 8 years ago
    hmm, maybe start of the scene is a bit too late for preloading?
    Here's a question I'd like to ask: when is the start of the scene event called? Is it before the scene is drawn or is it after it's been drawn?
    Ok, that sounds interesting. Maybe its too late. I should set the preload function into the game start action. Yes, I usually use pauses between two actions, because I'm not sure what ecactly happens inside the engine... I want my actions one after another... ;-)

    @AFRLme: I tried No a. and b. weeks ago (brightness to zero is a good idea, but I want to show an hourglass), - the mistake could be setting the preload into the wrong place. I will change it.



    Sorry must have skimmed over what you wrote or missed it entirely.

    You could temporarily turn the sound down to 0, enable an interface which contains a black image or whatever you want to display. Add animations to buttons, etc. Fade out & hide the interface when done & restore the sound back to whatever it was at. The problem with gauging how long to display said interface for though would still be an issue.

    As for the preloading & unloading. Add them into the at end of scene action part of the previous scene or inside of a called by other action that is triggered when you click on an exit / entrance to another scene.

    * edit: as for the pauses between actions, you don't need to do that. VS works its way down the action list inside of an action block one by one. Adding a pause or wait until action part after an action will cause it to delay the execution of the next action part in the list until the parameter specified has been met.

    Imperator

    7278 Posts

  • #20, by MachtnixThursday, 14. January 2016, 15:37 8 years ago
    The most important reason is the graphic cache size. Press the "Pos1"-button in the player you can see the course of managing the cache. Setting the graphic cache size up to 500 MB (!!) my animation works. My animation needs 325 MB cache and the VRAM takes 509 MB. Its only ONE animation..., whow ;-)

    I have a screen picture at the same scene now to hide the first animation run behind it (with an standard if-clause how often the animation runs). It's important which animation runs first: the first takes all the cache memory it can get (like ABBA: the winner takes it all...). If I use an hourglass animation while loading, this one will take some memory of course...

    I don't use any "preload", but I put all this animation stuff into the start action, BEFORE the first scene will be loaded. I have no idea how this "preload" works...

    All the gamer has to do is waiting... ;-)

    Machtnix

    Thread Captain

    1097 Posts