• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 User Events... more of them.. with names [SUGGESTION]

xDGameStudios

GameMaker Staff
GameMaker Dev.
what are the plans for user events in the new GMS2 are there any plans?!
well when using user events people don't usually use the numbers

Code:
user_event(1), user_event(2), user_event(3), user_event(4), user_event(5)
instead it's a common good practice to do something like:

Code:
enum ACTIVITY {
      SHOT
      DAMAGED
      ...
}
if that is the proper way to use user events, it would be great if we could address them by strings
just like a ds_map.. that would be far more similar to private methods.. and also make it so more can be created 15 is not that much, when creating objects that really need a lot of "private methods"... it helps structuring code and encapsulation
 

Mike

nobody important
GMC Elder
This isn't currently on our list I'm afraid.

Also, I've said this loads before, but events are slow - much, much slower than just calling a script. So you should limit their use, and certainly shouldn't really call them where you could just do a with(i){ script(); } call.... (or even a script execute where the script ID is stored in the object.

The only thing user events give you is inheritance, so use only when you "need" to.
 

GMWolf

aka fel666
This isn't currently on our list I'm afraid.

Also, I've said this loads before, but events are slow - much, much slower than just calling a script. So you should limit their use, and certainly shouldn't really call them where you could just do a with(i){ script(); } call.... (or even a script execute where the script ID is stored in the object.

The only thing user events give you is inheritance, so use only when you "need" to.
Are they slower than script_execute + array lookup?
 

xDGameStudios

GameMaker Staff
GameMaker Dev.
Ohhhh so events are slower?! :O
I really think there should be a performance database... where people could post various codes performance.. it would be great to know this kind of things... I know I could test.. but if I'm gonna test everything... I'm afraid I won't be doing any coding anytime some :p
The performance information was a plus (I'm always eager to learn this stuff) :)

@Mike what about script() vs script_execute(script) ... what is the performance comparison?! is it too much of a difference?
 

Mike

nobody important
GMC Elder
You know you can time this stuff yourself right? I mean.... this is how we all have to do it to find this stuff out. Just take the time yourself and figure out whats best for you.
 

GMWolf

aka fel666
Perhaps we should build a community driven performance data base.
Where we not only time individual functions and features, but also commonly used patterns etc.

I don't really think the performance of individual features matters too much (like global cars vs instance cars), just use whatever is appropriate.
But it could be useful to know things like the data structures, and their BigO performance VS custom data structures.
This would allow us to know when its worth using, for example, a linked list over a DS list.

I'll think about it, see if I can't setup a little data base and simple website to submit benchmarks.
 

gnysek

Member
Geez I love it <3 I was thinking about writing something like this on my own, so documentation looks more like those wrote using readthedocs.org - but this is also great. Would be nice if you host it on github and allow push requests.
Also would be nice to make it for GMS2 too.

YoYoGames should look at this design and learn a lot.
 
Top