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?
Script effeciency question.
Moderator: Graf Zahl
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
- Nash
- Developer
- Posts: 1226
- Joined: Sun Sep 25, 2005 1:49
- Location: Kuala Lumpur, Malaysia
- Contact:
- solarsnowfall
- Persecution Complex
- Posts: 363
- Joined: Fri Aug 05, 2005 8:51
Re: Script effeciency question.
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.
- chopkinsca
- Posts: 183
- Joined: Thu Dec 29, 2005 8:09
Re: Script effeciency question.
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.