Strike Groups and Formations [WARNING: Image Heavy]

Been taking a small break from my various other projects to unload a little bit, and I’ve been playing around with strikegroups/formations.

Here’s some screenshots of the first one I’ve made:



Surprisingly, the formation sorts out pretty well even with multiple larger ships:

There are a few times when it just absolutely fails at sorting, but I’m pretty happy with it.


What do you guys think? What tweaks or improvements do you see to be made?

4 Likes

Can you enable the Lua or big file for trials?

Or make a big file for study and invite interested modders to join in Steam.

Awesome work! Very excited to see new formations.

Right now, it just overrides Wall formation, so if someone is interested in figuring out how to add a custom slot before I get to it, that would be fine with me.

data:scripts/strike groups/sg_wall.lua:

Name = "Wall"
Order = 0.8                         -- Controls sort order for ID use.  In the next patch ONLY names will be allowed!
Hint = "$4954"
Title = "$5464"
Hotkey = 107
AI = 5
Icon = {
    texture = "DATA:UI\\NewUI\\Taskbar\\FormationIcons\\form_ico_wall.dds",
    uvRect = { 0/128, 0/512, 128/128, 128/512 },
    patch_X = { 4,-120, 4,0 },
    patch_Y = { 4,-120,4, 0 },
    patch_Scale = 1,

    Surface = {
        surface = "ui_multistate";
        { prop = "state0", float3 = { 0.00, 0.00, 1.00 } },
        { prop = "state1", float3 = { 0.00, 0.00, 0.00 } },
        { prop = "state2", float3 = { 0.00, 0.00, 0.00 } },
        { prop = "decal", float3 = { 0.00, 0.00, 0.00 } },
    }
}

ExtFilter = "sgf_gbx,sgf_hwrm"
Tags = "sgf_common"

StanceGrouping = "Batch"
StanceGroupingAg = "Shape"
StanceGroupingEv = "Subs"

DeathDamage = 0.90
FriendlyFire = { 0.8, 0.00, 0.00 }       -- Base, Pop, PopSqrt

PopDecay = 0.001

SpacingRange = 	 { 25, 1.75, 150, 1.35 }
SpacingRangeAg = { 25, 1.75, 150, 1.35 }
SpacingRangeEv = { 25, 2.50, 150, 1.50 }


Multipliers = {
    
    -- Leader //Const, PopRaw-1, PopSqrt-1
    -- Node //Nodedepth, LoMult,Above&AtUse4th,HiMult
    -- Accel/Brake// times_ so to 'accel faster' you mult _down_ (0.50 is twice as fast)
    
    MAXSPEED = {

        -- HW2 Pop - 3,4,6,9,12,15
        -- HW2 Scout - 1,1+,2,3,4,5
        
        -- Hig Pop - 5,6,10,15,20,25
        -- Hig Fighter - 1,1+,2,3,4,5

        -- Hig Pop - 3,4,6,12,18,21
        -- Hig Vette - 1,1+,2,4,6,7

        -- Vay Pop - 7,8,14,21,28,35
        -- Vay Fighter -1,1+,2,3,4,5

        -- Vay Pop - 6,7,12,18,24,30
        -- Vay Bomber - 1,1+,2,3,4,5

        -- Vaygr Pop 4,5,8,16,24,28
        -- Vay Vette - 1,1+,2,4,6,7

        { "Fighter", "Graph", 1, 0.95, 20, 0.87},
        { "Fighter_hw1", "Graph", 1, 0.95, 20, 0.87},

        { "Vgr_Interceptor",AggressiveStance, "Graph", 1, 1.00, 7, 1.00},
    },

    FLIGHTPERF  = {
        
        { "Fighter", "Graph", 1, 0.86, 20, 0.84},
        { "Fighter_hw1", "Graph", 1, 0.86, 20, 0.84},

        { "Corvette", "Graph", 3, 0.965, 4, 0.965, 6, 0.965, 12, 0.95, 18, 0.95},
        { "Corvette_hw1", "Graph", 3, 0.965, 4, 0.965, 6, 0.965, 12, 0.95, 18, 0.95},

        { "Vgr_MissileCorvette", "Graph", 4, 0.965, 5, 0.965, 8, 0.965, 16, 0.95, 24, 0.95},
        { "Vgr_LaserCorvette", "Graph", 4, 0.965, 5, 0.965, 8, 0.965, 16, 0.95, 24, 0.95},

    },
    ENGINEACCEL = {

        { "Corvette", "Graph", 3, 0.85, 4, 0.85, 6, 0.85, 12, 0.85, 18, 0.65, 21, 0.508},
        { "Corvette_hw1", "Graph", 3, 0.85, 4, 0.85, 6, 0.85, 12, 0.85, 18, 0.65, 21, 0.508},

    },
    ENGINEBRAKE = {

    },
    THRUSTER = {

    },
    THRUSTERACCEL = {

        { "Fighter", "Graph", 1, 0.90, 25, 0.90},
        { "Fighter_hw1", "Graph", 1, 0.90, 25, 0.90},

        { "Corvette", "Graph", 3, 0.85, 4, 0.85, 6, 0.85, 12, 0.85, 18, 0.65, 21, 0.508},
        { "Corvette_hw1", "Graph", 3, 0.85, 4, 0.85, 6, 0.85, 12, 0.85, 18, 0.65, 21, 0.508},

    },
    THRUSTERBRAKE = {

    },
    ROTATION = {

        { "Corvette", "Graph", 3, 0.85, 4, 0.85, 6, 0.85, 12, 0.85, 18, 0.508, 21, 0.500 },
        { "Corvette_hw1", "Graph", 3, 0.85, 4, 0.85, 6, 0.85, 12, 0.85, 18, 0.508, 21, 0.500 },

    },
    ROTATIONACCEL = {

        
    },
    ROTATIONBRAKE = {

    },
    WEAPONCONE = {

        -- HW2 Pop - 3,4,6,9,12,15
        -- HW2 Scout - 1,1+,2,3,4,5

        -- Hig Pop - 5,6,10,15,20
        -- Hig Fighter - 1,1+,2,3,4

        -- Hig Pop - 3,4,6,12,18
        -- Hig Vette - 1,1+,2,4,6

        -- Vay Pop - 7,8,14,21,28,35
        -- Vay Fighter -1,1+,2,3,4,5

        -- Vay Pop - 6,7,12,18,24,30
        -- Vay Bomber - 1,1+,2,3,4,5

        -- Vaygr Pop 4,5,8,16,24
        -- Vay Vette - 1,1+,2,4,6

        { "Corvette", "Graph", 3, 1.00, 4, 0.98, 6, 0.98, 12, 1.001 },
        { "Corvette_hw1", "Graph", 3, 1.00, 4, 0.98, 6, 0.98, 12, 1.001 },

        { "Vgr_LaserCorvette", "Graph", 4, 1.00, 5, 0.98, 8, 0.98, 16, 1.001 },

    },
    WEAPONACCURACY = {

        -- HW2 Pop - 3,4,6,9,12,15
        -- HW2 Scout - 1,1+,2,3,4,5

        -- Hig Pop - 5,6,10,15,20
        -- Hig Fighter - 1,1+,2,3,4

        -- Hig Pop - 3,4,6,12,18
        -- Hig Vette - 1,1+,2,4,6

        -- Vay Pop - 7,8,14,21,28,35
        -- Vay Fighter -1,1+,2,3,4,5

        -- Vay Pop - 6,7,12,18,24,30
        -- Vay Bomber - 1,1+,2,3,4,5

        -- Vaygr Pop 4,5,8,16,24
        -- Vay Vette - 1,1+,2,4,6

        { "Corvette",AggressiveStance, "Graph", 1, 1.001, 3, 1.001},
        { "Corvette_hw1",AggressiveStance, "Graph", 1, 1.001, 3, 1.001},
        
    },
    WEAPONDAMAGE = {

        -- HW2 Pop - 3,4,6,9,12,15
        -- HW2 Scout - 1,1+,2,3,4,5

        -- Hig Pop - 5,6,10,15,20
        -- Hig Fighter - 1,1+,2,3,4

        -- Hig Pop - 3,4,6,12,18
        -- Hig Vette - 1,1+,2,4,6

        -- Vay Pop - 7,8,14,21,28,35
        -- Vay Fighter -1,1+,2,3,4,5

        -- Vay Pop - 6,7,12,18,24,30
        -- Vay Bomber - 1,1+,2,3,4,5

        -- Vaygr Pop 4,5,8,16,24
        -- Vay Vette - 1,1+,2,4,6

        { "Fighter",AggressiveStance, "Graph", 1, 1.001, 5, 1.001},
        { "Fighter_hw1",AggressiveStance, "Graph", 1, 1.001, 5, 1.001},

        { "Corvette",AggressiveStance, "Graph", 1, 1.001, 3, 1.001},
        { "Corvette_hw1",AggressiveStance, "Graph", 1, 1.001, 3, 1.001},

    },
    BULLETSPEED = {

        -- HW2 Pop - 3,4,6,9,12,15
        -- HW2 Scout - 1,1+,2,3,4,5

        -- Hig Pop - 5,6,10,15,20
        -- Hig Fighter - 1,1+,2,3,4

        -- Hig Pop - 3,4,6,12,18
        -- Hig Vette - 1,1+,2,4,6

        -- Vay Pop - 7,8,14,21,28,35
        -- Vay Fighter -1,1+,2,3,4,5

        -- Vay Pop - 6,7,12,18,24,30
        -- Vay Bomber - 1,1+,2,3,4,5

        -- Vaygr Pop 4,5,8,16,24
        -- Vay Vette - 1,1+,2,4,6

        { "Corvette",AggressiveStance, "Graph", 1, 1.00, 5, 1.10},
        { "Corvette_hw1",AggressiveStance, "Graph", 1, 1.00, 5, 1.10},

        { "Vgr_Interceptor",AggressiveStance, "Graph", 1, 1.00, 7, 1.00},

        { "Vgr_LaserCorvette",AggressiveStance, "Graph", 1, 1.00, 5, 1.003},

        { "Kus_LightCorvette",AggressiveStance, "Graph", 1, 1.00, 4, 1.00, 21, 1.10},
        { "Tai_LightCorvette",AggressiveStance, "Graph", 1, 1.00, 4, 1.00, 21, 1.10},
        
    },
    TURRETSPEED = {

        { "Corvette",AggressiveStance, "Graph", 1, 1.009, 4, 1.009, 21, 1.10},
        { "Corvette_hw1",AggressiveStance, "Graph", 1, 1.009, 4, 1.009, 21, 1.10},

        { "Kus_LightCorvette",AggressiveStance, "Graph", 1, 1.005, 4, 1.005, 21, 1.005},
        { "Tai_LightCorvette",AggressiveStance, "Graph", 1, 1.005, 4, 1.005, 21, 1.005},

    },
    ACCURACYAPPLIED = {
        
    },
    DAMAGEAPPLIED = {

    },
    FIRERATE = {

        { "Fighter",AggressiveStance, "Graph", 1, 0.80, 5, 0.80, 10, 0.80},
        { "Fighter_hw1",AggressiveStance, "Graph", 1, 0.80, 5, 0.80, 10, 0.80},

        { "Vgr_Interceptor",AggressiveStance, "Graph", 1, 0.90, 7, 0.90, 14, 0.90},


        { "Hgn_AttackBomber",AggressiveStance, "Graph", 1, 1.00, 5, 1.00, 6, 0.98},
        { "Vgr_Bomber",AggressiveStance, "Graph", 1, 1.00, 6, 1.00, 7, 0.98},

        { "Kus_AttackBomber",AggressiveStance, "Graph", 1, 1.00, 5, 1.00, 6, 0.98},
        { "Tai_AttackBomber",AggressiveStance, "Graph", 1, 1.00, 5, 1.00, 6, 0.98},

        { "Corvette",AggressiveStance, "Graph", 5, 0.98, 6, 0.98 },
        { "Corvette_hw1",AggressiveStance, "Graph", 5, 0.98, 6, 0.98 },

    },
}

UnitLimit = 35

SupplyLimits =
{
    LayoutFighter = 33,
    LayoutCorvette = 33,
    LayoutFrigate = 17,
    LayoutDestroyer = 8,
    LayoutBattleCruiser = 1,
    LayoutResource = 14,
}

--SubFormations = 
--{
    --	Fighter = "Delta",
    --}

strikegroup = 
{
    OffsetFromParent                        = { 0.00,  0.00,  0.00},
    Children =  {
        -- Left
        { OffsetFromParent                  = {-1.00,  0.00,  0.00}, },
        
        -- Right
        { OffsetFromParent                  = { 1.00,  0.00,  0.00}, },
        
        -- BackUpper
        { OffsetFromParent                  = { 0.00,  0.50, -0.50}, },
        
        -- Forward
        {
            OffsetFromParent                = { 0.00, -0.50,  1.00},
            Children = {
                { OffsetFromParent          = {-1.00,  0.00, -0.75}, },
                { OffsetFromParent          = { 1.00,  0.00, -0.75}, },
            },
        },
        
        -- UpperLeft
        {
            OffsetFromParent                = {-0.50,  1.00, -0.50},
            Children =  {
                { OffsetFromParent          = {-1.00,  0.50, -0.50}, },
            },
        },
        
        -- UpperRight
        {
            OffsetFromParent                = { 0.50,  1.00, -0.50},
            Children =  {
                { OffsetFromParent          = { 1.00,  0.50, -0.50}, },
            },
        },
        
        -- Lower
        {
            OffsetFromParent                = { 0.00, -1.00, -0.25},
            Children = {
                { OffsetFromParent          = {-1.00, -0.50,  0.25}, },
                { OffsetFromParent          = { 1.00, -0.50,  0.25}, },
            },
        },
        
        -- BackLeft
        {
            OffsetFromParent                = {-1.00,  0.50, -1.00},
            Children = {
                { OffsetFromParent          = {-1.00,  0.00,  0.00}, },
            },
        },
        
        -- BackRight
        {
            OffsetFromParent                = { 1.00,  0.50, -1.00},
            Children = {
                { OffsetFromParent          = { 1.00,  0.00,  0.00}, },
            },
        },
    },
}

Also, it appears that sg_sphere.lua cannot be overridden.

Thanks, I’ll have a try.

I’m glad you created a different thread, because we have to go into other directions with this subject. The Devs kind of had to be bounded to the original system. Despite of that, it seems they’ve left for us a system that is better to customize and create new options.

I’m not aware of how the system is working now, so I’ll study your file. In the classic HW2, I created a strike groupo called Escort, which was a cube around the escorted ship, which is similar to your screenshot. The difference back then was that artificial “long line” when you have a lot of ships to put in formation.

What I wanted to have ideally is:

  • Frigates occupy the 8 vertices around the escorted ship(s), whenever there are/is frigate(s), +/- 500m away from the ship;
  • Corvettes occupy vertices of the frigates, except the vertice occupied by the escorted ship(s);
  • Corvettes occupy the front, back, above and below of the escorted ship(s)
  • Interceptors make a cube 5Km to the center of the SG;
  • Scout takes the lead 10Km ahead of the SG. If the fleet turns, the scout will turn and hurry up to take the lead again.

IDK how difficult it is to implement, but basically the lines are replaced by cubes, that’s more natural and you spread better your fleet skills.

Initial test of your proposed “Escort” formation:

Next:


image

Not sure why the back corners aren’t being populated…

2 Likes

Escort Formation:

image

image


@Chimas:
Frigates occupy the 8 vertices around the escorted ship(s).
Corvettes occupy edges next to frigates.
Corvettes occupy the front, back, above and below of the escorted ship(s).
     → Could not be done simultaneously with corvettes occupying edges.
Interceptors make a cube in front of group.
     → Making cubes is hard…
     Opted for a Fighter Screen instead.
Scout takes the lead even farther ahead.
     → I attempted to do this, but the amount of code needed for this is mind-boggling – and there is no way to separate scouts from other fighters for unitcaps purposes.
If the fleet turns, the scout will turn and hurry up to take the lead again.
     → This happens anyways.

2 Likes

Wedge Formation:

image

2 Likes

@BitVenom, perhaps you could help me out with something?

I’m quite confounded by a little bug I’ve been desperately trying to kill. Part of the “Escort” formation shown above (the fighter screen) is not working as intended.

Here’s the intended result:

And actually it works wonders until I throw a Destroyer or Battlecruiser into the group, and then I get this:

I’ve tried just about every possible iteration of Proxies/Children nodes that I can think of… Is there something I’m missing? I’m willing to send you the file.

Can you make a formation that looks like this?

title here [img]http://i0.kym-cdn.com/entries/icons/facebook/000/001/030/dickbutt.jpg[/img]

[edit]

Spoiler tags not working properly.

We’ve lost him :laughing:

Do they break formation to respond to an attack?

2 Likes

Yes they do.

1 Like

The solutions you’ve achieved so far are good enough, despite what is not working.
Can you send me the code/Lua so I can make tests? (via PM)

Spoiler tags not working properly.

Doesn’t work with and

use this code to hide
< details > < summary > title here < /summary >
image here
< /details >

… DELETE those spaces …

1 Like

Oh! What is this? Is that a fancy new button, you ask?

image

Why, yes! It is!


Coloring is a little off, but I may I’ll probably go back through and redo all of the existing icons to match, as this new icon is much cleaner/less artifact-y…

4 Likes

I like the hexagonal formation. Some of the benefits of a sphere (or circle), and some benefits of a wall.

That’s the intended outcome, but not the result I’m getting…

Did you just make that icon in Illustrator then plug it in?

I used GIMP. I’ve reworked all the icons except the original 3.

1 Like