Avorion

Avorion

[2.5.2+] Xavorion: Formations
61 Comments
LM13  [author] 20 Feb @ 3:42pm 
@ELLIOTTCABLE on Discord

Not intended, this only happens when you're using vanilla Velocity Bypass,
or have extremely fast ships - like Scout ships with maxed stats.

Collision damage should not be an issue with flight physics enabled.
ELLIOTTCABLE on Discord 20 Feb @ 3:15pm 
(oop, sorry, deleted my original post to add more, but hadn't reloaded the page to see that you'd already replied to it)

It'd be pretty neat if the "leaders can enter hyperspace with followers" could be locked behind progression somehow, and also be a feature that affects design constraints on the ships - i.e. require some sort of block on the 'capital' ship, be unavailable until Xanion (just like transporters), and require e.g. a larger block of Hyperspace Core blocks per mass/distance of included follower-ship!

Edit: Also, when in formation, ships seem to slightly lose their shit - flying around the formation leader in circles at extremely high speed, while the leader is just sitting around doing nothing. That's scary due to collision damage, but also more directly, makes the subordinate ship almost untargetable to repair-drones - that try and follow it around, but mostly fail to keep up. Is this a bug, or perhaps a mod-interaction; or is it intended behaviour?
LM13  [author] 20 Feb @ 12:10pm 
@ELLIOTTCABLE on Discord

Sounds like a feature for optional tweak, thanks - it may happen at some point.
Thought about it before, but decided it would be too limiting for combat/gameplay by default.
LM13  [author] 16 Dec, 2024 @ 4:55am 
@Koinzell || Souza

Sorry for late reply.
Adding new button to change formation should be as easy as creating a mod with two files as listed in comment below.


If you need more information, let me know.
LM13  [author] 16 Dec, 2024 @ 4:55am 
@Koinzell || Souza

------------------------
/scripts/Orders/OrderHUD.lua
------------------------

-- Insert new order button to HUD
local _NewCommand = { Icon = "data/textures/icons/regroup.png", Action = "ChangeFormation", Tooltip = "Change formation" }
table.insert( Self.LeaderActions, _NewCommand )
-- ^ above line can use one of those instead
-- Self.LeaderActions = ship with followers
-- Self.FollowerActions = ship following
-- Self.ShipActions = ship without leader/follower

------------------------
/scripts/Orders/OrderController.lua
------------------------

-- Create new order: Change formation index used by ship (called by button click)
Self.Action["ChangeFormation"] = function( _CallingShip, _Player )

local _FormationID = 1 -- Index @FormationDatabase.lua
-- Assign this ID for calling ship - value will be recognized by formation system
_CallingShip:setValue( "ShipProperty.FormationID", _FormationID )

end
Koinzell || Souza 8 Dec, 2024 @ 5:55am 
@LM13 Hello there.

i have tried to add the formation selection command in your files but as i'm no programmer every attempt i made messed up something else.

i've got the new button to show up by adding it to "OrderHUD.lua" inside #199"Self.ShipActions" as i assumed that choosing the formation before ordering ships to join formation would require less work. But i cant get it to call any function.

My last attempt was to create a function to toggle FormationIndex value from 1 to 8 each time you click the "Change Formation" button and tried to call it inside "FormationSelection.lua" replacing the _Class variable. but if i include("OrderController") it breaks subordinates ability to locate the leader ship.

would you be able to shed some light in this matter ?
Zappy The Floof 15 Nov, 2024 @ 10:37am 
Thanks
LM13  [author] 15 Nov, 2024 @ 10:22am 
@Zappy The Floof

Nope, formation order buttons have location hardcoded in .lua file.
Zappy The Floof 14 Nov, 2024 @ 7:37pm 
Is there a way to move the hud assets without messing with the XMLs?
LM13  [author] 1 Oct, 2024 @ 10:07am 
@Max Shadow

Apologies, Formation Orders only appear with Combat AI module enabled. You don't need full overhaul, just combat order extension (which is safe to enable mid game).

Description has been fixed, never expected anyone to use just formations.
Btw. "Move" does not remove a ship from formation - only Disband/Leave order.
Max Shadow 30 Sep, 2024 @ 6:38pm 
Is the "Formation Orders" part of the full overhaul? Because I'm only using this mod (and its dependency) and I don't see any new UI elements on screen when I'm in a formation. The only way I found to remove a ship from a formation is to give them a move order.
JackSaw 21 Sep, 2024 @ 3:41pm 
@Koninzell ah you are right, when I first saw the flight AI mod I thought it was some kind of flying overhaul and didn't get it lol, I see now that you need both to use everything
Koinzell || Souza 20 Sep, 2024 @ 5:16pm 
@Jacksaw, you are probably missing some important modules, in my game, when a ship is moving as part of a formation it is nearly impossible for it to crash into someone, some mystic force prevents it
JackSaw 20 Sep, 2024 @ 5:04pm 
Really love this as a feature, but having a hard time figuring out how to give formations orders or change formation. I might be missing part of the UI as I don't see "When mouse cursor is visible, new orders will apear right above health bar/turret groups UI." I don't have the full xavorion overhaul installed as I am doing a vanilla + play through first, that might be why that part of the UI isn't there?

The default formation keeps having ships running into stations lol
Koinzell || Souza 12 Sep, 2024 @ 2:37pm 
@LM13 you`re awesome !! i`ll try it as soon as i have freetime! as soon as i get something noteworthy i`ll share it here
LM13  [author] 12 Sep, 2024 @ 7:24am 
@Koinzell || Souza

All right, I've added new script to allow easy changes to formations.

New script: "data\scripts\Formation\FormationSelector.lua"

at line #36 there's an example function "GetCustomFormationID()"
with Class based selection already there - though by default this function will return default arrow formation.

With this, even UI mod can be created to choose formations - all it needs to do is call Entity():setValue( "ShipProperty.FormationID", Value )
LM13  [author] 9 Sep, 2024 @ 4:19pm 
@Koinzell || Souza
Hello, glad somebody is looking into code there.

Yeah, it can be done. Each time a ship is ordered to Escort, leading ship will send formation ID (literally index from *FormationDatabase.lua*) and slot.
This is done in function AddFollower - Line 318 @FormationFlight.lua, ID is assigned at line 326 ( local _FormationID = 1 )

So all that needs to be done is selection logic at line above.
I'm fixing some bugs now so maybe it's a good idea to expose this to some function thats easier to extend.
Koinzell || Souza 9 Sep, 2024 @ 2:23pm 
@LM13, Hello there, Hope youre having a good one.
I've been messing around with the Formations files, managed to get a nice cross formation working and all. Would be possible, with your current code, use different formations based in the class of the "flagship" ? i'm yet to look deeper in your code so i figured it would be better to ask you before falling in that rabbit hole. How often does the formationData gets called in your code? or is it just a one read while starting up and never again ? if it is called more than once, would it be possible to create a formationData with a conditional to select what formation to use based on the shipclass of the leader ? my idea would be implementing that inside the *FormationDatabase.lua*, not in the shipXAI *FormationFlight.lua*
LM13  [author] 26 Aug, 2024 @ 8:54am 
@2G33K4U

Third Person Perspective, the default mouse/keyboard mode with camera behind your ship.
First screenshot here is RTS mode, second is TPP
2G33K4U 26 Aug, 2024 @ 8:37am 
what is TTP mode?
Mister Cthulhu 26 Aug, 2024 @ 2:24am 
Ah gotcha, Well thanks anyways for the help anyways LM, Cheers mate!
LM13  [author] 26 Aug, 2024 @ 2:21am 
@Mister Anubis

Yes and no. There's no implemented way of changing them in game.

But formation system was created for multiple formations types - there's even FormationDatabase.lua file, but only first entry is ever used.

For programmers, it's line #326 (AddFollower) - ShipXAI/Plugins/FormationFlight.lua, that defines which formation is picked.
Mister Cthulhu 23 Aug, 2024 @ 4:06pm 
Is it possible to add more formation types? I have somewhat understanding with Avorions Lua files but I'm wanting to know if it's possible for me to add my own formations.
Mister Cthulhu 23 Apr, 2024 @ 2:19pm 
Ah okay, I gotta admit all your Xavorion mods are a must have! :Cupup:
LM13  [author] 23 Apr, 2024 @ 7:17am 
@Mister Anubis

The only way of control is via sub-formations, described in encyclopedia.
Distance is based on radius of ships in sub-formation.

Current distancing allows formation of fleets to move at full speed,
while being controlled with just a single commanding ship.
Mister Cthulhu 23 Apr, 2024 @ 4:13am 
Is there a way to change how close or far the formation can be? I'm making a formation with ISDs but they go so far away.
Rakshasas 14 Mar, 2024 @ 7:00am 
@LM13 - I have an update because I do experience high framerates, most of the time. Game stutterst but the average is 162.7 according to my AMD drivers.

It's kind of hard to know for sure but I noticed that the crazy loop they'd do trying to get in formation wasn't so crazy, and I also noticed that one of my ships actually did stop sometimes. So I took the lead ship and changed position and turned it and watched the behaviour a bunch of times. Most of the time, that same ship would actually come to a stop.

So then I checked it's stats, and went a bit crazy on adding inertial dampers and directional thrusters for yaw, and it's been working great. I then did the same thing to the ship that does have the +accel/+vel module and it also comes to a stop now.

So I think your change plus giving the ships better stopping power does the trick.
YamatoPower9000 12 Mar, 2024 @ 8:04am 
I got old system with ancient screen 60hz is a max with 60 fpx max respectivly and I gotta use Vsinc, with old CPU with only 4 cores (no HT). This is shamanic territory. Reminds me about loss of sharpness or durability if you hit a wall in darksouls with huge amount of FPS.
I'll try to fiddle with settings later. It's not just *looping* formation that ruins everything but a whole fleet is nearly useless as I feel like only AI auto turrets are helping.
LM13  [author] 12 Mar, 2024 @ 6:35am 
@YamatoPower9000

I've pushed a maybe-fix for Flight Physics mod.

I can't test it, since 60fps is the absolute max I can get.
I'd appreciate some information if that helped, but no pressure.
LM13  [author] 12 Mar, 2024 @ 6:04am 
@YamatoPower9000

On a second thought, do you have 120/144Hz display, or unlocked framerate above 100 ?
LM13  [author] 12 Mar, 2024 @ 5:48am 
@YamatoPower9000

You can PM me with details. I've seen strange formation behaviour on a stream, but have no idea where and why it comes from - tried to replicate this, but it's always working for me.

If you use some specific workshop ships, maybe that's the issue I've missed?

As for leaving formations - yes, those are presistive on purpose. Formations should work as a group unless ordered to leave/disband. ( Encyclopedia is being refreshed now, to contain quick information on controls, with detailed screenshots on formations, and other stuff )
YamatoPower9000 12 Mar, 2024 @ 5:42am 
I give up. I did fresh reinstall. Removed, deleted all old data, including folder in appdata. Unsubed from ALL mods.
Then only subbed to ONLY Avorion eXtended list which says 24 items but there like 16 mods in total. I didn't even used any sound mods, nothing. Only your list with 1 click. All activated. Menu has eXtended signature. New save - new galaxy. Normal mode, veteran difficulty. 2.4.3 current stable branch of avorion.
Rushed to Lady quest ship and..... escort still acts with insane looping.
There's no way I screwed up somewhere unless I misunderstood gyro instructions or "do not overwrite your vanilla ships" which I don't understand at all. I never use gyro, only workshop ships, except for last test run with nothing except eXtended list.
They also love getting glued into formations and I gotta make few clicks on them to "leave formations.
LM13  [author] 10 Mar, 2024 @ 3:20am 
@YamatoPower9000

Then there's still something wrong. I'm playing mostly with Formations of M1 - M3 ships, rarely Corvettes.

If you ever find what was causing that crazy flight - let me know.
YamatoPower9000 10 Mar, 2024 @ 3:15am 
Ok. I starting to feel like anything less than heavy corvette does that. I just built 2 heavy corvettes and they act chill. Below - crazy looping.
LM13  [author] 10 Mar, 2024 @ 3:04am 
@YamatoPower9000

There's an RTS Combat video on main mod page, or Combat AI.
You can see there how formations are supposed to work/look.

Details of use/behaviour with screenshots are in encyclopedia. ( Which will get a refresh soon )

If you have Class System, and full X - there's no insane looping, unless some other mod is screwing with speeds/stats.
YamatoPower9000 10 Mar, 2024 @ 12:08am 
I've subscribed to all mods in Avorion eXtended list. I don't understand replacement of escort command. Right click (RTS) still an escort (with insane looping flight physics) it also gets fighter icon and it happens even without escort order if I just order (in my case 2 ships) to move in 1 location (again in RTS mode). I can order - leave/abandon formation but never really felt they are in it.
Rakshasas 9 Mar, 2024 @ 8:51am 
The behaviour for me is easy to repro. I made sure all ships have no formation. I take another ship and r-click the lead ship to "Escort". That ship will fly to lead ship at normal speed.

When it reaches escort position it will give the "orders complete message". Then it goes into a extreme full burn and loops around at a speed that doesn't seem like it's possible for that ship to reach.

The only ship that has an acceleration and velocity module is the ship I primary fly and that's only because of the other perks provided by the "Rift mission module". It's an Intercept module.

Removing that module as a test did not seem to change anything either.

As to my early comment about a ship colliding with a gate. I think that might have happened after I gave it the stop order. I have not seen any collision since I made that comment. Ships seem to stop on a dime if it's going to hit something, so I'll chalk that up as something I must have done.
Rakshasas 9 Mar, 2024 @ 8:43am 
I've been meaning to come back with a more detailed report. Mods used:

AzimuthLib
Galaxy Map QoL
New Missions (Extra Ship Classes Core, Destroy Prototype Battleship, Wrecking Havoc, Collect Pirate Bounty, Attack Research Base, Escort Civ Transports, Ambush Pirate Raiders, Transfer Satellite and Eradicate Xsotan Infestation)
Extra Available Missions
1.0 Orders and Looping
Extra Ship Classes Core
ReImproved Harvest AI (recently added though, issue existed before this was added)
Xavorion: eXtended Scripting Framework, Docking, Flight Physics, Formations and Combat AI.

There are other mods that I am subscribed to but not listed in my save. I am going to assume there is no cross contamination bug happening right? Should I unsub everything that is not in use?
LM13  [author] 9 Mar, 2024 @ 1:41am 
I'm unable to replicate this. Even with fighter blueprints used as ships.

I assume you're not using Xavorion overhaul, just this mod with some others.
I'd need a full modlist to check - but, as it's the case with Velocity Bypass upgrades -
I can't tweak flight model for upgrades/speeds that dont exist in Xavorion.
YamatoPower9000 9 Mar, 2024 @ 12:24am 
I have same issue as Rakshasas. I had a ship that orbits my miner like a fly or an electron around atom. I probably haven't figure out formations at all before my I decided to fight invading pirates that oblitirated me in 2 shots. Rage quit and start over.
Rakshasas 2 Mar, 2024 @ 5:25pm 
Yeah, it's very strange. I do have a velocity/accel module on one of the ships in the fleet, and it definitely behaves the worst by far, but even the ships that don't have it keep wiping around like crazy. I've tried buffing their stopping power with inertial dampers too and nothing seems to help. I'm not too sure what I did yet.
LM13  [author] 1 Mar, 2024 @ 1:16pm 
@Rakshasas

Strange... Flight Physics should not allow anything to crash, and gates usually "swallow" anything before it can touch them.

Stuff like that could happen with vanilla Velocity Bypass, or some other speed affecting upgrades (that are not part of X).
Rakshasas 1 Mar, 2024 @ 1:08pm 
Hey, it's me again! Based on the change notes I don't think this is a new bug, but something odd is happening now. My escort ships are flying around in circles trying to get in formation while the lead ship is sitting still.

Basic troubleshooting steps: I cleared all formation orders, moved ships away from each other and told them all to independently jump to a empty sector. I have confirmed that none of them had any lingering orders or were part of any formation.

Then I moved the desired lead ship away from the group, and assigned one of them to be an escort. It flies towards the lead ship, slows down, drifts past it and then goes in a max speed loop trying to get in formation. Formation orders are working from what I can tell so this isn't a game breaking issue, just kind of fun to watch. Though I lost a bit of rep when one ship rammed a gate.
LM13  [author] 1 Mar, 2024 @ 5:33am 
Yes, multiplayer is working.

Here's a link to a discission about current multiplayer server(s):

https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/2923179923/7091547412719007992/
Destroileur 1 Mar, 2024 @ 5:30am 
Work on multiplayer on last update ?
RedRapture 14 Dec, 2023 @ 5:26pm 
Your mods are broken for multiplayer following the latest update. RIP mod.
Bixel 7 Jul, 2023 @ 1:29pm 
While NOT in formation sometimes setting a ship to "Attack" in a sector from the Map "M" then focus and switch to that ship, will be pinging beeps (no looking for escort messages) but will cancel beeps if press "N" and leave formation. Not game breaking
LM13  [author] 30 Jun, 2023 @ 6:39am 
Sure, check your invites
Diamon 30 Jun, 2023 @ 6:35am 
can i dm you that? it's more difficult to write here as steam is a bit slow on loading this chat
LM13  [author] 30 Jun, 2023 @ 6:30am 
@Diamon

What are the stats (velocity/acceleration/rotations) of that frigate? Flight Physics uses max stats of a ship, it may work strange for some ships without other modules.

Vanilla had strange approach to speeds of ships, that was changed by Class System, but it requires new save and other changes to rebalance combat.