Cargo Wingmen - a development

Development directions, tasks, and features being actively implemented or pursued by the development team.
Post Reply
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Cargo Wingmen - a development

Post by IAmDave »

Hi Everyone,
I'm new here, but in the past few days I've been looking into cargo wingmen and the commands you can give them. I found the thread about what they're supposed to do but don't (like being tractored back in), and I also had some ideas of what would be handy myself.

My plan was to make a few changes for our multiplayer LAN games, but I figured I'd post here to see if any of my changes would be useful and if there are any opinions on what would also be useful (I suspect quite a few!).

Here's what Ive done so far:
- fixed the 'dock with me' command so the cargo wingman sits in front of the player for tractoring
- fixed the tractor beam so that player owned ships can be tractored in
- changed the default command for a flightgroup to 'form up' so that they don't scarper as soon as you eject them.
- added a 'dock at my target' command so that you can send wingmen to a station. Once they dock you can use the change ship key to go to the docked ship and use the station menu (great for equipping them or filling up your freighter with cargo!).

still on my to do list:
- a 'move to target' command so I can get freighters to move while I escort them.
- add a 'hold position' command and put it as the default for the ship you just left so it doesn't scarper

If anyone is interested I can send the exe so you can try it with the latest svn trunk.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Cargo Wingmen - a development

Post by loki1950 »

Welcome aboard Dave just post a patch that can be applied to the current svn someone will try it out and provide the necessary feedback and then someone with commit privileges can put it into the svn tree 8)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

Here's a zip of my changes. To use them all you'll need to add a couple of lines to vegastrike.config to map keys to "CommDockWithMe", "CommDockAtTarget" "CommHoldPosition", and of course the "SwitchControl" key if you haven't already (for switching to docked wingmen).

I made a couple of changes too:
- reverted the default flightgroup command to 'break formation'. I figured this might be needed for normal AI flightgroups. Best if you use the "CommFormUp" key BEFORE ejecting your cargo wingmen.
- the "CommDockAtTarget" command also works on units that can't be docked with, in which case the wingmen move to that location. They will start pushing a ship if you use one as the target! Works great for getting heavy ships to a wormhole though, do something else for a while (in the same sector) and they're sat there waiting. Don't forget to tell them to form up before you press "j" though!
You do not have the required permissions to view the files attached to this post.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Cargo Wingmen - a development

Post by loki1950 »

Thx Dave i will probably be checking out svn myself early next week as I am being discharged from hospital Friday and will be setting up my work station at my brother's then :D so I will be giving you some feedback then.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

Cool! I like the "hold posistion" idea, kinda thinking I might drift back to playing the game.
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

hmmm... Is the zip for linux? Haven't downloaded the latest free visual studio, so can't do much windows compiling. Or is there something I'm missing? In short: I like the idea, how do I use it?
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

The zip contains the source code I changed - so only useful if you have a development environment set up. I'll test the exe i've built with 0.5.1 and see if it works, it'll save you a long SVN checkout!
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

Much appreciated, thanks.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Cargo Wingmen - a development

Post by klauss »

Hey IAmDave, can you make a patch of your tree?

If you checked out with SVN it should be simple, SVN will make a patch for you.

Otherwise just make a diff against the pristine sources you downloaded. Or tell us exactly which revision you downloaded for the changes so we can make the diff.

Patch would be preferred of course ;)

In any case, these changes all sound very good, I'd like to get them tested and into SVN.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

Hi klauss,
I'm away from my pc for a few days, but i'll get onto making a patch when I get back on weds. Do you use command line SVN client or a GUI? I have rapidSVN, but I'm not sure how to make a patch with it.
Dave
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

Hi Klauss,
I think I worked out how to make a patch... Hope it works!
You do not have the required permissions to view the files attached to this post.
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

Hi Travists,
I finally got to testing with 0.5.1 - my exe works with it, so if you want to try it out let me know and I'll send you it.
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

I am running SVN, but can't compile. If you can that would be great as pheonixstorm tends to handle that, but has so many duties that it doesn't happen regularly. When you upgrade cargo wingmen do they save and stay upgraded? I can also see this as part of a solution to a long standing question on how the bigger cargo ships trade/land. It has been proposed that they shuttle cargo with smaller ships, but that's had complications for a long time, if you can dock a smaller cargo ship in your big one, land it, and come back to it then a cargo transfer method is all that would be needed!
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

Yeah savegames are one of the things on my TODO list. Might take a lot of code reading to get to grips with them though!
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Cargo Wingmen - a development

Post by TBeholder »

IAmDave wrote:Here's a zip of my changes.
(looking them over in Diffuse) seems good. Though not without some doubts:

aggressive.cpp:
float dist = (leader->radial_size+parent->radial_size*3); //IAmDave - tractoring wingman fix
Hmm, maybe more sparse formations would be good for FormUp. But simply raising EscortDistance config variable would be enough.
As for DockWithMe, here's a simpler idea: to dispense with the whole "square formation" thing and let "DockWithMe" directive work only for the selected target. After all, they should be close anyway and "FormUp" brings all wingmen back to the mommy, so it's not like you have to find them first - normally NearestFriendlyKey will do.
Thus it's just
if ( (parentowner == leader) && (fg->target.GetUnit() == parent)) {
...
static float pickup_distance = XMLSupport::parse_float( vs_config->getVariable( "AI", "Targetting", "PickUpDistance", "900.0" ) );
float formdist = pickup_distance+leader->radial_size+parent->radial_size;
Right?
if ( target->faction == upgradesfaction || owner_rsize*nbig > target->rSize() || target->faction == owner_faction )
That's a broad sweep. I'd understand the same flightgroup, but even that would be questionable.
Leaving alone PVP, aren't hired guns in the same faction? Their communication turns to Privateer.
IMO better without this, since it only allows small ships to tractor big ones.
IAmDave wrote: - reverted the default flightgroup command to 'break formation'. I figured this might be needed for normal AI flightgroups.
May scatter all around the system. Under FormUp they'll escort each other around, usually that's okay.
IAmDave wrote:- the "CommDockAtTarget" command also works on units that can't be docked with, in which case the wingmen move to that location. They will start pushing a ship if you use one as the target!
Ugh. Other than damage, ramming is bad for relations... Maybe, it's better to fall back on FormUp for the same target, like DockWithMe does for non-cargo wingman, then turn towards it?
/aggressive.cpp
IAmDave wrote:Yeah savegames are one of the things on my TODO list. Might take a lot of code reading to get to grips with them though!
An ideal variant: tractoring and jettisoning implemented via docks in an unified way.
As a stopgap fix - suppose on save all units are removed from cargo and docked, one by one. Then they will be saved as docked ships, not as cargo - and on load will be auto-docked via DockToSavedBases (unless dockOnLoad is off) just like player's other ships. Right?
BTW, this could be complemented by "My Fleet" category working in cargo/starship the same way as in shipyard. Then everything would finally add up, and carriers would be useable without tedious erzats measures like launching, ejecting, switching to the ship, launching, then picking up. (trying to do that)
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

Don't know the game code enough to comment on most of it, but I see the "Dock With Target" as somewhat useful, especially if it can later be expanded to a dock with target, sell all cargo and return command. The stopgap save makes sense, but how do they reload into the cargo bay? The ability to load a ship you own into the bay of another you own doesn’t seem to be there yet. Nobody has grabbed the patch yet, so I'll give it a whirl shortly...
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

Hmmm... Looks like the patch is still for the devel version. My I have a Ready to role copy please?
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Cargo Wingmen - a development

Post by TBeholder »

travists wrote:Don't know the game code enough to comment on most of it, but I see the "Dock With Target" as somewhat useful, especially if it can later be expanded to a dock with target, sell all cargo and return command.
Goes without saying, yet in process at very least something have to be done about directives being given to the whole freakin' flightgroup.
Yes, difference between "with me" / "with other" is undesirable, but...
:idea: Maybe there should be special directives, one singling out a targetted wingman for the next directive (with timeout), another removing this so commands go to the whole flightgroup again?
travists wrote:The stopgap save makes sense, but how do they reload into the cargo bay? The ability to load a ship you own into the bay of another you own doesn’t seem to be there yet. Nobody has grabbed the patch yet, so I'll give it a whirl shortly...
IMO, overhaul of manifest/transfer lists at least to context-sensitive picker is long overdue. Who disagrees with this, just try to sell 200 missiles one by one, manually clicking at "sell" button, slot and confirmation for each. :wink:

Oh, and if you save when your other ship is flying outside, on load it's either a ship from its hold or a jettisoned "pilot". :shock:

BTW, maybe also Upgrades/Cargo overhaul.
I checked - and not only upgrades in Import_Cargo purchased with a capship (impossible to drop without setting dockport_allows_ugrade_storage) clutter damage report without doing anything useful. It's worse. All carried upgrades purchased as goods count against your upgrade space without doing anything useful!
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Cargo Wingmen - a development

Post by loki1950 »

All carried upgrades purchased as goods count against your upgrade space without doing anything useful
That's a major ouch but the system may clean up if someone took up the task of re-factoring as then the logic or illogical of the current code would expose it's self.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Cargo Wingmen - a development

Post by TBeholder »

On the second thought, all interceptors should be in
loki1950 wrote:
All carried upgrades purchased as goods count against your upgrade space without doing anything useful
That's a major ouch but the system may clean up if someone took up the task of re-factoring as then the logic or illogical of the current code would expose it's self.
The main problem is Upgrades (most of the time empty) being {filename; mountoffset; subunoffset}, while cargo has {filename; Category; price;quant; mass; volume; functionality; maxfunctionality;description;missionCargo}.

If it's okay to extend CSV format so that "upgrade" subrecords include the appropriate part. The rest is just lots of cut/paste and copy/paste of the same code now working with Cargo, plus a pair of compatibility workarounds allowing to load old CSV and saves (one correctly handling now-incomplete records and one loading upgrades from Cargo only when needed).
If so, maybe add at least setfunctionality energyconsumption for good measure instead of having to make workarounds every time something should be turned on/off we'll have a healthy reserve of things to play with (very reuseable for WC-style or better damage/repair model)? Power consumption, dunno, it looks like a good idea, but then most of the time you need it only in bulk and there's unused ECM_drain for ships and each upgrade in CSV anyway?
Last edited by TBeholder on Mon Jun 13, 2011 12:44 am, edited 1 time in total.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Cargo Wingmen - a development

Post by loki1950 »

And the generation of all those NPC ships as if you look at the console output you see that there are umpteen errors in their outfitting.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

Hi Turbo, good info + ideas there. I'll look at changing 'dock with me' to only apply to the selected flightgroup member.

I agree with the faction thing in the tractor beam code being wrong - I just don't know enough at the moment to be specific enough. I was trying to tractor a small ship into a plowshare and it didn't work with the original code.
ramming is bad for relations
Yes it really is! That's on my TODO list too, when i get the time.

I agree we need some way to give individual commands to members of the flightgroup, so you can specify a target for each ship or whatever. Although I suppose technically a flightgroup should always do the same thing - one or a column of freighters, a few fighters. Perhaps a better solution is to have a way to make multiple flightgroups and give commands to each?
IAmDave
Explorer
Explorer
Posts: 12
Joined: Mon May 23, 2011 3:24 pm

Re: Cargo Wingmen - a development

Post by IAmDave »

travists wrote:Hmmm... Looks like the patch is still for the devel version. My I have a Ready to role copy please?
I can email you an exe if you want? Max filesize is 2MB here, exe is 7.6. Just PM me your email address.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Cargo Wingmen - a development

Post by klauss »

Turbo Beholder wrote:
if ( target->faction == upgradesfaction || owner_rsize*nbig > target->rSize() || target->faction == owner_faction )
That's a broad sweep. I'd understand the same flightgroup, but even that would be questionable.
Leaving alone PVP, aren't hired guns in the same faction? Their communication turns to Privateer.
IMO better without this, since it only allows small ships to tractor big ones.
I agree, this is too broad.
It should work fine without this.
Only we should also make sure you cannot buy ships that you cannot hold (ie, tractor back).
Can you make the change Dave?

PS: I just committed the patch without the controversial bits.
I didn't have time to playtest it (so if someone wishes to, please, do), but reviewing the code, it seems to be fine.

So... give it a try, and Dave, if you can find out a better way to fix the tractoring thing other than checking against the faction, that would be dandy. :D BTW, Thanks for the patch.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: Cargo Wingmen - a development

Post by travists »

IAmDave wrote:I agree we need some way to give individual commands to members of the flightgroup, so you can specify a target for each ship or whatever. Although I suppose technically a flightgroup should always do the same thing - one or a column of freighters, a few fighters. Perhaps a better solution is to have a way to make multiple flightgroups and give commands to each?
As I see it, there are three, eventually four, levels of commands: Individual, Wing, and Flight Group (with fleet to come later).


Individual: applies only to a targeted/specified the dock with me/target would be mostly used here and how you would direct your bomber to attack a capship.

Wing: a subset of a flightgroup, typically no more than three or four craft working in unison help me out, form on my wing, and attack my target are typically used at this level.

Flight Group: (I'm not sure this is the present usage) All related craft in a given system/sector usually only jump through here type commands are used here

Fleet: All ships under your command, few blanket orders would be given, though an occasional rally here would be useful.
Post Reply