:X3: Online Complex Calculator version 2.5.5

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

Post Reply
User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

:X3: Online Complex Calculator version 2.5.5

Post by em3e3 » Sat, 12. Jan 08, 21:45

Nov. 17, 2009 Update - Major update! I've added drop-down boxes for selecting races, sectors, and the choices influence the values for the SPP and Mine Yields!

Wow, this community is amazing. We now have a German version of the calculator, with much thanks to rohrbecka and his team (X-Trem, Bown, Han Zulu, zazie, Chrissi82) for translating. You can find the page at http://www.altanetworks.com/x3/x3tcoccg.html. The support page for the German version is available at http://forum.egosoft.com/viewtopic.php?p=2716376.

I know DEADBEEF. put a lot of work into converting my original X3 Online Complex Calculator into one that was updated for Terran Conflict, and he implemented something I had wanted to do for a long time - saving and retrieving the factory list - so many thanks to him.

Without further ado:

Edit [27th Dec 2018]: The website has been archived by the wayback machine, link below. X2-Illuminatus

X3TC: http://web.archive.org/web/201511070022 ... tcocc.html
X3AP: http://web.archive.org/web/201512301454 ... apocc.html

Edit [08th June 2016]: Now also outdated The domain altanetworks.com expired, the server is still there though. You'll find the server addresses below. X2-Illuminatus

http://66.39.35.164/x3/x3tcocc.html - X3:TC calculator
http://66.39.35.164/x3/x3apocc.html - X3:AP calculator

Please note that the "make shorter" feature doesn't work here anymore. When posting long complex plans in the forum, please use url-tags instead. X2-Illuminatus

Image

Old / Outdated links

X3:TC Online Complex Calculator, English version 2.5.7 @ altanetworks.com
X3:TC Online Complex Calculator, German version 1.7.7 @ altanetworks.com
X3:TC Online Complex Calculator, English version 1.7.0 @ grangegame.co.uk
X3:TC Online Complex Calculator, English version 2.1 @ wolfsburg.de
X3:TC Online Complex Calculator, German version 2.1 @ wolfsburg.de

Also, still available:
X3 Online Complex Calculator
X3 Online Complex Calculator, French version
X2 Factory Loop Calculator

Enjoy!

Instructions
Starting at the top, is the 'Clear All' button, which clears all the selected factories. To the right is a drop-down select box to choose the race of the sector you plan on building in, and another drop-down select box that has the filtered list of that race's sectors, with sun output percentages.

Then, in each row of the table, there is a drop-down select box for 'Factory', 'Race', and 'Size'. Select the Factory, then the Race, then the Size. The wares that the station produces and requires is automatically shown at the bottom of the page, along with the profit and loss, total complex cost, Ancillary Cost field, a breakeven time, and the total station count. More on those later.

As you add additional factories, you'll notice that the Wares Produced and Used will change, showing you if you have a surplus of wares (in green), or a shortage (in red). The profit from selling the surplus is automatically shown in the 'Gross Profit' field, and the loss from buying resources is shown in 'Gross Loss'. Then, gross profit - gross loss is shown in 'Net Profit/Loss'

Changing the 'Buy' and 'Sell' prices will also change the profit and loss, but it will not let you set a price above maximum, or below minimum. And, if you want to see those min/avg/max prices, just move your mouse over the name of the ware.

'Leak' is probably something that you won't use much, but when checked, will include the profit from selling all of that ware produced at the 'Sell' price, and buying the needed quantity at the 'Buy' price.

Next, is the 'Ancillary Cost' field, which allows you to include extra cost items, like initial startup capital, ships, etc. The cost is included in the 'Total Complex Cost'. 'Breakeven' will show you how long the complex will take to pay itself off. Shorter is better!

And finally, the 'End Product' section. Certain wares, like weapons, shields, and missiles, can be sold to the NPC Equipment Docks, but also are used in the player's ships. By selecting one of the displayed end products, you are shown how the cost of the complex compares to just buying the product outright from NPC factories, at the 'Buy' price you have entered.

Anything I didn't cover, or didn't explain clearly enough? Feel free to tell me!

UPDATE HISTORY
--------------------
2.5.7 - Added 'a sunny place' sector and support for 450% sun sector
2.5.6 - Tweaked the behavior of the buy/sell prices for wares
2.5.5 - Added Terran Water Purification Plant, fixed Pirate PBG Forge, added Anarkis Crystal Free SPP, added Terran SPP back in
2.5.4 - fixed a rounding error in the Ore mine production calculation
2.5.1 - Adjusted the cycle times, production, and consumption of the SPPs
2.5.0 - New select boxes for races, sectors, sun yield, mine yield, made changes to loading and creating permanent links
1.8.1 - Implemented 'Grouped' factory select lists, split wares and factories into separate JS files
1.7.9 - made a few JS improvements, added L-sized Crystal Fabs
1.7.7 - tweaked end product calculations
1.7.6 - Minor grammatical changes
1.7.5 - changed Soja Husk requirement of Boron QTF, added menu for other pages
1.7.4 - sped up the loading of large saved complexes
1.7.3 - added links for common loops, US number formatting for Station and Total costs
1.7.2 - fixed the prices for the Cluster Flak and Flak Artillery Array wares.
Last edited by em3e3 on Thu, 19. Jan 12, 08:55, edited 30 times in total.

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

Post by jlehtone » Sat, 12. Jan 08, 22:31

Seems to work (I'm too tired to click-click anything real right now) with Firefox, but not in IE. Without IE is fine, but you might want to check the other browsers.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Sat, 12. Jan 08, 23:27

jlehtone wrote:Seems to work (I'm too tired to click-click anything real right now) with Firefox, but not in IE. Without IE is fine, but you might want to check the other browsers.
Fixed. I needed to add 'type="text/javascript"' to the <script> tag. Maybe it will work in Vista now?

Edit: confirmed that IE doesn't like 'getElementsByName' if there is more than one element with the same name. I will find a workaround.
Last edited by em3e3 on Sat, 12. Jan 08, 23:57, edited 1 time in total.
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Sat, 12. Jan 08, 23:40

nope. gives an error every time. the line and character vary, but it always says "error: 'document.getElementsbyName(...)[...]' is null or not an object

i tried some trickiness like trusted sites and run as administrator but *shrug*

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

Post by Merroc » Sun, 13. Jan 08, 00:24

Naturally (well i hope for some) i was interested when i read the title. A shame it doesnt really do much in opera. All i can do is enter station, then i cant find a button or anything to calculate. And if its done automatically, it doesnt do so :). Clicking on that "Endproduct: None" radiobutton made it freeze for a sec or 10. Pressing enter when entering a quantity of a station made it reload the page with a nice address link, but a clean page.
Also i cant enter a yield for mines :).

On the plus side, i dont get any random errors and i am using Vista (so sue me).

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Sun, 13. Jan 08, 00:32

Yeah, still working on the IE bugs. I got rid of the errors, but I still need to find a workaround for setting the 'yieldfield'.

And yes, the javascript should do the calculations automatically. Keep the feedback coming!

Edit: Okay, working in both Firefox 1.5 and IE6 on Windows 2000, will test FF2 and IE7 on XP next.
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Sun, 13. Jan 08, 01:16

It actually works now (Vista, IE7). It displays some code at the bottom of the page though, just in a textbox:

true, <input type="text" size="4" value="0" name="yield" onChange="update();" disabled>

although the yield box works even so, orgasmic.

criticism: when playing with yields energy cell consumption can stretch out too many decimal points, it moves the boxes around and looks weird. two decimal points would be good...

i assume the 'leak' box lets the complex sell off excess resources in a category, but it seems to have no effect.

the text which says "the cost of this loop will always be more" etc etc. screws up if theres more than one product. I entered a 125mj shield/lasertower loop and whichever product i selected it would say the cost was always more than buying available otherproduct.

'this page was generated in' doesnt work

finally, there should be a 'clear all' button.

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Sun, 13. Jan 08, 02:01

Okay, I went ahead and removed the debug box, used it to fix the IE7 stuff.
Strange that the e-cells consumption shows so many digits, even though I am using the Math.round function...

Then there's 'leak': The idea is, if this box is checked, that you actually want to sell the particular intermediate product that you are producing, and then buy from the NPC stations at a lower price. You'll notice that if you have it checked, and compare the gross profit & loss per minute fields to when it is unchecked, they will change. If you leave it unchecked, the script assumes that you will buy (or sell) the shortage (excess) at the listed prices.

Not sure about the loop cost calculator, as the assumption is you will only be choosing one end product. I'm open to suggestions...

Yeah, shoulda had a reset button from the start. It's there now!
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

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

Post by exogenesis » Sun, 13. Jan 08, 03:35

First impressions - very neat & clear interface + looks to be easy to use,
good job.

Slight rounding problem with some wares , but probably accurate enough.
Perhaps use 'per hour' rather than 'per minute' for more accuracy?

eg with multiplying 0.42/min bIRE by 4676 selling price = profit 1964 / min,
should be 0.4166 x 4676 = profit 1948 / min

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Sun, 13. Jan 08, 04:12

exogenesis wrote:First impressions - very neat & clear interface + looks to be easy to use,
good job.

Slight rounding problem with some wares , but probably accurate enough.
Perhaps use 'per hour' rather than 'per minute' for more accuracy?

eg with multiplying 0.42/min bIRE by 4676 selling price = profit 1964 / min,
should be 0.4166 x 4676 = profit 1948 / min
Very good idea. I don't know why I liked to see the per minute numbers, but I prefer accuracy. I've updated it, as well as fixing the 'clear all' button.
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

User avatar
fiksal
Posts: 16560
Joined: Tue, 2. May 06, 17:05
x4

Re: :X3: Online Complex Calculator ready for testing

Post by fiksal » Sun, 13. Jan 08, 08:18

em3e3 wrote: It's ready for testing, and I encourage feedback, advice, and debugging.
seem to run on Firefox 2.0.0.11, W XP


so far I got a usage comment.

I've been using an Excel complex calculator, and it's been fairly convenient, mostly because I can copy, save my factories and data in notepad(or even another excel doc) and paste them back into the program.

IE/Firefox however doesnt have the ability to copy Input fields as text.
Gimli wrote:Let the Orcs come as thick as summer-moths round a candle!

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Re: :X3: Online Complex Calculator ready for testing

Post by em3e3 » Sun, 13. Jan 08, 18:16

fiksal wrote: I've been using an Excel complex calculator, and it's been fairly convenient, mostly because I can copy, save my factories and data in notepad(or even another excel doc) and paste them back into the program.

IE/Firefox however doesnt have the ability to copy Input fields as text.
Yes, I can see why that would be handy. I can probably come up with an 'Export to tabbed text' feature. Thanks!
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

Rapier
Posts: 11373
Joined: Mon, 11. Nov 02, 10:57
x3tc

Post by Rapier » Sun, 13. Jan 08, 18:56

exogenesis wrote:First impressions - very neat & clear interface + looks to be easy to use,
good job.

Slight rounding problem with some wares , but probably accurate enough.
Perhaps use 'per hour' rather than 'per minute' for more accuracy?
I agree with both parts. The particular thing I've noticed is the figures for mines. These don't quite match my recollections of production rates, I suspect due to some rounding in your formulas. The relationship of yield to production is notoriously difficult to model mathematically; my preferred method is to create an actual table of yield and cycle time.
Rapier - The Orifice of all Knowledge

Godwin's Law is not one of the Forum Rules.
Search just the forum with Google

Skoll
Posts: 10
Joined: Wed, 9. Jan 08, 06:37

Post by Skoll » Sun, 13. Jan 08, 19:03

Excellent, I've been looking for an online factory calculator. I also really like that it works with just 1 factory, not just complexes. One of the other spreadsheets I downloaded only seemed to give output if you had 2+ factories.

One thing I think it could use, mostly to help a noob like me, is a list the avg price of each good. Either on the page, or on a link to another page, or in a popup, or in a hover over any of the good names. The reason is that the form asks for the buying/selling price of goods and I always base those on the average. If I have my own ships buying goods automatically (buy @ best price) then they will be getting the goods at below average. If I am letting the AI stock my factory then I usually set my buy price at just over average.

To use your calculator I find that I have to go off and look up the average price for everything.

Or is it highly recommended that I use the prices you list because those are in some way better than what I'm doing? Actually where are you getting your Buy/Sell prices from?

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

Post by jlehtone » Sun, 13. Jan 08, 19:08

Rapier wrote:The relationship of yield to production is notoriously difficult to model mathematically
I don't think so. Yes, the equation does contain a round operation, but the function does not have to be continuous anyway, as you only need to evaluate it for integer yield values.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Sun, 13. Jan 08, 20:14

@Rapier - I'm using this formula, taken from this page.

Code: Select all

Basic_cycletime = rounddown( BASETIME / (Yield + 1) ) + 1 seconds
Multiplier = rounddown( 59.9 / Basic_cycletime ) + 1
Cycletime = Multiplier * Basic_cycletime
Products per cycle = Multiplier * Fab_size
I then divide 'products per cycle' by 'cycletime', multiply by 3600 seconds to get the products per hour, then round to two decimals. Maybe I should round to no decimals?

@Skoll - that is a good idea, I like the idea of a hover showing the min, max, and average price. The script is smart enough to not let you put in a price that is lower than min or higher than max, if that helps.

Also, I made some assumptions about the default buy and sell prices. The buy price is based on the lowest price the NPC stations will pay for that ware as a secondary resource. The 'sell' price is based on the highest price the NPC stations will pay for the ware as a secondary resource, unless the ware is flagged as an 'end product'. That means that only Trading Stations and Equipment Docks will buy that ware, and since they only pay average price, the 'sell' price is set to average price.

You've guys have given me a lot more to do today!
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

doublehue
Posts: 22
Joined: Tue, 25. Sep 07, 11:54

Post by doublehue » Sun, 13. Jan 08, 20:28

:thumb_up: :thumb_up: :thumb_up:

Nice work!

doublehue

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

Post by jlehtone » Sun, 13. Jan 08, 20:53

em3e3 wrote:I then divide 'products per cycle' by 'cycletime', multiply by 3600 seconds to get the products per hour, then round to two decimals. Maybe I should round to no decimals?
Forget that multiplier part. 'Fab_size*3600/Basic_cycletime' yields the same result.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Sun, 13. Jan 08, 23:13

@Jlehtone: Thanks, I knew somehow the 'multiplier' cancelled out, but I wanted to make sure the formula worked as I found it. But I did make the change in the latest revision.

@doublehue: Thanks!

@Skoll: Got the min/avg/max price popup included, works on Win2K in FF1.5 and IE6.

I was surprised to see how high the 'buy' price was, compared to the 'min' price! I might lower the default 'buy' price, based on feedback...

@fiskal - still working on the export feature.
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

Rapier
Posts: 11373
Joined: Mon, 11. Nov 02, 10:57
x3tc

Post by Rapier » Sun, 13. Jan 08, 23:28

em3e3 wrote:@Rapier - I'm using this formula, taken from this page.

Code: Select all

Basic_cycletime = rounddown( BASETIME / (Yield + 1) ) + 1 seconds
Multiplier = rounddown( 59.9 / Basic_cycletime ) + 1
Cycletime = Multiplier * Basic_cycletime
Products per cycle = Multiplier * Fab_size
I then divide 'products per cycle' by 'cycletime', multiply by 3600 seconds to get the products per hour, then round to two decimals. Maybe I should round to no decimals?
I'm not aware that anyone has found a formula that works for all yeilds. IIRC this one works best for the higher yields but is less accurate for low yield, if you round differently you can make it better at low yields but nit at higher ones. THis formula is probably as good as any, the other option is to tabulate the yield and cycle time for silicon and ore and use those; that is a lot more work though.
Rapier - The Orifice of all Knowledge

Godwin's Law is not one of the Forum Rules.
Search just the forum with Google

Post Reply

Return to “X Trilogy Universe”