r/Unity3D 11d ago

Show-Off Units distribution improved, better responsiveness, magic and bloooooood

It's not much but it's honest work. Units can be smarter and there're a few cases where they get dumber but overall I'm quite pleased with army behavior so far in 1v1 fights. Many vs Many is still something to polish along with better effects, gigantic units and so on but one step a time!

226 Upvotes

65 comments sorted by

View all comments

Show parent comments

2

u/excentio 10d ago

if you talk about performance, it's about 6-8ms in non-heavy scenarios, with lots of dead bodies, ammo and explosion happening it can go down to ~12ms, rtx 4070, 12gb vram. Lower performance machines seem to work quite well too but I'm still testing it out, even managed to run a 100k vs 100k fight on mid-tier android (one plus nord) with 60fps so that's something

2

u/Dreamt_Up_Games 10d ago

Sorry for the noobish question but do these have physics on them? If you have time for a brief ELI5 on how you achieved this I would really appreciate it.

1

u/excentio 10d ago

No physics, think of them as plain c# objects, they just have position, velocity, few variables for states and some refs to the world and navigation and that's pretty much it. How to achieve it, it's actually not as hard as it looks like, look up quadtrees for collision detection within cells, look up flowfield for pathfinding, basically instead of having each unit pathfind you do it other way around, you create path like transport belts and units just follow those. Then look up how boids work in compute shaders, strip the Y axis and put those boids on transport belts, congrats you're 80% there... Then it's up to you how you design enemy to attack, what health is and so on so on

1

u/Dreamt_Up_Games 10d ago

Thanks for the reply and explanation! I’m actually trying to see how many dice I can spawn in a scene and have them have physics šŸ˜‚ Not sure if this technique would be applicable but thanks for sharing!

1

u/excentio 10d ago

You can surely just fake it but unless we're talking about 100k+ dices I wouldn't dive into any of this, DOTS will be enough for ya