I spent like 12 hours yesterday brute forcing my way through learning vectors, this would have been so useful to have watched first, lol Definitely very useful, thanks for this.
5:35 ya I really wish there was a sort of "lightweight struct" that was really just an array the compiler babied to simplify like pos[vec.x] into pos.x and have the compiler just know certain functions only apply to certain light structs on compile time
YoYo has said in the forums that their first goal was to get structs working and without issues and then to work on performance, so my guess is they will get faster in the future (or perhaps already have and I just haven't tested it).
@@SamSpadeGameDev A new beta update just went live including struct performance update, they believe the performance it is now on par with dsmaps but I'll be sure to test it. Even then, what I was really proposing was just an easier way to access arrays in a struct like way that doesn't require its own scope. Like for pos/spd/acc, types like vec2 that can easily need to be read/written to thousands of times per frame of you have enough entities
Incredible tutorial! So engaging to watch, we really appreciate all the work that goes into these super high quality videos. I would love to see an array version, how much faster is it do you think?
I'm not sure, and I haven't done a test of the two in awhile. When I tested the two versions back right after the initial release of 2.3 I could get about twice as many instances with the array version before the frame rate dropped below 60. The amount of instances this was depended upon how complex the behavior was. So on my old laptop a complex flocking sim was a hundred or so, and a basic seeking sim was a couple thousand. In thinking about it, I'll almost certainly do an array version later on, probably close to the end, so that I can say here is what it looks like for arrays, and just plug it into the code and do a comparison. You can see an example of an array version here: github.com/dicksonlaw583/gmlinear2/blob/master/extensions/GMLinear/GMLinear.gml but this includes both matrix and vector functions and was done as an extension prior to 2.3. It's very good, but also far more complicated with several layers of additional mental overhead (extension, a ton of functions, single letter variable names, no ability to name arguments, etc.).
@@SamSpadeGameDev Thanks Sam! That is very interesting indeed, once again, thanks for your amazing work, always such a treat when you release a new video!
I really like Sheldon Axler's book: Linear Algebra Done Right. I use Manim and was impressed with your presentation. What program do you use to make your animations?
I use Camtasia to edit my videos. Graphs like that are not exactly what it was meant for, so it's a little fiddly, but it works pretty well once it is all set up.
I almost certainly will at the very end. If you want to see the basics of what it looks like you can find a (much more comprehensive) version here: github.com/dicksonlaw583/gmlinear2/blob/master/extensions/GMLinear/GMLinear.gml. Not by me, but by another GMC member.
When I try to add "acceleration" to my velocity using "velocity.add(acceleration), my game don't run and says: ERROR in action number 1 of Step Event0 for object Obj_Enemy2: Variable .add(100024, -2147483648) not set before reading it. at gml_Object_Obj_Enemy2_Step_0 (line 14) - velocity.add(acceleration); Can someone help me?
The best thing about your tutorials is that it is enjoyable to rewatch them after a while.
I spent like 12 hours yesterday brute forcing my way through learning vectors, this would have been so useful to have watched first, lol
Definitely very useful, thanks for this.
Favorite line, 'With the introduction of structs, you can also use structs.'
this is exactly what I need thank you so much
Your channel is gold.
Splendid, thank you for the tutorial!
5:35 ya I really wish there was a sort of "lightweight struct" that was really just an array the compiler babied to simplify like pos[vec.x] into pos.x and have the compiler just know certain functions only apply to certain light structs on compile time
YoYo has said in the forums that their first goal was to get structs working and without issues and then to work on performance, so my guess is they will get faster in the future (or perhaps already have and I just haven't tested it).
@@SamSpadeGameDev A new beta update just went live including struct performance update, they believe the performance it is now on par with dsmaps but I'll be sure to test it.
Even then, what I was really proposing was just an easier way to access arrays in a struct like way that doesn't require its own scope. Like for pos/spd/acc, types like vec2 that can easily need to be read/written to thousands of times per frame of you have enough entities
Khan Academy is also a great place to learn all things maths related. Great video Sam, thanks so much!
That is another great place and I've watched a lot of their math videos (even some of their programming videos).
Where have you been all of my Gamemaker Studio life?
Great Videos! Thank you for making them :D
You are doing gods work
Incredible content. Thank-you so much.
Incredible tutorial! So engaging to watch, we really appreciate all the work that goes into these super high quality videos. I would love to see an array version, how much faster is it do you think?
I'm not sure, and I haven't done a test of the two in awhile. When I tested the two versions back right after the initial release of 2.3 I could get about twice as many instances with the array version before the frame rate dropped below 60. The amount of instances this was depended upon how complex the behavior was. So on my old laptop a complex flocking sim was a hundred or so, and a basic seeking sim was a couple thousand.
In thinking about it, I'll almost certainly do an array version later on, probably close to the end, so that I can say here is what it looks like for arrays, and just plug it into the code and do a comparison.
You can see an example of an array version here: github.com/dicksonlaw583/gmlinear2/blob/master/extensions/GMLinear/GMLinear.gml but this includes both matrix and vector functions and was done as an extension prior to 2.3. It's very good, but also far more complicated with several layers of additional mental overhead (extension, a ton of functions, single letter variable names, no ability to name arguments, etc.).
@@SamSpadeGameDev Thanks Sam! That is very interesting indeed, once again, thanks for your amazing work, always such a treat when you release a new video!
Extra thanks!😅
I really like Sheldon Axler's book: Linear Algebra Done Right. I use Manim and was impressed with your presentation. What program do you use to make your animations?
I use Camtasia to edit my videos. Graphs like that are not exactly what it was meant for, so it's a little fiddly, but it works pretty well once it is all set up.
why are all these functions static if they need a vector object to be used...?
Pleeeeease do this in arrays too! I'm so much more comfortable with them.
I almost certainly will at the very end. If you want to see the basics of what it looks like you can find a (much more comprehensive) version here: github.com/dicksonlaw583/gmlinear2/blob/master/extensions/GMLinear/GMLinear.gml. Not by me, but by another GMC member.
When I try to add "acceleration" to my velocity using "velocity.add(acceleration), my game don't run and says:
ERROR in
action number 1
of Step Event0
for object Obj_Enemy2:
Variable .add(100024, -2147483648) not set before reading it.
at gml_Object_Obj_Enemy2_Step_0 (line 14) - velocity.add(acceleration);
Can someone help me?