[Work In Progress] Functional Trader + stable supply/demand (0.22 final WIP)

The place to discuss scripting and game modifications for X Rebirth.

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

csaba
Posts: 1256
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba »

I just noticed Jey that you still have your Improved Engineer mod save itself into the save file which makes it impossible to remove the mod from the game for a layman without deleting his progress.

You might want to check this thread out before making this beauty into a mod:

http://forum.egosoft.com/viewtopic.php?t=354817
Mordegar
Posts: 325
Joined: Mon, 10. May 04, 01:07
x4

Post by Mordegar »

Seems to be not working in my unmodded Campaign Game (Campaign finished). Freighter keeps docking/undocking after 5 minutes and repeating in a loop. Some freighters seem to travel back to my urv station with 0 wares loaded, dock/undock and fly off to a station to do the same.

-prefersinglefiles is in my launch options already.
bbeach
Posts: 100
Joined: Tue, 24. Feb 09, 03:47
x4

Post by bbeach »

pirke123 wrote:
Fumblesneeze wrote:
pirke123 wrote: I don't expect the shipyard to make the decisions to replace lost ships. I expect them to follow orders and build a ship when told so :)

Isn't there a faction script somewhere? That manages the empire and decides what is needed where? That would decide to build ships and give the order to the shipyard. Assign some people on it, and assign the ship to a station / fleet / whatever.
Unfortunately there is no faction script (which is what I want to fix). The biggest ones in the hierarchy are stations. Stations will buy stuff they need and sell stuff they produce. Then there are "free" traders which will look for random trade routes (seller->buyer) and do those, but there is nothing bigger at work (yet).
So faction behaviour is hardcoded instead of in a moddable script? I still won't believe it's simply not there........ :o

The fact that you can't find it doesn't mean it doesn't exist :) The other way around does work: if you find it, it exists.
Faction AI doesn't exist. Look in your savegame file if you don't believe us. The only money being saved is either your account, or a budget you've allocated to commander/manager.

The AI ships flying around, when they buy wares from your station it generates credits out of thin air.

When you sell wares to an AI station, it generates credits out of thin air.
User avatar
pirke123
Posts: 373
Joined: Tue, 3. Sep 13, 18:00
x4

Post by pirke123 »

bbeach wrote:
pirke123 wrote:
Fumblesneeze wrote:
pirke123 wrote: I don't expect the shipyard to make the decisions to replace lost ships. I expect them to follow orders and build a ship when told so :)

Isn't there a faction script somewhere? That manages the empire and decides what is needed where? That would decide to build ships and give the order to the shipyard. Assign some people on it, and assign the ship to a station / fleet / whatever.
Unfortunately there is no faction script (which is what I want to fix). The biggest ones in the hierarchy are stations. Stations will buy stuff they need and sell stuff they produce. Then there are "free" traders which will look for random trade routes (seller->buyer) and do those, but there is nothing bigger at work (yet).
So faction behaviour is hardcoded instead of in a moddable script? I still won't believe it's simply not there........ :o

The fact that you can't find it doesn't mean it doesn't exist :) The other way around does work: if you find it, it exists.
Faction AI doesn't exist. Look in your savegame file if you don't believe us. The only money being saved is either your account, or a budget you've allocated to commander/manager.

The AI ships flying around, when they buy wares from your station it generates credits out of thin air.

When you sell wares to an AI station, it generates credits out of thin air.
I really believed Bernd when he said this was a real economy. That includes faction AI with a proper checkbook.

Do the faction stations have their own pile of cash? Or is everything thin air except the player?
bbeach
Posts: 100
Joined: Tue, 24. Feb 09, 03:47
x4

Post by bbeach »

pirke123 wrote: Do the faction stations have their own pile of cash? Or is everything thin air except the player?
Everything is out of thin air except the player.

Those piles of cash would need to be saved in the savegame file somewhere if they existed in game, the only pile of cash that is saved is for the player faction.
User avatar
pirke123
Posts: 373
Joined: Tue, 3. Sep 13, 18:00
x4

Post by pirke123 »

When I search for "money" in the save file, I get 609 hits. Somebody must have some money somewhere :)

Those are big numbers btw, many are over 100m, and a few even over 1b.
User avatar
pilakin
Posts: 235
Joined: Sat, 16. Feb 08, 23:44

Post by pilakin »

look, if you had a complete network of stations and ships from miners till shipyard. would you need money then? for what, to pay yourself?
Tarazu
Posts: 67
Joined: Thu, 8. Apr 10, 07:59
x4

Post by Tarazu »

Thanks for the mod, this is working perfectly.. logged in and saw the trade ship that was stuck standing still getting me worried and then *warp* :D had to wait almost an hour for my ships to sort themselves out at my construction ships but seems to be fine now!
User avatar
pirke123
Posts: 373
Joined: Tue, 3. Sep 13, 18:00
x4

Post by pirke123 »

pilakin wrote:look, if you had a complete network of stations and ships from miners till shipyard. would you need money then? for what, to pay yourself?
Hmm, interesting remark! I might even agree with it :)

Looking at PMC, they do have a complete production line from mining to ship building.

So when I have 600+ lines of "money" in my save file, and the wealth of a faction is split over all of its assets (traders and stations), then it's a real economy anyway.

All that remains is the question who decides to build what ship and what station where. It could be random luck: build random ships. If a random ship happens to be a construction vessel, go build a (random?) station at a (random?) spot. That could even work.
Grimm Spector
Posts: 137
Joined: Thu, 23. Oct 08, 17:06
x3tc

Post by Grimm Spector »

Jey123456 wrote:
csaba wrote:Oh damn I'm getting 2 "Task complete" messages reappearing every second now with the sound as well. Making me go crazy.

Also my ships I sent to different systems to trade got bugged and are going back and fort through the jumpgate. This bugs "the take me to" command as well. You can unbug the "take me to command by undocking telling your ship to leave the squad then telling it to take you to the zone again.
I take it this is from having your own ship trading right ?

i havent done any testing on that side yet (so expect issues like that heh). for the jumping thing, i never actually got a ship to jump through a gate (it was on my list of things to test before doing the real release tho).
Vanilla. 1.17. My Rahanas happily flies through gates if I'm docked with it when given trade orders. Even though the trades are messed.
xXPhantomFenix
Posts: 45
Joined: Sun, 24. Nov 13, 02:01

Post by xXPhantomFenix »

The power of modders !! :lol: :lol:
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

I want this as a regular mod sooooo bad...
csaba
Posts: 1256
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba »

Looksy what I found. Negative volume of Ice....

Wouldn't that kill the Ice->Water->Wheat->Food cycle Jey had problems with? :roll:

[ external image ]
Last edited by csaba on Wed, 27. Nov 13, 23:08, edited 1 time in total.
dez505
Posts: 172
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dez505 »

If anyone can Jey123456 can, trust me he's good at what he does....

Good work Jey123456 I'm following all your changes and how you're doing it all.

Egosoft can't afford Jey lol :P
User avatar
Fumblesneeze
Posts: 75
Joined: Tue, 26. Nov 13, 10:07
x3tc

Post by Fumblesneeze »

I really believed Bernd when he said this was a real economy.
All the traders work with supply and demand, they only pick trades that are lucrative, which means buyer has low amount of wares/high price and seller has high amount of wares/low price. So yeah, it is a 'real' economy in a way, it's just that the ai, in its current state, simply assumes that all npc factions always have enough money to pay for everything (like the npc traders on stations who regularly pay me 2mil for my loot while earning nothing because they just stand there). It would be no problem to give them their own account and extend the script to check it before trades (like in skyrim for example, but even there their money just gets reset after a while) but this would honestly be just annoying for the player without a real benefit to the economy.
When I search for "money" in the save file, I get 609 hits.
search for <account ...> and then count their distinct id's. You will see that there are as many distinct accounts as there are (active) player captains/architects/managers + 1 (for the player).
bbeach
Posts: 100
Joined: Tue, 24. Feb 09, 03:47
x4

Post by bbeach »

pirke123 wrote:When I search for "money" in the save file, I get 609 hits. Somebody must have some money somewhere :)

Those are big numbers btw, many are over 100m, and a few even over 1b.
I'm not at home so I can't check my savegame file to go through all of mine, but the ones I found when I searched during my research were just trade offers. No entity, faction or station outside of the players control keeps track of it's money.

Keep in mind those numbers need to be divided by 100. The game doesn't store decimal points, so $1000.00Cr is stored as 100000.
Hellaciouss
Posts: 57
Joined: Sun, 6. Jan 13, 18:38
x3tc

Post by Hellaciouss »

nonnex wrote:Thank you. I'll try it
Or start over. I don't think the 100 trade mission is very far into the game, no?
bbeach
Posts: 100
Joined: Tue, 24. Feb 09, 03:47
x4

Post by bbeach »

pilakin wrote:look, if you had a complete network of stations and ships from miners till shipyard. would you need money then? for what, to pay yourself?
There isn't a single faction that has a complete network of stations and ships from miners till shipyard. PMC doesn't own all of the stations in albion.

I'm not complaining about the lack of NPC's using money, I don't care if it's a fiat currency based economic simulation or a resource based economic simulation.

What I care about is the fact that I actually don't have an impact on it at all. A faction doesn't have to use resources(money or otherwise) to repair or build ships or stations to replace ones that have been destroyed. It's the same problem that made all of the previous X games shallow simulations.

In X3:AP you could destroy a factions shipyards and endlessly blow up their ships because they'd just keep spawning out of thin air.

XR is the exact same way. Ships that you blow up aren't replaced out of the economy, they're created out of thin air. Also in XR, if no ships are destroyed, shipyards still build them to make it look like it's busy doing important things for the economy, but really they're just wisking them away into thin air.

So if the shipyard constantly builds ships and destroys them, and the game creates ships out of thin air outside of the economy when it needs them; how are my actions impacting anything besides my own ability to purchase ships at said shipyard?
Norboth
Posts: 29
Joined: Sat, 23. Nov 13, 14:41

Post by Norboth »

Respect for that work.

But be carful with fixing the economy of DeVries... I think it sould be nearly broken. It seams to be the destinated Sandbox for the Player to fix. In a Global view you should have two running economies in Albion and OL. One friendly to you and one as a fiting Hotspot. And in both you are abel to get your resurces to fix the economy in DeVries if you want.
But thats only my two Cent. :wink:
OvrTehBottm
Posts: 14
Joined: Sun, 3. Feb 13, 02:24
x4

Post by OvrTehBottm »

To bad there isn't a way to introduce a Pirate faction or at the very least beef up the current Pirates. Unfortunately, with nearly all sectors owned and operated by friendly factions there is no way to remove ships from space 'naturally'.

One question I have is ship production tied to specific orders or is it an issue of If <wares> Then <build.ship>? Could an arbitrary limit be placed on the number of ships flying within the universe and or systems? Without any form of destruction, ship building seems to be a runaway process.

Another thought is order of preference. Given an equal buy/sell percentage do ship yards have a greater preference by traders as a place to sell wares over another station?

It seems to me the greatest use of resources is within ship building. not on a per unit basis but as a whole. How can food, energy and other consumable resources be enhanced to utilize ship building resources into creating stations? If food, energy and medicine can be consumed in greater quantities more stations would be required to fill the dwindling consumables. That would draw materials away from ship building and into station building.

I look forward to your further development of this WIP.

Return to “X Rebirth - Scripts and Modding”