Topic: RPG Maker 2003 lag workarounds (Read 717 times)

  • Comrade!
  • Group: Member
  • Joined: Apr 21, 2005
  • Posts: 9
I came across this on the Gamefaqs page for RPG Maker 2003, and it caught my eye:

Reducing Lag

You may notice that in events that have a lot of complex coding, or events that call others with complex coding, tend to lag when the game is played. This makes gameplay very annoying. To prevent this, insert a Wait of 0.0 seconds before and after the Call Event or group of complex coding. This will remove lag almost entirely.

I'm working on an "arcade" project with a bunch of friends.  Basically, each of us is doing a minigame and putting into one RPG Maker project.  There will be some fancy programming and other things, so lag/performance will be an issue.

My question to you all: In addition to the suggestion above, are there any other good tips that we can use to optimize performance?  I'd like to get a "programming tips" document together for people who haven't programmed their games yet, so any suggestions that you can offer would be greatly appreciated.
  • Avatar of Ragnar
  • Worthless Protoplasm
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Premium Member
  • Joined: Jun 15, 2002
  • Posts: 6536
I wonder if there was anything that works the same as Wait 0.0 but better... like CHANGE SHIP LOCATION or some other random command nobody would think of calling

uh... also it helps with show picture if you make the picture as small as possible... so if you have a CMS you should make the menu graphic tiny and specify x, y instead of making a screen-size graphic with a lot of transparency? Also, I remember Move Picture is faster than Show Picture probably because Show Picture makes a new buffer everytime it's called... or something. Only problem with this is the natural thing to move around would be the cursor and you might want that to show instantly instead of /sliding/ over, but I think if you set the transition time to 0.0 seconds it's instant

I think there was something else weird like .xyz pictures show faster than .png. But I really don't know. It'd probably be easy to design a stress test for that though

Also if you do the command "Break" or "End Loop" or whatever it's called, when not inside a loop already, it brings the event to an end no matter how many lines of code are left. It might help to know that when designing your events. Like hell, I dunno, in a CBS if an enemy's already dead none of the other events matter for attacking it because it's already been beaten, and you just end the event instantly. You can have a switch or variable that's off or zero until something happens to make it otherwise. Like so with the dead case, the switch is off by default stays off which signifies a miss
Last Edit: September 11, 2009, 04:47:17 am by Ragnar
  • Group: Member
  • Joined: Sep 9, 2008
  • Posts: 14
Well, the only other thing worth mentioning I can think of is to avoid rotating big pictures because it can lead to an extreme lag, especially combined with show message commands. I could be mistaken, but it seems this mostly happens on Windows Vista.

And something else that has nothing to do with lags:
If you have very long events, then insert a comment at the beginning. This strangely enough reduces the codes loading time.

  • Avatar of Mikemc
  • Caboose
  • PipPipPip
  • Group: Premium Member
  • Joined: Oct 7, 2002
  • Posts: 387
Don't let stuff happen until you need it. Like if you have a floor full of arrows, maybe only activate them just before you get there and deactivate after you pass. In Befuddle Quest 3 there's a map where it feels like the submitter left all the events on and running even though the player hadn't entered their rooms yet.

Quote from: Evangel
You can't run from your past, S4D. YOU CAN'T RUN FROM YOUR PAST!
  • Avatar of Allen Hunter
  • I'm listening.
  • PipPipPipPip
  • Group: Premium Member
  • Joined: Nov 15, 2008
  • Posts: 516
I've never had that much of an issue with lag in Rm2k3. The only time I ever got/get lags is if I played a game in non-full screen (without pushing F5 key to shorten the screen down to the original pixels size) with a bunch of events activated all over the place around my character's presence. And with that, it is a bitch to move around maps.

However, I have realized the usefulness of having Wait set to 0.0 instead of just 0.1. For example, it's easier to do place a Parallel Process Event to change the tint/color of a screen when I'm walking around a certain map. With Wait: 0.1s, right when the screen loaded in a new map, I still saw the same color on the screen as the previous, before changing to the specified one for that map. With Wait: 0.0s, it INSTANTLY changes colors right when it loads and you see your characters.
Last Edit: September 11, 2009, 07:29:25 pm by Allen Hunter

\m/NWOBHM lives on\m/

Хорошая работа для для того чтобы потерять ваше время путем перенести этот никудышный блок текста в английском.
  • Group: Premium Member
  • Joined: Apr 8, 2007
  • Posts: 86
Don't let stuff happen until you need it. Like if you have a floor full of arrows, maybe only activate them just before you get there and deactivate after you pass. In Befuddle Quest 3 there's a map where it feels like the submitter left all the events on and running even though the player hadn't entered their rooms yet.

Might surprise you, but that's exactly how the map was coded, closing down all irrelevant parallel processes to the current segment of the map. It did have a lot of empty events for each arrow tile though, which might have added a little to the load as well (at least in my experience I mean to have noticed that a lot of empty events could cause some lag). Building upon that, you could also use the screen related coordinates to limit stuff like coordinate updates to that which is actually on screen, unless it collides with some other part of the code/system

Choice of looping method could be something to consider as well. label + go to label being the fastest, loop being the second fastest, and simple parallel process being the slowest, with the chance of things lagging being higher with the faster kinds.
And of course, if there is something which doesn't need to be updated all that often, you might wanna use more than just a 0.0 wait as well, leaving it for stuff which needs to be processed faster.
  • Avatar of Blitzen
  • some sort of land-cow
  • PipPipPipPipPipPip
  • Group: Premium Member
  • Joined: Sep 25, 2002
  • Posts: 935
Just script your systems in loop cycles instead of using parallel processes and you should avoid lag almost entirely.
  • Group: Member
  • Joined: Jun 11, 2007
  • Posts: 86
Avoid common events that are parallel processes, except for when completely necessary
Don't do anything stupid (it's hard to think of good examples of this)
Avoid parallel processes and auto starts that could potentially repeat a zillion times per second.
Avoid displaying too many numbers or other pictures that involve a freaking ton of Fork Conditions.  For example, if you want to Show Picture the value of variable A, it might require If A = 1, Show Picture Number1, If A = 2, Show Picture Number2, all the way up to 99, and doing tasks like that seriously slows down gameplay.
  • Avatar of The Penguin
  • Bombs of Fire!
  • PipPipPip
  • Group: Premium Member
  • Joined: Apr 11, 2003
  • Posts: 310
The reason why wait 0.0s works is because each wait 0.0 is actually 0.0167 of waiting.  If you want to, put two or three in there, because all the wait times do is have the parallel process or w/e you are using be executed less often.
If you want to, you can download the link in my sig, and you can open it up in rm2003 and see some of the ways I used to reduce lag; almost all of it is just executing events when they are needed, and at no other times.
  • Comrade!
  • Group: Member
  • Joined: Apr 21, 2005
  • Posts: 9
These are some great answers.  Thanks so much to each of you.  Personally, I've never really used the loop command.  Is there a tutorial for it somewhere that I could read or perhaps one of you can offer up a quick example of how it would work as opposed to using a parallel process.  Are there any particular kinds of trip-ups or things to watch out for when using loop cycles?