Page 1 of 1
Script effeciency question.
Posted: Wed Feb 08, 2006 19:45
by chopkinsca
Suppose I want to make a script that controls mutiple timed events such as item respawning. I'm not asking how to make the script, but which way would be more effecient.
1) Have each event in it's own script with a delay.
or
2) have one script that goes through a list of possible events each game tic (or every couple of them) and checks which ones to activate?
Posted: Wed Feb 08, 2006 19:59
by Graf Zahl
It mostly depends on the logic you use to maintain your events. If that is simple the difference is minimal. But if you have to do complex maintenance stuff in your script it'd be better to use one script per event.
Posted: Wed Feb 08, 2006 20:06
by Nash
(2) would drop GZDoom's performance.
Best to go with (1)!
Re: Script effeciency question.
Posted: Thu Feb 09, 2006 4:17
by solarsnowfall
In terms of something like item respawning, it isn't really necessary to check every tic. Unless you need near instantanious item replacement, have it loop every second or few. It doesn't sound like anything terribly resource hungry to me.
Re: Script effeciency question.
Posted: Thu Feb 09, 2006 18:30
by chopkinsca
solarsnowfall wrote:In terms of something like item respawning, it isn't really necessary to check every tic. Unless you need near instantanious item replacement, have it loop every second or few. It doesn't sound like anything terribly resource hungry to me.
I know, when I actually did it, if I did it that way, I planned on working out the longest intervels that I could check each condition.
Anway, I guess I'm just a bit paranoid about making something that will run fine on my computer but slow for other people. Probably because the topic of doom mods that are too slow to be playable for some people has come up often. I want to try and limit the people who I'm excluding from playing the maps, although I'm more doing it for myself.