[X3LU] Mayhem 3.21b

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
TestUnknown
Posts: 56
Joined: Fri, 6. Apr 12, 01:40

Post by TestUnknown » Sat, 13. May 17, 09:47

This is kind of weird or maybe a bug. In Mayhem.Conquer.xml around line 45:

Code: Select all

* Conquest

dim $validRaces = [Yaki], [Pirates], [Xenon], [Player], [Unknown], [Goner], [OCV]

if find $conqueror in array: $validRaces
$sector-> set local variable: name='mayhem_autopopulateRace' value=null
$sector-> set local variable: name='mayhem_autopopulateMinStations' value=null
end

do if find $previousOwner in array: $validRaces
$sector-> set local variable: name='mayhem_autopopulateRace' value=$conqueror

$sector-> set owner race to $conqueror
The above does not check to see if $conqueror is a valid 'mayhem_autopopulateRace'. For example, if [Yaki] conquers a sector previously owned by [Xenon], then first if would be true mayhem_autopopulateRace is set to null, but second if is also true, so mayhem_autopopulateRace is set to [Yaki]

According to Mayhem.Monitor.Autopopulate.xml, [Yaki] is not a valid mayhem_autopopulateRace.

Edit: Add the fix below:


Mayhem.Conquer.xml
-----------------------------------
line 45: change to

Code: Select all

* Conquest

dim $validRaces = [Yaki], [Pirates], [Xenon], [Player], [Unknown], [Goner], [OCV]
if find $conqueror in array: $validRaces
$sector-> set local variable: name='mayhem_autopopulateRace' value=null
$sector-> set local variable: name='mayhem_autopopulateMinStations' value=null
else
do if find $previousOwner in array: $validRaces
$sector-> set local variable: name='mayhem_autopopulateRace' value=$conqueror
end
Last edited by TestUnknown on Sat, 13. May 17, 21:46, edited 1 time in total.

TestUnknown
Posts: 56
Joined: Fri, 6. Apr 12, 01:40

Post by TestUnknown » Sat, 13. May 17, 09:56

Mayhem really makes X3 much much more fun. I am making my first M7, the biggest ship I will have now that I recycled the Akuma. So I am still a beginner. So far I really enjoy this. So thank you very much for writing the mod. But it occasionally does something I don't expect, that is why I am reading the codes. I hope I didn't offend anyone or scare anyone off by picking at the codes.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Sat, 13. May 17, 21:57

The problem of your M2 always returning back to its first homebase is that sometimes, ships stop responding and just stop living. Somewhere, there's a line that says "if you're speed is at 0, then go back to your homebase bitch, because I need you".

I don't remember where is that line, and I'm not in the mood to fix it right now, but that's the problem with the ship you captured earlier.

And frankly, I don't give a shit about the ships you capture, because that feature is lame and should be banned. Marines, capture, boarding pod... I never use that because it's so boring, so yeah, there's probably some problems with it.

TestUnknown
Posts: 56
Joined: Fri, 6. Apr 12, 01:40

Post by TestUnknown » Sat, 13. May 17, 22:09

TestUnknown wrote:
Sirrobert wrote:Pretty sure it's the same ship.
Thanks, that explains why the Akuma I capture from Yaki is doing weird things by itself. The script that assigns attack and defend tasks for Yaki only check to see if the ship exists not whether it's owned by player.
Fix may actually be easy. Too bad I cannot test it for awhile because I already recycled the captured Akuma and I am thinking of starting a new game now that I added Fortifications for Yaki, Xenon, OCV, and Pirates sectors so that these sectors will not flip sides so fast and so that Player cannot steal a sector right after it's conquered by someone else.

Fix: change Mayhem.GetAssignedShips.xml to

Code: Select all

$allShips = [THIS]-> get local variable: name='mayhem_assignedShips'
$allShips.owner = [THIS]->get owner race

for each $ship in array $allShips using counter $index

if $ship-> exists
$ship.owner = $ship->get owner race
skip if $allShips.owner ==$ship.owner
remove element from array $allShips at index $index
else
remove element from array $allShips at index $index
end
end

[THIS]-> set local variable: name='mayhem_assignedShips' value=$allShips

return $allShips
I don't know if this will catch everything, maybe I'll find out in a few days.

EDIT: added one line to save local variable 'mayhem_assignedShips', so the result is saved
Last edited by TestUnknown on Sun, 14. May 17, 03:11, edited 1 time in total.

TestUnknown
Posts: 56
Joined: Fri, 6. Apr 12, 01:40

Post by TestUnknown » Sat, 13. May 17, 22:14

Joubarbe wrote:The problem of your M2 always returning back to its first homebase is that sometimes, ships stop responding and just stop living. Somewhere, there's a line that says "if you're speed is at 0, then go back to your homebase bitch, because I need you".

I don't remember where is that line, and I'm not in the mood to fix it right now, but that's the problem with the ship you captured earlier.

And frankly, I don't give a shit about the ships you capture, because that feature is lame and should be banned. Marines, capture, boarding pod... I never use that because it's so boring, so yeah, there's probably some problems with it.
We posted our replies at the same time, hehe. I understand you are busy, not a problem. If I find the solution, I'll post it. Saves you time.

TestUnknown
Posts: 56
Joined: Fri, 6. Apr 12, 01:40

Post by TestUnknown » Sat, 13. May 17, 22:37

Joubarbe wrote: And frankly, I don't give a shit about the ships you capture, because that feature is lame and should be banned. Marines, capture, boarding pod... I never use that because it's so boring, so yeah, there's probably some problems with it.
Maybe you are right. Marine training is expensive. I had about 18 marines at the time and I think I lost 10 because my marines are not yet fully trained yet. I had to do it because I was getting invaded by multiple Yaki M2's and M1's and my defensive fleet consisted of 5 M6s. Not enough to fight back so I had to capture a Yaki's M2 and use it to fight the rest. I don't know if it is realist to fix up a M2 and deploy it so fast in real life. But we are Sohnens and we do whatever it takes to survive.

I kind of like marines and the ideas of marines fixing, capturing and defending ships and stations. It adds a personal touch even when your Empire gets big. Although if you are so against it. I may not use it in the future since I am planning to restart the game. Come to think of it, I never see NPC does it. Still, are you sure you don't want me to just figure out where the fixes are?

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Sat, 13. May 17, 23:23

Mayhem.Monitor.Shipyard.NPC: line 252 "* we add a safety to check for non active ships..."

I think that's where the problem is.

Code: Select all

if not $ship-> is task 0 in use
  START $ship-> call script 'Mayhem.Task.Defend' : sector=[SECTOR] leader=null ally=null

if get global variable: name='mayhem_debug'
  $t = $ship + ' in ' + $shipSector + ' was inactive and has been recalled by ' + [THIS]
  display info box: text= $t, icon= 0, timeout= 20000, fadeout= 2000
  write to player logbook $t
  end
end
Have fun.

TestUnknown
Posts: 56
Joined: Fri, 6. Apr 12, 01:40

Post by TestUnknown » Sun, 14. May 17, 03:10

Joubarbe wrote:Mayhem.Monitor.Shipyard.NPC: line 252 "* we add a safety to check for non active ships..."

I think that's where the problem is.

Code: Select all

if not $ship-> is task 0 in use
  START $ship-> call script 'Mayhem.Task.Defend' : sector=[SECTOR] leader=null ally=null

if get global variable: name='mayhem_debug'
  $t = $ship + ' in ' + $shipSector + ' was inactive and has been recalled by ' + [THIS]
  display info box: text= $t, icon= 0, timeout= 20000, fadeout= 2000
  write to player logbook $t
  end
end
Have fun.
Thank you very much. I changed Mayhem.GetAssignedShips.xml which is what returned $assignedShips to remove ships that no longer belongs to the station. Also added another line to save the updated ship list so it does not have to remove ships repeatedly.

Mayhem.GetAssignedShips.xml
-----------------------------------
Replace all:

Code: Select all

$allShips = [THIS]-> get local variable: name='mayhem_assignedShips'
$allShips.owner = [THIS]->get owner race

for each $ship in array $allShips using counter $index

if $ship-> exists
$ship.owner = $ship->get owner race
skip if $allShips.owner ==$ship.owner
remove element from array $allShips at index $index
else
remove element from array $allShips at index $index
end
end

[THIS]-> set local variable: name='mayhem_assignedShips' value=$allShips

return $allShips


ravennn
Posts: 13
Joined: Sat, 30. Nov 13, 10:14

Post by ravennn » Wed, 17. May 17, 20:43

Just a question about performance... are you ok with this mod even when occurs a battle where both sides deploy large forces?

I've just jumped in the middle of sector where were fighting about 50-100 fighters and maybe 10 M1-M7?... just raw guess... and I barely could do anything as it was just too laggy... also with few M7 lauching volleys of missiles it was a hell for performance.
I've also noticed, that even in a sector without fight my SETA is just dropping down... (using distance to object / station as a meter). When I run SETA 10x it is ok for first few sec and then starts to slow down to about a 30-50%. (which isn't that big problem as the first example).

I don't really know how game works exactly, but is it possible, it might be worse because of satellites? ... so even if I'm not in the sector it's still bigger burden?

I'm running with proc: i5-3450, 8GB RAM and NVidia GeForce 560...
And actually I haven't notice such big lags until recently (or forget them). Don't even have such huge 'empire' (about 10 stations, 6 trade ships maybe?), the only bigger difference that I know about is a large amount of satellites across the universe.

Oh and btw OCV seems little unstoppable right now... already took second sector with the first wave and I've never even saw any commonwealth force that could at least hope to be strong enough to stop them.
Their capitals and fighters numbers are almost the same as both attacker and defender at the begging of an ordinary commonwealth assault. :)

And OCV didn't care about my satellites, so it still scans that sector so if it does have such impact on the performance, I'll have to go to erase them myself. :(

Sirrobert
Posts: 1213
Joined: Wed, 21. Aug 13, 13:55
x3ap

Post by Sirrobert » Thu, 18. May 17, 00:10

Does OCV build ships after they take a sector?
In my game they just spread out so thin that local forces crushed all but the destroyers (that did stick together a little).

I mopped the destroyers one by one with a Shark
9 out of 10 voices in my head say I'm crazy. The 10th is singing the music from Tetris

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Thu, 18. May 17, 00:18

Unless the OCV behavior was drastically changed in Mayhem they should work like in LUV: the central station generates a constant stream of resources that are "spent" by the OCV to get ships. That means that once they start branching outside of the Omicron Channel, their ship growth rate in the newly conquered sectors should diminish by the number of sectors they are actively growing fleets in. Combined with the still unsolved (unless I misremember) issue of NPC traffic passing through OCV sectors resulting in more and more constant losses to the OCV (as their owned sector space increases) results in a "spread too thin" effect.

This is by design in LUV I believe. The idea being that they produce ships overall at constant rate, no matter how many sectors they have acquired giving the player a good chance to beat them even if they have occupied most of the universe (it just takes longer time as you will need to take back so many OCV sectors). If instead you were to more realistically model the OCV resource rate by increasing it proportional to the number of sectors they own then there will be a point where they become unbeatable and it's game over.
X3LU 1.5.2/1.7.0 Youtube series with: IEX 1.5b + LUVi, SIaF r7 (previously also used Phanon Plus 4.02, Revelation Plus 1.04, Diverse Game Starts - LU Edition)
[ external image ]

VincentTH
Posts: 6626
Joined: Wed, 6. Nov 02, 20:31
x4

Post by VincentTH » Thu, 18. May 17, 00:42

memeics wrote:Unless the OCV behavior was drastically changed in Mayhem they should work like in LUV: the central station generates a constant stream of resources that are "spent" by the OCV to get ships. That means that once they start branching outside of the Omicron Channel, their ship growth rate in the newly conquered sectors should diminish by the number of sectors they are actively growing fleets in. Combined with the still unsolved (unless I misremember) issue of NPC traffic passing through OCV sectors resulting in more and more constant losses to the OCV (as their owned sector space increases) results in a "spread too thin" effect.

This is by design in LUV I believe. The idea being that they produce ships overall at constant rate, no matter how many sectors they have acquired giving the player a good chance to beat them even if they have occupied most of the universe (it just takes longer time as you will need to take back so many OCV sectors). If instead you were to more realistically model the OCV resource rate by increasing it proportional to the number of sectors they own then there will be a point where they become unbeatable and it's game over.
IMHO, OCV are different in MayHem. They don't gather resources, they are just a giant wrecking ball going after the strongest faction at the time of their spawn, sector after sector until they are all eliminated, only to resurface after 2 days.

ravennn
Posts: 13
Joined: Sat, 30. Nov 13, 10:14

Post by ravennn » Thu, 18. May 17, 07:47

VincentTH wrote:IMHO, OCV are different in MayHem. They don't gather resources, they are just a giant wrecking ball going after the strongest faction at the time of their spawn, sector after sector until they are all eliminated, only to resurface after 2 days.
Ye, I think the same... also they didn't even capture that first sector, they just spawned, destroyed everything in it and moved to another one.
Those rates and numbers can be tweaked in a file, MayHem is well commented in that way (thankfully), so when I'll have time to playagain I'll see if commonwealth will be able to do at least something or if OCV will take dozens of sectors... for now they are all packed together so if later happens than I can't image it every 2 or 3 days all over again... I play at very slow pace. :)

What about that performance? Am I only one who gets laggy after few hours?

Sirrobert
Posts: 1213
Joined: Wed, 21. Aug 13, 13:55
x3ap

Post by Sirrobert » Thu, 18. May 17, 09:12

memeics wrote:Unless the OCV behavior was drastically changed in Mayhem they should work like in LUV: the central station generates a constant stream of resources that are "spent" by the OCV to get ships. That means that once they start branching outside of the Omicron Channel, their ship growth rate in the newly conquered sectors should diminish by the number of sectors they are actively growing fleets in. Combined with the still unsolved (unless I misremember) issue of NPC traffic passing through OCV sectors resulting in more and more constant losses to the OCV (as their owned sector space increases) results in a "spread too thin" effect.

This is by design in LUV I believe. The idea being that they produce ships overall at constant rate, no matter how many sectors they have acquired giving the player a good chance to beat them even if they have occupied most of the universe (it just takes longer time as you will need to take back so many OCV sectors). If instead you were to more realistically model the OCV resource rate by increasing it proportional to the number of sectors they own then there will be a point where they become unbeatable and it's game over.
No, OCV works different in Mayhem. They don't start in Unknown Omega any more (that's where the player starts).

Instead, they spawn a fleet in a random sector every few days. And that fleets goes on a rampage in different directions, thus spreading out over the network.
9 out of 10 voices in my head say I'm crazy. The 10th is singing the music from Tetris

VincentTH
Posts: 6626
Joined: Wed, 6. Nov 02, 20:31
x4

Post by VincentTH » Thu, 18. May 17, 09:23

ravennn wrote:
VincentTH wrote:IMHO, OCV are different in MayHem. They don't gather resources, they are just a giant wrecking ball going after the strongest faction at the time of their spawn, sector after sector until they are all eliminated, only to resurface after 2 days.
Ye, I think the same... also they didn't even capture that first sector, they just spawned, destroyed everything in it and moved to another one.
Those rates and numbers can be tweaked in a file, MayHem is well commented in that way (thankfully), so when I'll have time to playagain I'll see if commonwealth will be able to do at least something or if OCV will take dozens of sectors... for now they are all packed together so if later happens than I can't image it every 2 or 3 days all over again... I play at very slow pace. :)

What about that performance? Am I only one who gets laggy after few hours?
I don't have performance problem at all. I have some random crash/hung, probably related to the memory leak in X3 (that has been fixed in the latest patch, but, unfortunately does not work with LU/MayHem). When I see some slow down, I just do an emergency save, quit and reload, to fix it.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Thu, 18. May 17, 13:53

@ravennn: if you have lags during big battles, there's no magic, you should decrease the number of ships Mayhem generate. That can be done by modifying t/9971-L044.xml. This file defines all templates used by the AI. "Difficulty" is your threat level, ie. how many sectors you conquered.

Beware of M1s, they come with a lot of fighters and that's why Mayhem battle fleet only use 1 of them maximum.

ravennn
Posts: 13
Joined: Sat, 30. Nov 13, 10:14

Post by ravennn » Thu, 18. May 17, 14:07

Joubarbe wrote:@ravennn: if you have lags during big battles, there's no magic, you should decrease the number of ships Mayhem generate. That can be done by modifying t/9971-L044.xml. This file defines all templates used by the AI. "Difficulty" is your threat level, ie. how many sectors you conquered.

Beware of M1s, they come with a lot of fighters and that's why Mayhem battle fleet only use 1 of them maximum.
Thx, I'll onto those settings...
still do you know if visibility of a sector also impacts performance? So if such battle is in unrevealed sector vs in one where I have satellite...?

EDIT: Ok, main problem is with GPU, not CPU ... and there is about 30 M1 to M7 ships in battle... around 20 of them is M7 class so with all those missiles and fighters all around... it's little too much. I'll just mess a little bit with numbers. :) Thx.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Thu, 18. May 17, 21:48

No, problem is with CPU. GPU means shit in X3. Visibility means shit. Everything means shit. Even our new president do so.

ravennn
Posts: 13
Joined: Sat, 30. Nov 13, 10:14

Post by ravennn » Thu, 18. May 17, 21:54

Joubarbe wrote:No, problem is with CPU. GPU means shit in X3. Visibility means shit. Everything means shit. Even our new president do so.
Yet turning off AA and lowering textures sped things up... still little laggy, but far less then it used to be.
I'd lowered numbers anyway, but that single battle is less laggy with lower graphics and same numbers.

btw, ye, sad thing is, that Macron is bad not only for France, but for whole EU... and our poor Visegrad 4. :(

User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Thu, 18. May 17, 22:45

Use something like HWMonitor and determine if your are GPU bottlenecked or CPU bottlenecked in a laggy fight (you watch for >=99% GPU or >=99% CPU usage on one core). On modern systems (assuming you have v-sync on and don't render X3 at >500FPS for no good reason) you will are very likely to see GPU usage at around 30% or less and one CPU core at 99%.

That's what Joubarbe meant, in large fights the CPU is the bottleneck (likely from the collision calculation code) and unless you can overclock your CPU to run at 10Ghz or more per clock, then reducing graphics settings, getting better/faster GPU, getting CPUs with more cores won't help.
X3LU 1.5.2/1.7.0 Youtube series with: IEX 1.5b + LUVi, SIaF r7 (previously also used Phanon Plus 4.02, Revelation Plus 1.04, Diverse Game Starts - LU Edition)
[ external image ]

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”