Vectors in GameMaker Studio 2.3

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 25

  • @charcoalPanda
    @charcoalPanda Рік тому +1

    The best thing about your tutorials is that it is enjoyable to rewatch them after a while.

  • @koolgool
    @koolgool 10 місяців тому

    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.

  • @SponkADonk
    @SponkADonk 10 місяців тому +1

    Favorite line, 'With the introduction of structs, you can also use structs.'

  • @EnterWarrior
    @EnterWarrior 7 місяців тому

    this is exactly what I need thank you so much

  • @Ailwuful
    @Ailwuful 3 роки тому +4

    Your channel is gold.

  • @Xplorates
    @Xplorates Рік тому +1

    Splendid, thank you for the tutorial!

  • @TheInevitableHulk
    @TheInevitableHulk 3 роки тому +3

    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

    • @SamSpadeGameDev
      @SamSpadeGameDev  3 роки тому +1

      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).

    • @TheInevitableHulk
      @TheInevitableHulk 3 роки тому +1

      @@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

  • @karlstenator
    @karlstenator 3 роки тому +1

    Khan Academy is also a great place to learn all things maths related. Great video Sam, thanks so much!

    • @SamSpadeGameDev
      @SamSpadeGameDev  3 роки тому

      That is another great place and I've watched a lot of their math videos (even some of their programming videos).

  • @davidmistoffelees8459
    @davidmistoffelees8459 Рік тому

    Where have you been all of my Gamemaker Studio life?

  • @GooseNinja
    @GooseNinja 3 роки тому +1

    Great Videos! Thank you for making them :D

  • @TheCivildecay
    @TheCivildecay 3 роки тому +1

    You are doing gods work

  • @craigcashman2275
    @craigcashman2275 3 роки тому +1

    Incredible content. Thank-you so much.

  • @misterr3083
    @misterr3083 3 роки тому +1

    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?

    • @SamSpadeGameDev
      @SamSpadeGameDev  3 роки тому +1

      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.).

    • @misterr3083
      @misterr3083 3 роки тому +1

      @@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!

  • @headspin4120
    @headspin4120 3 роки тому +1

    Extra thanks!😅

  • @aulasdematematicaefisica
    @aulasdematematicaefisica 3 роки тому +1

    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?

    • @SamSpadeGameDev
      @SamSpadeGameDev  3 роки тому +1

      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.

  • @inkkles
    @inkkles 2 роки тому

    why are all these functions static if they need a vector object to be used...?

  • @AlexLovesDesign
    @AlexLovesDesign 3 роки тому +1

    Pleeeeease do this in arrays too! I'm so much more comfortable with them.

    • @SamSpadeGameDev
      @SamSpadeGameDev  3 роки тому +1

      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.

  • @thiagomedeiros2273
    @thiagomedeiros2273 Рік тому

    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?