Will we be able to create own mods for the flowfield?

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

  1. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    Unless Elijah has made changes since the last time he set up flow fields it should be 24 bits per space in the integration field (16 for value, 8 for flags), 8 bits in the flow field (4 for direction, 4 for flags), and 8 bits in the cost field (all for value).

    Source: Elijah's article in http://amzn.to/XMrUMu
  2. Causeless

    Causeless Member

    Messages:
    241
    Likes Received:
    1
    Curious; what exactly are the "flags" used for?

    Also, I vote that we get a separate forum for tech talk. If you only account tech live streams there, you won't need to worry so much about people misunderstanding the purpose and end effect of any PA tech, and it'd also give a sort of a forum hub for modders to discuss the possible limitations, advantages and uses of any tech used in PA. Anyone else agree?

    I said 3 bits because:

    1 bit has 2 values, 2¹ (0, 1)
    2 bits has 4 values, 2² (00, 01, 10, 11) - can face in all cardinal directions
    3 bits has 8 values: 2³ (000, 001, 010, 011, 100, 101, 110, 111) - can face all neighbors

    Of course you'd need to play a bit of a game of tetris to get as much efficiency as possible, as you can only allocate memory in sizes of at least 1 byte, or 8 bits, which you can't fit several sets of 3 bits perfectly into without getting extra memory until it rounds up or using the excess space for something else. However, Elijah has decided to instead use 4 bits for direction giving a total of 16 directions.
  3. Sorian

    Sorian Official PA

    Messages:
    998
    Likes Received:
    3,844
    "Flow Fields are 8-bit fields with the first 4-bits used as an index into a direction vector lookup table"

    His article goes into the really technical bits, so I missed that part the first time I skimmed over it.
  4. syox

    syox Member

    Messages:
    859
    Likes Received:
    3
    Yeah but Elijah said he uses 4.

    Also i would like a to see a try for conversion this array stuff to the actuall mesh. should work also. Most polys are triangels so going for every edge should be possible. And you could support tunnels, overhanging cliffs and bridges with it, and multiple platforms. And other things like climbing up walls hanging from ceilings?
    But the infrastructure behind is harder. You need the overhead for structure information too. Not that you have the mesh from the 3D object though :D
  5. Causeless

    Causeless Member

    Messages:
    241
    Likes Received:
    1
    Having the flowfields performed on a nav mesh instead of an array of set square sizes is something discussed in the irc channel, and the end excuse for it not being worth it is: it completely undermines the entire point flowfields were implemented in the first place. You can only add cost on a per nav-tri scale, and they can be very big depending on the size and flatness of the planet. This means you can't have tanks etc avoiding each other in the same way - it's a bunch of fancy technology being used to achieve nothing A* already does.

    About overhangs etc, that's already possible. Justice, one of the guys working at Uber, discussed this with us for a little while after I asked. He told us that it's something Elijah had already considered, and the answer is this (he notifies us this was a while back so he may not fully remember, and my interpretation of it may skew it a little): each flowfield sector doesn't need to connect in an euclidean sense in 2d space. Instead, they are more like portals - the edge of one flowfield doesn't need to connect to the other at an edge you would visually see, but instead to any other flowfield, meaning you can have situations where 2 flowfields can overlap the same space in 2d, yet both be separate - like how an overhang "goes over" the same space in 2d as the ground underneath. It also means you can completely troll your players by having your units teleport across the planet, I assume :p.
    Last edited: March 29, 2013
  6. syox

    syox Member

    Messages:
    859
    Likes Received:
    3
    +1

Share This Page