Share Our DOTS Showcases

HI all.

I was thinking that we have general WIP thread, letting show of users their projects.
However it would be nice, to have at least similar thread in purpose, but solely with focus on DOTS.
I think that could encourage people on capabilities and usability of DOTS, specially when many packages are still in preview.

By officials, we have been showcased few projects already. I.e.

Megacity

https://unity.com/megacity

Spellsoul Universe
(is there a blog somewhere?)

Or

FPS Sample with Live Link

https://unity.com/releases/2019-3/dots-sample

Each is bringing great source of knowledge, where presenting and discussing challenges and solutions.

Join and Share Too

Hence I would like to invite anyone, to share their works and prototypes with some screenshots and vids if you have one, made of course using DOTS. Please add few words, where DOTS is applied and maybe what kind of challenges you faced so far.

7 Likes

So if I may, I let it started.

My most recent work is using L-System (Lindenmayer Systems), to generate plants. I converted its algorithm to DOTS and now testing in practice.

I growth my procedural DOTS garden, using Unity 2020.2 Entities 0.16.0

Original vid, with 150k entities. But I have updated version above.

https://www.youtube.com/watch?v=BRlJ2nkvea4

Each plant is procedural generated and in this particular case scenario, it has created close to 150k 300k entities. If watching carefully, you can spot new plants popping out, every so often in random places and start growing.

Currently using 3 type of meshes, to represent different parts of plants, with applied translation and scaling. Branch, as cube, sphere as tree canopy. And another sphere as leaf, flower, or fruit. Shader Graph with URP and HybridRenderer 0.10.0 is used, to apply color variations in jobs.

Mind I run it in editor, so sure there are some overheads. But current sample is GPU bound rather than CPU. As far I tested, single plant generation with burst, is at least 6 time faster.

22 Likes

I think this is a very nice idea and it would be interesting to see what others have been making!

To help learn ECS I made a space battle simulator - I picked it because most people are already familiar with these kind of games and know what to expect.

The full project source is available here: GitHub - ElliotB256/ECSCombat: A space battle simulation, based around Unity ECS framework.

There are a few features worth noting:

  • There are a few different behaviors that ships can perform - attacking, roaming, escorting, etc.
  • Each ship has equipment, and each equipment item is an entity itself. These entities can be damaged or destroyed during combat. For instance, you might notice some of the smaller ships start moving slower once their engine is destroyed, or they may lose a weapon mid-battle.
  • There are a range of combat calculations performed. For example, weapons have an effective range that changes their damage. Hit calculations are based on the accuracy of the weapon and the speed and evasion rating of the target ship - small fighters are good at dodging. Shields can intercept attacks.
  • There are different types of weapon, such as projectile or instant hit. The weapons typically spawn an attack entity, which is then used to apply the intended effect to a target. For instance, a laser cannon is an entity with TargettedTool and InstantEffect components, which spawns an attack entity with Attack, Damage, Target.

My next plan is to try this project as a web build using tiny, so Iā€™ve been waiting for tiny to allow custom materials and material properties.

25 Likes

Iā€™ve partially integrated DOTS into an existing project. It is called ā€œRocket Scienceā€ and this is a space simulator like KSP, but with the Solar system in real scale.

I used DOTS for heavy parts of the game. Firstly, it was quadtree planet generation in real scale using heightmaps for large details and noise for small. Second part where DOTS was useful is for orbits generation and updating.

The first problem I faced is using long-running jobs (but it is pretty much solved now except for JobHandle.CombineDependencies). Second is that all quads and orbits have unique meshes (but the same material) so I could not use Hybrid Renderer. Graphics.DrawMesh was the solution here, but it is not that fast as it could be.

Other than that using DOTS was the best decision Iā€™ve ever made in this project. Planet generation takes less than 1ms in total (thanks to long-running jobs). And code became much cleaner.




18 Likes

This is my small pre-pre-alpha game(3D multiplayer space simulation/arcade type of game) written in C# ( Unity3d/DOTS/Netcode) - currently because of low budget :frowning: tested only locally (intention is that game should be similar to Elite Dangerous/bsgo) :

edit : must add that currently working more on a single player updated for 0.50 using dots physics 0.50 new input system etc :

later i intend to upgrade whole project to be multiplayer

12 Likes

Nice idea for a post!

Mineā€™s more on the tool side - a Tween lib & Timeline for working with hybrid & pure. Hoping it helps a bit with the pain of animating things. Edit-time previews, serialized animations you can reuse and nest and much more. Love the performance of course but what Iā€™m really focussing on is a great workflow.
6551968--741649--GIF 15-10-2020 15-24-26.gif

Old captures and itā€™s not that clear but these spheres are animated individually in an open subscene, reusing this one anim & preview. Of course with entities you can comfortably animate 10s of thousands all burst, multi-threaded etc as youā€™d expect.
6551968--741652--GIF 19-07-2020 22-47-06.gif
Still some way to go but working hard on trying to finish it up.
Looking forward to seeing what else gets posted!
(Always interested in following other dotty people - Iā€™m @timboc_ on the twitters)

25 Likes

Weā€™re using DOTS for pathfinding, rendering, and some gameplay logic for this game:

11 Likes

Hello everyone, I want to share my project too.
It was a solo developed, 4 months project. You can control a train which carries thousands of cargo boxes from a station to another.
Each cargo boxā€™s positions are updated by dots individually. On the railroad, enemy drones appear and you can shoot them.
Systems calculate (loco+railcars)'s net force, friction, gravity etc. and adjust trainā€™s speed accordingly.
Except UI, it was a fully dots game.
Here is a video:

12 Likes

Iā€™m going to bump this because it was linked recently and somehow I missed it in my earlier lurking. Iā€™ll post some actually content later.
Iā€™d also like to add that if any of you post random things on Twitter, Iā€™ve been pretty much monopolizing the #UnityDOTS tag recently and I would love to see more things officially tagged. I know a few that post things without the tag, and Iā€™m hoping to see more sharing with the tag as DOTS becomes used more and more. Iā€™m always super excited to see the projects everyone is doing.

8 Likes

Great idea!

Hereā€™s my crowd simulation:

40 Likes

Looks really fancy.
How you animate characters? Unity animation, or custom approach?

2 Likes

Post your fire simulation here, too.

2 Likes

Was asking my self the same questionā€¦

2 Likes

In the youtube comments of @LudiKha videos where people have asked about animation he has liked an answer that said: ā€˜GPU Skinning, in short, you bake your animations into textures and move vertices in the geometry shader.ā€™

And on another comment has linked to Joachims GPU texture animation project.

So itā€™s probably safe to say that heā€™s using GPU texture animation.

The other videos on the channel are pretty cool too.

2 Likes

Had a thread with this but hereā€™s a shipped PC/PS4 VR game based on early ECS (still with inject api):

21 Likes

Yeah, I remember while ago, seeing your earlier progress. Really liked it. Thx for sharing.
Staying faithful to inject huh? :stuck_out_tongue:

Ah thats cool. Thx for sharing the findings.
That explains, how it has been achieved so many animated units.

I tried Joachimā€™s animation code myself, few months ago.

1 Like

Thanks! Well, we held to the old version of ECS because the game was done when they released the new query api (The PC version was already released and I was porting it to ps4), at the time there was no significant gain in moving to it imo - maybe some better burst performance but the project was DoA so we didnā€™t invest in it further. I was a bit limited in what I could ā€˜burstā€™ but managed to get it running well enough on a ps4 :slight_smile:

4 Likes

Stickied it for now, itā€™s nice that people can share and learn from each otherā€™s projects in one place, and DOTS will benefit from it too!

9 Likes

Awesome! What challenges did you encounter in getting VR working with DOTS? Itā€™s a particular use case for me and Iā€™m worried much is missing from the API surface / compatible componentsā€¦

3 Likes

I have been working on this targeting plugin. I have second version coming, which will allow multiple targeting systems, actions and targeting instructions.

Here i direct link to video:

And yes its not tied to any platform. You do not need vr-goggles/packages to use the plugin. How to toggle vr-support for the plugin is on the documentation.

I came with this idea after playing several VR-games and noticed that object picking differs quite a lot. Mostly the targeting or the object-finding behavior. I think there is a demand for quality VR-games, which are time consuming to produce.

Currently I have been making on more example scenes for the next release. Next version will have examples on how to use the plugin for creating smart weapon targeting on top down shooter and tower defense like games. The end goal is to also add edge detection, so players can also filter + detect edges for sneaking and moving scenarios reducing the need for adding trigger colliders everywhere.

The plugin is mostly done. The only thing Iā€™m adding is a chunk detection system + tests for it that will allow to increase the targeting systems to thousands and still have + 60-90 fps depending on the kind of environment.

5 Likes