Faction Wars Hotfix

The place to discuss scripting and game modifications for X4: Foundations.

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

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

Mysterial wrote: Sun, 13. Jan 19, 17:39 The hull calculations for stations fluctuate because modules go from "wreck" to "nonexistant" or "wreck" to "repairing" in various cases. Oddly, the map health bar doesn't take that into account at all, and I'm pretty sure the OOS problems attacking stations happen when the map health bar reaches zero even though the station is still alive. I think the OOS attack function stops working when that happens.

None of these problems are really a result of this "hotfix" (I saw the same with a vanilla 1.50 attack from HOP) but it makes them more obvious because the faction logic likes to start building defense stations right in the enemy's face.
On the map, it did seem like the station had no health, the bar was grey, but viewing the station from within my ship by selecting it, it had a lot of health left. I understand already that this is a vanilla problem and the problem might very well be with the defense station itself as I have seen plenty of factory stations be destroyed easily enough. So there may be a couple of issues with that. And obviously I know it has nothing to do with this particular mod, as I already said, the only thing this mod does is add the macros. If you read my previous posts, I specifically stated this and also that there are a lot of issues with the whole war aspect of the game which is why this won't actually work in the end. Egosoft needs to fix this part of the game, it is clear it isn't complete and even adding the macros won't really progress the war much
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

I(kzorn101 wrote: Sun, 13. Jan 19, 17:39
BlackRain wrote: Sun, 13. Jan 19, 17:04
I(kzorn101 wrote: Sun, 13. Jan 19, 16:19

Can't confim that behavior. Maybe there went something else wrong. Stations are destructible even in the build phase. But the ai isn't able to attack effectifly the station modules. The checks where the ai script pointing from a destructed module to a none destructed seem to be not working correctly.
They try to fix this in the current beta 1.51 patch.
They were able to get the station down to 42% health eventually. The reason I initially said that was because I was watching as the central part of the station became a wreck and then miraculously became completely whole again (and the hp jumped up from 70% to 85%). I guess there could be other reasons for this but I didn't see any CV connected to the station and it was not a gradual repair. It was a jump from 70 to 85 in an instant and the central part was a wreck and then not a wreck. Weird behavior but later it did eventually go down to 42% but they must have been attacking that station for several hours.
May an interrupt process failed when the CVs was maybe destructed. I could see this strange behavior once. The CVs was destroyed during the construction of the station but the process who should close the connection failed. It caused the same behaivor you describe. As far as i could figuerd out it may has somthing to do with the construction dornes. The interrupt signal failed to reach all drones, which causes a functional exception and ended in a never ending construction loop.
You should report that as a bug, as it is clearly a bug. They may not be aware of this and should be good to point it out.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

In my opinion, there are a few issues with the wars.

1) The strange behavior of attacking stations and destroying them, they need to fix this.
2) The buildstorage is a huge issue. One, it doesn't disappear even when the station is destroyed. Two, it causes issues if it is destroyed (like when making it destructible) which could lead to crashes and other issues so it is obvious why they made it indestructible. Three, issues of CV's of any faction building stations despite even being enemies, issues of faction ownership of sectors and the buildstorages and station building in general.
3) Economic issues related to the destruction of stations and construction of stations, also the economic impact of having to replace ships consistently and efficiently. Disturbances in the economic chain overall.
4) OOS combat still needs a lot of tweaking and improving overall including against ships and stations.
5) Combat scripts in general need a lot of improvements, especially escorts and replacing subordinates/subordinates joining up with lead ships.

These are the major issues I can think of at this time but there are certainly more.
shealladh
Posts: 322
Joined: Thu, 11. Jun 09, 13:29
x4

Re: Faction Wars Hotfix

Post by shealladh »

BlackRain wrote: Sun, 13. Jan 19, 17:55 In my opinion, there are a few issues with the wars.

1) The strange behavior of attacking stations and destroying them, they need to fix this.
2) The buildstorage is a huge issue. One, it doesn't disappear even when the station is destroyed. Two, it causes issues if it is destroyed (like when making it destructible) which could lead to crashes and other issues so it is obvious why they made it indestructible. Three, issues of CV's of any faction building stations despite even being enemies, issues of faction ownership of sectors and the buildstorages and station building in general.
3) Economic issues related to the destruction of stations and construction of stations, also the economic impact of having to replace ships consistently and efficiently. Disturbances in the economic chain overall.
4) OOS combat still needs a lot of tweaking and improving overall including against ships and stations.
5) Combat scripts in general need a lot of improvements, especially escorts and replacing subordinates/subordinates joining up with lead ships.

These are the major issues I can think of at this time but there are certainly more.
6) Ship Orders needs a look as well. I have reported an issue where is stalls, lags and creates other issues (due to "Critical" Orders either not working or taking a long time to cancel out), which I fear is part of the above and why I'm mentioning it here. At least inter-hooked under the new scheme of things.
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: Faction Wars Hotfix

Post by celludriel »

My attempt for 5)

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="//attention/actions">
		<actions>
			<label name="start"/>
			<set_value name="$debugchance" exact="100"/>
			<do_if value="not this.ship.isjobship">
				<debug_text text="'Ship is not a job ship. Restocking subordinates not yet supported.'" chance="$debugchance"/>
				<return/>
			</do_if>

			<debug_text text="'restock subordinates. init: ' + $init" chance="$debugchance"/>

			<get_subordinate_macro name="$macros" commander="this.ship" init="$init" multiple="true"/>
			<debug_text text="'no suitable subordinate job ships found. we need the following macros:'" chance="$debugchance"/>
			<do_all exact="$macros.count" counter="$i" chance="$debugchance">
				<debug_text text="' ' + $macros.{$i}"/>
			</do_all>

			<do_if value="not $macros.count">
				<resume label="finish"/>
			</do_if>

			<set_value name="$clusterranges" exact="table[]"/>
			<find_cluster_in_range name="$clusters" maxdistance="$jumps" multiple="true" object="this.ship"/>
			<do_all exact="$clusters.count" counter="$i">
				<set_value name="$distance" exact="this.cluster.gatedistance.{$clusters.{$i}}"/>
				<do_if value="not $clusterranges.{$distance}?">
					<set_value name="$clusterranges.{$distance}" exact="[$clusters.{$i}]"/>
				</do_if>
				<do_else>
					<append_to_list name="$clusterranges.{$distance}" exact="$clusters.{$i}"/>
				</do_else>
			</do_all>
			<remove_value name="$clusters"/>

			<debug_text text="'looking for shipyards'" chance="$debugchance"/>
			<do_all exact="$jumps + 1" counter="$i">
				<do_if value="$clusterranges.{$i - 1}?">
					<set_value name="$shipyards" exact="[]"/>
					<do_all exact="$clusterranges.{$i - 1}.count" counter="$k">
						<find_station name="$shipyards" space="$clusterranges.{$i - 1}.{$k}" canbuildships="true" append="true">
							<match_content class="class.buildmodule"/>
							<match_relation_to object="this.ship" relation="friend" comparison="ge"/>
						</find_station>
					</do_all>
					<debug_text text="'found %s shipyards'.[$shipyards.count]" chance="$debugchance"/>
					<shuffle_list list="$shipyards"/>

					<do_all exact="$shipyards.count" counter="$k">
						<do_all exact="$macros.count" counter="$o">
							<set_value name="$buildmodules" exact="$shipyards.{$k}.buildmodules"/>
							<do_all exact="$buildmodules.count" counter="$m">
								<do_if value="not $buildmodules.{$m}.isbusy and $buildmodules.{$m}.canbuildmacro.{$macros.{$o}}">
									<set_value name="$shipyard" exact="$shipyards.{$k}"/>
									<debug_text text="'found shipyard %s %s %s with free build module'.[$shipyard.idcode, $shipyard.knownname, $shipyard]" chance="$debugchance"/>
									<!--TODO @Owen @Klaus Workaround to clear counter variables-->
									<remove_value name="$k"/>
									<remove_value name="$m"/>
									<remove_value name="$o"/>
									<resume label="flyto"/>
								</do_if>
								<do_else>
									<debug_text text="'shipyard %s %s %s has %s build modules. build module %s ruled out. buildmodule is busy: %s, can build macro: %s'.[$shipyards.{$k}.idcode, $shipyards.{$k}.knownname, $shipyards.{$k}, $buildmodules.count, $m, $buildmodules.{$m}.isbusy, $buildmodules.{$m}.canbuildmacro.{$macros.{$o}}]" chance="$debugchance"/>
								</do_else>
							</do_all>
						</do_all>
					</do_all>
				</do_if>
			</do_all>

			<label name="flyto"/>

			<do_if value="not $shipyard?">
				<resume label="finish"/>
			</do_if>

			<remove_value name="$clusterranges"/>
			<!-- disabling move to see if it works without moving
			<debug_text text="'Moving to shipyard ' + $shipyard.knownname + ' in ' + $shipyard.zone.knownname" chance="$debugchance"/>

			<run_script name="'move.generic'">
				<param name="destination" value="$shipyard"/>
			</run_script> -->

			<do_if value="not $shipyard.exists">
				<resume label="finish"/>
			</do_if>

			<add_builds_to_replace_subordinates name="$builds" commander="this.ship" buildobject="$shipyard" init="$init"/>
			<wait exact="1s" />
			<debug_text text="'requesting %s builds from shipyard %s %s %s.'.[$builds.count, $shipyard.idcode, $shipyard.knownname, $shipyard]" chance="$debugchance"/>

			<label name="wait"/>

			<set_value name="$BuildingObjects" exact="[]" />
			<do_all exact="$builds.count" counter="$i" reverse="true">
				<do_if value="$builds.{$i}.exists and $builds.{$i}.isshipbuild">
					<debug_text text="'adding buildobject %s.'.[$builds.{$i}.buildobject.idcode]" chance="$debugchance"/>
					<append_to_list name="$BuildingObjects" exact="$builds.{$i}.buildobject" />
				</do_if>
			</do_all>

			<debug_text text="'waiting for ' + $BuildingObjects.count + ' subordinates'" chance="$debugchance" />
			
			<do_all exact="$BuildingObjects.count" counter="$i" reverse="true">
				<do_if value="$BuildingObjects.{$i}.isoperational">
					<set_value name="$Ship" exact="$BuildingObjects.{$i}" />
					<debug_text text="'build event ' + event.name + ' for object ' + $Ship.knownname" chance="$debugchance" />
					<set_object_commander object="$Ship" commander="this.ship"/>
					<debug_text text="this.ship.idcode + ' is taking command of ship ' + $Ship.idcode" chance="$debugchance"/>
					<organise_job_ship_subordinates commander="this.ship"/>
					<set_ship_expiration_time ship="$Ship" time="-1s"/>
					<activate_job_ship_orders ship="$Ship"/>
					<remove_value name="$BuildingObjects.{$i}"/>					
				</do_if>
			</do_all>
			
			<do_if value="$BuildingObjects.count gt 0">
				<debug_text text="'%s at the shipyard. waiting for %s builds to finish.'.[this.ship.idcode, $BuildingObjects.count]" chance="$debugchance"/>
				<wait exact="2s" />				
				<resume label="wait"/>
			</do_if>

			<debug_text text="'all subordinates built'" chance="$debugchance" />
			<label name="finish"/>
		</actions>
	</replace>
</diff>
- Doesn't look for orphan ships that seems to be failing in the original so all ships will be build in the shipyard/wharf
- Job ships shouldn't be flying towards the shipyard but subs should just join the job ship
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

celludriel wrote: Sun, 13. Jan 19, 18:36 My attempt for 5)

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="//attention/actions">
		<actions>
			<label name="start"/>
			<set_value name="$debugchance" exact="100"/>
			<do_if value="not this.ship.isjobship">
				<debug_text text="'Ship is not a job ship. Restocking subordinates not yet supported.'" chance="$debugchance"/>
				<return/>
			</do_if>

			<debug_text text="'restock subordinates. init: ' + $init" chance="$debugchance"/>

			<get_subordinate_macro name="$macros" commander="this.ship" init="$init" multiple="true"/>
			<debug_text text="'no suitable subordinate job ships found. we need the following macros:'" chance="$debugchance"/>
			<do_all exact="$macros.count" counter="$i" chance="$debugchance">
				<debug_text text="' ' + $macros.{$i}"/>
			</do_all>

			<do_if value="not $macros.count">
				<resume label="finish"/>
			</do_if>

			<set_value name="$clusterranges" exact="table[]"/>
			<find_cluster_in_range name="$clusters" maxdistance="$jumps" multiple="true" object="this.ship"/>
			<do_all exact="$clusters.count" counter="$i">
				<set_value name="$distance" exact="this.cluster.gatedistance.{$clusters.{$i}}"/>
				<do_if value="not $clusterranges.{$distance}?">
					<set_value name="$clusterranges.{$distance}" exact="[$clusters.{$i}]"/>
				</do_if>
				<do_else>
					<append_to_list name="$clusterranges.{$distance}" exact="$clusters.{$i}"/>
				</do_else>
			</do_all>
			<remove_value name="$clusters"/>

			<debug_text text="'looking for shipyards'" chance="$debugchance"/>
			<do_all exact="$jumps + 1" counter="$i">
				<do_if value="$clusterranges.{$i - 1}?">
					<set_value name="$shipyards" exact="[]"/>
					<do_all exact="$clusterranges.{$i - 1}.count" counter="$k">
						<find_station name="$shipyards" space="$clusterranges.{$i - 1}.{$k}" canbuildships="true" append="true">
							<match_content class="class.buildmodule"/>
							<match_relation_to object="this.ship" relation="friend" comparison="ge"/>
						</find_station>
					</do_all>
					<debug_text text="'found %s shipyards'.[$shipyards.count]" chance="$debugchance"/>
					<shuffle_list list="$shipyards"/>

					<do_all exact="$shipyards.count" counter="$k">
						<do_all exact="$macros.count" counter="$o">
							<set_value name="$buildmodules" exact="$shipyards.{$k}.buildmodules"/>
							<do_all exact="$buildmodules.count" counter="$m">
								<do_if value="not $buildmodules.{$m}.isbusy and $buildmodules.{$m}.canbuildmacro.{$macros.{$o}}">
									<set_value name="$shipyard" exact="$shipyards.{$k}"/>
									<debug_text text="'found shipyard %s %s %s with free build module'.[$shipyard.idcode, $shipyard.knownname, $shipyard]" chance="$debugchance"/>
									<!--TODO @Owen @Klaus Workaround to clear counter variables-->
									<remove_value name="$k"/>
									<remove_value name="$m"/>
									<remove_value name="$o"/>
									<resume label="flyto"/>
								</do_if>
								<do_else>
									<debug_text text="'shipyard %s %s %s has %s build modules. build module %s ruled out. buildmodule is busy: %s, can build macro: %s'.[$shipyards.{$k}.idcode, $shipyards.{$k}.knownname, $shipyards.{$k}, $buildmodules.count, $m, $buildmodules.{$m}.isbusy, $buildmodules.{$m}.canbuildmacro.{$macros.{$o}}]" chance="$debugchance"/>
								</do_else>
							</do_all>
						</do_all>
					</do_all>
				</do_if>
			</do_all>

			<label name="flyto"/>

			<do_if value="not $shipyard?">
				<resume label="finish"/>
			</do_if>

			<remove_value name="$clusterranges"/>
			<!-- disabling move to see if it works without moving
			<debug_text text="'Moving to shipyard ' + $shipyard.knownname + ' in ' + $shipyard.zone.knownname" chance="$debugchance"/>

			<run_script name="'move.generic'">
				<param name="destination" value="$shipyard"/>
			</run_script> -->

			<do_if value="not $shipyard.exists">
				<resume label="finish"/>
			</do_if>

			<add_builds_to_replace_subordinates name="$builds" commander="this.ship" buildobject="$shipyard" init="$init"/>
			<wait exact="1s" />
			<debug_text text="'requesting %s builds from shipyard %s %s %s.'.[$builds.count, $shipyard.idcode, $shipyard.knownname, $shipyard]" chance="$debugchance"/>

			<label name="wait"/>

			<set_value name="$BuildingObjects" exact="[]" />
			<do_all exact="$builds.count" counter="$i" reverse="true">
				<do_if value="$builds.{$i}.exists and $builds.{$i}.isshipbuild">
					<debug_text text="'adding buildobject %s.'.[$builds.{$i}.buildobject.idcode]" chance="$debugchance"/>
					<append_to_list name="$BuildingObjects" exact="$builds.{$i}.buildobject" />
				</do_if>
			</do_all>

			<debug_text text="'waiting for ' + $BuildingObjects.count + ' subordinates'" chance="$debugchance" />
			
			<do_all exact="$BuildingObjects.count" counter="$i" reverse="true">
				<do_if value="$BuildingObjects.{$i}.isoperational">
					<set_value name="$Ship" exact="$BuildingObjects.{$i}" />
					<debug_text text="'build event ' + event.name + ' for object ' + $Ship.knownname" chance="$debugchance" />
					<set_object_commander object="$Ship" commander="this.ship"/>
					<debug_text text="this.ship.idcode + ' is taking command of ship ' + $Ship.idcode" chance="$debugchance"/>
					<organise_job_ship_subordinates commander="this.ship"/>
					<set_ship_expiration_time ship="$Ship" time="-1s"/>
					<activate_job_ship_orders ship="$Ship"/>
					<remove_value name="$BuildingObjects.{$i}"/>					
				</do_if>
			</do_all>
			
			<do_if value="$BuildingObjects.count gt 0">
				<debug_text text="'%s at the shipyard. waiting for %s builds to finish.'.[this.ship.idcode, $BuildingObjects.count]" chance="$debugchance"/>
				<wait exact="2s" />				
				<resume label="wait"/>
			</do_if>

			<debug_text text="'all subordinates built'" chance="$debugchance" />
			<label name="finish"/>
		</actions>
	</replace>
</diff>
- Doesn't look for orphan ships that seems to be failing in the original so all ships will be build in the shipyard/wharf
- Job ships shouldn't be flying towards the shipyard but subs should just join the job ship
The problem with the second point you mention is that if the job ship doesn't fly towards the shipyard, where will it go? If it goes on patrol and leaves the sector (especially to a dangerous place) it will get destroyed before the subordinates can join up.
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: Faction Wars Hotfix

Post by celludriel »

BlackRain wrote: Sun, 13. Jan 19, 19:26 The problem with the second point you mention is that if the job ship doesn't fly towards the shipyard, where will it go? If it goes on patrol and leaves the sector (especially to a dangerous place) it will get destroyed before the subordinates can join up.
There is no ideal scenario with those subordinates. I also kinda custom tailored this one for my own FactionWar logic. However since I can't control if a job ship stays in his sector when given a patrol order the point is quite mute anyhow.

You can't trust this game to do anything you say it should do and it's frustrating and sucking the joy of modding out of me.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

celludriel wrote: Sun, 13. Jan 19, 19:31
BlackRain wrote: Sun, 13. Jan 19, 19:26 The problem with the second point you mention is that if the job ship doesn't fly towards the shipyard, where will it go? If it goes on patrol and leaves the sector (especially to a dangerous place) it will get destroyed before the subordinates can join up.
There is no ideal scenario with those subordinates. I also kinda custom tailored this one for my own FactionWar logic. However since I can't control if a job ship stays in his sector when given a patrol order the point is quite mute anyhow.

You can't trust this game to do anything you say it should do and it's frustrating and sucking the joy of modding out of me.
Well, it is fine if the leader goes to the shipyard or wharf, if the subordinates would just immediately join up with the leader when finished.
shealladh
Posts: 322
Joined: Thu, 11. Jun 09, 13:29
x4

Re: Faction Wars Hotfix

Post by shealladh »

BlackRain wrote: Sun, 13. Jan 19, 19:38
celludriel wrote: Sun, 13. Jan 19, 19:31
BlackRain wrote: Sun, 13. Jan 19, 19:26 The problem with the second point you mention is that if the job ship doesn't fly towards the shipyard, where will it go? If it goes on patrol and leaves the sector (especially to a dangerous place) it will get destroyed before the subordinates can join up.
There is no ideal scenario with those subordinates. I also kinda custom tailored this one for my own FactionWar logic. However since I can't control if a job ship stays in his sector when given a patrol order the point is quite mute anyhow.

You can't trust this game to do anything you say it should do and it's frustrating and sucking the joy of modding out of me.
Well, it is fine if the leader goes to the shipyard or wharf, if the subordinates would just immediately join up with the leader when finished.
Even if they are recalled before the leader docks, would also work. Maybe the code could be expanded to include scenarios for them do recall before dock, deploy after undocking automatically.

So for example, if you had them as escort, they'd dock at leader's ship, then undock and continue escorting when the lead decides to leave. Just a thought
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: Faction Wars Hotfix

Post by celludriel »

BlackRain wrote: Sun, 13. Jan 19, 19:38
celludriel wrote: Sun, 13. Jan 19, 19:31
BlackRain wrote: Sun, 13. Jan 19, 19:26 The problem with the second point you mention is that if the job ship doesn't fly towards the shipyard, where will it go? If it goes on patrol and leaves the sector (especially to a dangerous place) it will get destroyed before the subordinates can join up.
There is no ideal scenario with those subordinates. I also kinda custom tailored this one for my own FactionWar logic. However since I can't control if a job ship stays in his sector when given a patrol order the point is quite mute anyhow.

You can't trust this game to do anything you say it should do and it's frustrating and sucking the joy of modding out of me.
Well, it is fine if the leader goes to the shipyard or wharf, if the subordinates would just immediately join up with the leader when finished.
I actually had no problem with that, if I include the move to shipyard the subordinates do join up there. However I can't count on the jobship to resume it's default order. Consider following setup:

Job setup

Code: Select all

      <job id="argon_fighter_reinforcement_group" name="Argon Fighter Leader" startactive="true" >
        <modifiers rebuild="false" commandeerable="false"  />
        <orders>
            <order order="Patrol" default="true">
                <param name="range" value="class.sector"/>
            </order>
        </orders>
        <category faction="argon" tags="[factionlogic,military,fighter,fighterwing]" size="ship_s" />
        <quota maxgalaxy="59" />
        <location class="galaxy" macro="warexp_galaxy_macro" relation="member" comparison="exact"  faction="argon" />
        <environment buildatshipyard="true"/>
		<expirationtime min="31557600" max="31557600"/>
        <ship>
          <select faction="argon" tags="[military,fighter]" size="ship_s" />
          <loadout>
            <level min="0.4" max="1.0"/>
          </loadout>
          <owner exact="argon" overridenpc="true"/>
        </ship>
        <subordinates>
			<subordinate job="argon_fighter_subordinate"/>
        </subordinates>
      </job>
      <job id="argon_fighter_subordinate" name="Argon Fighter Wingman" startactive="false" >
        <modifiers subordinate="true" commandeerable="false" />
        <orders>
		  <order order="Escort" default="true">
			<param name="formation" value="formationshape.dartvertical"/>
			<param name="formationparam" value="2500m"/>
		  </order>
        </orders>
        <category faction="argon" tags="[military,wingman]" size="ship_s" />
        <quota wing="4"/>
        <location class="galaxy" macro="warexp_galaxy_macro"/>
        <environment buildatshipyard="true"/>
		<expirationtime min="31557600" max="31557600"/>
        <ship>
          <select faction="argon" tags="[military,fighter]" size="ship_s" />
          <loadout>
            <level min="0" max="0.7"/>
          </loadout>
          <owner exact="argon" overridenpc="true"/>
        </ship>
      </job>
Building the job ship

Code: Select all

<cue name="Request_Job_Ship" instantiate="true">
	<conditions>
		<event_cue_signalled/>
	</conditions>
	<actions>
		<set_value name="$Sector" exact="event.param.{1}" />
		<set_value name="$Tag" exact="event.param.{2}" />				
		<get_suitable_job result="$Jobs" faction="$Faction" tags="[$Tag]" multiple="true" />
		<debug_text text="'Found suitable jobs: %1'.[$Jobs]" chance="$DebugChance"/>
		<do_if value="$Jobs.count gt 0">
			<shuffle_list list="$Jobs" />
			<find_zone name="$Startzone" space="$Sector" normalzone="true"/>
			<debug_text text="'Zone to order ship to: %1'.[$Startzone.knownname]" chance="$DebugChance"/>
			<request_job_ship name="$Requested_Job_Ship" job="$Jobs.{1}" requester="$Sector" zone="$Startzone" />
			<debug_text text="'Requested ship %1 for job %2'.[$Requested_Job_Ship,$Jobs.{1}]" chance="$DebugChance"/>
		</do_if>
	</actions>
</cue>
Now with the vanilla script the following happens

- The jobship is created and flies towards the sector that requested the creation
- It kinda patrols there for a bit, then flies back to the wharf to get subs
- Subs build and join up
- If you are lucky the job ship returns to his sector and resumes patrol

Now suppose another one of those calls happen a new jobship is created, and when the time comes to get new subs ... it STEALS the subs of the first one. Then the first one wants subs again and he STEALS them from the second one ad infinitum.

So with my script and move activated

- The jobship is created and flies towards the sector that requested the creation
- It kinda patrols there for a bit, then flies back to the wharf to get subs
- Subs build and join up
- If you are lucky the job ship returns to his sector and resumes patrol
- However you can't count on the job ship to STAY in that sector, sometimes not always ... it just decides on it's own to LEAVE that sector leaving it undefended

So with my script and move deactivated

- The jobship is created and flies towards the sector that requested the creation
- It kinda patrols there for a bit and keeps doing so
- Subs build and join up in the sector of the job ship
- However you can't count on the job ship to STAY in that sector, sometimes not always ... it just decides on it's own to LEAVE that sector leaving it undefended

There is no consistency in the given orders to ships !!!!!!
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

Did you make sure to limit its scope of patrol? Also, you don't need to have it go to the patrol area and then go get subs, it should automatically go get its subs after being built (at least if using the normal process of patrol assigned in jobs). You would then just need the built subordinates to immediately join up.
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: Faction Wars Hotfix

Post by celludriel »

BlackRain wrote: Sun, 13. Jan 19, 20:11 Did you make sure to limit its scope of patrol? Also, you don't need to have it go to the patrol area and then go get subs, it should automatically go get its subs after being built (at least if using the normal process of patrol assigned in jobs). You would then just need the built subordinates to immediately join up.
It's the default patrol order I took from the vanilla jobs , at least I think I did this part right

Code: Select all

        <orders>
            <order order="Patrol" default="true">
                <param name="range" value="class.sector"/>
            </order>
        </orders>
this is basically how I call the ship to be created

Code: Select all

<request_job_ship name="$Requested_Job_Ship" job="argon_fighter_reinforcement_group" requester="$Sector" zone="$Startzone" />
I can tell you it does not wait for it's subs, the first thing it does after being build is go straight for it's requesting sector. Which I hope is also the target sector for the Patrol order. Now maybe , MAYBE the patrol orders in the job.xml only work with a hardcoded implementation of the job engine at startup of the game and any job ship you build dynamically you have to give specific orders. However here I'm guessing and maybe talking out of my ass
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: Faction Wars Hotfix

Post by BlackRain »

celludriel wrote: Sun, 13. Jan 19, 20:18
BlackRain wrote: Sun, 13. Jan 19, 20:11 Did you make sure to limit its scope of patrol? Also, you don't need to have it go to the patrol area and then go get subs, it should automatically go get its subs after being built (at least if using the normal process of patrol assigned in jobs). You would then just need the built subordinates to immediately join up.
It's the default patrol order I took from the vanilla jobs , at least I think I did this part right

Code: Select all

        <orders>
            <order order="Patrol" default="true">
                <param name="range" value="class.sector"/>
            </order>
        </orders>
this is basically how I call the ship to be created

Code: Select all

<request_job_ship name="$Requested_Job_Ship" job="argon_fighter_reinforcement_group" requester="$Sector" zone="$Startzone" />
I can tell you it does not wait for it's subs, the first thing it does after being build is go straight for it's requesting sector. Which I hope is also the target sector for the Patrol order. Now maybe , MAYBE the patrol orders in the job.xml only work with a hardcoded implementation of the job engine at startup of the game and any job ship you build dynamically you have to give specific orders. However here I'm guessing and maybe talking out of my ass
I was talking about if you used jobs normally, however, if you are going to use an MD script to take over job ships than you would need to have scripts which run on the ship and might even need to create your own script. The way you are doing it won't have them automatically get subordinates and also once they leave the zone they were originally patrolling in, they won't return. Most likely they took on a new patrol or something. You could set it up so that they run the patrol script again and you can specify the place you want them to go once more, make sure to specify their range too.
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: Faction Wars Hotfix

Post by celludriel »

BlackRain wrote: Sun, 13. Jan 19, 21:38
I was talking about if you used jobs normally, however, if you are going to use an MD script to take over job ships than you would need to have scripts which run on the ship and might even need to create your own script. The way you are doing it won't have them automatically get subordinates and also once they leave the zone they were originally patrolling in, they won't return. Most likely they took on a new patrol or something. You could set it up so that they run the patrol script again and you can specify the place you want them to go once more, make sure to specify their range too.
Well I've considered everything you sum up here. I even specifically order them to patrol the zone the second they arrive in their target sector. They did always get their subordinates though thanks to the order.restock.subordinates.xml.

Code: Select all

<!-- Do cleanup of ordered ships, if ordered ship is operational and in sector remove it from the ordered ship list -->
<do_all exact="$OrderedShips.count" counter="$j" reverse="true" >
	<set_value name="$Ship" exact="$OrderedShips.{$j}.{'$Ship'}" />
	<do_if value="$Ship.isoperational and $Ship.sector == $Sector">
		<create_order id="'Patrol'" object="$Ship" default="true">
			<param name="range" value="class.zone"/>
		</create_order>	
		<activate_job_ship_orders ship="$Ship" />
		<remove_value name="$OrderedShips.{$j}" />
	</do_if>
</do_all>
but try as you might, at a certain point they just get a mind of their own and fly of leaving their ordered zone/sector/cluster. Also they have a tendency to hover around the gates, as if mocking me: "see how close I'm to the gate I will leave this place... be sure of it"

You just can't count on any of the code you write, there are to many interrupts and god knows what else going on interfering with anything you program.

I've looked at the order.fight.patrol.xml script and I'm thinking this is the culprit

Code: Select all

      <do_if value="player.age gt @$next_resupply_check" chance="30">
        <debug_text text="'%1 (%2) ready to resupply.'.[this.ship.knownname, this.ship]" chance="$debugchance"/>
        <signal_objects object="this.ship" param="'resupply'" param2="false" param3="$debugchance" comment="param2 = urgent?, param3 = $debugchance"/>
        <set_value name="$next_resupply_check" exact="player.age + 30min"/>
      </do_if>
After a while this one says go resupply the resupplyhandler kicks in somehow decides a resupply is needed and the ship flies of to the nearest wharf shipyard to get a "resupply". I theoretically could make my own patrol script leaving this part out. But man Toto are we not in Kansas anymore !
User avatar
TDuke
Posts: 11
Joined: Fri, 4. Jan 19, 22:13
x4

Re: Faction Wars Hotfix

Post by TDuke »

Installed it yesterday 4 hours in on newgame with SETA. And i do see an increase in fighter squadrons (10 to 15) with some destroyers and a capital ship otherwise no war. But encountered that it spams out AI transports like crazy. 10-20 per station :?
Help costs nothing. Neither does kindness. Spread it.
Death to Xenon and Paranids! :?

~Beginner Modder~
Bravari
Posts: 46
Joined: Mon, 15. Jun 09, 20:00
x4

Re: Faction Wars Hotfix

Post by Bravari »

in my game, ANT made a defense platform in HOP sector. It's health is reduced to zero and it heals back up. Endless loop.
Mysterial
Posts: 664
Joined: Wed, 6. Nov 02, 20:31
x4

Re: Faction Wars Hotfix

Post by Mysterial »

It appears that the 1.6 beta has fixed the Build Storage ownership problem, although if the station gets attacked while in construction it still has the AI not being able to kill it properly. Baby steps ;)
reanor
Posts: 804
Joined: Thu, 23. Oct 03, 01:39
x4

Re: Faction Wars Hotfix

Post by reanor »

Thanks for trying guys, sounds like too many underlying problems that need Egosoft's fix of the core *sigh*... So much mess...
“The dark and the light, they exist side by side." ... “It is often in the darkest skies that we see the brightest stars."
Mr.Freud
Posts: 325
Joined: Sat, 16. Nov 13, 20:20
x4

Re: Faction Wars Hotfix

Post by Mr.Freud »

And one of the main issues is the performance of the engine. They already decreased LOD distance in 1.51 in order to improve performance - which is a bad sign. Main AI calculations is done on the same thread as LOD rendering. they did the same thing with Rebirth after launch. But X4 is much "bigger" and deeper than Rebirth so they will have to look for new solutions which might be a real problem. IMO it's the main reason why they disabled wars for now.
They aim for realistic economy but in order to achieve it there must be constant wars and/or expansion. Theoretically both goals are reachable but it all comes down to the possibilities of (AI = Engine performance). Decreasing draw distances is of course one way of freeing more power for AI but it's the simpliest route and they already made first step on it which might mean that they really don't have a better solution as of now.
reanor
Posts: 804
Joined: Thu, 23. Oct 03, 01:39
x4

Re: Faction Wars Hotfix

Post by reanor »

Which is very sad because it means that 2 out of 4 game mechanic pillars are simply not working and it all sounds like a pretty darn desperate dead-end. :cry: With the resource heavy engine, they can no longer make mass battles like in previous X games. Even though the engine can handle very well 50+ defense drones chase ships around the station/sector, even in 1.5. The FPS may drop and with adjusted LOD it's very possible, so I wish Ego would fix this war issue that currently prevents any kind of end game-play. Any kind of war conflict currently just dies out, no matter how powerful you make kha'ak and xenon, their stations just don't know what to do, after their few small fleets are destroyed. And local factions don't know either. You can go from sector to sector, take control over everything and they won't be able to continually oppose your efforts or help themselves because the scripting simply isn't there. *sigh*
“The dark and the light, they exist side by side." ... “It is often in the darkest skies that we see the brightest stars."

Return to “X4: Foundations - Scripts and Modding”