safemode wrote:This is for missiles and other fast moving objects where they are moving too fast for our simulation steps to put the unit within 1 radius of the last position.
Yeah, that's the one case that should be handled. But that doesn't need a full capsule-vs-capsule test, only a ray test.
safemode wrote:With hardware graphics, you probably wont notice this problem unless you've got a lot going on in the screen (either bloating the gpu frame or lots of units adding to both). But eventually it will get noticed because we dont handle it well.
IIRC, physics isn't tied to graphics. Physics only advances one step at a time, and when things are way behind schedule, only up to N steps. IIRC.
Anyway, that's not the problem with missiles, IIRC again. IIRC, the scheduler forces missiles on the high-priority slot. They go right through units because they're very very very fast, and sometimes they miss the target having no ray test.
safemode wrote:It's more cost effective. When units check for proximity to other units anyway they can save that return value to a variable. The next unit will do the same. And so on. It doesn't matter if unit A says it's not close to anything, then later in that frame Unit B says it's close to unit A. That's ok. Position/Physics is calculated serially in VS, not in parallel.
Actually, we talked about this with hellcatv once. The better way for this to be handled, is to compute a per-unit simulation step based on probability volumes. Ie, you compute the probability volume of a unit as, given acceleration and speed limits within the time quantum, the volume where it could end up in the following T seconds. Then you compute T such that it doesn't result in intersections, apply some maximum, and that's it. Well, with the added complexity that would require having a per-unit value like that, because if you change one T for one unit, you should validate that it doesn't interact with other volumes, but that's not computationally efficient, so some heuristics are called for.
In fact, the usage of probable volumes is the main heuristic at work, because you could simply compute a curved trajectory, but that wouldn't account for possible acceleration variations that could be induced by quantum changes. Using volumes, you can change the simulation step of units without invalidating other units' quantum selection.
Anyway, in that way, you have almost perfect simulation at almost optimal speed.
safemode wrote:Always giving a unit near units higher priority than units not near other units guarantees that units where there is a chance of clipping or totally missing a collision will get caught before that happens.
Which is essentially the main proposition of probability volumes. The idea of "probability volumes" though is specifically coined to optimize the case of flocking (units in formation), which are close to each other, but have really stable paths.
safemode wrote:Edit: i think the way things are done now is a semi-random selection of units but weighted on distance to the player. .. This however, is insufficient. And it doesn't appear to take into consideration speed when calculating what "near" is. There is a lot of room for improvement here. and it will vastly improve gameplay dynamics. It's embarrassing to have a game that looks so good behave so badly.
The randomness is in phase offset, but not frequency. Frequency is deterministically derived from distance to player and unit role.