Download Mad Hatter's Profitable Economy Mod v1.0

The place to discuss scripting and game modifications for X²: The Threat.

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

Mad Hatter
Posts: 246
Joined: Fri, 5. Dec 03, 16:08
x3

Download Mad Hatter's Profitable Economy Mod v1.0

Post by Mad Hatter »

Mad Hatter's Profitable Economy v1.0 is done. :D

The mod is complete, and is now online at xscripting.com.

You will need to unpack your game to use this mod. Here is where I learned how:

Tutorial: How to Unpack your game for Modifications in X² by Shadowtech

Please let me know if you find any mistakes, and I'll fix them. (My eyes are crossing from looking at it for so long.)


Here is the info from the readme:
This modified spreadsheet contains new product and factory prices, and is intended to provide a solution to X2's economy problems. As the game stands, all factories are on a linear progression. This means that as you buy more advanced factories, the investment and resource costs go up, but profit remains the same. This model is based on a curved progression and is primarily based on the factories price. A more expensive factory will provide more profit per minute, but a longer ROI cycle.

This fix is accomplished entirely through changes in product and factory prices. The one thing that changes when implementing this fix is game balance. Some of you may have seen my first economy proposal. That one was made to fix the profit curve, while maintaining game balance. It wound up in the trash once I found out that Egosoft had hard coded the factory consumption ratios, and based them on price, not production.

While we all thought the economy ran on 15 Energy Cells / min. The truth was that everything ran on 240 credits worth of energy / min. So, if you set E Cell cost to half normal - the universe would consume at twice the normal rate. Which makes all price changes to production resources completely pointless. (Welcome to government imposed equality.)

Since I can't change prices on any resources used for production - I can't curve the economy AND bump it to fit the current price structure we're all used to.

This new fix implements the same profit and loss curves of my previous plan, but leaves all production product Avg Price equal to the current X2 economy. In those cases, factory prices changed - sometimes drastically to fit the curve. Some went up - Some went down. Overall, the game will be more challenging with this fix - so it won't be for everyone. Low end equipment tends to cost similar to original. High end tends to cost more, and prices vary sharply with stock levels. I wish that didn't happen, but the Factory Stock Limits are hard coded by Egosoft as well. So anything with an 2/2 limit will sell at Avg Price with 1 in stock, and Min Price with 2 in stock. (Docks are still at Avg.) In most cases for high end items (125MW shields, PPC's, etc.) the min price is comparable to the old prices. Avg is higher. Max is way higher, and will only come into play if you let the docks buy from you. (Welcome to government assisted buying.) I'm sorry it has to be that way. But all the values to fix those issues are hard coded. PPC's are much more expensive now. I'd suggest making them more powerful to justify the cost.

All of the price settings are calculated with the following formulas:

Max Profit / Minute = SQRT(FactoryCost) / (2 - (Factory Cost / 8400000)) (The more expensive the factory - the higher the potential profit per minute)
Min Item Price is set to equal a x% loss based on worst case resource costs, where x= 0.6 + (Factory Cost / 16800000) (Less expensive factories are subject to higher % loss under poor management.)

The only exceptions are Space Fuel and Space Weed which behave as if their factories cost 75% more than actual, and Swamp Plant and Squash Mines which have a 50% bonus. This bonus is to reflect the added risk of transporting these goods. If there is no incentive to trade in illegal goods - nobody would ever bother. (I also significantly raised some of the prices on these so they would be more profitable.)

All repeated products have their prices scaled to factory cost of the first race to include it. (Argon -> Boron -> Paranid -> Teladi -> Split)
In some cases the racial variation in factory price had to be narrowed a bit. While they all have the same max profit - their avg profit varies slightly (and so does price)

So, what's the bottom line?
Basically, you get to play with an economy that isn't flat. If you invest more, you stand to make more. There is now a reason to build high end fabs. And the better you manage them, the more you'll make. If you just plop down a bunch of cheap factories, and manage them horribly - you can even take a loss.
This should appeal to anyone who is sick of running Solar Power Empires.
The difficulty will probably be higher than normal. So newbies may find it difficult, but players who really want to "Think", or wish that starting on Extreme mode actually DID something will probably really like it.
the_conquerer_cgi
Posts: 309
Joined: Fri, 26. Dec 03, 16:12
x3tc

Post by the_conquerer_cgi »

You know Mad, I wonder if there's not something to be had in the PDB files in the cut directory.
Mad Hatter
Posts: 246
Joined: Fri, 5. Dec 03, 16:08
x3

Post by Mad Hatter »

Unfortunately, I don't know anything about how this stuff works or how to get into those other files.

(I'm a developer, but I build custom business applications for Lotus Domino - which is distinctly different from this.) :)

I wanted to get into that MRUvalues.pck hoping that had something to do with resource usage, but both StoneD's and OlisJ's unpacking apps crash when you try to unpack that one. (However, if JonHandby was correct about hard coding, then this is probably not it.)

Let me know if you find anything.

I think I'm going to take a look at the sound values in TBullets. I saw some posts that said the firing sound is in there. I saw a pile of sounds in one of the folders. If I can find those, I may try to take the firing sounds from FreeSpace2 and swap them in. The guns in X2 just sound so terribly whimpy...

I can't stand listening to a capital ship battle and having it sound like *piew, piew, piew* :P
the_conquerer_cgi
Posts: 309
Joined: Fri, 26. Dec 03, 16:12
x3tc

Post by the_conquerer_cgi »

Mad Hatter wrote:Unfortunately, I don't know anything about how this stuff works or how to get into those other files.

-snip-

Let me know if you find anything.
Hey, well we're in the same boat. Truth be told I don't have a clue about those files either.
Mad Hatter wrote:I think I'm going to take a look at the sound values in TBullets. I saw some posts that said the firing sound is in there. I saw a pile of sounds in one of the folders. If I can find those, I may try to take the firing sounds from FreeSpace2 and swap them in. The guns in X2 just sound so terribly whimpy...
Yeah, that was me. :lol: Firing sound is in Tlasers column 9 I think. Hey, get MSN Messenger. My account is in my profile, I'm on all the time.
Fetch
Posts: 33
Joined: Fri, 30. Jan 04, 01:08
x2

Post by Fetch »

Was something done to Cycle times and resource usage as well as price variations? I'm trying to set up a Bliss Place chain, and have noticed something odd...

Previously, it took 60 energy and 8 Swamp Plants to make 1 Space Weed.

Now, I'm sitting here with 12k energy and 532 plants in the station, and it still hasn't gathered enough resources to start production. Is this intended? I'm sure hoping it spits out more than 1 space weed, especially considering that the cycle time is 7:41:00.

I'll post again when it gathers enough to produce and let you know what I find if this is a bug.
Fetch
Posts: 33
Joined: Fri, 30. Jan 04, 01:08
x2

Post by Fetch »

OK, definately something weird going on.

Needed Resources at 100%

13905/15000 Energy Cells present
1042/2000 Swamp Plants present

The Space Weed factory still hasn't started producing.

However, I did notice that all NPC Bliss Place factories still use the old resource consumption rates. Also, the # Products for player owned Bliss Places is listed as 60, though the station can only hold 42... that's likely why it won't produce.
Mad Hatter
Posts: 246
Joined: Fri, 5. Dec 03, 16:08
x3

Post by Mad Hatter »

I'll check this and fix it ASAP.


Edit: I just checked mine, and the levels are fine. I have 5000 ecell max like normal, and 666 swamp plant limit. (The 42 limit is normal for the higher spaceweed price).

A few questions:
Did you change any of the price values?
Did you start a new game or add the changes to an old one?
If it was a saved game, did you already own the factories before adding the economy mod?
Sholl
Posts: 1
Joined: Sat, 17. Jan 04, 18:32
x2

Post by Sholl »

Thanks for the link top the tutorial. I have been trying to find out how to unpack my game for a week.
User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Post by Storm_Front »

I just started a new game with this mod installed, no scripts, and I'm getting a ctd when I try to dock with the SPP in Argon Prime. It happened on two new games in a row.
Fetch
Posts: 33
Joined: Fri, 30. Jan 04, 01:08
x2

Post by Fetch »

No changes made, nothing else tweaked. I applied the mod to an old game, and bought the factory new to try to place. Ill try it again with a new game and let you know what happens.
User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek »

Stupid question here, but has anyone verified that this mod works for them? (I'm not talking about crashing, I'm talking about changing profitability of the factories) There seems to be a difference of opinion in the forum on whether this will work due to the linearity of the production model. For the high end factories, where the price of the output good has been changed (raised) to make the factory more profitable, do the number of inputs required change to keep the production profit multiplier equal to 1.3?

ex: (I'll use spaceweed)

current scenario (old economy):
in a cycle time of 4 min:
consumes 60 ecells @ 16, value 960
consumes 8 swamp plants @ 156, value 1248
total input value = 1248 + 960 = 2208
produces 1 spaceweed @ 2912
production ratio (or multiplier) = 2912 / 2208 = about 1.3
profit / min = (2912 - 2208) / 4 = 176

If I understand correctly, this mod is based on the fact that if you raise the price of spaceweed to 5534, the new scenario is:
consumes same inputs for value 2208
now produces 5534 in 4 min
new production ratio = 5534 / 2208 = about 2.5
new profit / min = (5534 - 2208) / 4 min = 831.5 (yay!)

but my question is does the game let you do this?

or does it scale up the inputs required and cycle time like this:
increase in output value = (5534 / 2912) = 1.9
new cycle time = 4 min * 1.9 = 7.6 min
new ecells required = 60 * 1.9 = 114 @ 16 = 1824
new swamp plants required = 8 * 1.9 = 15.2 @ 156 = 2310 (about)
new consumed value = 1824 + 2310 = 4134
new production ratio = (5534 / 4134) = 1.3 (grrrrr)
new profit / min = (5534 - 4134) / 7.6 min = 184 about the same as before (difference to rounding errors)

Please tell me we aren't chasing our tails here and someone has verified that it behaves correctly and does vary the prof / time of the factories which have been changed. I'm midway through implementing my fix which is extremely similar to MH's, but I don't want to chase it if it's a pipe dream.
"Nature's first green is gold" . . . stay golden.
Mad Hatter
Posts: 246
Joined: Fri, 5. Dec 03, 16:08
x3

Post by Mad Hatter »

Fetch wrote:especially considering that the cycle time is 7:41:00.

:evil: :evil: :headbang: :headbang: :evil: :evil:

*Much Swearing*

The mod won't work as is. And there may not be a way to do one at all. Thanks guys for trying it out and letting me know what you found. I'm going PM one of the guys at xscripting and tell them to pull it down.

Here's the scenario now... When you change the price values - everything works fine for all plants that currently exist. But when you create a new plant - it recalculates the production time so that it can't produce faster than the accepted amound of profit / minute. :evil:

I'll have to do some more calculations, but here's what I found with Drone Factories... The normal price (in the TwareT) is 72. And each drone takes 72 seconds to make. I changed the price to 82 - and now they take 82 seconds to make!!! I'm guessing it multiplies this fraction out until it lands on a whole number. In this case, instead of 4 drones in a 288 second batch - it became 48 drones in a 3936 second batch!!!!! So to prove a point I raised it to 92. 24 in a 2208 second batch. Yep thats right - 92 seconds each.

The whole f**king thing is based on enforced equality. Not to piss anybody off. But this is what happens when a development company in a socialist country tries to make a capitalistic game.

*more swearing*
User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek »

Mad Hatter wrote:Here's the scenario now... When you change the price values - everything works fine for all plants that currently exist. But when you create a new plant - it recalculates the production time so that it can't produce faster than the accepted amount of profit / minute.
In addition to cycle time, I think it probably adjusts the number of inputs required as well so that the profit margin is always 1.3. (see post above) Perhaps in adjusting the number of inputs required it calculated a non-integer number and therefore never started production. I'm guessing, but that might explain fetch's problem with his plant never running.

*sigh* maybe one day we'll fix it. I'm encouraged that I've seen at least one person (nox) that is starting to try to piece together an understanding of the code the game is written in. Here's wishing him luck.

You know what's kind of funny is that there are probably quite a few people in the devnet who've signed NDA's that know what the answer is and how to accomplish what we want to accomplish, but can't talk about it.

:headbang:

Hope your hearts collectively break as you read these posts.
"Nature's first green is gold" . . . stay golden.

Return to “X²: The Threat - Scripts and Modding”