Hey again,
So I've done a lot of work in triggers, but have learned enough data to convert some of it into data.
The question I have regarding this is which is better in processing speeds?
Let's say I have a trigger which every 0 seconds gathers a bunch of units and searches around them.
Versus a data behavioral search?
Since there are a decent amount of units in the game, I'm concerned on the lag/speed issue.
As far as I know, in this regard, data would be the way to go.
Most of the things in our project are done through Data, very little is done through triggers (basically just UI, reviving and score tracking). People I think will be quite surprised as a lot of what is possible through Data in Sc2 was only possible through triggers in Wc3. You could theoritically make an entire game through Data.
Triggers have advantages in that they can modify certain data values dynamically and use mathematical functions that would not be practical with pure data. Best path is a fusion of data and triggers where needed.
Still for highly complex stuff triggers might be better lag wise while for simple high replicate stuff use data.
So here's a more specific question, let's say I have about 25 units that need their radius checked every 0 seconds. Would this be better done with a behavior search which triggers an effect (then follows though with triggers). Or just have triggers check the nearest unit if it's within the radius and keep it to triggers?
Since there is no way of "benchmarking" data (for script we have the trigger debugger), nobody can tell whether triggers or data is faster.
I personally believe that they both use the same internal API so i think there is not much of a difference. (At least as long as you have some basic scripting experience, since data is more fail save)
My advice: Do whats practical in data, and the same for triggers. If you get into performance problems you can still try to switch over to data/triggers and see if its any difference.
One fact I like about triggers though is that its easy to find overhead by looking at the debug window and applying optimiziations at the right places. In data there is basically no way to check what causes the biggest overhead and whats really going on, therefore you might have a huge overhead somewhere without even knowing about it.
What I can tell you is that my map is mostly triggers. I haven't noticed any kind of slow down with the game's lag when using lots of triggers for kills/damage/unit enters region.
The biggest issue is that there is a limit to the number of triggers that can run at one time (maybe 256 of them?). Triggers get invoked at the Action, even if the condition isn't met. If you have 10 players, and each player gets spawned 10 units at the exact same time, and you have 10 different "Unit Enters Playable Map Area" triggers, you'll have 1000 triggers running in the same instant and your game will break.
Also, I will continue to use the trigger editor over data. Manipulating data is the worst, and the interface to do it is so clunky. Can't copy and paste, if you change the middle value of a data event then the third value gets reset, you can't reorder your data events. To top it off, the data editor doesn't have any built-in documentation. It may be powerful, but I absolutely hate using it.
Triggers are way more fun, and you should have fun while making a map.
Yeah my map is mostly triggers too. And actually that maximum thread limit is a bit intimidating.
I built a simple physics engine for projectile motion and debating on how to detect collisions. I already have the trigger way done.
Anyways, I plan to actually make the data section and do a few tests to see which one runs better in extreme conditions.
I know it might only apply to my situation, but I'll let you all know how it goes.
Btw, still looking for a data editor for my project. It's pretty far along now. But needs a data editor who knows what he's doing.
Data is applied to the trigger thread limit too so keep that in mind. If you do a ton of stuff at the same time in data you might still run into the same problems triggers can have.
The best and easiest way to go is mix of data and triggers. But it really depends on type of your map. If it is rpg with complex mechanics, character development and less units i think better to use triggers. If it is some melee mod data seems like viable option. Actually i think the most important stuff to learn in data are actors and movers to make cool visuals. Gameplay mechanics much easier to make with triggers that might use some dummy effects and behaviours. All of that imho ofc.
Hey again, So I've done a lot of work in triggers, but have learned enough data to convert some of it into data. The question I have regarding this is which is better in processing speeds? Let's say I have a trigger which every 0 seconds gathers a bunch of units and searches around them. Versus a data behavioral search? Since there are a decent amount of units in the game, I'm concerned on the lag/speed issue.
Help appreciated!:D
As far as I know, in this regard, data would be the way to go.
Most of the things in our project are done through Data, very little is done through triggers (basically just UI, reviving and score tracking). People I think will be quite surprised as a lot of what is possible through Data in Sc2 was only possible through triggers in Wc3. You could theoritically make an entire game through Data.
@DogmaiSEA: Go
I have a prediction, if BLizzard makes a new RTS with an editor, There wont be a need for triggers, it will be 100% data. Dialogs and all.
Triggers have advantages in that they can modify certain data values dynamically and use mathematical functions that would not be practical with pure data. Best path is a fusion of data and triggers where needed.
Still for highly complex stuff triggers might be better lag wise while for simple high replicate stuff use data.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
So here's a more specific question, let's say I have about 25 units that need their radius checked every 0 seconds. Would this be better done with a behavior search which triggers an effect (then follows though with triggers). Or just have triggers check the nearest unit if it's within the radius and keep it to triggers?
Truth is: Nobody really knows.
Since there is no way of "benchmarking" data (for script we have the trigger debugger), nobody can tell whether triggers or data is faster.
I personally believe that they both use the same internal API so i think there is not much of a difference. (At least as long as you have some basic scripting experience, since data is more fail save)
My advice: Do whats practical in data, and the same for triggers. If you get into performance problems you can still try to switch over to data/triggers and see if its any difference.
One fact I like about triggers though is that its easy to find overhead by looking at the debug window and applying optimiziations at the right places. In data there is basically no way to check what causes the biggest overhead and whats really going on, therefore you might have a huge overhead somewhere without even knowing about it.
@Juxtapozition: Go
As data can only check every 0.0016 seconds without causing major issues I would use triggers for that divide by 0 situation.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@Juxtapozition: Go
What I can tell you is that my map is mostly triggers. I haven't noticed any kind of slow down with the game's lag when using lots of triggers for kills/damage/unit enters region.
The biggest issue is that there is a limit to the number of triggers that can run at one time (maybe 256 of them?). Triggers get invoked at the Action, even if the condition isn't met. If you have 10 players, and each player gets spawned 10 units at the exact same time, and you have 10 different "Unit Enters Playable Map Area" triggers, you'll have 1000 triggers running in the same instant and your game will break.
Also, I will continue to use the trigger editor over data. Manipulating data is the worst, and the interface to do it is so clunky. Can't copy and paste, if you change the middle value of a data event then the third value gets reset, you can't reorder your data events. To top it off, the data editor doesn't have any built-in documentation. It may be powerful, but I absolutely hate using it.
Triggers are way more fun, and you should have fun while making a map.
@SkrowFunk: Go
Yeah my map is mostly triggers too. And actually that maximum thread limit is a bit intimidating. I built a simple physics engine for projectile motion and debating on how to detect collisions. I already have the trigger way done.
Anyways, I plan to actually make the data section and do a few tests to see which one runs better in extreme conditions. I know it might only apply to my situation, but I'll let you all know how it goes.
Btw, still looking for a data editor for my project. It's pretty far along now. But needs a data editor who knows what he's doing.
Data is applied to the trigger thread limit too so keep that in mind. If you do a ton of stuff at the same time in data you might still run into the same problems triggers can have.
As far as number crunching goes triggers are limited to two threads working simultaneously so can only use 2 cores of your computer.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
Is data incorporated into these two threads? As if it was triggers?
I have a prediction, if Blizzard makes a new RTS with an editor, There wont be a need for Data, it will be 100% triggers...
...I hate data...
♥♥Triggers♥♥
@Antimatterthunder: Go
hahaah, they did that it was called Sc1, and it was in the 90s :P
The best and easiest way to go is mix of data and triggers. But it really depends on type of your map. If it is rpg with complex mechanics, character development and less units i think better to use triggers. If it is some melee mod data seems like viable option. Actually i think the most important stuff to learn in data are actors and movers to make cool visuals. Gameplay mechanics much easier to make with triggers that might use some dummy effects and behaviours. All of that imho ofc.
@Juxtapozition: Go
According to my brother yes. He also mentioned something about concurrency...
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg