r/btd6 • u/Stunning-Bid3174 OBJECTION! • 4d ago
Discussion Before asking for multithread support, learn what multithreading is and decide whethever it's worth it or not (image semi-related)
here's some links
Multithreading (computer architecture) - Wikipedia)
Pros and Cons of Multithreading: Advantages and Disadvantages
I'm pretty sure ninja kiwi considered multithread support but i could be wrong
15
Upvotes
6
u/Asgoreismyhubby 4d ago
Now im not very great at coding,im too low iq to even learn python , but if im not wrong they'd need to rewrite the whole game from scratch to support multi thread
25
u/maenwhile 4d ago
Main problem with multi threading is consistency. Right now as an example having multiple snipers with the same attack speed would result in each sniper having its unique target thanks to the single core of the CPU calculating each attack separately. Meanwhile multi threading would require syncing between all cores so 5 snipers don't attack the same red bloom and placing dart monkeys in a chimps start would result in the same outcome(win/lose)
4
u/Jakkilip 3d ago
Multithreading wouldn't solve anything. You need to optimize the game and not brute force running awful code.
1
u/AD007xD 3d ago
I might be speaking out of my ass here but can NK use make use of the GPU by utilising compute shaders to crunch calculations?
0
u/Leather-Distance2296 3d ago edited 3d ago
Hello! I am currently working on rewriting all of BTD6 into rust. (it is still early)
rusttd6.com
I have reached a point where my version can run up to 5 times faster, and the bottleneck is never the graphics, it is always the CPU and the fact it is all running on one thread.
I tried getting multithreading to work, and it would significantly increase performance. But it is just not really possible to make the game run the exact same with multithreading because the order in which calculations are done.
there is some logic which can be spread out, but not enough for a meaningful impact. It definitely is possible, but then you could be using even more CPU to just make sure all the threads are perfectly in sync, and would have little gain.
Definitely possible to do it right, but requires Alot of work.
Even though multithreading is hard, I was able to make the code more effecient especially for late game rounds and heavier calculations. Before NK should attempt something like this, they should optimize their logic.
1
u/elmage78 1d ago
What tf did they intend on multithreading ? What is there to do asynchronously ? Unless it is like visual effects i am stumped
1
u/Good-Competition-129 1d ago
Claude add multithread support and make no mistakes
0
u/MrRuckusRCRC 2d ago edited 2d ago
AI slop or not, this gives the reasoning behind no multithreading currently.
"While the underlying Unity engine handles some minor background tasks (like audio, rendering, or OS-level scheduling) across different threads, all of the heavy lifting—tower targeting, projectile physics, damage calculations, and bloon movement—runs sequentially on a single CPU thread.
Because of this, late-game Freeplay rounds (Round 100+) rely entirely on your CPU's single-core clock speed and cache rather than its total core count. Even high-end multi-core processors will bottleneck once one core hits 100% utilization from thousands of overlapping projectiles and damage checks.
Why Ninja Kiwi Hasn't Multithreaded Gameplay
EDIT: But I agree. They really should go the route of rebuilding it from the ground up for the next version of Bloons. In the old days of coolmathgames.com with the older versions, it was ok, but they are now too popular to continue with a single threaded game. It would make late game so much more enjoyable if it wasn't a slide show.