Types of movement in games

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

КОМЕНТАРІ • 9

  • @PJutch
    @PJutch 4 місяці тому +2

    Another useful classification you can make is discrete angle vs continous angle. Like shooting in Dead Cells (2 directions) vs Super Metroid (8 directions) vs Terraria (any angle) is significantly different.

  • @fuzzy-02
    @fuzzy-02 4 місяці тому +3

    That was insightful to watch, I liked the (current) final implementation especially the part where stuff like collision is handled on the discreet plane level, I feel it make things much easier to code and for performance wise.
    Would love to hear about benchmark comparison

    • @undermountain_dev
      @undermountain_dev  4 місяці тому

      Thanks!. It's much easier implementation wise, but I don't have any data about performance, unfortunately. The entities movement wasn't bottleneck at any point, so I didn't bother improving it's performance. This change was only driven by how painful it was to work with previous solution. From my experience, I would say second solution is more performant, but without proper tests it's hard to say.

  • @PJutch
    @PJutch 4 місяці тому +1

    Problem with discrete movement on a square grid is is that it creates an eternal question: how many neigbours cell has?

  • @PJutch
    @PJutch 4 місяці тому +1

    I have seen another nice solution for interpolation - exponentially interpolation. Iirc the formula is newSpritePos = fieldPos + (oldSpritePos - fieldPos) * exp(-speed*deltaTime) Basically, you just multiply distance between sprite position ad field position by factor < 1 and adjust that factor because of variable frame rate. Nice thing about it is that you only need to store sprite position and field position and it's execatlywat you want to access.

    • @undermountain_dev
      @undermountain_dev  4 місяці тому

      Hmm, haven't seen that, but looking at formula it should work nicely, no conversions needed. Maybe I will find chance to test it. Thanks!

  • @piteroix
    @piteroix 5 місяців тому +2

    Really interesting video. I love the 420 2137 reference ❤ LIKE 👍