Question: are there directional costs?

Discussion in 'Planetary Annihilation General Discussion' started by syox, March 28, 2013.

  1. syox

    syox Member

    Messages:
    859
    Likes Received:
    3
    Like hill-upwards vs hill-downwards? Or flowing rivers. Maelstrom. Air flow (airplanes).
  2. TheLambaster

    TheLambaster Active Member

    Messages:
    489
    Likes Received:
    131
    If not going around a hill rather than over it would be pretty pointless, wouldn't it?


    Edit: never mind, I'm stupid.
  3. bmb

    bmb Well-Known Member

    Messages:
    1,497
    Likes Received:
    219
    We don't even know if physical hills should have cost. They might climb hills just fine at the same speed as flat land.
  4. Causeless

    Causeless Member

    Messages:
    241
    Likes Received:
    1
    Directional costs makes no sense, and I can already tell you, there's about a 90% chance that PA does not have them.

    Think about it - your units always travel to the pixel with lowest cost when pathing. If you are on top of a hill, your units will already path down the hillside since that'd lead to the target anyways. How else would they reach the target? It's a physical need for them to move down the hill.

    And, if the target is of a higher altitude, it still makes sense to go uphill. You can't possibly get there any better by going downhill first.
  5. KNight

    KNight Post Master General

    Messages:
    7,681
    Likes Received:
    3,268
    Unless, for example, tanks can't move at top speed uphill, then you have a situation where going around a hill might be quicker than going over.

    Mike
  6. bobucles

    bobucles Post Master General

    Messages:
    3,388
    Likes Received:
    558
    There could be any number of uphill/downhill, up/downwind, and up/downstream mechanics. Obviously, they make one direction more effective than going the opposite direction.

    Something like that could be in PA, maybe. I guess it depends on how important that sort of thing is.
  7. TheLambaster

    TheLambaster Active Member

    Messages:
    489
    Likes Received:
    131
    This makes no sense at all. You are completely ignoring the actual question, which was, if going up a slope/ through a river/ what have you would add some kind of cost to the path that leads across that slope. Certainly going over a hill makes the way longer than if there was no hill. Going around the hill in most of the cases would make for an even longer way though. the critical question is now, if going up slopes slows down units. If so, is this taken into account for the navigation? I assume not and think only the actual length of the path is relevant.
  8. Causeless

    Causeless Member

    Messages:
    241
    Likes Received:
    1
    No, you misunderstand. Direction cost != Slopes having cost.

    I thought the original post was saying that going up a hill should have a directional "cost" to it, while going down one would not. I countered by saying slopes should be given cost regardless of direction, as the end result is the same.
  9. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    I'm just going to have to link this here;

    viewtopic.php?p=698871#p698871


    Directional costs might matter. Consider this; you have a tank driving from A to B via some path R1. Now, you want the tank to drive from B to A. Does it take R1 backwards, or is there a more efficient path R2?

    If R2 exists for B to A, but isn't R1 backwards then you will invariably have directional costs in some shape.
  10. bobucles

    bobucles Post Master General

    Messages:
    3,388
    Likes Received:
    558
    But it's not. Go outside sometime, and try it for yourself. Some hill directions are easier to travel than others.
  11. Causeless

    Causeless Member

    Messages:
    241
    Likes Received:
    1
    I never said all slopes should be given a constant value. The steeper the slope, the higher the value, makes more sense IMO. I'd say generally the shallower slopes are easier and steeper is harder. When taking into account rocks and bumpy ground, you can just add extra cost for that, but even so I don't think Planetary Annihilation needs to worry about such minor things.

    EDIT:

    Firstly, the units look at the closest 9 local points, and we're already in a bit of an argument there about that so instead of rehashing it here, I'll just link to my latest post:

    viewtopic.php?p=698899#p698899

    Secondly, can you give an example of any scenario where the R2 path is more efficient?

    I can't think of any involving static objects. In the case of having units or buildings etc blocking the way, that's why the flowfield gets recalculated whenever some update like units moving or a building is placed.
  12. apocatequil

    apocatequil Member

    Messages:
    109
    Likes Received:
    9
    I think the primary answer is not really.
    I would guess that turning side to side is going to matter a lot for Orbitals and maybe Navy units, but nothing at all for any Ground units or Air units. Uphill versus downhill will simply represent a small cost hill in certain cases, say for a tank, but less for a bot and none for a spider bot. If your unit's target is up a hill, then your unit is probably gonna go up that hill. If you are on top of a hill, your unit is gonna go down that hill before it goes anywhere else, if your target is behind a hill, in most cases your unit is gonna go around that hill, unless it's like a hover tank, or a spider bot or something else that just doesn't care that much about slopes.

    The flow field pretty much supplies the units with how much they are going to turn, then it's up to their turning rate to see how fast they can do it.

    Orbitals become a different matter in my head, but they haven't mentioned anything about them at all, so I can't even speculate about what possible variables we could expect to speculate with... So.. yeah.
  13. syox

    syox Member

    Messages:
    859
    Likes Received:
    3
    Yes i mean cost based on the direction of movement. So going from (0,0) to (1,0) may have a different cost then going from (1,0) to (0,0). This is probably not important for direct neighbor cells but for longer routes.

    And my post was not a suggestion only a question. :)
  14. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    If anyone is still looking for an example of where directional costs really matter; hills with friction have costs dependent on path direction (as opposed to hills without friction). Real-life hills are non-energy conserving.
  15. syox

    syox Member

    Messages:
    859
    Likes Received:
    3
    Problem there is it ups the ressources and cpu time you need, like times 4.

    so probably the plus in realism doesnt justify the plus in computing power needed.
  16. TheLambaster

    TheLambaster Active Member

    Messages:
    489
    Likes Received:
    131

    This is majorly ugly, but it will do:

    [​IMG]


    From A to be you want to take the straight ramp. From B to A the curved one, because it might be to steep for you vehicle to climb it.
  17. bobucles

    bobucles Post Master General

    Messages:
    3,388
    Likes Received:
    558
    O(X) is the best O there is. Go with it! :lol:

Share This Page