Adding sprites and animations to my game engine

Sdílet
Vložit
  • čas přidán 8. 07. 2024
  • Data locality segment inspired by "Game programming patterns" By Robert Nystrom
    Music:
    - Rhombus by Peppsen
  • Hry

Komentáře • 20

  • @cient_dev
    @cient_dev  Před 20 dny +1

    As a quick note before I make the next dev log, I just want to say that in practise, you usually don't want to store the animation map in the AnimationComponent itself (Was just for demo purposes) Instead, store a string or enum in the component to index a map holding every available animation in some kind of Asset manager class so you don't store identical animations across different components!

  • @ryanlockhart5328
    @ryanlockhart5328 Před dnem

    0:09 I felt that

  • @tay7931
    @tay7931 Před 3 dny +1

    i want to get into game development but then i realise how complex coding languages look to me and i get super overwhelmed lol

    • @cient_dev
      @cient_dev  Před 3 dny +3

      There are so many engines now that make it so accessible, you don't have to do what I'm doing here! Toby Fox claims to know very little about coding and he went ahead and made Undertale in GameMaker studio

    • @tay7931
      @tay7931 Před 3 dny

      @@cient_dev oh i see, thank you!

  • @kactusking243
    @kactusking243 Před 22 dny +6

    Bro please keep making videos

    • @cient_dev
      @cient_dev  Před 22 dny +2

      Working on a new one!

    • @kactusking243
      @kactusking243 Před 22 dny

      @@cient_dev nice, I saw all of them were from a month ago and got worried you’d quit

  • @clumsygiant_
    @clumsygiant_ Před měsícem +3

    Subbed! Keep up the good work

    • @cient_dev
      @cient_dev  Před měsícem +1

      Will try and make you proud

  • @SkitzFist1
    @SkitzFist1 Před 21 dnem +1

    Nice video. Would love to see a deep dive of your ECS

    • @cient_dev
      @cient_dev  Před 20 dny +1

      You'll probably enjoy the next dev log

    • @SkitzFist1
      @SkitzFist1 Před 20 dny

      Awesome! Looking forward to it 😁

  • @clafted871
    @clafted871 Před měsícem +3

    Awesome! Love to see ECS stuff, though I do wonder, as I work on my own ECS engine too, would it help to have the entities and their component data be serializable? I was thinking of a JSON-style format, so that someone could simply make a new component with something like:
    "CollisionComponent {
    Width: 10
    Height: 12
    }"
    I figured it may be an easier implementation than a whole game editor as larger game engines like Unreal and Godog have, yet I can't figure how to do it. Thoughts??

    • @cient_dev
      @cient_dev  Před měsícem

      Honestly I haven't really played with serialization much in the context of an ECS, but having it could definitely be helpful (especially with state) and there are some libraries I've encountered that can dump simple structs like components into a JSON from within the code to handle serialization.
      But if you want to avoid hardcoding components and just have your own JSON-esque component ecosystem, maybe just have a Component class with a name and map, like
      struct Component {
      string name;
      map properties;
      }
      And you could parse the JSON file into this general struct, so that 'name' would be assigned as 'CollisionComponent' and properties would contain 'width: int(10)' and 'height: int(12)'.
      Then you simply just retrieve a desired component by name, and can get it's values using the properties map, like
      if (component.name == 'CollisionComponent') {
      int width = std::any_cast(component.properties["width"]);
      }
      Not sure if that's the most efficient solution but that's what I'd do if I went with JSON approach

  • @bakje24
    @bakje24 Před 10 dny +1

    3:22 very random and probably doesnt matter but why 4? why not 2? top left and bottom right is all you need no?

    • @cient_dev
      @cient_dev  Před 9 dny

      Good question! You can definitely just provide 2 corners and derive the rest from it in RenderSprite, I just personally find it more readable for RenderSprite to take in 4 UVs without having to do any of the derivation logic within the function (Separation of concerns I guess); And the Renderer::Sprite struct is just a way to wrap parameters to send to the function so it's more readable, it's a stack allocation and is destroyed at the end of the call so added memory isn't really an issue.

  • @OscarMdev
    @OscarMdev Před 29 dny +1

    Hello, I am trying to make an engine with ECS, I wanted to ask if you followed any class design or sequence for your engine. Currently I have been trying to apply it to a Java game but I always have the same problem regarding its architecture.

    • @cient_dev
      @cient_dev  Před 29 dny +1

      I don't follow a specific architecture for the engine, but try to follow design patterns that I've picked up over time when they're helpful. Reading game programming patterns by Robert Nystrom is a good start, and if you'd like to see how some games implement an ECS, check out some games that use EnTT (an ECS library) here github.com/skypjack/entt/wiki/EnTT-in-Action

    • @diadetediotedio6918
      @diadetediotedio6918 Před 21 dnem

      ​@@cient_dev
      I recommend some Sanders Mertens articles like 'Why its time to start thinking games as databases' and others, even if you don't use flecs, it is very inspiring, and the articles have a high quality.