[MOD] UFO - Ultimate Fleet Overhaul (V0.6.1 Beta, 3rd February 2015)

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
darthmoll
Posts: 196
Joined: Fri, 11. Sep 09, 16:24
x4

Post by darthmoll »

i know there is a shipyard in Ascendancy > shady vault and also in de vries > Glaring truth > Darned hot air.
PREDATOR490
Posts: 34
Joined: Thu, 29. May 08, 20:41
x3ap

Post by PREDATOR490 »

The shipyard for Albion is in Ascendency > Shady Vault.
User avatar
FinWiz
Posts: 115
Joined: Sat, 30. Nov 13, 02:38

Post by FinWiz »

I don't think Im gonna try this any time soon because I like a possiblity to add and remove my mods whenever I want but just wanted to ask something. I understood that this mod uses it's own menu option like MCE (2-4-1, you said). So what happens if I use the stock "fleet" option? (comms->assign new superior)
How can you say there is no game under the bugs when bugs so far have prevented us from fully playing it.

"One should strive to achieve, not sit in bitter regret."
-VNV Nation
spartanheyho
Posts: 162
Joined: Sun, 24. Nov 13, 16:06

Post by spartanheyho »

Logically, same thing as UFO. Functionally, doesn't work worth squat vanilla script wise as far as I have been able to tell.

On a side note, I want to chime into the whole ships not working deal. I made a brand new save and tested UFO functionality at the shipyard in Albion. I had UFO, MCE and CSE running along with the UFO ship spawner/resetter.

Real easy: I had two balor's built. Both were given full crew compliments (captain, Defense officer, engi) with all 5 star stats on everything. Upon completion, both were automatically in my squad. I removed both.

I used UFO ship spawner/resetter to reset one balor completely. I then made myself commander of both and gave each the individual order to take an aggressive stance.

I took up a pirate raid mission that was Hard difficulty. Enemy fighters and one enemy Balor spawned. I made my way to the enemy Balor and my two Balor's followed. The Balor I had reset completely via UFO test tool attacked while the other did not.

TL;DR: Resetting ship completely even if it was built helps UFO commands work. Seems to be an issue with standard player.default script ship commanders run and/or fight.defend.capital script defense officers run with UFO or UFO isn't resetting/taking over properly (hence a completley cleared Balor being able to attack because no other scripts were running beforehand).
Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker »

Ladies and Gents,

I have just released UFO V0.3.2, which contains a fix that will hopefully finally make your capital ships engage enemies correctly. The only downside to the fix is that it is probably less performant than the version before.

Hafe vun!
User avatar
darthmoll
Posts: 196
Joined: Fri, 11. Sep 09, 16:24
x4

Post by darthmoll »

Mad_Joker wrote:Ladies and Gents,

I have just released UFO V0.3.2, which contains a fix that will hopefully finally make your capital ships engage enemies correctly. The only downside to the fix is that it is probably less performant than the version before.

Hafe vun!

LIFESAVER. my hero. :)

works perfect now. not sure what you mean about less performant. but its working . 10 enemy ships within 10 miles range and my ships are off. drones are being dispatched to eliminate the targets.

can you explain less performant?
Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker »

darthmoll wrote: LIFESAVER. my hero. :)

works perfect now. not sure what you mean about less performant. but its working . 10 enemy ships within 10 miles range and my ships are off. drones are being dispatched to eliminate the targets.

can you explain less performant?
Well, the function find_gravidar_contact only checks the vicinity of the ship for other ships, and I think the game is optimized for this check.

With the new version, I am forced to check the whole sector for all ships and then filter them by relation and distance. I assume this check is more computationally expensive than the gravidar check, but it shouldn't really bog your machine down too much.
User avatar
darthmoll
Posts: 196
Joined: Fri, 11. Sep 09, 16:24
x4

Post by darthmoll »

Mad_Joker wrote:
darthmoll wrote: LIFESAVER. my hero. :)

works perfect now. not sure what you mean about less performant. but its working . 10 enemy ships within 10 miles range and my ships are off. drones are being dispatched to eliminate the targets.

can you explain less performant?
Well, the function find_gravidar_contact only checks the vicinity of the ship for other ships, and I think the game is optimized for this check.

With the new version, I am forced to check the whole sector for all ships and then filter them by relation and distance. I assume this check is more computationally expensive than the gravidar check, but it shouldn't really bog your machine down too much.

i noticed when the ships respond to the enemy that it it takes a tiny moment of the pc performance. but it lasts only about 1 or 2 seconds.

yet again. very nice work. now i hope it will work for others to.

so guys. download the new version. it works for me. let us know if it works for you to. :)
spartanheyho
Posts: 162
Joined: Sun, 24. Nov 13, 16:06

Post by spartanheyho »

Good work! I do notice somewhat of a slight performance hit but not too much. Its bounds better than useless combat vessels. Given time, I am sure you will find an elegant solution.\

EDIT: Also, take note that the previous versions method of getting ships to attack worked ... so long as the UFO spawning/resetting tool was used to reset selected ship. This worked for me on ships fresh out of the shipyard. I had MCE and CSE installed on top of UFO. A few things to note with that, as mentioned by previous posts and combined with my observations, are:

1. Ships reset with UFO testing tool would create ships owned by NPC factions with crew members owned by the player.

2. Ships could not be added to squad or given basic vanilla commands if reset implying vanilla scripts (including the ship captains player.default script) were nuked and never reinstated. This is proven by captains status on ship info panel in-game being "None" after reset combined with permanent inability to invite reset ship to squad from that point forward.

3. The defense officers scripts were reinstated as their status would always be "Defend" on the ship info screen after reset.
Last edited by spartanheyho on Sat, 30. Nov 13, 18:06, edited 1 time in total.
Neoxan
Posts: 12
Joined: Fri, 29. Nov 13, 20:34

Post by Neoxan »

Im definately in love with you Joker, keep up the good work.
Kierk
Posts: 115
Joined: Wed, 30. Oct 13, 16:38

Post by Kierk »

Issue with player built ships found and resolved! It appears that when player ships are built, the gravidar is not activated for them so they can't properly scan for targets. This can be fixed by editing the save file. Like any save file edits make sure you back up the save before making any changes.

Open the file in Visual Studio Express (preferred) or in a word processor (tested with Open Office Writer) and search for the term [owner="player"] without the []. It will go through and show all the NPCs and ships that you own, you're looking for a like that begins with something like [component=ship_l] or [component=ship_xl], these are where the data for your capital ships begins. Scroll down slowly until you see an <ammunition> tag. It should go on to list the drones you have on board and then close out with a </ammunition> tag. Directly after the </ammunition> tag there should be a <gravidar/> tag. If you do not see this on the line directly after </ammunition> you need to add it and save the file.

Example my player built Taranis showed like this:

Code: Select all

<ammunition>
<available>
<item macro="units_size_drone_attackdrone_impulse_mk1_macro" amount="71"/>
<item macro="units_size_xs_welder_drone_macro" amount="10"/>
</available>
</ammunition>
<lastglobalanimation trigger="battlestate_yellow" time="1176.44"/>
and it would not engage targets. When i edited it to read

Code: Select all

<ammunition>
<available>
<item macro="units_size_drone_attackdrone_impulse_mk1_macro" amount="71"/>
<item macro="units_size_xs_welder_drone_macro" amount="10"/>
</available>
</ammunition>
<gravidar/>
<lastglobalanimation trigger="battlestate_yellow" time="1176.44"/>
it began to work properly.

This also explains why my earlier tests worked fine, I was using the storyline Taranis which you board. It already had the <gravidar/> tag in its data. In fact this is how I found the issue, I compared the save code for the player built and the captured taranis to see the difference. Good luck folks!

Edit: While testing and posting it looks like Mad Joker put up a version that doesn't rely on the gravidar check, so that is an alternative to save editing. Also I'm reporting this as a bug to ES.
Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker »

Glad to hear that the new version finally works for you guys :)
Kierk wrote:...

Edit: While testing and posting it looks like Mad Joker put up a version that doesn't rely on the gravidar check, so that is an alternative to save editing. Also I'm reporting this as a bug to ES.
Yeah, that is definitely a serious bug that will screw over all people playing this game and needs to be fixed ASAP.

Thanks for finding this, as I actually did the save-file comparison myself, but missed the <gravidar /> tag.
PREDATOR490
Posts: 34
Joined: Thu, 29. May 08, 20:41
x3ap

Post by PREDATOR490 »

Works for me as well now, the Balor that I built reacts without a reset.

Now, will this mod work with stations so players can have stations that defend themselves ?
Alternatively, can the player assign ships to a station that will defend it ?

I'm curious - is the lack of the gravidar the reason why non-mod default ships are unable to fight ?

Only issue with this mod is that large fleets are going to be extremely hard to manage due to having to scroll through every ship in your fleet and no distinction except the captain.
I spawned 14 capitals all XL and I couldnt tell which one was which unless I looked up the name of the captain, nevermind how annoying it was to go through the list 3 ships at a time, twice.

I can only imagine how insane this is going to get for setting up fleets to defend stations or multiple groups.
spartanheyho
Posts: 162
Joined: Sun, 24. Nov 13, 16:06

Post by spartanheyho »

How could one go about setting the gravidar tag in the NPC_Shiptrader.xml file? Perhaps too off topic for this thread? Just trying to scrounge up some ideas.

EDIT:
Only issue with this mod is that large fleets are going to be extremely hard to manage due to having to scroll through every ship in your fleet and no distinction except the captain.
I spawned 14 capitals all XL and I couldnt tell which one was which unless I looked up the name of the captain, nevermind how annoying it was to go through the list 3 ships at a time, twice.

I can only imagine how insane this is going to get for setting up fleets to defend stations or multiple groups.
Joker is on it and working on functionality for ease-of-use. In time, this will be absolutely amazing.
Kierk
Posts: 115
Joined: Wed, 30. Oct 13, 16:38

Post by Kierk »

Honestly I'm not really sure. I can see where it would go in the shiptrader script but I don't know exactly how to use that to interact with the save data for the gravidar command. The scriptproperties file or common file is usually where I'd find this info but nothing about gravidar enabling or disabling on an object there. The best bet at present is if one of the folks managing the save editors could add a special function to check if the gravidar tag is present and if not add it, not just for player ships but for all ships.
spartanheyho
Posts: 162
Joined: Sun, 24. Nov 13, 16:06

Post by spartanheyho »

Roger. I saw you guys posted it over in the patch beta forums and folks know about it in this thread now too. As usual, since this is basically open source, someone somewhere is going to find a way to geter' done. Good find by the way. Who woulda thunk it!!??
Kierk
Posts: 115
Joined: Wed, 30. Oct 13, 16:38

Post by Kierk »

I just never get tried of watching my taranis take out wave after wave of xenon fighters, once again just a really great job on this mod Joker.
User avatar
Fumblesneeze
Posts: 75
Joined: Tue, 26. Nov 13, 10:07
x3tc

Post by Fumblesneeze »

One workaround would be to skip the ship-building step and simply spawn the ship.

If you spawn a ship like this, it will have a gravidar tag:

Code: Select all

          <create_ship name="$ship" zone="$zone">
            <select size="class.ship_l" tags="$Types.{$i}"/>
            <owner exact="faction.player" overridenpc="true"/>
            <pilot>
              <select faction="faction.heartofalbion" tags="[tag.commander]"/>
            </pilot>
            <defence>
              <select faction="faction.heartofalbion" tags="[tag.defencecontrol]"/>
            </defence>
            <engineer>
              <select faction="faction.heartofalbion" tags="[tag.engineer]"/>
            </engineer>
            <units>
              <unit category="unitcategory.transport" mk="1" exact="50" />
            </units>
            <cargo>
              <wares list="[ware.fuelcells]">
                <fillpercent min="70" max="80"/>
              </wares>
            </cargo>
            <safepos value="$FreighterPos" />
            <rotation yaw="90deg" />
          </create_ship>

or if you don't want to replace the building process, you could check for when it has finished building, then quickly remove it and spawn a new one. Of course this is only needed until ego patch the construct_ship command to properly add the gravidar.
Streaming while writing mods: twitch.tv/fumblesneeze
PREDATOR490
Posts: 34
Joined: Thu, 29. May 08, 20:41
x3ap

Post by PREDATOR490 »

Since I was curious -

I built a taranis fresh off the line - spawned enemies = No reaction
I added the Gravidar tag then used MCE escort command = Taranis guns went red and then stayed red when I got hit

I added a fresh built Balor to the Taranis squad using the default game method - The Balor guns went active as well when I got hit

Reloaded - added a gravidar to both ships and never used MCE at all.
- Ships react to attacks on me and themselves, including launching drones

It appears the Gravidar is the reason player ships cannot react at all and with it added, the default game wont need UFO to manage the squad.
My ships even started to pursue on their own without orders.

The issue that is going to be coming up is how poorly the ships are at fighting. Friendly fire is insane because the shots are extremely slow and the AI will close to point blank range just to get hits.

The Balors are really poor - I have yet to see one of them use their missile payload because they dont like to engage a target head on and when they do... they still dont fire anything.
Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker »

PREDATOR490 wrote:It appears the Gravidar is the reason player ships cannot react at all and with it added, the default game wont need UFO to manage the squad.
My ships even started to pursue on their own without orders.
Yes, once the gravidar bug is fixed, ships will be able to actually fight without UFO, but this mod gives you so much more:

- Different stances for ships (i.e. more fine-grained control)
- Control over at what distance ships will engage (will come with V0.4.0)
- Ability to give orders to many ships at once via Broadcast Stance
- Ships actually stop engaging enemies when their commander leaves the battle instead of fighting to the bitter end
- No turret light cycling bugs
- Enemy engagement reports (will come with V0.4.0)
- Utilizing skills of NPCs (e.g. 5 star captains can do in-sector jumps), though this is not really useful yet since NPCs don't gain experience (planned for the future)

The only thing that I cannot change is the stupid turret AI you mentioned. Currently, I simply use <set_turret_targets> to initiate combat, which means all the actual aiming and target choosing happens somewhere in the game logic (except that I can specify preferred targets for all turrets at once).

There are commands <aim_turret> and <fire_turret>, but as far as I could see these need to be run in a tight loop since aim will aim the turret once, and firing will just make it fire in whatever direction it was aimed. But even that would still be possible, if necessary (though a nightmare to code), but the biggest problem is that I cannot find in a script what targets a turret is good against (except hardcoding an association-list for all turret macros). That information is hidden in the bullet macros, which I cannot access. There are some stupid script-properties about this, which don't help at all. I can for example ask what the combined dps against capital ships of the turrets in some quadrant of my ship is, but it won't tell me which turrets this takes into account, just the total dps. This might still help for target prioritization (like saying, hey, I have 10k dps against big ships, and 1k against small ships, so I will just ignore all small ships), but no fine control over turrets. So this is pretty much worthless.

All that said, it is up to Egosoft to either improve the aiming logic themselves, or to give us the proper tools to fix issues like these.

Return to “X Rebirth - Scripts and Modding”