Spring's range ring and targeting issues
Moderator: Moderators
-
- Posts: 933
- Joined: 27 Feb 2006, 02:04
Spring's range ring and targeting issues
There's a wide variety of weird issues with the range rings displayed when building or attacking with a unit in Spring.
1. When placing a building, the proper range range ring isn't called: http://springrts.com/mantis/view.php?id=1225
2. Range rings don't take into account maximum angles of fire, so if you build something on the top of a cliff, the range ring won't reflect that it is unable to shoot a the base of the cliff.
3. Range rings don't reflect terrain problems that make units unable to reach a firing solution, for instance building a Bertha too close to a hill will make you unable to fire at large portions of the map. Similar things happen when building too close to each other and not being able to fire through their hitsphere.
I'd love to see at least some of these issues be tackled. My real goal is something like the F2 "is this possible" view for movement or placing a building. Imagine a view like that for "what can these selected units fire at?", and being able to call that from a Lua widget. It'd make placing defenses or running attacks much much easier. It would also be great for Smoth's tower defense map.
1. When placing a building, the proper range range ring isn't called: http://springrts.com/mantis/view.php?id=1225
2. Range rings don't take into account maximum angles of fire, so if you build something on the top of a cliff, the range ring won't reflect that it is unable to shoot a the base of the cliff.
3. Range rings don't reflect terrain problems that make units unable to reach a firing solution, for instance building a Bertha too close to a hill will make you unable to fire at large portions of the map. Similar things happen when building too close to each other and not being able to fire through their hitsphere.
I'd love to see at least some of these issues be tackled. My real goal is something like the F2 "is this possible" view for movement or placing a building. Imagine a view like that for "what can these selected units fire at?", and being able to call that from a Lua widget. It'd make placing defenses or running attacks much much easier. It would also be great for Smoth's tower defense map.
Re: Spring's range ring and targeting issues
+1 -- showing something like this when considering where to build a defense turret is a major feature for just about every mod.
Re: Spring's range ring and targeting issues
The calculation may be too hard.
- thesleepless
- Posts: 417
- Joined: 24 Oct 2007, 04:49
Re: Spring's range ring and targeting issues
i suspect it would be similar to LOS calculation, although quite a bit more intensive since LOS is straight lines and range is affected by gravity.
Re: Spring's range ring and targeting issues
100% accurate rings/arcs for all weapontypes is probably too hard yeah; but taking at least horizontal firing arcs into account should be possible.
Vertical firing arcs may be possible too; but this is already a lot more complex because the circle may have holes in it. E.g. from a single (possibly concave) polygon it becomes multiple polygons.
(e.g. when there is a hole in the ground, there should be a sub-circle indicating a weapon can't fire at the ground inside the hole; same with a cliff: a weapon may be able to fire a bit away from the cliff, but not directly at the bottom of it.)
Vertical firing arcs may be possible too; but this is already a lot more complex because the circle may have holes in it. E.g. from a single (possibly concave) polygon it becomes multiple polygons.
(e.g. when there is a hole in the ground, there should be a sub-circle indicating a weapon can't fire at the ground inside the hole; same with a cliff: a weapon may be able to fire a bit away from the cliff, but not directly at the bottom of it.)
-
- Posts: 933
- Joined: 27 Feb 2006, 02:04
Re: Spring's range ring and targeting issues
Well, the way I look at it is make it "calculate on demand" by hitting a key and just tell players with slower systems "don't click this". Maybe even split it out to its own thread or use OpenCL or something?
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Spring's range ring and targeting issues
A real-time, exact solution for this is extremely non-trivial--it roughly represents as much work as rendering the game world a second time every frame.
If you loosen the requirements, I suppose one could try a progressive Monte Carlo simulation, where some percentage of the processor time is spent detecting the impact points of shots fired at random angles. I doubt this will be satisfactory, though, as it would probably take a long time to get a clear picture of the area covered.
The immediate, less satisfying, somewhat annoying, but functional solution, is to get Google Frog's (?) widget that places a nanoframe without building it (forget what it's called) and use FPS camera + T and/or Attack AoE. I suppose you could try to adapt Attack AoE to cover non-ballistic weapons and activate when a unit is being built, although you would need some second pointing method to specify the desired attack location, since the mouse is already taken up with placing the building. Unfortunately I CBA to do that for you =p Also note that Attack AoE does not have perfect knowledge of units' fire points; the position returned by Spring.GetUnitWeaponVectors tends to jump around, so I decided not to use it.
If you loosen the requirements, I suppose one could try a progressive Monte Carlo simulation, where some percentage of the processor time is spent detecting the impact points of shots fired at random angles. I doubt this will be satisfactory, though, as it would probably take a long time to get a clear picture of the area covered.
The immediate, less satisfying, somewhat annoying, but functional solution, is to get Google Frog's (?) widget that places a nanoframe without building it (forget what it's called) and use FPS camera + T and/or Attack AoE. I suppose you could try to adapt Attack AoE to cover non-ballistic weapons and activate when a unit is being built, although you would need some second pointing method to specify the desired attack location, since the mouse is already taken up with placing the building. Unfortunately I CBA to do that for you =p Also note that Attack AoE does not have perfect knowledge of units' fire points; the position returned by Spring.GetUnitWeaponVectors tends to jump around, so I decided not to use it.
Re: Spring's range ring and targeting issues
Why not just imagine a peewee standing in a few different "tiles", and then going "could I shoot at it from here"? If yes, shade the square (or whatever unit is in it) green, if no shade it red.
We don't have to have a range ring - in fact we won't have a ring on anything involving physics and terrain.
This is basically the monte carlo simulation, except rather than pick random firing arcs we pick random targets representing things we'd actually want to shoot.
We don't have to have a range ring - in fact we won't have a ring on anything involving physics and terrain.
This is basically the monte carlo simulation, except rather than pick random firing arcs we pick random targets representing things we'd actually want to shoot.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Spring's range ring and targeting issues
Yeah, that's a better idea (after all the player is looking for coverage on the ground, not the results of shooting at a particular angle), and not a bad one overall, assuming you aren't going for super-high resolution. A progressive simulation is probably even within widget capability (although the implementation may be rather involved), assuming you can get the weapon position properly.
-
- Posts: 933
- Joined: 27 Feb 2006, 02:04
Re: Spring's range ring and targeting issues
And remember, for static units you'd only have to run the calculation once unless there's been some terrain deformation or another unit build nearby that may choke the firing arcs.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Spring's range ring and targeting issues
Well, you certainly wouldn't have to redo it every frame (as long as the player stays on the same buildoption and the same build position, and there are no appreciable changes in obstacles). Beyond this, however, I don't see much potential for precalculation; number of turret trajectory characteristics x number of possible build positions on the map x number of grid squares on the map is way too much to calculate even for a pregame calculation (to say nothing of terrain deformation and unit blocking), not to mention the memory needed to store the results. Even just the last two would take an unacceptably long amount of time and memory upon clicking the build button: supposing a grid square size of 64 x 64 and a map size of 16 x 16, I believe we're already looking at over 4 billion elements. Granted, not all weapons can cover a whole 16x16 map, but they are far from unheard of.
I would be wary of trying to do thousands of projectile simulations in a single frame though, even if it's not every frame--thus, a progressive simulation.
I would be wary of trying to do thousands of projectile simulations in a single frame though, even if it's not every frame--thus, a progressive simulation.
Re: Spring's range ring and targeting issues
Something to keep in mind is that here the player is also looking for if he can target known buildings/units in range. So in addition from shading a hypothetical peewee on a bunch of tiles, we should also consider known enemies (and shade them green or red as well).
Peewees (or whatever "default" unit) may have different targeting sweet spots than the actual units in those locations; it may be important for mods to be able to define the default targeting model for this sort of thing.
Peewees (or whatever "default" unit) may have different targeting sweet spots than the actual units in those locations; it may be important for mods to be able to define the default targeting model for this sort of thing.
Re: Spring's range ring and targeting issues
I try to do such widget, using AttackAoE, by testing every point with ballistics vectors, but has great perfomance impact. May be there are exist the better way??? Any suggestion would be apppreciate )))
- Attachments
-
- AttackRange.jpg
- (143.04 KiB) Downloaded 2 times
Re: Spring's range ring and targeting issues
wow, which mod/UI is that? looks really nice! sorry i have nothing to contribute to discussion
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Spring's range ring and targeting issues
Unless I'm mistaken, that would be NOTA.