Sandman
Registered:1387320692 Posts: 224
Posted 1777954494
Reply with quote
#1
I really want to make more use of fighters in Cosmos - possibly even to run a fighter wing at PAX this year. Now, I'm no coder/scripter of any means, but in Legendary missions, I've been able to dig around and edit the code that specifies how many torpedoes a fighter delivery mission would specify. In the hanger/missions.mast:_torp_types = _torp_types.split(",") # remove blanks _torp_types = [x for x in _torp_types if x] torp_type = random.randint(0,len(_torp_types)-1) amount = random.randint(1, max(1, 3-torp_type)) torp_name = _torp_types[torp_type].strip() I edited to reduce the number of possible torpedoes and reduce the number of 'better' torpedoes. I'd like to find where the torp_type is called out to understand their 'ranking'. I'd kind of like to limit ordinance delivery missions to shuttles, but could be okay with fighters/bombers delivering a couple homing or one just one of the other types. That addresses one thing. The next thing I'd like to tweak is the ordinance that a small craft can carry if that is possible. Currently bombers carry IIRC 10 homing, 2 nukes, 2 emps, 5 mines. That's on par with a capital ship and a single bomber can do some serious damage and almost doesn't need any help. I'm trying to find where those values are set and change them if possible. Anyway, if someone can point me to the files and values I need to play with that would be great. Also open to any suggestions to make small craft less overpowered, but still interesting.
__________________CDR Callisto "Sandman" Bold Executive Officer of TSN Harbinger Shipwright of Project Harbinger (Seattle WA)
DizzyKungFu
Registered:1412276692 Posts: 250
Posted 1778007642
· Edited
Reply with quote
#2
I don't think you can change fighter/bomber payloads in 1.2.2, but I'm pretty sure it IS possible in the new version Thom is working on (which will probably be released as 1.3.0 soon). But one way I find is pretty easy to make fighters less OP is in the /data/shipData.yaml file. In this file, any ship that has "cockpit" listed in its "roles" is a fighter. And for these ships, there is a weird bug/undocumented-feature/oddity in that their actual shield strength listed in this file is actually QUADRUPLED in the game! This gives fighters and bombers shield strength on par with many capital ships! So I usually knock these shield values down to something like 10-15 (so effectively 40-60 in-game), and fighters and bombers become a lot more fragile and feel more risky. You get so many at stations now, you're unlikely to run out, but it changes the type of play for fighter players as they'll have to weigh the possibility of losing resources. PS: You'll notice that torpedo payloads are listed in shipData.yaml, but for fighters I'm pretty sure this is NOT where the game actually gets this info, so I don't think changing "Homing", "Nuke", totals here have any effect on fighters, unfortunately.
Sandman
Registered:1387320692 Posts: 224
Posted 1778021747
Reply with quote
#3
Thanks for that info. I suppose I'll wait and see what the next release brings. I recall the fighter shield issue being mentioned a while back but hoped it had been resolved - so that's a good fix for now.
__________________CDR Callisto "Sandman" Bold Executive Officer of TSN Harbinger Shipwright of Project Harbinger (Seattle WA)
Darrin
Registered:1518310287 Posts: 434
Posted 1778114656
· Edited
Reply with quote
#4
So, there are a couple ways to approach this. I'm not 100% sure how the game determines torp_types_available, but it looks like in hangar.py, when a fighter/shuttle is spawned inside a hangar, the python code reads what types of torpedo that craft can use from shipData.yaml, and then sets this as a string on the blob object for that craft. So if you want the Shuttle to only be able to carry Homing and EMP torps, then edit the shipData.yaml so it looks like: "torpedostart": [ { "Homing": 0 }, { "EMP": 0 } (I didn't test this, so I'm not sure if this works. At some point an "Objective" object is created and the torpedo_types_available string is copied from... the target of the objective, which is usually the Artemis, not the ship carrying the delivery, so again, not sure how this works exactly.) The default string looks like: Homing,Nuke,EMP,Mine, Since this string is part of the blob values assigned to the blob object, you could get the CRAFT_ID or SHIP_ID and just reset the string value to whatever: temp_craft = to_object(CRAFT_ID) temp_craft.blob.set("torpedo_types_available", "Homing,EMP,", 0) (Not sure if this works either, I get confused about what is a space object, what is a blob object, and what is an engine object. This will probably screw up the docking code, which cycles through the torpedo types to reload them.) The other thing you can try, in missions.mast when _torp_types is assigned, just replace the string with something else. _torp_types = sel_o.data_set.get("torpedo_types_available",0) _torp_types = "Homing,EMP," Or maybe we want to differentiate between the different shuttle/fighter/bomber craft types. _torp_types = sel_o.data_set.get("torpedo_types_available",0) if has_role(CRAFT_ID, "shuttle"): _torp_types = "Homing,EMP," if has_role(CRAFT_ID, "bomber"): _torp_types = "Homing,Nuke,Mines," Anyway, not sure if this helps, as I said, I didn't try it out in the code.
__________________ Call Sign (EF/TSN): Bassellope
Sandman
Registered:1387320692 Posts: 224
Posted 1778176356
Reply with quote
#5
Thanks. That gives me a place to start looking. I can make adjustments and see what breaks.
__________________CDR Callisto "Sandman" Bold Executive Officer of TSN Harbinger Shipwright of Project Harbinger (Seattle WA)
DizzyKungFu
Registered:1412276692 Posts: 250
Posted 1778208635
· Edited
Reply with quote
#6
Quote:
Originally Posted by Sandman Thanks. That gives me a place to start looking. I can make adjustments and see what breaks.
Please post your results! Many of us are looking for the ways to tweak the fighters for better play! I always struggle to decide if I want to include fighters in a convention setup. It's usually fine, but when you get a clever fighter player I will occasionally look over and the main ship has 20 nukes and the fighter player is currently on the other side of the map, single-handedly holding off a large fleet of baddies.
Sandman
Registered:1387320692 Posts: 224
Posted 1778363028
Reply with quote
#7
Again, not a coder here, but not afraid to edit. Also I am just working with Legendary Missions for testing at the moment. Tried your first suggestion in the shipData.yaml and it appeared to have no effect. Changing the number of homing appeared to have no effect. Also noted that the fighter spawns with 10 homing though that bit of code specifies 5 homing for a fighter- so it seems to get those numbers elsewhere. As for the missions.mast file, with the help of AI, I was able to come up with this: if has_role(CRAFT_ID, "shuttle"): _torp_types = "Homing,Nuke" elif has_role(CRAFT_ID, "bomber"): _torp_types = "Homing,Mine" elif has_role(CRAFT_ID, "fighter"): _torp_types = "Homing,EMP" else: _torp_types = sel_o.data_set.get("torpedo_types_available", "") That does appear to work as far as restricting the types of torpedoes available to small craft. I will note that I learned that since bombers have both 'fighter' and 'bomber' roles, that I needed to have the bomber before the fighter in the if/elif/else sequence or bombers would be seen as fighters first and get the fighter loadout. I'll keep tweaking and see what works. I especially want to limit the number of Nukes (and probably Mines) any small craft can deliver. Maybe zero for fighters, one for bombers, and two for shuttles - that can be debated. But I want to find how to do that cleanly.
__________________CDR Callisto "Sandman" Bold Executive Officer of TSN Harbinger Shipwright of Project Harbinger (Seattle WA)
Sandman
Registered:1387320692 Posts: 224
Posted 1778383345
· Edited
Reply with quote
#8
Found where the default small craft loadout is set. It is hangar_crafts.yaml Changing the ordinance count here did change what the small craft launched with.terran: - key: tsn_fighter torp_types: Homing: 6 shields: [100,100] roles: fighter display_text: Fighter - key: tsn_bomber roles: bomber torp_types: Homing: 8 Nuke: 1 EMP: 1 Mine: 2 shields: [160,160] display_text: Bomber - key: tsn_shuttle torp_types: Homing: 2 shields: [200,200] roles: shuttle display_text: Shuttle Now I am wondering if changing the shield values here will also affect the shield value at launch or if that can only be set separately in shipData.yaml Edit: changing shields in hangar_crafts.yaml did not seem to make a difference. Ran into a glitch with my change to the missions.mast file though. (at least I think it's there) When I tested, I only looked to see what delivery mission payload to confirm it did what I wanted without launching. I later discovered that Bombers for some reason won't move under thrust - almost like they are tractored/docked. Hmm...
__________________CDR Callisto "Sandman" Bold Executive Officer of TSN Harbinger Shipwright of Project Harbinger (Seattle WA)
quaris
Registered:1778268741 Posts: 16
Posted 1778484059
· Edited
Reply with quote
#9
If you want to limit ordinance delivery missions to shuttles, this is the relevant bit of code you'd want to edit, missions.mast line 26:
if random.randint(0,4) == 2: jump story_mission_investigate else: jump story_mission_deliver_to_player if has_role(docked_with, "station") jump story_mission_deliver_to_station if has_role(docked_with, "__player__") There are a few different ways to accomplish this, but I believe this would work (I have not tested this code): if random.randint(0,4) == 2 or has_role(CRAFT_ID, "shuttle"): jump story_mission_investigate else: jump story_mission_deliver_to_player if has_role(docked_with, "station") jump story_mission_deliver_to_station if has_role(docked_with, "__player__") If you want the shield maximums to actually be the maximums specified in shipData.yaml, you can remove this for loop from hangar.mast. I found this to be easier than quartering each shield strength in shipData.yaml. (Github bug report that tracks this: https://github.com/artemis-sbs/LegendaryMissions/issues/458 ) for x in range(c): m = shields[c] if c<len(shields) else craft.blob.get("shield_max_val", x) craft.blob.set("shield_max_val", m*4, x) v = shields[c] if c<len(shields) else craft.blob.get("shield_val", x) craft.blob.set("shield_val", v*4, x) These are some other issues that I encountered with shuttles/fighters/bombers which haven't come up here yet but I think you might want to be aware of: Looks like you've already figured these two out, but FYI I have already written github bug reports for these issues too:
Was there anything else you still wanted to change about shuttles/fighters/bombers? I've already had to work with the code to try to make them work more reasonably in the Eastern Front mod, so I can probably point you in the right direction for any features/tweaks.
quaris
Registered:1778268741 Posts: 16
Posted 1778485083
Reply with quote
#10
Re bombers not thrusting... I can only guess, but are bombers' "speed_coeff" getting set to zero somewhere? For example,bomber_blob.set("speed_coeff", 0, 0) Or, more generally, is something else related to its speed getting set to 0 by something in your custom scripts?