Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New forum theme up and running!
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Major Lag
« previous
next »
Print
Pages: [
1
]
Author
Topic: Major Lag (Read 4604 times)
drenrin2120
Global Moderator
Sage
Posts: 6,101
Major Lag
«
on:
November 18, 2010, 02:15:32 AM »
Quick question if anyone knows, does using the show picture command as opposed to the move picture command create more lag?
«
Last Edit: November 18, 2010, 06:26:27 PM by drenrin2120
»
Logged
SaiKar
KOFFING!
Staff
Royal
Posts: 4,082
Re: pictures
«
Reply #1 on:
November 18, 2010, 02:25:44 AM »
One command by itself? Nah. The same command repeated over and over in some sort of loop? Definitely. I'm not sure there's a difference between the two though so it's more about controlling how often the loop repeats.
Logged
drenrin2120
Global Moderator
Sage
Posts: 6,101
Re: pictures
«
Reply #2 on:
November 18, 2010, 02:48:32 AM »
Yeah, how about 600 conditional branches with a max of 20 possible "show picture" commands every time the players pushes a button. And when autoscroll is on, that's happening somewhere around 5 times a second. Maybe more.
The lag isn't the worst, but it could get worse by the time I'm done coding it all.
Logged
SaiKar
KOFFING!
Staff
Royal
Posts: 4,082
Re: pictures
«
Reply #3 on:
November 18, 2010, 03:04:59 AM »
I'm not sure if you're exaggerating with the 600 conditional branches thing. But, um, if you're not, you might want to look at splitting that up into separate events.
Logged
drenrin2120
Global Moderator
Sage
Posts: 6,101
Re: pictures
«
Reply #4 on:
November 18, 2010, 06:26:03 PM »
Okay, so I'm converting this topic into a different problem. Major lag problem with my Magic HUD.
I'd post the whole event but it's too damn long. Which I know is the problem (being too long). Here's basically how it works.
There are five different events that take part in displaying the Magic HUD. The most important event takes into consideration what keys the player is pushing. We'll call this event,
KEY INPUT
This event just changes a few variables around. It is a parallel process.
The second event is called by
KEY INPUT
when it is need, it determines what HUD to display based on the variables the first event is giving it. We'll call this event
HUD DISPLAY
. It is inactive (not parallel).
The third event is also called by
KEY INPUT
when it is need. Except, this event determines where to place the Arrow display based on variables it's been given. We'll call this event,
ARROW DISPLAY
. This event is inactive.
The fourth event is the
AUTO SCROLL
event. It has two pages. The second page is a parallel process, it is activated by a switch when either the Item or Magic Menu is opened. Very simply, it acts independently of
KEY INPUT
. It merely waits until the player has held a key down for about a second, then auto scroll takes over, zipping through the list at an item every .0664 of a second. (I think, that is if 0.0 wait is equal to .0166)
Now, the fifth event causing all the lag, we'll call it
LIST DISPLAY
, is inactive. It is roughly 580 conditional branches long and changes 20 pictures at a time. This is due to the way I have the system set up. In the Magic HUD, there are a maximum of 20 items that can be displayed at any given time depending on what skills the character has learned. The pictures themselves don't move when the player pushed up/down. Instead, the pictures change their appearance to give the affect of a scrolling list.
LIST DISPLAY
is called every time the player pushes the up/down arrow. That means, when
AUTO SCROLL
is doing its thing,
LIST DISPLAY
is being called every .0664 seconds (in theory). Obviously, even when I was scripting all this, I had some concerns about lag. But I didn't think it would be this bad.
I was hoping the problem was in the amount of conditional branches the system was running through in a short amount of time. I was wrong. I tested this theory by breaking
LIST DISPLAY
up into 4 pages. Each page was only capable of displaying a range of items and each page was called accordingly, thus cutting down the amount of conditional branches the system had to work through from about 580 to 150 (at a time).
But this didn't reduce lag.
I'm thinking it has to do with the 20 different "show picture" commands happening
x
amount of times a second. But I just can't figure out how best to implement a list system.
*TLDR
My list display is too slow and I think the way I set it up is inefficient. What can I do to reduce lag? Or, is there a tut out there that describes a better way of creating a list in rm2k3?
Any help or suggestions would be god sent. Thanks for reading the whole thing if you did and I hope that's enough information.
Logged
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: Major Lag
«
Reply #5 on:
November 18, 2010, 07:45:24 PM »
Hmms, hmms.
Well there's a reason why I avoid using pictures like teh plague.
Anyway. So your list that shows on the screen consists of 20 different "items / spells" ? and pressing up down swaps between them?
Also, is the lagg while holding down the button or also when simply pressing it?
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
drenrin2120
Global Moderator
Sage
Posts: 6,101
Re: Major Lag
«
Reply #6 on:
November 18, 2010, 09:41:56 PM »
yeeaahh, pictures are a hassle, but I've seen them done the right way and they look and feel much better than charasets/chipsets. Plus, they're easier to deal with... provided you do it right, unlike how I did it, apparently. xD
Well, yeah, it's a menu containing all the skills a character has available to them and it displays 20 at a time out of a possible 60. That means every time the player presses up/down or holds up/down, 20 different pictures change using the "show picture" command. I feel I might know how to code it using "move picture" commands, but I use the word "might" strongly. Plus, it'd mean I'd have to scrap what I've already done. So I'm hoping there's a way to just make it work better.
As for your question, when pushing up/down repeatedly to scroll through the menu one skill at a time there is some lag. When holding up/down to autoscroll, there is a LOT of lag.
Let's say I have Picture ID's 1 through 20. 1 through 10 are on the left side of the column, 11 through 20 are on the right. Depending on where the cursor is on the list (which is kept track of by two variables: "List Lead" tracks positions 1 through 30, "List column" tracks either column 1 or 2) the conditional branches determine which pictures (1 through 20) should be displaying what skill.
Hope that makes sense.
Here's a screenshot of it:
«
Last Edit: November 18, 2010, 09:52:15 PM by drenrin2120
»
Logged
A Forgotten Legend
Your neighborhood box of colors
Royal
Posts: 4,428
Re: Major Lag
«
Reply #7 on:
November 18, 2010, 09:53:24 PM »
As soon as you said lag I though of the "Wait: 0sec"
Logged
drenrin2120
Global Moderator
Sage
Posts: 6,101
Re: Major Lag
«
Reply #8 on:
November 18, 2010, 09:55:03 PM »
yeah, I tried putting that in with my conditional branches, but it froze the system up. =\
and for some reason it kills auto-scroll.
«
Last Edit: November 18, 2010, 09:56:38 PM by drenrin2120
»
Logged
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: Major Lag
«
Reply #9 on:
November 18, 2010, 10:15:00 PM »
What if you reduce the number of skills shown at a time? From 20 to like 12-16, there might just be too much to process at the same time after all.
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
drenrin2120
Global Moderator
Sage
Posts: 6,101
Re: Major Lag
«
Reply #10 on:
November 19, 2010, 12:57:09 AM »
Well, I was hoping I wouldn't have to do something drastic, but the more I read up on reducing lag on rm2k3, the more it seems I just did it wrong. Sure, it works, but the 20 "show picture" events are causing a lot of lag.
I'm gonna see what happens when I switch the "show picture" commands to "move picture" commands.
Logged
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Major Lag