I almost dumped Unity's DOTS! - World Simulation Project - Indie Game Devlog #3 (Unity DOTS/ECS)

Поділитися
Вставка
  • Опубліковано 28 тра 2024
  • Finally it's time to start a completely new passion project "World Simulation Project" along with a devlog channel.
    In this video we'll take a deeper look at the technical backgrounds and the usage of DOTS and create a tile selection system.
    It's my first serious attempt to create a huge scoped simulation of a world.
    Timestamps:
    0:00 Intro
    1:09 What was the problem?
    2:31 Failed attempts
    3:19 New world generation process
    4:56 Tile selection system
    6:38 Settings
    7:54 Outro
    ---------------------------------------------
    If you are interested in more deeper discussions about Unity, DOTS or game development in general, feel free to join my Discord server:
    / discord
  • Наука та технологія

КОМЕНТАРІ • 29

  • @Churdington
    @Churdington Рік тому +21

    Minecraft doesn't use individual cubes. Each chunk is one object. When you are breaking a "block", you're actually deforming the chunk's singular mesh. It just updates the polygons of the mesh. When you place a block onto the terrain, it just adds new vertices to the mesh, and removes the vertices underneath the new block. It still remains one mesh. That's why you don't see cubes when you clip underneath the surface. You're seeing one big mesh with only the external triangles generated. Why would anyone use thousands or millions of objects when it could just be ONE object?
    As for raycasting, you don't need to use physics for that. You're using a grid. You could design an extremely fast lookup system that would take almost no time at all to calculate, probably just the equivalent of few hashmap lookups, instead of having a literal physics engine to determine your grid.

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

      About the mesh you're absolutely right. It's only the chunks "surface" that is displayed via a mesh.
      The idea with the grid is really good. When I go over my features for refactoring and optimizing, I will check this out (it's already added to the Trello Board).
      If you want, you could join the discord so we can talk about it in more detail.
      Thanks for the feedback :)

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

      @@banditbloodwyndevs8782 also please dont introduce state in your systems. its bad. State goes into component data!

  • @WAYNGames
    @WAYNGames Рік тому +4

    Nice job ! Great to see people trying new tech like DOTS and sharing the issues they meet and how the solved it.

  • @MrBinyata
    @MrBinyata Рік тому +2

    nice work! I am currently trying to understand dots with the physics library, hopefully you make it far in your project

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

      Thank you 😊 I hope so. That's why I make the videos: showing my stuff to interested people keeps me motivated.

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

    Nice! We got there in the end!

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

    Amazing!

  • @thewhiterabbit4268
    @thewhiterabbit4268 Рік тому +2

    DOTS is another word for triggering Burnout

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

      🤣Well said!
      But I really like it. It needs time for training, but when you are familiar with it, it's very cool.

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

    Are there any features you would wish in this kind of game? Put them here in the comments and they will be added to the idea pool in my Trello board :)

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

      I guess vegetation, animals and biomes)
      In the end it will be cool to see simulation with villages cities and resource management)

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

      @@EmanX140 my plan is to completely revamp the world generation process in a future iteration. For now I have a basic process to be able to continue with other stuff.
      But yes, I plan to have biomes, rivers etc.

  • @FantaLaTone
    @FantaLaTone 11 місяців тому +1

    looks great but it needs some optimization i recommend looking into Minecraft's code

    • @banditbloodwyndevs8782
      @banditbloodwyndevs8782  11 місяців тому

      You're absolutely right. Especially the mesh creation is horribly inefficient. That's a point I have to work on in the future.

  • @EmanX140
    @EmanX140 Рік тому +2

    So no physics at all now?

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

      No ECS-Physics, correct. But the chunk GameObjects have a traditional MeshCollider for the raycasting.

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

      ​@@banditbloodwyndevs8782 I also had performance problems with the default dots physics system. But I also had good success rolling my own physics system. It's essentially only basic collisions, but the code can be hyper optimized for my use case.

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

      @@JudahDoupe good to know. I think sooner or later I will go back to all of my systems to refactor and improve. Maybe I will also change some things related to the physics.

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

    Great video but , the music is distracting

  • @hominusprogramming
    @hominusprogramming 9 місяців тому

    For the entire video my question was: "Why he isn't using the unity 3d tilemap for the grid?" then i found out that you store the data of the tile inside the tile itself. That's the worst things you can do, not even Terraria does that!
    The way to go here is to have a world manager that each time you walk outside of a chunk the manager save the state of the chunk, then, when the player is near that chunk (at least 1 chunk out of screen of distance) the manager run the simulation to "fake" that the chunk continued to live on during the player's absence. Not only this, but ECS was developed for entities i.e., npcs, mobs, vehicles or in other word the part of your game that are kinda "alive".
    Tiles are essentially textures (or object) that exists without doing nothing, some games even instantiate tiles directly in the GPU, and because (especially if you don't "dig or build") they don't have to do nothing all changes are handled by the famous WorldManager I mentioned earlier.
    In this way you can have a lot of tile without destroying the users pc. Remember "use the right tool for the right job" if you already have a system (tilemap) that with a little bit of modification can help you achieve what you need don't force yourself to adapt an entrie different system (ecs) to your needs.
    And you can see that even at Unity they didn't think of using DOTS for everything infact you cannot create a "DOTS-only" project from Unity Hub you need at least one scene with some Mono object inside.
    This is only a suggestion, i'm not an english speaker so if it's came off as a rant i'm sorry. However you decide to go i wish you luck with your project!

    • @banditbloodwyndevs8782
      @banditbloodwyndevs8782  9 місяців тому

      Thanks a lot for your feedback :)
      I'm sure you're right with what you say. Let me explain my point of view:
      Regardless of what it was originally intended for, ECS is a toolset. And what tools are used for it only limited by the skills and creativity of the one who uses them. In my case, my skills are limited, but I try to find creative ways to use it. As far as I understand the purpose of ECS, it's a super optimized technology to store and manipulate data. And that is exactly what I need for my world simulation. So maybe there are better ways of doing it, but with this project, I try to use ECS.
      I hope you still enjoy what I'm doing with this project and whatever comes in the future.

    • @il35215
      @il35215 9 місяців тому

      World manager ... cool, another guru telling how to implement god class anti-pattern. If your project has classes named Manager or Controller, then congratulations, you are a shitty programmer.

  • @Arkaen-AI
    @Arkaen-AI Рік тому

    Invite invalid 😞

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

      Oh sorry for that. I will check that. Thanks for telling me

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

      I updated the invitation link.
      discord.gg/dqFy6zDnpz
      Would be happy to see you there :) Sorry again for the confusion.