Tag Info

New answers tagged

0

Yes, Unity contains physics OverlapSphere function. This requires the objects have colliders, but does not require rigid bodies. The performance of this is hard to judge until you actually use it in your implementation. If you run into performance issues, I would suggest however you implement some kind of quad/octree as suggested in this related question. ...


3

I won't repeat why you should not use one thread per game entity, but if you truly want to use a simple-to-think-yet-efficient concurrent model, look for the actor model. In the actor model, you software is made of actors. Each actor is a parallel entity that you may think as a thread with state, even though it may be implemented differently. Each actor ...


2

Before you do anything read the first paragraph here First and foremost, running hundreds of threads isn't going to boost performance. It is going to instantly ruin your game. Why ? Because afaik in Windows and Linux the schedulers wakes up every millisecond (possibly more like 3) to check if another process needs to run. So if you have 50 tanks and 100 ...


10

Rule number one of multithreading: Don't even think about it, unless you really need to use multiple CPU cores for performance reasons*. Multithreading opens up a whole can of worms of obscure and impossible to reproduce bugs: Race conditions! Because you have no control over the thread scheduling of the OS, you have no control over the order in which ...


4

That sounds like a really bad idea. For multithreading to work well you need individual tasks that require significant computation, and can be easily segregated so that they don't work on the same dataset. There is an overhead to each new thread you use, there is in some cases a big overhead for shipping data between threads, and once you have occupied each ...


0

Random number generator: you actually want a pseudo-random number generator that will give the same result for each player at the same situation. There are several ways to implement it, for example you may make the player agree a seed over the network then generate the pseudo-random number from that seed. Or you hash somehow the current game state and use ...



Top 50 recent answers are included