[REL] Cover that line

Discussion in 'Released Mods' started by cola_colin, July 23, 2015.

  1. cdrkf

    cdrkf Post Master General

    Messages:
    5,750
    Likes Received:
    4,831
    @cola, loving the fact you can shift order the commands and see the results :D I've been waiting for this one for ages- should make using long range units like Orcas or Sniper bots far more effective (now we just need the equivalent of the TA / Spring Roko to go with this!)
  2. stuart98

    stuart98 Post Master General

    Messages:
    6,020
    Likes Received:
    3,902
    Already got ya covered there (Or at least on August 1st I will) :).
    Last edited: July 24, 2015
    cdrkf likes this.
  3. cdrkf

    cdrkf Post Master General

    Messages:
    5,750
    Likes Received:
    4,831
    Nice, I don't remember any roko / storm like unit in any of the previous balance mods so that will be nice (the slow rockets were always kinda silly but made for some great micro) :D
    stuart98 likes this.
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    Well I hope it'll be good enough as it is now. Else it'll need more hours of improving the matching stuff, from skimming over NoX I think it may be a good idea to take the result from my current algorithm and run a few optimization passes over it that try to remove crossing lines. Not sure. Problem is PA is 3D. That makes all this not easier, a perfect solution might need to consider that the unit will walk around a sphere.
    cdrkf and stuart98 like this.
  5. cdrkf

    cdrkf Post Master General

    Messages:
    5,750
    Likes Received:
    4,831
    I think the system as is, is worth releasing..... Certainly looks workable and is way better than no line tool :)

    Obviously if you fancy working out an even more elaborate solution don't let me stop you :p
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    optimization problems. Endless fun.

    EDIT:
    Added another O(n^2) pass that tries to reduce the travelled distance by swapping the targets, seems to help a lot to at least not have some units that basically take the worst possible direction.

    perf wise the PA pathfinding and simulation run into issues before I do.
    Last edited: July 24, 2015
    cdrkf and stuart98 like this.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    ace63, cdrkf and Alpha2546 like this.
  8. dom314

    dom314 Post Master General

    Messages:
    894
    Likes Received:
    1,208
    If you want to deal with the sphere, but still use straight lines for most of the algorithm, how about the following:

    Step 1: Find the average distance, get the arc length distance from that (assuming you can recover the radius of the planet?)
    Step 2: Rotate goal points back to where the units start, so basically you are really solving the problem of slightly modifying the formation.
    Step 3: Solve as normal, so this is solving the assignment regardless of how far along the sphere the commands are.
    Step 4: Rotate goal points back to original position, and issue orders with matching computed from step 3.
  9. stuart98

    stuart98 Post Master General

    Messages:
    6,020
    Likes Received:
    3,902
  10. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    Guys i see lots of what i would call gameplay/visual mods. Has any of you ever considered federating all these mods within à single one ? Not saying that each of them should disapear as a single mod, but if no technical restrictions a "PA global enhancement" could lead to à larger adoption. Or it may be toi early to consider merging all these mods. I know also that it would require any modder accepts its mod to be added and someone responsible for updating the merged mod.
    cdrkf likes this.
  11. probodobodyne

    probodobodyne Active Member

    Messages:
    216
    Likes Received:
    182
    Great stuff, some questions:

    1. Will we be able to set their rotation somehow? Orcas and Leviathans would be better off showing their broadside while making a train would be silly for other units and they'd look better facing the center.
    2. Will we be able to make the units hold the line all the time? As in making them not chase enemy units.
  12. Alpha2546

    Alpha2546 Post Master General

    Messages:
    983
    Likes Received:
    1,571
    this looks so good. I always loved that feature in ta spring and now its gonna happen in pa.

    Very awesome!
  13. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    Are you overriding the default pathfinding behaviour or simply assigning the final positions for all the units ?
  14. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    I am only assigning the final movement location target to each unit, that's why there are so many preview lines for all the move commands.
    I also cannot make this kind of command as a "group" command, so if you combine dox with ants in this the dox will move faster than the ants.

    @probodobodyne
    I can assign a target orientation as well I think, but it is in pathfindings hand to decide how to reach the location, so it probably would not do what I want. It might be possible to do lots of small "in between commands", but that would probably eat performance really bad. Maybe another day.
    You can always tell units to hold position, that's a default feature of the UI.
    doud likes this.
  15. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    I've thought about it, but it seems my current algorithmn somewhat works for distances long enough. Longer distances may suffer from it, but over longer distances the pathfinding will screw everything over anyway.

    [​IMG]
    [​IMG]

    That scenario came down to 2 lines of dots moving together. Not even that bad I guess.
    Last edited: July 25, 2015
    cdrkf likes this.
  16. dom314

    dom314 Post Master General

    Messages:
    894
    Likes Received:
    1,208
    If it ain't broke, don't fix it!
  17. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    pinbender just told me that there still is the free formation code from a year ago. It can be triggered via the new API as well, but it's not exactly the same as my solution, as it doesn't do lines, it does free formation drawing. This mod will stay like it is, as it is about lines and nothing but lines.
    But just so everybody who like to mod PA knows: Calling the send order API with a move command, a lot of units and a curve in multi_pos yields you the old free form orders.
    wondible and cdrkf like this.
  18. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,363
    Likes Received:
    2,144
    I thought using those custom formations crashed PA, which is why @wondible's mod was made obsolete?
    https://forums.uberent.com/threads/obsolete-enable-custom-formations-78071.62269/
    Does it work again?
  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    Yes and No.
    What @wondible did was call some native call that basically goes "okay please do line commands now". That made it use a different path to collect the input and then called some native calls that were supposed to end up with a free formation command.

    The new orders API exposes the underlying "do a free form order with these input points" function to js. That call seems to work fine, the crash probably is somewhere in the -by default not active- input collection code.

    My mod hooks into the js part of the free form input stuff, but then collects everything in js and only calls the new send order API. In fact I can easily switch it over to the free formation stuff instead. Maybe I'll actually find some modifier key, so the user can chose which behavior is wanted. They do behave differently.
    DeathByDenim likes this.
  20. stuart98

    stuart98 Post Master General

    Messages:
    6,020
    Likes Received:
    3,902
    Poke.

    RELEASE THIS THING ALREADY!!!!SHIFT1

    Please.

Share This Page