VN Maker - game slowdowns and performance optimizations

Discussion in 'Visual Novel Maker Support' started by Bors, May 27, 2019.

?

Should there be an exhaustive "best practices" repository for VN Maker?

  1. Yes

  2. No

Results are only viewable after voting.
  1. Bors

    Bors UI/UX Designer Veteran

    Messages:
    34
    Likes Received:
    2
    Location:
    Canada
    First Language:
    Bulgarian
    Primarily Uses:
    VNM
    We just released a roughly one-and-a-half hour long demo of the VN we've been working, and tons of feedback started pouring in. Unfortunately, a lot said feedback is concerning the demo slowing down and not running that great (and some is about the occasional broken save game), which is extremely disheartening.

    Essentially:
    - for some users, load times between scenes are way too long by visual novel standards
    - some users have experienced the game slowing down after playing a while, with sprites moving in a jerky fashion and even in some cases the text being affected

    What we've done to optimize assets:
    - all audio saved as ogg
    - all images saved for the project's default resolution of 1080p
    - png files saved with TinyPNG - great tool, can sometimes save you 60%-70% on the size without much visual downgrade

    Now, any help to specifically optimize our project so it runs properly for as many users as possible would be great. It would be even better if we can create a repository with all the best practices and tricks for making games produced with VNMaker play as smooth as conceivable. Some of the things to start with could be:

    - are there any third party software/libraries/drivers that users should install?
    - are there any third party programs that are known to cause conflicts/problems with VNMaker?
    - what actions/techniques in VNMaker have the greatest performance impact?
    - memory leaks are mentioned a few times in the patchnotes -> are projects started on older versions of VNMaker automatically patched, or are there elements that need to be manually replaced?
    - is there a certain way that you need to properly remove your loaded assets once you are done using them in a scene, or is the change of the scene in itself enough to properly clean them from memory?

    Overall, anything you know that makes games made with VNMaker run better, please post it.
     
    #1
  2. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,630
    Likes Received:
    14,377
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    • Don't run any common events that aren't set as inline when you allow saving.
    • Do not use Call Scene when you are loading new resources in a new scene. Call Scene works better as something where you add several parts. Change Scene is when you want to do those. I'm not sure if you do the same thing, but someone reported us lag slowdowns and it's because they used a ton of call scenes instead of change scene and just using fadein/fadeout to emulate it.
     
    #2
  3. Bors

    Bors UI/UX Designer Veteran

    Messages:
    34
    Likes Received:
    2
    Location:
    Canada
    First Language:
    Bulgarian
    Primarily Uses:
    VNM
    I might be misunderstanding the first point, can you please elaborate on it? Our project (the demo is a straightforward VN with no fancy mechanics, just a sequence of 13 scenes) is based of the Action UI and practically none of the events there are set as "inline". However, mostly everything is "single instance". Also, I can't think of many VNs where you wouldn't allow the user to save...

    On the second point, we only used "call scene" once at the very end of the demo, as it's bundled with the "add choice" common event, and the called scene pretty much is just a line + "change scene". That would hardly impact performance, no?
     
    #3
  4. Kentou

    Kentou Admin Veteran

    Messages:
    186
    Likes Received:
    43
    For the first one, if you have 1080p project, if you have lots of characters, backgrounds and/or parallel common events accessing 1080p assets then a lot of memory is needed to loading can take sometime especially with older SATA/IDE hard drives. On my older Windows Notebook with SATA-Drives I experience that too. This is also partially because of HTML5/NW.js technology.

    For the second one, if you think there is memory leak, the best is to skip through your game over and over again in a loop and check the memory to see if there is more and more (heavy) increase. If that is the case, send us the project so we can go through that loop ourselves and try to figure out the issue.



    Users should download and install latest drivers with OpenGL support. Doesn't matter if other high-end 3D Games work smooth, since those are using Direct3D which is much better supported by Windows and driver vendors by default and especially on default windows installations (like on notebooks).

    If the users PC is too old, like from ~2009 the driver might be black-listed. In that case you can disable the black list setting the:
    --ignore-gpu-blacklist
    flag in the package.json file. If you google about it you find a lot more info about that.

    There shouldn't be conflicts except some anti-virus programs might detect NW.js as a virus which it is not. But I think that has been fixed already but might still happen.

    Try to use smaller graphics and small resolution like 540p or 640p if you want to support older hardware. Don't use 1080p videos for special effects like rain, etc. since that is expensive. Also for audio, due to an HTML5 Web-Audio API limitation, Audio tracks need to be fully decoded in memory first before playback which can cause significant loading-delays on some devices (especially some Android phones) while it causes no issues on others. So try to use not so many long audio tracks in a scene if possible.

    If you don't have much script modifications then everything should be updated automatically. If you have modifications, it depends if those still contain old bugs.

    You have to use Change Scene command and if you expand it, make sure Erase Pictures, etc. is all set to Yes. Assets are usually freed on scene change. Except system assets such as sounds, UI skins, etc.

    Hope that helps, I am still looking into your other issues.
     
    Last edited: May 27, 2019
    #4
    Ubiquit and Bors like this.

Share This Page