Help with performance issues! (Demo provided)

Discussion in 'RPG Maker VX Ace' started by Sophism, Oct 28, 2014.

  1. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,544
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    or to lessen the burden of doing parallax maps, you could always make an edited tileset containing the combined/relocated tiles that you'd be using and use it on the editor itself... 
     
    #21
  2. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    @Engr. Adiktuzmiko :

    That was the first thing I thought of, but then you'd lose the visual of an actual chair.

    - If you used just the chair back, the ground can be seen though the transparent areas.

    - If you used a combined chair seat + chair back tile, while setting a star passability, the 'chair seat' can also be seen over the character.
     
    #22
    Marsigne and Dalph like this.
  3. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,544
    Likes Received:
    2,900
    Location:
    Philippines
    First Language:
    Tagalog
    It all depends on how you set it up. If you use only 1 tile for the whole chair. then yes, they will have a shared passability setting.
     
    #23
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,712
    Likes Received:
    11,419
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    When you DO use parallel processes (especially if you have a lot of them), add a Wait 5 Frames or something at the very end (outside of any conditional branches or loops, possibly as well as INSIDE any loops).


    What happens is that it will be processed EVERY frame. If you have 60 of them, that's 60 events trying to do as many of the commands they contain per frame as possible. That's a whole lot of processing. Adding a Wait as part of each iteration allows other events to have a look-in too, which decreases lag considerably. The longer the wait you can manage, the better.


    Many of these things DON'T need to happen 60 times a second. Something that checks the position of the player, for instance - the player isn't going to cross 60 tiles in a second. A Wait for 20 Frames on a parallel process event like that will cater for you moving 3 tiles per second.
     
    #24
    Susan and Sophism like this.
  5. Sophism

    Sophism Veteran Veteran

    Messages:
    36
    Likes Received:
    6
    First Language:
    English
    Susan, you have no idea how much I appreciate the effort you've put into helping me. Thank you so much!  :)

    It's a bummer that parallaxing wouldn't really solve the issues completely, but I did have a feeling the lighting script would still hold back performance. It's probably for the best though, as I prefer the ease of editing tiles, since small changes to a map this big can escalate into having to redo large chunks of it. (Once upon a time the hedge maze's passages were only one tile wide.)

    Your terrain tag suggestion worked splendidly! Removing all the seat events and hooking up a terrain tag parallel process to handle them bumped up the FPS quite a bit. Even standing next to the fountain at nighttime, with all of the nearby lamp posts and the character's candle lit up, the project now runs at ~30 FPS... so all in all, this change and the previous merger of all the wall transparency events were a vast improvement, to say the least.

    As for the water reflection effect being projected onto the parallax layer, it doesn't seem to impact FPS that much on my system at least. Turning it off yielded a 0-2 FPS gain.

    And Shaz, I hadn't thought of including a small Wait command to my parallel processes. So I went ahead and added a Wait 10 (To account for dashing.) to the wall transparency event. It gave me a 4-5 FPS boost next to the fountain, and anywhere between 2-10 FPS while traversing the hedge maze. A modest but very welcome performance increase without any drawbacks. Thanks for the tip!
     
    Last edited by a moderator: Nov 6, 2014
    #25
  6. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    Hi again, sorry for not posting this earlier.

    Effect on FPS:

    Yes, I found your switches. Switching off the following :
    - character effect - increases FPS by 0-2.
    - film grain - increases FPS by 0-2.
    - blinking - increases FPS by 0-1.

    Having more than one parallel process cause 1-10 FPS loss, considering you're already running a performance intensive map.

    Having many conditional branches, even in one parallel process can cause a drop in FPS 1-5.

    I can't understand the significance of the 'block' events though. They seem to cause lag at the eastern-most house. Probably as bad as the fountain after it's been optimized. FPS drops to 20-30 with those events present. Can you do without them?

    Light effects decreases FPS by 10-30 depending on how many are open at the same time.

    Not that it would change much, but have you considered using a character sheet for the dumpster?
    On to good (but tedious) things:

    1) Be sure to clean up your region ID on your benches. There's a conflicting event/region at the SE bus stop.

    2) Reducing conditional events & used Region IDs:
    - You can reduce the Region ID usage in the maze by combining pictures or the maze from both ends.
    - You have to decide if your maze will be available day & night or just at night.
    - If it is only at night, you can further combine your pictures.
    - If the maze is available during the day, you can reduce region usage by at least 1/3. More if it only available at night.
    - Reducing Region usage will reduce the amount of conditional branches in your parallel process, effectively increasing your FPS by 5-10.

    3) Reducing light sources:
    - I found a way to help increase you night FPS by 5-15FPS (depending on where you are at now) up to 50.
    - It will require quite a bit or trial & error, and fine-tuning from your side.
    Example (not fine-tuned):
    - Create a parallel process with condition switch 11: Night is ON.
    - Create, say 4 separate conditional branches with set handling ON.
    - Use 'script' on each conditional branch:
    -> 1) $game_player.x < 50 && $game_player.y > 60
    - set switch 21: Lights SW ON else set switch 21: Lights SW OFF
    -> 2) $game_player.x >= 50 && $game_player.x <= 100 $game_player.y > 60
    - set switch 22: Lights S ON else set switch 22: Lights S OFF
    -> 3) $game_player.x <= 110 && $game_player.y <= 60
    - set switch 23: Lights N ON else set switch 23: Lights N OFF
    -> 4) $game_player.x > 110 && $game_player.y <= 60
    - set switch 24: Lights NE ON else set switch 24: Lights NE OFF
    - Now change the condition switches of all your light sources (including the windows) to the appropriate regions.
    - Playtest the night scenario & check your FPS,
    - The lesser lights you have on at a time, the less drop your FPS suffers.
    The FPS still seems to drop at times for no apparent reason even when you're standing still.
     
    #26
    Marsigne, Dalph and Sophism like this.
  7. Sophism

    Sophism Veteran Veteran

    Messages:
    36
    Likes Received:
    6
    First Language:
    English
    Susan, I don't mind at all! Like I said, you're already going far beyond what I expect people to help a stranger with.  :)

    Let's see. Effects. The effects don't impact the performance that much, although I suppose they do add up. This is probably OK though, as all of them combined don't seem to produce that much of a slowdown, and quite frankly, outside of the film grain effect (Which I intend to be a toggle option.) I really can't see myself getting rid of the character blinking or the reflections. (The same script will also be used to make mirrors work in the mansion interior.)

    On my version of the project I've already tackled some of the issues you've brought up now as well as previously. Particularly, the wall transparency parallel processes have all been merged into one, including the maze's.

    The Blocks. Yeah, the eastern servant's house Blocks were pointless... one of those stupid mistakes that slip by when you're tired at the end of the day. :headshake:  I think I mentioned them in a previous post, and I had them fixed back then. The only Blocks remaining in my current version are used on the northwestern crypt - three of them covering cracks on the wall to prevent the player from moving through them, and twelve total to handle a couple of edges that the player can walk over or below depending on their elevation.

    Using a character sheet for the dumpsters is a nice idea. They were in my B tileset for a while, so I ended up using the same method I did for the doors with them. You're absolutely right though, turning them into an actor sprite would be a more elegant approach even if it doesn't impact performance. Likely gonna be low priority for now, but I'll be sure to do it sooner or later... since my accursed perfectionism demands it.

    You mentioned the region IDs. I cleaned up all my region IDs when I reworked the Direction Fix event to use terrain tags instead. I did catch the conflict with the bus stop seats too.

    As for the maze; it is available day and night, although at night it turns off your minimap while you're venturing inside it, darkens the area further and reduces the radius of your candle light. I'm not sure what you mean by combining regions for both ends though. Do you mean reusing the region ID for walls outside the current screen position?

    I remember ages ago, when the lights started becoming a problem I looked into a proximity based script, but the way it was implemented meant every light had to be a parallel process too. So it ended up breaking even in terms of performance gain. Your solution circumvents that issue nicely, so I'm about to give it a shot!

    Once this is over, I'll update the demo link so you can see the improvements you helped me with!
     
    #27
    Susan likes this.
  8. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    I can see the huge amount of work & effort you put into your project so I'm more than happy to try to help.

    Obviously, you tried to incorporate a lot of elements of realism in your game.

    Couldn't download your project when you first put it out so I thought your problem was resolved & you had removed it,

    Shaz had a good call on the 'wait' command. I had completely missed that.

    Engr. Adiktuzmiko implied using a combination of A5 & B-E tiles to achieve your seat effect for the back facing ones.

    Re Effects- The FPS affected is negligeable. Just thought I mention it.

    Re Blocks

    - Yes, you mentioned it earlier. Just thought I point it out as that's what I found. Good you have it fixed now.

    Re Doors

    - Maybe you can turn them into a character sheet too. That way you may not need the tile swap script. It was intended for larger scale tile swaps anyway.

    Re Maze

    - Combining all the walls will definitely reduce the amount of conditional branches and Region ID used.

    - Your perception of what I said about combining regions in the maze is correct.

    - However, you won't need to do that now since you've combined it all.

    Re Lights

    - Just try it out and let me know if you need help in setting the switches & so on.

    - Your map only shows 17 x 13 at a time so you don't need many lights on at the same time.

    Working on troubleshooting your project has been very interesting.

    Good idea on putting out a revised version of your demo. That way other people can test for lag & other problems.

    In the future you may want to encrypt it and place it in the Early Project Feedback or Project Development page for people to try & test for you. Just a suggestion though.

    Thanks for sharing, and Good luck!
     
    #28
    Marsigne and Dalph like this.

Share This Page