[SCR/MOD] Complex Cleaner v3.20 / Modular Complexes

The place to discuss scripting and game modifications for X³: Reunion.

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

MarkusXL
Posts: 219
Joined: Thu, 5. Nov 09, 19:44
x3tc

Post by MarkusXL » Sat, 13. Feb 10, 17:35

Ugh, it seems all my above work is null and void, because I did not realize it at the time, but I was running XTM .7.3. :?

So, I went ahead and enjoyed all the Main Plot and Bala Gi Missions with my Factory Module Complex AND my downloaded ships (which are arranged into CAT/DAT files in order by Plugin Manager as False Patches) AND my Ashley's Fabs.

Now that's done, I'm ready to start a new game with XTM .7.5 and Ashley's Fabs AND my downloaded ships AND Complex Cleaner!!

I started with a clean slate and re-installed everything:

1. Fresh Game install
2. Patch up to 2.5
3. Bonus Pack
4. EMP
5. Plugin Manager 2.12 (the "Lite" version did not work for this at all)
6. XTM .7.5
7. Ashely's Fabs
8. Test test test ALL OK - made a Backup Folder

9. Downloaded a bunch of ships and installed them
10. Test test test all ok.

During testing with CC, it was easy to get back to 8 from the backup folder.

Tried installing CC both before and after the downloaded ships, no difference.

It just don't work all together. CC works fine if you select it as the Selected Mod Package at game launch, but then you get no downloaded Ships. If any downloaded ships are present in any saved game you try to load, boom it kicks out with the "corrupted save game" message.

Select Plugin Manager as the Selected Mod Package from the game launcher, as you normally should, and you have all your ships, but no Complex Cleaner. It can't find is components, mainly the Factory Module models.

<sigh>

I have put another 3 full days of hacking on this and I am ready to give up on Complex Cleaner, and enjoy my downloaded ships without it.

So it comes down to a personal choice. Downloaded ship or CC? :(

I really worked hard with Plugin Manager to try to get it to work. There is a "allow more than one mod" checkbox, but no help. I tried arranging the downloaded ships as "standard mod" and as "false patch" in the options, but no joy. "Redo Base Mod" no help. :(

Too bad, but I did have my fun with CC. So far, I consider it the best way to deal with tons of factories because it puts them all in one neat little package.

Connect an Extended Complex Hub to it, and man, the ship traffic is huge, and you got megatons of wares coming and going, and its a huge river of credits!! A giant cash cow!! I had a dozen CAGs assigned to it, and they were non-stop jumping around generating huge profits!!

:lol:


Thanks Gazz for the fun, while it lasted! I may come back it someday when I can edit these CAT/DAT files with some understanding. X is a game by programmers, for programmers.

End Transimission.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sun, 16. May 10, 00:56

Gazz, have you ever experimented with factory modules that weren't standard 1, 2, 5, 10, 20, 40, etc.?

Would you know if 3x, 4x, 6x, 8x, would work, for example?

jumbled
Posts: 320
Joined: Mon, 28. Jun 04, 08:22
x4

Post by jumbled » Thu, 2. Sep 10, 12:11

Could you please explain the actual math behind crunching mines? I use the MS Excel spreadsheet "Complex Calculator", which works wonders for me to figure out what and how many of everything I need to make a balanced complex, but fails after crunching because ore/silicon mines get crunched sometimes to S size and lose fractions of their output along the way.

I'm also discovering a lot of "fuzzy math" in here which goes far off from your original estimates of 1 to 2 % loss.

For instance, some time ago I crunched a complex (keeping my original "rock" mines), and everything was great cuz I knew what I was getting. But then I decided to expand, and rather than trying to place a bunch more rocks, I figured to try crunching them into the complex.

I forgot what my original mines were by this time, after fooling with it for so long trying to get it right, but after crunching they came out to some assortment which fell far short of what I calculated I'd need to fill my new beam fabs. The resulting mines, in this case, have yields the same as mines with a yield of 12! Even though they're multiplied as sizes 5, 10, 20, etc., it's not enough.

So I brought in what I thought might work -- a yield 12 rock to put a mine on it to fill the gap of what I'd need to supply my stations. The theory here was if it's MAKING yield 12 mines, it might take an original one and translate it straight across. I put an XL mine on it, crunched it and did a bit of math only to find I'm still short. So I got yet another 12 rock, put an M mine on it, and it added only an S (size 1) module with HALF the output I needed!

Now I'm paying more attention to what I need vs what I'm getting, and I'm playing with it a little to see what comes up. I took out my Orca with a load of M size ore mines, found a group of rocks, put a mine on a couple and watched the results. Here's what I found:

I put a M mine on a 18 rock, got a mine with output of 4 every 64 secs (just like the Complex Calculator says), giving me an hourly output of 225. I crunched it and got a size 2 fab with output of 2 every 101 secs (1:41 time), yielding an hourly total of 71! That's approx 1/3 the original! 2% loss, you say? I think not.

Next I did another M mine on a 25 rock. Got a mine good for 6 ore every 72 secs. Crunched it and my original size 2 module (from above) is now a size 5, same cycle time, output 5. Hourly is about 178, still LESS than my original yield 18 rock mine, but now we should have the equivalent of mines totaling 25+18=43 yield. A 43 yield rock mine (M size) would give me 514/hr.

So I thought maybe the math is really REALLY bad on small numbers. I recalled a huge yield 90 rock in Antigone Memorial. So I put a M mine on it. The rock gives up 18 every 63 secs, hourly is 1029 ore! Wow. Crunched, however, and it loses some of its luster. It's now a 10 module giving 20 every 1:16 (76 secs)...that's 947/hr. Not as good as 1029, and close to an 8% loss.

The numbers are better than for the small rocks, but I don't use huge rocks, first because I don't have that much I need to make. Second, there's only just so much market to sell beams and missiles, so a humongous complex tends to make more stuff than the whole galaxy has room to sell to.

Anyway, what kind of math is going into this and why the big differences? I can understand "integer math sucks", and rounding loses a lot of bits 'n' pieces, but this is ridiculous. I'm losing at least a third, and sometimes up to two-thirds of my expected output.

I'll probably have to go back to rock mines until we figure this out...at least they work as expected.

Fading_light
Posts: 1
Joined: Wed, 12. May 10, 20:48
x3tc

Mine Crunch loss

Post by Fading_light » Thu, 30. Sep 10, 11:26

I did the math out for ore and silicon mines.

Ore: expected output per hour (before crunch) / 240 round that number down to the nearest whole number (so 30.9 becomes 30) and then * that number by 240. This will give you the amount of ore produced per hour after the crunch.

Silicon: expected output per hour (before crunch) / 61.016949 round that number down to the nearest whole number (so 30.9 becomes 30) and then * that number by 61.016949. This will give you the amount of silicon produced per hour after the crunch.

I am running an unaltered game other than the complex cleaner.

jumbled
Posts: 320
Joined: Mon, 28. Jun 04, 08:22
x4

Post by jumbled » Sat, 2. Oct 10, 04:12

MarkusXL wrote:Now that's done, I'm ready to start a new game with XTM .7.5 and Ashley's Fabs AND my downloaded ships AND Complex Cleaner!!

I started with a clean slate and re-installed everything:

1. Fresh Game install
2. Patch up to 2.5
3. Bonus Pack
4. EMP
5. Plugin Manager 2.12 (the "Lite" version did not work for this at all)
6. XTM .7.5
7. Ashely's Fabs
8. Test test test ALL OK - made a Backup Folder

9. Downloaded a bunch of ships and installed them
10. Test test test all ok.
This is probably way late to be of any help to you, but... I'm assuming item #4 is the community EMP pack found in here, right? Did you know XTM has its own copy of EMP included, and installing the community version is actually NOT recommended? It might be causing you some of your troubles. ;)

biliskner25
Posts: 11
Joined: Thu, 17. Apr 08, 00:57
x4

Post by biliskner25 » Sat, 3. Dec 11, 12:34

jumbled wrote:Could you please explain the actual math behind crunching mines? I use the MS Excel spreadsheet "Complex Calculator", which works wonders for me to figure out what and how many of everything I need to make a balanced complex, but fails after crunching because ore/silicon mines get crunched sometimes to S size and lose fractions of their output along the way.

I'm also discovering a lot of "fuzzy math" in here which goes far off from your original estimates of 1 to 2 % loss.
etc etc..

after some extensive math and review into Gazz's code (i'm not a programmer so excuse my mistakes please) it appears the newly created Ore/Silicon factories are assumed to be Yield 13.

Each factory S therefore produces 1 ore per 43 secs (or 2 per 86secs if you want to be really pedantic)

Therefore a yield 40 L ore mine.. producing 20 ore every 60 secs (1200 per hour) should be converted to a size 14 factory (1200/3600*43)

How gazz achieved this and helped to reduce fractions was to multiply Product per cycle by 10000 and then divide it by a number (263 in the original i think) to reach his target factory size..

However.. this number is far too large.. and ends up underestimating your factory size by anywhere from 5 to 21% (in the above example you'll only get a size 12 instead of 14 factory).. and it's horrible at small yield asteroids.. i've edited the portions so that they more closely reflect the yield of the original mine.. (and also added the ability to crunch nividium mines in ashley+xtm) This could possibly be a conflict with mods or one of the mods (Ashley's XXL or XTM) changed cycle times in some way?

Edited file available on request.

Changes made plugin.gz.CmpClean.crunch:
$Mine.Fraction.Nividium added
Nividium filtering removed
Code changes to make using in game scripter easier -_-

Increased multiplier to 100000 from 10000
Ore divisor changed to 2326 instead of 263 (average of 13% increase)
Silicon divisor changed to 582 instead of 66 (another 13% increase)
Terracorp Nividium mines added to crunch list.. divisor 19

Major changes below

Code: Select all

Line 70:
$useore = $Station->uses ware {Ore} as product
  $usesil = $Station->uses ware {Silicon Wafers} as product
  $usenv = $Station->uses ware {Nividium 15_2} as product
  if $usenv OR $useore OR $usesil 
    skip if $Station->get local variable: name='GZ.FACTORY.MODULE'
      $Station->set local variable: name='GZ.CC.REAL.MINE' value=[TRUE]
  end
   
Line 294:
if $Station->get local variable: name='GZ.CC.REAL.MINE'
  gosub Find.Station.Size.Mine

Find.Station.Size.Mine:
$Dummy1 = $Station->get number of products per cycle
$Dummy2 = $Station->get production cycle time: account for secondary resources=null
* = cycle time in sec, even if out of resources
$Dummy3 = 0 
 
if $Station->uses ware {Ore} as product
  $Dummy3 = 2326 
  $Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Ore 
  $Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3 
  $Mine.Fraction.Ore = $Factory.size - $Dummy1 
  $Factory.size = $Factory.size / $Dummy3 
   
else if $Station->uses ware {Silicon Wafers} as product
  $Dummy3 = 582 
  $Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Silicon 
  $Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3 
  $Mine.Fraction.Silicon = $Factory.size - $Dummy1 
  $Factory.size = $Factory.size / $Dummy3 
   
else if $Station->uses ware {Nividium 15_2} as product
  $Dummy3 = 19 
  $Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Nividium 
  $Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3 
  $Mine.Fraction.Nividium = $Factory.size - $Dummy1 
  $Factory.size = $Factory.size / $Dummy3 
end
endsub

Kimdino
Posts: 17
Joined: Fri, 7. Dec 12, 03:45

Post by Kimdino » Thu, 24. Jan 13, 12:05

Hi folks,

Are there any experts still monitoring this thread?

I have been trying to install Gazz's mod but am having problems. I am using ver 2.5 of X3R (LGP edition) with XTM 0.7.4 installed. After several attempts at installing the mod version of CC (as detailed below) I now have the script version installed and it works perfectly. All CC variants were d/led from http://www.hentschke-keramik.de/x3scripts.php3 as I assume this page holds the latest versions?

I have tried placing the cat & dat files in /opt/x3/mods/. On doing this mod appears in the 'Mods' selection dialogue selected from the games startup window. I click on '32' (as the correct version for my setup?) on starting the game, loading my latest save, resaving, closing down, restarting and loading the new latest save there is no sign of the 'commands->Custom' button in my ship menu. I have searched through the ship menus, all reports and options are as before CC was installed. The 'Mods' dialogue did already contain an entry 'its_arg_cp_mod_v1c', might this upset things?

I then removed 3?.?at from the mods directory and tried the fake patch method. A listing of '/opt/x3/' revealed that the directory contained 01.cat & 01.dat -> 11.cat & 11.dat. So I renamed a copy each of 32.cat & 32.dat to 12.cat & 12.dat respectively. Other than the business with the 'Mod' selection dialogue I repeated the above procedure. And had the same lack of result.

I have tried the above (with a few variations) several times with no luck. I have tried both the 'zip' & 'spk' versions'.

This is when I tried the script version and everything came up properly straight off.

One thought that I had involves 'What actually are the CAT & DAT files?'. Do they hold data for the X3 programme code or are they an extension to it? If they are executable binaries, then do they make OS specific calls as this would account for the problem. Has anyone successfully installed this mod on any OS other than MS-Windows?

The script version is very useful but I have a SuperComplex in the planning stage. I would MUCH rather fly below giant refrigerators than thread my way around a mass of asteroids and pipes. Thus I would really like to be able to use the 'crunch' function'. Is anyone able to help me get the mod version working, please?

Cheers, Kimdino

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Thu, 24. Jan 13, 16:49

Kimdino wrote:I have tried placing the cat & dat files in /opt/x3/mods/. On doing this mod appears in the 'Mods' selection dialogue selected from the games startup window. I click on '32' (as the correct version for my setup?) on starting the game, loading my latest save, resaving, closing down, restarting and loading the new latest save there is no sign of the 'commands->Custom' button in my ship menu.
Got a tractor beam?
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Kimdino
Posts: 17
Joined: Fri, 7. Dec 12, 03:45

Post by Kimdino » Mon, 28. Jan 13, 10:34

Hi Gazz,

Glad to see you're still on the case. I know a few software companies who could take a lesson in LTS from you. :thumb_up:

I kept trying and it now works. As a 'Mod' btw. Not sure what I had done differently this time so can't say what was wrong before.

I carry a tractor beam as standard equipment on all ships >= M6. Who knows, I might accidentally cap a big ship that needs towing to safety. :o

For anyone else in a like position stumbling across this thread, Yes this mod IS compatible with the linux version of X3R.

Gazz: thanks for a good mod.

Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 » Sat, 11. Jan 14, 19:38

Heya, great mod, does wonders for my old machine in the fps department got a few questions I can't seem to figure,

- Mines
Would it be okay to crunch alot of small mines with low yield, and they would eventual make a okay output? or should I only use the usual 30 yield mines or above?

- Modules
is it possible to actual have 2 diffrent modules in 1 sector?
like 2 independent factorys.

cheers

Kimdino
Posts: 17
Joined: Fri, 7. Dec 12, 03:45

Post by Kimdino » Sat, 11. Jan 14, 21:13

Re. Mines
I believe it would. Beware of computer load though. There seems to be a practical limit on factories per sector dependent on the power of your computer. Beyond this the game seems to start crashing a lot when you are in sector.

Re. Modules
Yes. In fact it becomes necessary when building very large factory modules. The system is limited in distance that it can connect, the workaround is to build and then join separate modules.

Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 » Sun, 12. Jan 14, 08:41

- Mines
Umh. not sure you understood, but I gave it a try,
crunching all the small mines togther with the big ones, it gave a bigger yield,
I was afraid that puttling like a yield 3 ore mine would reduce the number of productcs or something like that, that the crunched mine would make :) (normaly you would never put a mine on a yield 3 cause it would cost more engergy cells that it would produce ore to sell)

But it just add more factories, so from now on im going to crunch all does yield 3 - 20 mines togther :D it really increases my fps alot


- Modules

Can't figure out how to make 2 separat modules, it just seem to make 1 what ever I do, I've tried to run the Ignore command on the first module but it dosnt seem to work on it

Post Reply

Return to “X³: Reunion - Scripts and Modding”