Complex Calculator V3.0!!

General discussions about the games by Egosoft including X-BTF, XT, X², X³: Reunion, X³: Terran Conflict and X³: Albion Prelude.

Moderator: Moderators for English X Forum

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Fri, 25. May 07, 13:45

You want to know what ill do with this long story?

Let me tell you, ill write down for myself telling myself to read this when... lets call it awake, cos im not really that right now. And when im at my own computer, then as i have told myself by then re read everything, re-examine everything, etc, etc. Fix what needs fixing. Stuff like that, you know ;).

Also typo's or more commonly known as bugs in such a sheet/macro are possible, its people like you, mostly bald people i guess... that i rely mostly on, on getting them out.
A shame i wasnt around at all last week, i might have been able to save you from your baldness :(

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

Post by jumbled » Sat, 26. May 07, 01:28

Merroc wrote:Also typo's or more commonly known as bugs in such a sheet/macro are possible, its people like you, mostly bald people i guess... that i rely mostly on, on getting them out.
I'm not bald, I'm "Follicle Deficient"! :D

No problem. At least now things seem to work a little better and I feel more confident to start planning my financial enterprise. In so doing, it's likely I might lose the rest of my hair, but then at least I won't have to worry about buying new combs all the time.

:lol:

I'm a former programmer, myself, so I know the perils and pitfalls of making good software. I really enjoy the work you and others put in to make the "X" experience so much fun, and hope to see more of it in the future!

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Mon, 28. May 07, 20:54

Uhh right, i read it again.

Im in the VBA editor now, but for fear of making it worse in my quest to correct it, would be usefull if you provided line numbers where the errors are.

I know i made it myself, but its a loooong time ago ;).
Also your "You made a typo in an IF statement" is very helpfull, you should realise why im sarcastic ;).
The error probably sneaked in from the V1 to V2 change, when i edited loads of the columns and tried to fix the macro accordingly (well some parts at least, others i rewritten).

And about your NPC S type factories needed question. Not entirely sure what you mean. Its suppose to work that e.g. you have a Space Fuel loop, closed one. You can use this number to see how many buyer stations (in this case probably Pirate Bases) you need to sell your complete production.
Or if you have an EC shortage, you can see how many NPC SPPs you need to buy enough EC. It basically works by taking the "For Sale / Hour" or "To Buy / Hour" and divide it by a (fixed) number in the raw data sheet. If your the first doesnt change, then that wont either...

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

Post by jumbled » Tue, 29. May 07, 02:05

Merroc wrote:Im in the VBA editor now, but for fear of making it worse in my quest to correct it, would be usefull if you provided line numbers where the errors are.
Ok, in sheet 4, Complex Calculator, starting at line 141, this is in my copy now. You'll need to cross-reference with yours to compare:

Code: Select all

        If wks.Cells(nRow1, "AN") = "Ore" Then 'we're looking for Ore to change
            If Not wks.Cells(nRow1, "AR") = "" Then 'For that Ore should be produced of course
                AmountExcess = wks.Cells(nRow1, "AR") 'How much excess Ore is produced
                If AmountExcess > 0 Then 'Only if there is an excess
                    For nRow2 = 2 To 79
                        If wks.Cells(nRow2, "AN") = "Energy Cells" Then 'look for the Energy Cell entry
                            EnergyCells = wks.Cells(nRow2, "AR") 'Excess Energy Production
                                ExcessAdd = AmountExcess * 6 'The amount of Energy which doesnt get used for Energy Cells
                                Temp = wks.Cells(nRow2, "AP")
                                newEnergycells = Temp - ExcessAdd 'How much we have in the end
                                Temp = wks.Cells(nRow1, "AP")
                                newAmountExcess = Temp 'How much Ore we have in the end (usage)
                            wks.Cells(nRow2, "AP") = newEnergycells 'Set EC
                            wks.Cells(nRow1, "AO") = newAmountExcess 'Set Ore
                        End If
                    Next
                End If
            End If
        ElseIf wks.Cells(nRow1, "AN") = "Silicon Wafers" Then 'And Silicon
            If Not wks.Cells(nRow1, "AR") = "" Then 'Silicon should be produced
                AmountExcess = wks.Cells(nRow1, "AR") 'And have an excess (how much)
                If AmountExcess > 0 Then 'Greater than 0
                    For nRow2 = 2 To 79
                        If wks.Cells(nRow2, "AN") = "Energy Cells" Then 'Look for EC entry
                            EnergyCells = wks.Cells(nRow2, "AR") 'What is the excess EC production?
                                ExcessAdd = AmountExcess * 24 'excess Silicon * EC per Silicon
                                Temp = wks.Cells(nRow2, "AP")
                                newEnergycells = Temp - ExcessAdd
                                Temp = wks.Cells(nRow1, "AP")
                                newAmountExcess = Temp
                            wks.Cells(nRow2, "AP") = newEnergycells
                            wks.Cells(nRow1, "AO") = newAmountExcess
                        End If
                    Next
                End If
            End If
On line 146, you used column AK, not AN, so you were looking for the text "Energy Cells" in a column of numbers, not names. This resulted in Ore excess not being taken back for EC, and I would always show ore for sale. And on line 161 (I think), you were looking for the excess amount of silicon (presumably in the For Sale column AR), but taking the number from the output column AO instead. So instead of returning the excess for a EC credit, you took the full output and credited it back. I had to make some assumptions here on your intent, cross-referencing between these two sections, but it seems to work better now.

And again, as I think I mentioned earlier, in your Factories page, and in the Raw Data page, you use an incorrect cycle tme for Hornet missiles. Should be 16 minutes (960 seconds). I found this when I was getting uneven bio usage from the food facts divided into the tech output.

I also noticed you are now using constants in the Factories page, whereas you used formulas in v1.15. Just my personal opinion, but I would think keeping one set of constants (maybe on your Raw Data page) and using formulas based on that everywhere else might make for fewer chances of errors (and easier corrections).
Merroc wrote:And about your NPC S type factories needed question. Not entirely sure what you mean. Its suppose to work that e.g. you have a Space Fuel loop, closed one. You can use this number to see how many buyer stations (in this case probably Pirate Bases) you need to sell your complete production.
Or if you have an EC shortage, you can see how many NPC SPPs you need to buy enough EC. It basically works by taking the "For Sale / Hour" or "To Buy / Hour" and divide it by a (fixed) number in the raw data sheet. If your the first doesnt change, then that wont either...
Maybe... I tend to make completely self-contained loops and the only thing coming out is an end product. What this part might tend to show me is if my loop is incomplete and I need to see where I have "extras" to use up by adding more high-level factories, or if I'm over-doing it and need to take something out, or use a larger size on something to fill in.

The section that confuses me the most is for the EC. It could be because I get credits back for the excess mining, and it gets used first before I "run out" and need more from outside. Therefore, if I add more fabs into my complex, I see odd figures for EC because more of the excess return from the mines is used. I should probably just ignore it until I actually run out of EC internally. Bio and minerals work more to my expectations.

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Wed, 30. May 07, 01:58

First of all, thanks. Ill look into it when i have the time... hope its anytime soon... ;)
jumbled wrote:I also noticed you are now using constants in the Factories page, whereas you used formulas in v1.15. Just my personal opinion, but I would think keeping one set of constants (maybe on your Raw Data page) and using formulas based on that everywhere else might make for fewer chances of errors (and easier corrections).
:lol: :lol: :lol: :lol:

You honestly must be kidding me! :lol:
Trust me, the way i make it is by formula's, however if i keep that sheet in the customer version in full formula's. You can press the "calculate now" button, get some coffee, come back and see its still not done. It might not be now, on my Core 2 Duo, but it was on my old Sempron. In light of users without up to date processors i decided to do it this way. Dont worry, its only full of errors if the formula's are ;).
Also having the raw data in that factory sheet isnt possible either, cos lookups wouldnt work. Basically the factories sheet isnt full of constants, like hell i want to enter everything twice!

jlehtone
Posts: 21814
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone » Wed, 30. May 07, 08:25

@jumbled: You could go through X-Freak Cartman's Komplexprüfer too, just for comparison.

What happens in a complex is simple. Really. The problem is that one should iterate and consider the current stock amounts of every ware and their effect on every step, just like the game does. Dave Toome's standalone has such simulation. Excel has "Solver", doesn't it? No, I do not suggest using it. The assumptions and approximation made in spreadsheet together with user brain are quite sufficient, aren't they? Winnie the Pooh does not play X3, does he? :wink:

There are two types of self-sufficient complexes: the one that produces what it consumes, and the one that consumes only what it produces. The latter works only if at least one ware stock is continuously full. Every factory requires a float. Some just need more float than others.

Simple Goner math. :P
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

John McG
Posts: 553
Joined: Wed, 29. Dec 04, 19:08
x4

complex calculations - silicon mines

Post by John McG » Wed, 5. Dec 07, 12:02

It appears that silicon mines are not included in the complex calculations to see what factories are needed in a complex, is that correct?
We really do need them included as crystal fabs etc. are affected.
Thanks

John McG
Posts: 553
Joined: Wed, 29. Dec 04, 19:08
x4

Beta Kyon Emitter

Post by John McG » Thu, 6. Dec 07, 11:41

You don't appear to have Beta Kyon Emitter factories in your excellent 'complex calculator'.
Are you thinking of adding them?
Thanks

pjknibbs
Posts: 41359
Joined: Wed, 6. Nov 02, 20:31
x4

Post by pjknibbs » Thu, 6. Dec 07, 13:02

Eh? Beta Kyon Emitter factories don't exist...unless you're using a mod that adds them, and the Complex Calculator can hardly be expected to include every single station that has been added by all the mods ever created for X3!

exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis » Thu, 6. Dec 07, 14:44

Is Merroc still posting ?

pjknibbs:
Merroc's Excel sheets do include support for Ashley's Fab's, ie XL wepaons fabs,
but Armagedon added Kyons & EMP forges later than Merroc's latest version.

John McG:
Mines are included, why do you not think so?
If you're thinking of 'autofill', Merroc didn't support this cos "don't know what asteroid size you want to use".

John McG
Posts: 553
Joined: Wed, 29. Dec 04, 19:08
x4

Beta Kyon emitters

Post by John McG » Thu, 6. Dec 07, 17:25

The complex calculator supports Ashley's Mod, and you can buy Beta Kyon Emitters at Ashleys Argon Shipyard.

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Fri, 11. Jan 08, 19:06

Just to clarify, which you might have already assumed for me not posting (haha). Im uhh not really supporting this thing much lately (e.g. since the last update i havent touched it). Mostly cos i only visit these forum's like once a month?

Only reason i saw these posts now, cos i needed the link :p.

User avatar
Jimyd
Posts: 207
Joined: Fri, 28. Apr 06, 22:05
x3tc

Post by Jimyd » Fri, 16. May 08, 21:47

Okay I've used this before, but since I have reinstalled my OS and I'm having problems with macros/digital signing for Microsoft Excel.

Does anyone have a quick-easy-to-read one available, or an example to make one for this spreadsheet?

I'm not to smart when it comes to stuff like this.

Slonor
Posts: 648
Joined: Fri, 28. Jul 06, 03:44

Merroc's calculator still works with TC?

Post by Slonor » Wed, 31. Dec 08, 18:06

Is Merroc's complex calculator still valid with TC? If not, are there any other Excel based complex calculator for TC?

http://forum.egosoft.com/viewtopic.php?t=165330

User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious » Wed, 31. Dec 08, 18:18

Somewhat.

It doesn't handle sun percentage, and a lot of new factories are obviously not present (although you could add them, with a bit of fiddling).

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Tue, 3. Feb 09, 22:13

I have been sort of persuaded into looking into this sheet again. And to think i would have some ease and quiet times after i quit wow... :P

Soo... im just gonna do that. No promises though..

Nooo stop hitting me Toaster!! :(

User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious » Tue, 3. Feb 09, 22:35

Good news! I always preferred working in the spreadsheet to the other calculators.

I did update it a bit myself but got bored after the first half-dozen factories :p.

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Thu, 5. Feb 09, 22:12

Right it looks like im going through with this, and as added bonus im making it multi-game-multi-mod compatible :P. Also im gonna make it easy to add data. Easy as it may be, i really dont feel like browsing through 5 games (and perhaps mods) to get the data i need. So i figured why not let you guys work a bit ;).

The idea, I need the following data from all stations in any X game (and if you like a mod), however i dont look at M, L, XL, XXL, XXXXXXXXXXXL, etc. all i need is it all brought down to S sized factories (so if you're looking at a L station, just divide the numbers you get by 5).
Apart from that I need the wares in each game with a bit of information.

The data i need are as followed:
For stations:
  • Race -> quite obvious, for vanila games it can be all 5 of the main races. If you're adding a mod to my data, with stations from another race, please use your race' name)
  • Station (name) -> The name of the station you're adding, two caveats, if you're adding a solar power plant, also add for what sun intensity it is, e.g. Solar Power Plant 150 for a SPP in 150% sunlight. And secondly if you're adding something for a mod Put the station name and mod name in it. For examply say you name your Mod "merroc's added stations" (or simply mas) and your station is called "Pew Pew Lazor Factory", it would be something like "Pew Pew Lazor Factory - mas". Dont worry i still have to actually pay attention to add it, so anything out of the ordinary will be noticed :).
  • Size -> Preferably 1, but if you're adding an XL (10) or 2 sized station you can leave that here. But please dont come up with XXXL stations, stick to vanila lettering, else i dont know what it is :). If you're going from another size but adding it as 1, please note that this affects the cost, input/output and stock of a station!
  • Game -> Note here for which game you're adding, any of the following: XBTF, XT, X2, X3R, X3TC. Most importantly is X3TC ofcourse.
  • Cost -> How much the station costs you to buy at the shipyard.
  • Cycle time (sec) -> how long the cycle is for the production of the goods
  • Product -> what product it makes
  • Output/Cycle -> how many products per cycle
  • Stock -> the max stock of the product
  • Input 1 -> the name of the first (top) resource
  • Input/cycle -> how many of that resource per cycle
  • stock -> the max stock of that resource
  • Input 2 -> the name of the second (middle) resource. If the station doesnt have a 2nd (or 3rd) leave blank
  • Input/cycle -> how many of that resource per cycle
  • stock -> the max stock of that resource
  • Input 3 -> the name of the third (bottom) resource (if your mod has a factory with more than 3 resources, contact me..)
  • Input/cycle -> how many of that resource per cycle
  • stock -> the max stock of that resource
for wares:
  • Ware -> the name of the ware. If you're adding a new modded in ware, please add it in the name as followed: For examply say you name your Mod "merroc's added stations" (or simply mas) and your station is called "Pew Pew Lazor Factory", producing "Pew Pew Lazor"s it would be something like "Pew Pew Lazor - mas".
  • Game -> The game from which you're recording data for this ware
  • Min -> minimum price of the ware
  • secondary Min -> (optional) the so-called secondary min price of the ware, used for npc secondary resources prices if im not mistaken. You can get this through the script editor
  • Avg -> average price of the ware
  • Secondary Max -> (optional) the so-called secondary max price of the ware, used for npc secondary resources prices, if im not mistaken. You can get this through the script editor
  • Max -> the max price of the ware
  • Size -> how much cargo space the ware takes in your hold
  • Transport Class -> the TC of the ware
Most of this information can be gathered from the script editor, and ill probably write myself a script for that as well, however im aware that there are script geniouses out there who would do that faster, more efficient and better than me. Im hoping they are reading this thread as well :).
Please note that if you're adding a modded in station with a new ware, also add the wares itself.

Proper use of capital letters are well appriciated (aka start every new word with a capital letter).

Now i might be a bit lazy (or i just also want to enjoy the game and maybe some RL too :P), but im not 100% stupid, so i made a nice template for you guys, with 2 examples. downloadable here:
http://homepage.uvt.nl/~s108174/template.xls (26KB)

Filled in templates can be mailed to: rjeckmans@hotmail.com (spam on the other hand is unwanted)
And of course as soon as i have something ill note it here, in fact ill update the first post with this information as well as a list with information i still need.

Thanks for your help :)

Merroc
Posts: 5920
Joined: Mon, 16. Feb 04, 20:01
x3tc

Post by Merroc » Mon, 9. Feb 09, 18:59

Right, figures :D. Everyone is just as lazy as me...

But meh, i did want to do it. So i did some gathering myself, used multiple sources, etc. But ive got X3TC data, i hope :P.

Anyway, after an afternoon of coding, checking, copy/pasting, etc etc. my brain is hurting. Oh and i also made a beta V3.0 sheet :).

I'd like to share it with you for now, note that not all functions work (as intended).
Im also not going to make the mistake of having 2 million updates in 24 hours. Im gonna relase this, work on it some more and when i feel like it make a beta 2 with errors you guys found :P.

So, without further adjeu-something: http://homepage.uvt.nl/~s108174/Complex ... ta%201.rar (167 KB)

As always with a beta, not everything is working. look at the TODO list to see what doesnt work.

User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious » Mon, 9. Feb 09, 20:19

Solar power plants on any line but the first seem to give an error.

Post Reply

Return to “X Trilogy Universe”