True line of sight?

Discussion in 'Backers Lounge (Read-only)' started by darac, October 3, 2013.

  1. darac

    darac Active Member

    Messages:
    261
    Likes Received:
    128
    I remember this being an option in TA. I think True line of site might have some cool dynamics in this game and fix a few of the exploits i've already seen, like the air scout in a crater trick.

    The larger the planetoid the less the curvature and naturally the longer the line of sight. Mountains and other obstacles provide good opportunities for sneak attacks and ambushes. Trenches and canyons could provide cover for ground units from detection and bombardment.

    With aircraft, missiles and orbital being at higher altitudes, they can be seen from further away making ground AA able to have a longer range and be more effective vs air while being shorter range and less effective against ground (if they continue to be able to shoot at both). But conversely aircraft and orbital can also see further making them better at recon as one might expect.

    It could also allow us to exploit differing altitudes to differentiate aircraft more, like an advanced spy plane that flies at very high altitude and therefore has more vision of the surface of the planet while being out of the range of t1 AA.

    Is this something that's planned or has been thought about?
  2. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    It's been thought about, and abandoned.

    Discussion of gameplay improvements are essentially moot because the performance impact / programmer time required to implement line of sight calculations on planets makes it impossible. It's one of the disadvantages of not being a 2d height mapped game.

    It might be a feature for future research but for PA it's dead.
  3. darac

    darac Active Member

    Messages:
    261
    Likes Received:
    128
    Fair enough. Thanks for the reply.
  4. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    Don't you have Line of Fire checks currently?
    How is it different from Line of Fire checks? Wouldn't Line of Sight checks have similar computation cost?
  5. darac

    darac Active Member

    Messages:
    261
    Likes Received:
    128
    I don't think it is the same, line of fire is 1 direction for each unit. Sight is a sphere of vision around a unit. And I don't think units really care to much about line of fire at the moment, they just turn turret in direction of target and fire. If something is in the way that something dies instead.

    That all said though, there may be ways of faking line of sight. But it would require a lot of programmer time to research and implement and it would increase computational load, so i'm not surprised it's been shelved.
  6. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    I imagine they would have similar cost.

    However, you're effectively firing your Line-of-Sight gun from every unit, to every other unit, every single step in the simulation. That's where the cost piles up, I think.

    You could optimise it down by filtering out units that have already been shot. That would bring down the number of checks from (n^n) back to n! (n-factorial), but that's still a lot.

    [EDIT:] *back to something like n! It won't actually be n-factorial.
  7. darac

    darac Active Member

    Messages:
    261
    Likes Received:
    128
    I wonder if you could fake it like this:
    • A unit has vision equal to its 'vision' times a factor based on its distance from the planets center. (simulates more curvature on smaller planets).
    • A unit on the ground can't see anything that is on the ground behind terrain x meters higher than it
    • You can speed up both these steps by building a low res height map of the planet surface (does this already happen for AI pathing?)
    • Air and orbital can simply ignore terrain heights as they fly high enough for it not to matter.Air units can be seen by ground units at ground units max sight distance calculated above.
    Again it would take precious Uber programmers so I know they aren't going to change their plans but could something like this be a mod?
  8. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    We do line of fire calculations, which are honestly more complex than line of sight for most weapons, from every unit to every enemy unit with in it's vision radius. Doing line of sight checks would be relatively trivial, though for the same reason we don't use beam style lasers on most units, line of sight would actually kind of suck most of the time.

    The real computationally intensive issue is showing the line of sight to the player. It would require doing the equivalent of real time point light shadows from every unit in the game, this is one of the slowest shadow types to do as it requires rendering 6 shadow maps for each "light". The other option would be to voxelize the world and do line of sight checks against the voxel representation. That's where the engineering time would come in, and generating the voxel data wouldn't be all that fast either for the planet size we have.
  9. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    I hadn't thought about that part.

    Well there we go.
  10. syox

    syox Member

    Messages:
    859
    Likes Received:
    3
    That!

    Makes me a sad little panda:
    http://www.youtube.com/watch?feature=player_detailpage&v=DazOlwt8akI
  11. godde

    godde Well-Known Member

    Messages:
    1,425
    Likes Received:
    499
    I don't think that is completely necessary. I could turn this around and say that it is completely necessary that I can see exactly where units can shoot and where they cannot reach with their weapon. If people wanna play with it and make a game/mod depending on it they should be able to do that.

    He said it. It is trivial. Now you have to do it.
    Or maybe I should just ask nicely:
    [​IMG]

    Well if it is easily moddable then that is fine too.

Share This Page