How is Lag Possible in RM Games?

Discussion in 'General Discussion' started by Labyrinthine, Nov 4, 2016.

  1. Labyrinthine

    Labyrinthine Artist/ Developer Veteran

    Messages:
    445
    Likes Received:
    392
    Location:
    Labyronia
    First Language:
    Finnish
    How is it possible that we've got some super-realistic 3D games with a million moving parts running in 60 FPS, and yet my RPG Maker project starts lagging if I insert more than 4 simple light sources in a single space. Shouldn't these fairly simple 2D games run smoothly with modern computers no matter how much events and stuff you stack into them? I'm aware what causes the lag in most situations, but I still can't understand it.
     
    Last edited by a moderator: Nov 4, 2016
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,797
    Likes Received:
    11,505
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I would look at the events/scripts you are using to see if they're causing it.  Don't be so quick to blame it on the engine.


    If you want help, make a post in the Support forum for the appropriate engine, and show screenshots of the events you use to add the light sources, along with a link to the script you're using (if any).


    RM runs just fine at 60FPS until you start inserting things that cause it to lag, and that could be as simple as not turning off a parallel process when it's done its job.
     
    Last edited by a moderator: Nov 4, 2016
    #2
  3. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    There are many reasons why a "simple 2D game" might lag.


    There's a lot of underlying logic behind a "simple 2D game", so whereas from a design perspective, all you have is a light being shown, from a technical perspective, it's not exactly all that simple.


    As for how it's possible, it's all about what tools are used and how they tools are used.


    The hardware is there, but if you don't use it properly, you'll get sub-optimal results.



    The more things you add into it, the more processing power is required. Even the most powerful computer will start to slow down given enough things to do.
     
    Last edited by a moderator: Nov 4, 2016
    #3
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,942
    Likes Received:
    10,648
    First Language:
    English
    Primarily Uses:
    RMVXA
    I would especially check out any parallel processes you might have.  One sub-optimally designed parallel process can bring a game almost to a halt.


    As for only a few events causing lag, I've just done a quick count on one moderately complex map in VXAce.  I have 134 events there, many of them moving, lighting, switches being activated and deactivated by the player walking on certain tiles, and it runs smooth as butter.  That's not because I have a high end computer, it's very much mid range.  And I've had no complaints from players, and there are now thousands of them, who between them probably have most specs.
     
    #4
  5. ElementalLight

    ElementalLight Resident Anime Junkie Veteran

    Messages:
    250
    Likes Received:
    58
    Location:
    Lands of Adrin
    First Language:
    english
    Primarily Uses:
    RMVXA
    I very often run into lag in RM games. the simple answer is just the amount of things the computer processes in the RM engine and what not . 

    My best guess is that using a lighting system in RM is heavily CPU/GPU intensive .

    Id recommend one of the many anti lag scripts made to fix issues like this they typically help a fair bit.
     
    #5
  6. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,323
    Likes Received:
    2,961
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    See, Rpg Maker is quite versatile. You can make an event that is a villager and when the player press a button on it, the villager will say something. You can make another even that is a trap that activates when you step on it. And you can do many other things with events, so it's natural that your maps will have many of those. One of the problems with lag is that after every step of the player, the game will need to check if the character is now stepping on an event that activates on touch. To check that, the game needs to look into every event of the map to see if it's on the right place and with the right trigger. And repeat that for every step of the player.


    RM will let you configure special conditions on terrains, so that you can have for example one kind of terrain that causes damage on the player when the player steps on it. For that to work, the game needs to check the kind of terrain you're stepping on after every step.


    And just like those two examples, there are many other things that your game may or may not have, so basically the game code is always checking if something should be happening at that moment. And to check that, it needs to go through all pages of all your events, so there's always a lot of stuff happening under the hood.


    It's different from a game made in, let's say unity. Because on an unity game, you'll code what happens under the hood directly, so your game won't be constantly checking a list of events to see if there's anything to do at that moment. The code will be smart enough to only run when it's needed.


    But as people said on the other replies: if you organize your game well, it should run just fine.
     
    #6

Share This Page