New answers tagged rts
The server contains the actual running model of the game (the only source of truth). Each player sends commands to be executed in the server's model, and when they see those actions take place, it's a result of the server accepting that command and echoing back the effect of it. This echo is also broadcast to all other players in tandem. If Player A is ...
It seems like what you're looking for is the Optimal Reciprocal Collision Avoidance algorithm. The preceding paper is also worth a read. Although the paper may be a bit involved the theory behind the algorithm is fairly straightforward: Assume that you already have a simulation (game) with agents (units) that have some sort of bounding volume around them. ...
I know some people frown on link dumping, however I found this to be a very enlightening paper, and it obviously conveys way more than I could elaborate on : http://aiguy.org/onewebmedia/Hagelback_Lic-Thesis.pdf
Another solution that scales very well and can be used for a multitude of other things is an influeunce map. Generate a set of grid tiles around the unit to scan within X radius. Scan these tiles for an enemy standing on one of them. If you want to get the closest enemies, you can sort your set by distance. This might be the most efficient method, ...
Top 50 recent answers are included