Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Trivial Psychic on June 04, 2014, 07:45:53 pm
-
After reading of formation headaches in THIS (http://www.hard-light.net/forums/index.php?topic=87679.0) thread, it occurred to me that perhaps there might be a way to override the hard-coded formation behavior with a table file. First of all, if implemented, I could foresee the ability to customize a formation using ship radii as an expandable distance so it can scale up depending on the size of the craft involved. I could also foresee it calculating the distance based on the size of the craft and the one next to it, so in theory you could mix together ships of quite varying size without them running into each other. There would also be a figure indicating what the maximum number of ships that can be arranged in this particular formation. Then the radii system would be used to indicate lateral separation, aft or fore of the lead, and vertical separation. The lateral separation would use positive or negative values indicating whether its left or right of the lead. Then the figures would be in order for position 2, 3, etc. You could have lead, 2 and 3 on the right side and 4, 5, and 6 on the left. I know that the default formation is alternating from side to side, but not being restricted to this could give us considerable flexibility. We could make a completely line-abreast formation, single file, or echelon.
The next set of options could include overriding restrictions of not using afterburner during waypoints, (which may have already been added to ai_profiles), or whether the formation should fly parallel while flying waypoints, as formations often crowd together when approaching a waypoint. I'm sure there are other options that modders might like to have incorporate into this.
The final issue is implementation. The first and most obvious location is in the wing editor in the same way we select ai classes. The second would be as part of the ai-form-on-wing sexp. This would add options for what formation to use, with the option for default, followed by perhaps what position in the formation the craft would take. Another option (though it would require changes to the ship selection interface screen) would be to give the player the choice of what formation to chose from a list of what the FREDder has allotted. The final option would be to allow the player to select the formation in mission when they make the "form on my wing" command. It would require another level within the comms menu.
So, is this feasible, desirable, too hard to impliment?
-
Is this possible? I would love to see custom formations for wings...
-
TBH, I don't think that wing formations are important enough to be worth the time and effort spent making them customizable. The player probably won't notice how the formations look, and they won't have much gameplay impact in most scenarios.
-
We can already permit afterburner usage while waypointing. Other than that I don't think this is substantially useful.
-
Writing the code to parse a new table file is easy. Writing the code to instruct the AI how to fly a new formation is hard.
-
I think it would be a useful feature, it would be nice if we could get ships to fly in something other than a 2d V. don't let the nay sayers get you down, get coding.
-
I think it would be a useful feature, it would be nice if we could get ships to fly in something other than a 2d V. don't let the nay sayers get you down, get coding.
Do you actually play or make content for this game though :p
-
I started writing such a mod-wide ai_profiles.tbl formation override for FotG several years ago but never finished it. It's not actually a particularly complicated thing to do AI-wise because the AI code isn't hardwired to fly a particular formation; there's simply a function or two for calculating the position a ship should take relative to the wing leader. The hard part, I found, is to come up with a simple but flexible syntax.
-
While we're on that topic, is the code that makes them do that glitchy looking jumpiness to assume/stay in formation in that same area of code? Making them do formation flying more fluidly could benefit the overall atmosphere pretty much across the board.
-
While we're on that topic, is the code that makes them do that glitchy looking jumpiness to assume/stay in formation in that same area of code? Making them do formation flying more fluidly could benefit the overall atmosphere pretty much across the board.
Can't say I recall seeing any particular glitchiness. AFAIK they just use some standard fly-to-location code to fly towards their position in the formation, which I suppose can result in some weirdness in some situations.
-
The glitchiness is a result of fighters attempting to turn around when they are too close to the lead fighter, instead of just cutting their engines and drifting.
-
As I coded the afterburner feature for pretty much everything where ai didn't use them yet (waypoints, to position, formations) I have a pretty good idea how this code works. Besides that I scripted formation flying for my RTS mod.
In the end it boils down to the problem that there are dozens of hardcoded values that specify how the ai flies to a point or how it keeps formation. Both functions are similar in how they work. Making these values accessible via a table and modifying them is probably sufficient to remove most if not all of the glitchiness some people experience.
If you want other formations that can't be reached by simply modifying the values in the current code I would recommend scripting with dynamic waypoints. Catching any orders given (like form-on-my-wing) is simple in scripting and they can be replaced with waypoint orders on the fly. It's not very simple but at least keeps the game code free of all the mess that may come with advanced formation features.
-
The player probably won't notice how the formations look, and they won't have much gameplay impact in most scenarios.
I think it would be really useful for cutscene purposes.
-
Cutscenes are tightly scripted so you can manually position and move the ships.
-
That is correct, but yet, with such thing implemented that could be easier.
But since this feature would be a pain for coders, that don't really matter too much.
-
Well, the problem with AI code in general is that a whole lot of values are hardcoded and impossible to customize. That's a bigger problem than different formations. Some sort of general AI overhaul would definitely be nice, with all this hardcoded stuff properly exposed, capship AI improved and future feature implementation made easier.
-
If formations were expanded to include some of the options in Homeworld 1, it'd open up a lot of FRED options. Things such as sphere and wall formations instead of the default V for large wings or groups.
-
I'm not sure I see the options opened up. For fighters this is strictly a non-combat formation, so you're coming up with new fancy ways to parade. Most non-fighter combatants probably shouldn't be in a wing anyway.
-
Flight demonstration squadron campaign:
- Fly exactly down this path and keep you job
- Release patriotic colored gas trail
- Waggle those wings
- Your tax dollars at work
-
I'm not sure I see the options opened up. For fighters this is strictly a non-combat formation, so you're coming up with new fancy ways to parade. Most non-fighter combatants probably shouldn't be in a wing anyway.
Unless we also implement a way to get groups of ship to follow some sort of formation without being in a wing.
I think this kind of feature would be pretty neat. Making big ships fly in formation is a bit of a pain right now. But yeah, again, AI code...
-
What about bombing formations? Commanding a bomber wing to take out a subsystem will make them form up in a line instead of the standard V formation and then break off about 1000m away from their target. While this works fine in retail, it doesn't work in mods that use bombers focusing on speed rather than bulk. Nicely lined up bombers make for easy targets.
-
That's probably a result of the bombers following the subsystem's attack path.