Vitality C++ engine - #2

Поделиться
HTML-код
  • Опубликовано: 27 авг 2024
  • After a hiatus throughout October, here's part 2 showing off some more progress on Vitality's new C++ engine.
    Main updates since last time:
    - Threaded chunk generator / loader / unloader
    - Linux compile
    - Lighting simulation (+ shaders)
    - Audio (not featured in video)
    - Codebase refactoring

Комментарии • 13

  • @DarkDao
    @DarkDao Год назад

    True to its name, the project is still kicking.

    • @machimanta
      @machimanta  Год назад +1

      Maybe I'm too obsessed with 2D block-based platform games lol

    • @loli42
      @loli42 Год назад

      @@machimanta that's one way to spell terraria clone 🫠

    • @machimanta
      @machimanta  Год назад

      @@loli42 true true true... to a degree

    • @DarkDao
      @DarkDao Год назад

      @@machimanta To be fair, not many good games of this kind happened after terraria, so why the heck not.

    • @loli42
      @loli42 Год назад

      @@machimanta ...to an extent.

  • @Limekys
    @Limekys Год назад

    It's very cool that the project has moved to C++ and you keep making a game like this! Too bad we have to wait longer, but I think it will be worth it. In the meantime I will stay with Game Maker, I like this engine very much )
    Can I expect from you some technical article about how your regions, chunks and world generation work?

    • @machimanta
      @machimanta  Год назад +1

      I think I keep coming back to this project because I really do believe in the idea of the game and it’s actually quite a fun technical problem to solve making a game like this easily scalable and performant (trickier than it may seem). I ultimately decided to abandon GM in favor of C++ for three main reasons:
      1. The original was made in GMS1.4 which has sense been deprecated for GMS2.3 (and the project conversion not only breaks the game, but once fixed is considerably slower due to “compatibility” wrapper functions around deprecated 1.4 built in functions)
      2. GML has no support for multithreading, which is a big setback if you want to complex, asynchronous computation (like chunk gen, pathfinding ai, etc.) without stalling the main thread
      3. GM doesn’t have great graphics API support. For instance, the only shaders you have access to are fragment and vertex, but games like Vitality would really benefit from compute shaders (water simulation)
      Edit: All that said, GM is still my preferred tool for rapid prototyping of ideas. The issues above are pretty specific to the needs of this project
      I’ve definitely considered doing some technical videos. I think I’m going to continue developing this engine for a bit first before making any of those though since a lot of stuff is still in flux

    • @Sh1rhix
      @Sh1rhix Год назад

      @@machimanta I think Game Maker has gotten better over the years. I notice it with my project which is similar, I've gotten so many improvments just from upgrading to GMS 2 that even on VM it's super fast. Of course multithreading and compute shaders are still missing, allthough I've heard rumors of it being on the roadmap. But what I actually wanted to say with this message is that just because there is a limitation, doesn't mean it's impossible or it performs badly. I've worked on liquid and radiation simulation for months and during this time, I've learnt so many things about performance. Instead of avoiding the limitations, learn to work around them. I can tell you, it will do wonders... for the next time.

  • @SmolJordan
    @SmolJordan Год назад

    new bloxed version lookin clean

    • @machimanta
      @machimanta  Год назад

      the sequel we’ve all been waiting for

  • @top3misterioyterrorzapoyot571
    @top3misterioyterrorzapoyot571 Год назад

    Hey bro, what are the mathematics topics are the ones that are recommended to review for the creation of more advanced video games.

    • @machimanta
      @machimanta  Год назад +1

      For mathematics specifically, you can benefit a lot from just having a solid foundation algebra (including trig functions like sin/cos/tan). For most game programming that's all you'll ever need. If you want to dive deeper into topics like graphics (rendering) or physics simulations, you'll definitely want to know concepts of linear algebra (basically, how to use and transform between coordinate spaces represented by matrices).
      If you're interested in game programming in general, I think it's always a good idea to know what the computer is actually doing under the hood. So basically understand the concepts of: algorithms (specifically algorithmic time & space complexity), memory management (stack allocations vs. heap), cache hits/misses (this can be huge for performance, especially reading/writing data in large loops), and then just general code structure/organization. Doesn't hurt to have a good foundation in discrete mathematics too, since many problems are solved recursively or through state machines.
      For a performant game, you generally want to:
      1. Avoid allocating heap memory during runtime (can trigger CPU stalls as the game waits for the operating system to point it to blocks of memory, creating FPS jitter)
      - In c/c++, this is anything that calls malloc/realloc (std::strings in C++ are notorious for this, as well other containers like std::vector, etc. My engine does not use these for that reason)
      2. Avoid using algorithms slower than O(1) or O(n*log(n)) when iterating over large data sets (think nested loops)
      3. Minimize GPU draw calls (mostly done through smart batching/instancing of sprites/geometry)
      4. Multithread parts of the game that don't need to be synchronous for gameplay to continue (in Vitality, chunk generation is an example of this)
      5. Profile new code before optimizing too much, unless the optimization is trivial