[MOD] BetterTurrets. Updated 20.12.2014
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 4447
- Joined: Tue, 2. Dec 03, 22:28
-
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03
Balor doesnt use ammo as far as i know. Missile-turrets use ammo, balors novadrones were considored like "main gun"
EDIT: if balor used ammo, its running-costs would be astronomical in the least, ~15k cr X 4 each salvo...
EDIT2: tried the mod, both good and bad. Based on "cheated" 5-star rated DO named Bob
I like the DO aiming at guns, not just random shooting, missiles also aim at guns, novas leave ships battered and in flames.
Fulmekron VS Xenon I took me 45 minutes. For some reason my ship just stops shooting every 20-30 sec and all guns have quite low fire-rate. Jet/LRs fire barely at all, but sometimes a full salvo.
Xenon I doest have that many guns to shoot at, when the DO ran out of targets, he stopped shooting.
Basicly what i'd like is "point and spray" when in range but if juicy target is visible, aim at that but keep spraying.
After guns, second priority should be shield-gennys, the small ones. Xenon I cap-genny has more hp then the rest of the ship together.
Third priority, engines! If hes hurtin, kick him the knee!
Overall, "i see good in this" but it needs to keep shooting "at something red" when in range.
EDIT: if balor used ammo, its running-costs would be astronomical in the least, ~15k cr X 4 each salvo...
EDIT2: tried the mod, both good and bad. Based on "cheated" 5-star rated DO named Bob
I like the DO aiming at guns, not just random shooting, missiles also aim at guns, novas leave ships battered and in flames.
Fulmekron VS Xenon I took me 45 minutes. For some reason my ship just stops shooting every 20-30 sec and all guns have quite low fire-rate. Jet/LRs fire barely at all, but sometimes a full salvo.
Xenon I doest have that many guns to shoot at, when the DO ran out of targets, he stopped shooting.
Basicly what i'd like is "point and spray" when in range but if juicy target is visible, aim at that but keep spraying.
After guns, second priority should be shield-gennys, the small ones. Xenon I cap-genny has more hp then the rest of the ship together.
Third priority, engines! If hes hurtin, kick him the knee!
Overall, "i see good in this" but it needs to keep shooting "at something red" when in range.
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
@swatti - this mod only changes the capship DO's behavior/priorities. If the vanilla captain manages by pure luck to position the ship correctly, the DO will fire the IHC/torpedoes.
The ship movements/ captain AI is controlled in move.attack.object.capital.xml script.
What you could try is CDOAIO and remove the fight.attack.object.capital.xml file from it (that file is also the cause for that OOS dronespam bug with that one) - so don't subscribe from steam, but download it from nexus so you get the unpackaged version instead. That mod have some clever movement code for those two ships.
Edit: What I easily can do here are to ignore fighters as valid targets for the IHC/torpedoes. Don't know if it matters much - my vanilla captains prefer to point those away from the enemy it seems, so haven't seen how long recharge time those weapons have..
And I'll look into your ideas swatti - some good points there, thanks
One question though with the Xenon I - was your DO in offensive or defensive? If the latter they won't shoot at the hull.
The ship movements/ captain AI is controlled in move.attack.object.capital.xml script.
What you could try is CDOAIO and remove the fight.attack.object.capital.xml file from it (that file is also the cause for that OOS dronespam bug with that one) - so don't subscribe from steam, but download it from nexus so you get the unpackaged version instead. That mod have some clever movement code for those two ships.
Edit: What I easily can do here are to ignore fighters as valid targets for the IHC/torpedoes. Don't know if it matters much - my vanilla captains prefer to point those away from the enemy it seems, so haven't seen how long recharge time those weapons have..
And I'll look into your ideas swatti - some good points there, thanks

One question though with the Xenon I - was your DO in offensive or defensive? If the latter they won't shoot at the hull.
-
- Posts: 4447
- Joined: Tue, 2. Dec 03, 22:28
Just downloaded the alpha and can't test right nowAdded:
Drone targeting of cap ships for offensive DO's and NPCs. Wing size and launch delay are based on DO skill and works as follows:
Wing size is set to DO "baseskill" (min 10 max 30) divided by 3. For comparison vanilla=5
Launch delay (to replenish lost drones) is 75-DO baseskill. i.e. will vary between 45-65s. Vanilla is 60s.
Might have to nerf it a bit, we'll see <- please leave a comment aye/nay.

Alternatively, it could scale based on the # of drone launch pads a ship possesses.
I mostly say this because while DO skill should be important, so should ship class. I envision it as number of drone operators, or bandwidth available for controlling combat drones. ScannArs arn't cheap!
The torpedoes should still shoot at the player - dodging Balor novadrones is a noble pastime! IIRC, they have a 40second recharge.Edit: What I easily can do here are to ignore fighters as valid targets for the IHC/torpedoes. Don't know if it matters much - my vanilla captains prefer to point those away from the enemy it seems, so haven't seen how long recharge time those weapons have..
Irrational factors are clearly at work.
-
- Posts: 2774
- Joined: Tue, 29. Oct 13, 21:59
The IHC is faster refire than the torps on a balor. I'm currently using clj's ship specific code wedged into 2.51 move.attack.object.capital.xml along with custom range finding per ship which is pretty smooth. Despite the slower refire testing my taranis 1v1 with an HoA balor, the taranis took a petty hefty kicking despite the much heavier armour before dispatching it.
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
@Sandalpocalypse
Some very good ideas there - I'll add scaling of dronelaunches based on both ship size/type and DO skill. Suls and arawn should have some extra bonuses methinks.
I'll also add a separate target list for IHC/torpedoes so they only fire at L+ ships, stations and skunk (should add M ships as well?)
Will probably have a new version up sometime this weekend
@YorrickVander
Think I'll do the same. Have sent a pm to clj btw. asking for permission to use the code in a "sucellus/balor fix" type mod to make this easy to do for non coders as well (thinking a simple copy/pasta job and diff patching it in there).
Haven't seen him here for a while so suspect I'll not get an answer, but worth a try
Btw. been looking in 3.0 beta changelog, anyone know the details on this one "Improved AI attack behaviour on fleets of capital ships."? If lucky they've added LOS check before fire in the exe turret code (crosses fingers) - could simplify my code here a bit if that's the case.
Found no obvious changes in the AI script itself.
Some very good ideas there - I'll add scaling of dronelaunches based on both ship size/type and DO skill. Suls and arawn should have some extra bonuses methinks.
I'll also add a separate target list for IHC/torpedoes so they only fire at L+ ships, stations and skunk (should add M ships as well?)
Will probably have a new version up sometime this weekend
@YorrickVander
Think I'll do the same. Have sent a pm to clj btw. asking for permission to use the code in a "sucellus/balor fix" type mod to make this easy to do for non coders as well (thinking a simple copy/pasta job and diff patching it in there).
Haven't seen him here for a while so suspect I'll not get an answer, but worth a try

Btw. been looking in 3.0 beta changelog, anyone know the details on this one "Improved AI attack behaviour on fleets of capital ships."? If lucky they've added LOS check before fire in the exe turret code (crosses fingers) - could simplify my code here a bit if that's the case.
Found no obvious changes in the AI script itself.
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
-
- Posts: 381
- Joined: Sun, 15. Oct 06, 17:37
This might be beyond the scope of what you intend to do with this mod, but I noticed that even when defense officer is set to "defend," the main cannon on Sucelli (is that the proper plural?
) are used against targets' hulls.
Also, on the topic of "boarding assistance," would it be possible to enable that behavior even when DOs are set to "attack enemies," but only if I'm actually in the middle of a boarding attempt? Changing the DO setting in the middle of a battle is a hassle.

Also, on the topic of "boarding assistance," would it be possible to enable that behavior even when DOs are set to "attack enemies," but only if I'm actually in the middle of a boarding attempt? Changing the DO setting in the middle of a battle is a hassle.
-
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03
-
- Posts: 381
- Joined: Sun, 15. Oct 06, 17:37
Yeah I don't mean I want them to target surface elements, I mean I would like them to just not fire at all when DO is in defend mode.swatti wrote:Id prefer if ALL big guns, sucellus IHC and HIVI/MA guns just hit the hull, these guns have waaaay too slow projectiles to hit small spots like individual guns.
-
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
Have to admit using the DO offensive/defensive state was primarily just an easy way to have a toggle for the behavior without the need to add extra UI stuff buried somewhere in all those nested menus
A hotkey for the toggle when ship is selected as target and a screen prompt for confirmation would maybe be the best, or adding an option to the green circle menu thing for easy access - don't know how to do that yet or if it's even possible, but should be a small rewrite to the AI code when/if I discover how. There are still lot's of room for some feature creep here
Big guns offline when in defensive is easy to implement - I'll add that. They should not intentionally target the hull now either, but they are not very accurate and have dat splash damage.
The tricky part is making them ignore fighters etc.
Have to "cheat" a bit since I cant send separate target lists to the primary and secondary (all the turrets) weapon slots it seems - but I can control when each of them are firing. Swapping valid target lists just before firing secondary is the current plan - have to do some testing to see if this makes any difference at all.
Currently done:
Have implemented a change in the dronelaunch size ruleset. Depending on DO skill XL and light/heavy sul will launch 2-10 drones, other L ships are limited to 1-5. As a reference vanilla is 5 pr. swarm. Delays have not been changed from the current version (i.e. still depends on DO skill).
Will also remove the savegame dependency flag in the next one - seems safe to remove, and if no caps are in the same zone as the skunk it will not leave any "junk" variables in the save either.

A hotkey for the toggle when ship is selected as target and a screen prompt for confirmation would maybe be the best, or adding an option to the green circle menu thing for easy access - don't know how to do that yet or if it's even possible, but should be a small rewrite to the AI code when/if I discover how. There are still lot's of room for some feature creep here

Big guns offline when in defensive is easy to implement - I'll add that. They should not intentionally target the hull now either, but they are not very accurate and have dat splash damage.
The tricky part is making them ignore fighters etc.
Have to "cheat" a bit since I cant send separate target lists to the primary and secondary (all the turrets) weapon slots it seems - but I can control when each of them are firing. Swapping valid target lists just before firing secondary is the current plan - have to do some testing to see if this makes any difference at all.
Currently done:
Have implemented a change in the dronelaunch size ruleset. Depending on DO skill XL and light/heavy sul will launch 2-10 drones, other L ships are limited to 1-5. As a reference vanilla is 5 pr. swarm. Delays have not been changed from the current version (i.e. still depends on DO skill).
Will also remove the savegame dependency flag in the next one - seems safe to remove, and if no caps are in the same zone as the skunk it will not leave any "junk" variables in the save either.
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
New version is up - calling this one beta just because 
Changes from alpha4:
- Separate target list for primary weapons (IHC/torpedoes for Sucellus/Balor primarily). Will now only shoot at hull (station and cap) + the skunk. Fighters/surface elements are ignored. Defensive DO's will not use the "Big guns".
Made this a generic implementation so all ships with weapons in tag.primary_slot will benefit from this.
Luckily the engine allowed me to do this without resorting to "hacks"/workaronds as i first suspected
- Changed some station attack/suppression code. Should be a bit more accurate now + updated for "Big guns".
- As mentioned in previous post - changes have been made to drone wing size (logic now based on cap size and type). And the mod will not leave an entry in the save anymore (OP updated with recommended method to add/remove the mod).
Aaaand - i might have inadvertently made the K a bit nasty it seems... They are now very accurate and eager to fire that pink stuff.
3 of them with wingmen really put a dent in my little fleet + quickly blew up 3 traders who wanted to join the party. And killed me once when trying to give some orders and was stuck in the menus
Can nerf them a bit if necessary (don't know if the I has that weapon... been a while since i last met one).
Link updated in OP, I've only tested this version in v3.0 but should still work on 2.5.

Changes from alpha4:
- Separate target list for primary weapons (IHC/torpedoes for Sucellus/Balor primarily). Will now only shoot at hull (station and cap) + the skunk. Fighters/surface elements are ignored. Defensive DO's will not use the "Big guns".
Made this a generic implementation so all ships with weapons in tag.primary_slot will benefit from this.
Luckily the engine allowed me to do this without resorting to "hacks"/workaronds as i first suspected

- Changed some station attack/suppression code. Should be a bit more accurate now + updated for "Big guns".
- As mentioned in previous post - changes have been made to drone wing size (logic now based on cap size and type). And the mod will not leave an entry in the save anymore (OP updated with recommended method to add/remove the mod).
Aaaand - i might have inadvertently made the K a bit nasty it seems... They are now very accurate and eager to fire that pink stuff.
3 of them with wingmen really put a dent in my little fleet + quickly blew up 3 traders who wanted to join the party. And killed me once when trying to give some orders and was stuck in the menus

Link updated in OP, I've only tested this version in v3.0 but should still work on 2.5.
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
-
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03
Does this mod change how CAPTAINS choose targets? Ive noticed my ships tend to chase off the first enemy they can see blindly ignoring anyone else... X3 had the same.
Run a re-target every 30sec or so, mostly to make sure capital-ships hunt cap-ships and fighters go after other fighters.
Also the Balor frigate could use some self-preservation and only target capital ships if there are other friendly capitals around, otherwise, priority: fighters and small game. Balors die in 20sec against most big guys.
Run a re-target every 30sec or so, mostly to make sure capital-ships hunt cap-ships and fighters go after other fighters.
Also the Balor frigate could use some self-preservation and only target capital ships if there are other friendly capitals around, otherwise, priority: fighters and small game. Balors die in 20sec against most big guys.
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
Think you already know the answer to that one 
But I agree, that would be an interesting little project. Know Mad Joker did a lot of clever stuff in his UFO mod with the captains.
Could have formations and tactics based on skills perhaps, morale checks before flee, different behavior based on opposition, a bit of random behavior for less predictability etc. etc. - lots of possibilities, lots of complexity. Have to think a bit about this

But I agree, that would be an interesting little project. Know Mad Joker did a lot of clever stuff in his UFO mod with the captains.
Could have formations and tactics based on skills perhaps, morale checks before flee, different behavior based on opposition, a bit of random behavior for less predictability etc. etc. - lots of possibilities, lots of complexity. Have to think a bit about this

-
- Posts: 1278
- Joined: Sun, 7. Dec 03, 12:03
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
Yup, the Sucellus only have a 10deg firing arc on its IHC, and the vanilla captain is quite rubbish and prefer to point that thing away from the enemies so it rarely fires.
Have made a patch for personal use based on clj's CDOAIO movement code which makes them a lot better, but have not received response from him on a pm where I asked for permission to release this as a standalone mod.
Could perhaps do a quick writeup on how to DIY such a patch. Lots of complex movement code in there, but would be just a copy/paste job if i provide the patch framework really. Any interest in this?
Have made a patch for personal use based on clj's CDOAIO movement code which makes them a lot better, but have not received response from him on a pm where I asked for permission to release this as a standalone mod.
Could perhaps do a quick writeup on how to DIY such a patch. Lots of complex movement code in there, but would be just a copy/paste job if i provide the patch framework really. Any interest in this?
-
- Posts: 108
- Joined: Sat, 13. Aug 11, 14:30
Hi, just a shameless plug for my new WIP mod:
http://forum.egosoft.com/viewtopic.php? ... 15#4457015
Decided to rewrite that captain AI code from scratch - take it for a spin and give me some feedback in that thread
http://forum.egosoft.com/viewtopic.php? ... 15#4457015
Decided to rewrite that captain AI code from scratch - take it for a spin and give me some feedback in that thread
