http://files.byondhome.com/Ter13/Exodus_src.zip
This file will demonstrate the problem with repeating macros.
Press space bar to swap the control scheme between repeating macros and an input handler loop.
The difference is night and day, and it handles very well over a reasonable internet connection. Any game currently using repeating macros for movement needs to stop immediately.
ID:2130520
Aug 11 2016, 8:25 pm
|
|
Aug 11 2016, 8:47 pm
|
|
I absolutely hate repeating macros. There's something implicit in programming design that feels so wrong about having to tell a function the same information over and over again. Design paradigms of "I'll let you know when the status-quo changes" just feel and function so much cleaner.
|
Aren't north/south/east/west() repeating macros?
By coincidence I came into byond discord asking this exact question of why an input handler loop would be superior over repeating macros just a few days ago. |
In response to Clusterfack
|
|
They are.
|
In response to Clusterfack
|
|
It's a key reason why the movement system in my old project didn't use BYOND's default movement system to begin with. It actually turned out to be more efficient for me to do all of the movement and collision handling on my own, not only for system performance, but the additional level of control it gives over movement in your project is just invaluable.
|
Once upon a time, BYOND didn't have +up and +down for macros, and thus, in these dark days, all macros were either repeating or not, there was no in between. That's why the default macros are repeating, there was simply no way to accomplish movement with how macros initially worked.
|
I just want to note that I applied this change to both of my games after I saw this post, and the difference is night and day. Thank you for yet another incredibly useful tidbit!
|
Yeah, I've been using movement loops since the day after the ability to handle up and down macros was added. Quite a few of us were wanting that feature for specifically that purpose. Two macro fires is a whole lot better than 100 for moving across the map for sure.
|
Ter13 wrote:
The difference is night and day SilkWizard wrote: I just want to note that I applied this change to both of my games after I saw this post, and the difference is night and day. Nobody can accuse me of false advertising, that's for sure. Glad to be of service, Silk. Some of these small quality of life fixes can go a long way to making BYOND games not feel like BYOND games. |