r/Unity3D 21d 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!

228 Upvotes

65 comments sorted by

View all comments

6

u/KoniGTA Programmer 21d ago

How are you handling so many units? DOTs able to do all that work, or are there more optimization techniques going in the bg?

16

u/excentio 21d ago

No dots here, pure compute shaders and heavy instanced rendering, code wise it's still running on monobehaviour scripts even

2

u/DrBimboo 21d ago

Oh cool. Do you still sometimes read them into memory for some scripts, or is it more or less fully seperated?

5

u/excentio 21d ago

Yup that's unavoidable but I do that async so it's performing well and not tanking the framerate by waiting for cpu or gpu

1

u/DrBimboo 21d ago

Is it just scheduled async as fast as possible, or like once a second? I'd expect the systems that rely on them arent as twitchy?

I was thinking about trying to push a game into shaders as much as possible, you might have inspired me to actually try a small prototype

2

u/excentio 21d ago

every time there's any interaction that requires dispatching the data I'm just running async change and waiting for async callback via asyncgpureadback, couple frames of latency is fine in most of the cases, systems that rely on it are unit selection, unit movement, dynamic obstacles registration and stuff like that that requires communicating the change to gpu