|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
Posted: Wed, 30. May 12, 23:00 Post subject: |
|
|
Another update. About a month and a half or so until I'll be back in full development, but I made some changes today:
Names make more sense and sound less stupid. Mode adjectives used, race names used, etc.
Ship choice for companies now more sensible.
Totally destroyed and began to rewrite the ship-for-station scripts. They now simply use a bastardised mix of current game scripts but paying attention to their homebases needs and other homebased ships.
Ships now jump if they have a jumpdrive and restock energy from their homebase like a player ship would.
Auto-replaced ships by GoD when a homebased ship dies now instantly removed from being homebased then destroyed, before handing it over to the routine to deal with getting a new ship properly.
Began more ideas and planning on outfitting, buying, equipping, upgrading, etc. ships, and also how to implement this into freetraders.
Finished giving all freetrader ships and account for now. This includes dock traders, military supply TSs, and others, for now.

_________________ _______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
Posted: Thu, 21. Jun 12, 10:53 Post subject: |
|
|
Tonight, "full time" work will reinitiate!
One thing I was thinking over the past few days was how the current economy cheats energy-wise.
I have 3 choices:
- Leave it as it is, and laugh at the player's desperate crystalplexes.
- Remove the player's need for crystals, free energy! (Face it, SPPs are expensive enough as it is.)
- Add crystal need for AI and see if my economic restructuring and growth algorithm convinces the AI that there's a huge shortage of energy... and food, and crystals, and silicon, etc. etc. And see if it all works out nicely.
_________________ _______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
jack775544

Joined: 13 Dec 2011 Posts: 776 on topic Location: On the bridge of a Xenon CPU ship (Australia)

|
Posted: Thu, 21. Jun 12, 11:57 Post subject: |
|
|
| EmperorJon wrote: |
Tonight, "full time" work will reinitiate!  |
Yay
| EmperorJon wrote: |
- Remove the player's need for crystals, free energy! (Face it, SPPs are expensive enough as it is.)
|
I like this option crystal plex's have always been a pain.
_________________ SDS: Ship Diagnostics Software
"The greatest trick the devil ever pulled was convincing the world he doesn't exist" - Charles Baudelaire |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
UberWaffe
Joined: 25 Apr 2012
Location: Orbiting reality at +3 irrationalities
|
Posted: Thu, 21. Jun 12, 15:06 Post subject: |
|
|
Heh. I like this thread. I'm aiming way lower in terms of complexity in my concept for a civilian economy for XTimelines (of which the far-more-talented-than-me modders probably have a very good reason for going military economy only).
Anyway.
| EmperorJon wrote: |
Those are my ideas... but... what are yours'?
What do you want to see? What do you not want to see? |
As for ideas, I have some.
Trade stations
Firstly, and already mentioned, is that trade-station should be the main means of consuming produced wares.
My thinking on dynamic consumption would be to base the rate of consumption on how many sectors are owned by the race that owns the sector the trade station is in.
Realistically speaking: Populations can't change that much in just a few (ingame) days.
Limitation-ally speaking: Scripts can't read sector populations anyway.
Reason-ably speaking : The more sectors a race (or the player) controls, the greater its power, and thus arguably the higher the standards of living of its people (or at least the more arrogant and greedy. )
My intent, when I get around to scripting it (just started the EcoHog), is to define a global array for each race, for each ware that trade stations consume (planned specialised trade stations called planetary docks, that would all eat the same wares, both high-end and basic. It is actually meant for these docks.)
The arrays would be an array of floats[] (Numbers in X3) that specify how much of a product is eaten every 15 minutes by each planetary dock.
First script will run on each planetary dock, eating NUM number of each ware every 15 minutes as specified by the global array for that race. A value less than 1, would mean that every eat cycle that ware has a (NUM*100)% chance to consume 1 ware. (So a consume of NUM=0.4 would mean that every 15min cycle there is a 40% chance to eat 1 of that ware).
| Code: |
for i = 1 to Wares[].Size do
NUM = Race[x].GlobalArray[i]
if NUM >= 1 then
Wares[i].Stock -= NUM
else
if ((random 0.0 to 1.0) < NUM) then
Wares[i].Stock -= 1
end
end
endfor
wait random 14.9*60*1000 to 15.1*60*1000 ms
repeat
Add in sanity checks for NUM>0 and Wares[].Stock >= NUM.
|
Second script
Runs once an hour (maybe shorter?) and counts the number of sector controlled by each race. Then sets global array of NUMs for the wares for that race.
Here you can also define 'random' events, that adjust the consumption for a ware (or wares). Since this per-race global array is used everywhere, random events can be things like 'double demand for Ecells at all Terran planetary docks for the next hour!' or some such.
Corporate Strongarming
An idea I have thought of (and started poorly coding yesterday) was the idea of a Economic Hog (EcoHog). It might fit well with your companies... or not.
Its purpose is to simulate supply contracts between stations (agreement to mainly deal only with one another), and mainly to make the player's life harder.
Essentially acting like a station camper, an EcoHog would be given a homebase, target station, target ware(s), and buy/sell parameters.
When selling, it would need its homebase to produce the product and will load up with as much of the product as possible and head to the target station. It will then proceed to continually sell as much of the product, keeping the demand at the target as low (or non-existent) as possible.
Its default 'wait' location is at the target station, selling off anything it had until its cargo runs empty, or the target station is full and its cargo is at least half empty.
When buying, it would go to the target station, buy everything it can, and dump it all at its homebase. Its default 'wait' location is at the target station, buying up anything it can until its cargo bay is full, or the target station is empty and its cargo is at least half full, or the target station is empty and its homebase is more than half empty.
You just can't include player stations in a hog like this, since the player can dictate the buy/sell prices of resources/goods at his/her station/stations.
I/like/slashes///
Alternatively, you could have AI companies 'cheat', and spent some of their credits to 'hire' an EcoHog to hog a ware a player's complex needs a lot of, or is producing a lot of. Though they don't 'own' the EcoHog, so they don't suffer the full brunt of the bad-selling and/or buying-tactics.
Maybe.
Again, more aimed at hogging the key planetary docks stations, as those are the consumers. I figure a AI company would not mind too badly if a player only ever produced enough (and low tech enough) wares to supply the AI's factory resourcing needs, but never sold directly to consumers.
[EDIT]I'm slowly brainstorming more ideas for corporate strongarming. If I think of any I'll post them in the mentioned thread, and if they might be applicable to you, I'll post them here.[EDIT]
[EDIT]
Oh, yes.
AI Company Bankruptcy
If a AI company goes negative, and does not recover, maybe first 'sell-off' some (not all) of their assests (stations and ships associated with those) as opposed to... not entirely sure what you do currently.
Sold assests would simply be dropped from their ownership array (effectively going to the government. Which implies the government is actually a bank, but anyway). The company receives the value (or a good portion thereof) of the assests, hopefully returning them to being 'in the black'.
Maybe just reset their account to 50k or something for ANY station and its ships sold, so that big companies are really hard to kill off.
[/EDIT]
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
UberWaffe
Joined: 25 Apr 2012
Location: Orbiting reality at +3 irrationalities
|
Posted: Fri, 22. Jun 12, 10:03 Post subject: |
|
|
Sorry, I apologise.
Verbal diarrhea. 
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
Posted: Sun, 24. Jun 12, 15:28 Post subject: |
|
|
I'm currently trying to work out exactly how the new stations system will work.
Using the trade info function I can get necessary information on the storages of stations.
My original idea was to collect the storage information for every station in one race's sector group, so for example it would collect all the resource and product storage space in the core Argon home cluster around Argon Prime.
It would then weigh up these values to work out what factories were needed, for example if there was a total possible storage of Energy Cells as a product of 100000, and a resource storage of 200000, then it knows that if all the SPPs were full they'd only half fill all the factories once it got shipped out.
The issue with this is it pays no attention whatsoever to production times; it's all well and good seeing that the total storage space for Energ Cells being used equals the total storage space required, but factories, especially large weapons factories, use a few thousand cells every few hours... and XL SPP creates a few thousand every few minutes!
Does anyone know if the storage directly matches the factory size EVERY TIME, as if so I can work out the total storage in terms of sizes of S, M, L, and XL, and therefore the total output.
For example, if the total ore consumption is equal to 10x L, then I need 10x L's worth of mines, surely!
I also have to consider the resources needed for the step below. For example, instead of saying "I need ore, I'll find somewhere for a mine" it'll say "I need ore, but ore needs energy, there's not enough energy" etc. and work its was down. It'll also have to notice a surplus and then suggest new factories which can exploit that surplus while making a product that WILL be used somewhere by something... It may involve recursion. Ew.
All in all, it'll work out what factories are really needed where, then add them to a list. The factories on this list can then be built by any relevant company. By this method, the companies and economy grow building their own factories, and the fact that it's actually centrally pooling data to find where to tell anyone build is hidden and irrelevant. It just simulates companies deciding to build wherever they want in a dynamic way. 
_________________ _______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Killjaeden

Joined: 03 Sep 2006 Posts: 4297 on topic Location: Germany

 |
Posted: Sun, 24. Jun 12, 17:06 Post subject: |
|
|
| Quote: |
| Does anyone know if the storage directly matches the factory size EVERY TIME, as if so I can work out the total storage in terms of sizes of S, M, L, and XL, and therefore the total output. |
Yeah, it's directly proportional - you can substitute 1 XL SPP (station size of 10) with 2 L SPP (size 5) or 5 M SPP (size 2) without problem on a large scale. Applies to storage and ware output/consumption.
On a microscale (in a complex) you have a small problem because after each production cycle there is a small delay. The more smaller size stations you have the longer the delay in total - not an issue for universe scale economy though
Here's a price/storage calculator excel - it's in german, but should be easy to understand with google translator
_________________
Tutorial Custom Turrets; Guide advice on placing turrets; Guide Performance of Models
Last edited by Killjaeden on Sun, 24. Jun 12, 17:13; edited 1 time in total |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Killjaeden

Joined: 03 Sep 2006 Posts: 4297 on topic Location: Germany

|
Posted: Sun, 24. Jun 12, 17:18 Post subject: |
|
|
don't know , sorry
But i remember that lucike had a function in his CAG script where you could check your complexes and it showed the excess/deficits of all wares in the complex. Perhaps taking a look at how he did it might save some time.
_________________
Tutorial Custom Turrets; Guide advice on placing turrets; Guide Performance of Models |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Aydan
Joined: 08 Sep 2007
|
Posted: Sun, 24. Jun 12, 18:02 Post subject: |
|
|
What you're missing is the role the stations are playing in your economy. You're looking only at stations and ignoring one of the major gameplay parts. Stations producing a ware are only bricks in the middle of nowhere They do nothing but converting items into another form. If they have no more ressources, or their storage is full of products, they simply stop. They can not produce anymore. If they don't get supplies, they are useless, regardless if there's a demand only 20 metres away.
/edit: This post is about dependencies of traders and stations, and the behaviour has to be adjusted to the changes/scripts of EmperorJon
The most limiting factor on stations are NPC traders and THEIR behaviour.
It's NOT only a question of just placing them, i'll explain that later.
First, you need to calculate the average speed of a given trader job. That means you need to look at the jobs file and identify the ship type and calculate its average speed. That means you need to get the total amount of ships used to transport the ware in a given race, the range of variants and their possible max speed. You can then calculate the possible average speed. But the tricky part is that the equip libs are giving them only a limited amount of engine tunings, so you need to have a look at the equip libs also, to get an image of how many engine tunings they get in average. Only then you can calculate the real average speed, and believe me, it's far slower than you may expect.
Take a very close look at the flags on the traders, if they trade only in race sectors, if they are allowed to cross enemy territory and so on. The distribution of traders is a very tricky thing, and it'll take some days to get the distribution over all for just a single race.
Now, the speed is so important for you, because it may take longer to ship the products from one station to the next, because the way is longer than the actual cycle time on the station itself. That means that you may need multiple traders doing the same trade run to keep the consumer supplied. Otherwise the production will stall. A NPC trader with a max speed of 70 m/s is only flying at 35 m/s, because it's flagged to use only 50% of its max speed in the jobs file. It it is supposed to fly 35 km.... well, let's say it'll take a while, and a 35 km wide sector isn't that uncommon. Now add to that that the gates have to e used, because the station is in the next sector, and the cycle times of a station are getting obsolete, because the traders are the limiting factor with their flight time.
And now, here comes the hard part. NPC traders are independent and act autonomous. They decide on their own needs, and you have to place the stations accordingly, so you get a running economy between producers and consumers. NPC traders are rating trades by the amount of money they can earn in a given time range. That means they do look for the best trade and consider producer, consumer and the time they need to get there. You may have often wondered about traders with only 3 or 6 ore, although they could transport thousands of them. It was the best deal they could come up with in their range. And that may be only 6 ore. They calculate their current position to the point where they will buy for the best price. The ware is randomly picked from their job, but the calculation is not random. If the station is in the next sector, they calculate "Current position->Rendezvous point gate->gate->Rendezvour point gate->Rendezvous point station->station" That's the calculation for a single way. Stations and gates with extensively long docking ways (rendezvous point->station) have a decent disadvantage, because the speed is greatly reduced on docking. So TOAs and giant terran stations can get ignored, because the flight time can be longer than crossing an entire sector. Just measure the speed and time It's really true.
If the ship has reached its destination, it checks for the demand and buys accordingly to the demand. The same distance check is performed for the best sell run now. This is the point where you need to consider that the positioning of your station is critical, as the consumers must be near by. If it's located at the other side of a 70 km sector, but a gate is nearby, the way through the gate to the next sector my be much shorter, and all the ships will probably be heading there, because it's only 30 km through the gate, but 70 km in sector. This is the tricky thing behind NPC traders and distances, according to their behaviour.
Now the second trickiest thing is demand and the NPC trader behaviour. Demand is CREATED by traders. Only if wares are traded, there's a demand over all. If the product storage is full of products, there's no demand for supplies. The station can not produce at all. Only if the products are sold, it will start to eat up ressources again, creating demand of ressources. So if no goods a re sold, there's no demand, and the demand is strongly tied to NPC traders and their ability and behaviour to trade. Once again you need to have a look at the job files and equip libs to find out how large the average storage room for a given job in a given race is. Then you need to adjust the size of the stations on the map itself, to create a lot of demands. The thumb rule is, the larger the station size (XL and up), the worse the economical performance is.
The goal is to spread the traders as far as you can to have roughly the equal chance to have a trader ready to do a trade run, wherever it is. If you place a XXL SPP somewhere, the storage and producing capability is so strong, that after a while all NPC EC traders will gather somewhere around this SPP. And they will all calculate their trades from there, resulting in a monopolistic trade behaviour. The storage room is so large, that the price is never high enough to make other, smaller SPPs attractive to them, simply because they're too far away. The price only rises if a good chunk of Ecells is taken away, and this is calculated as a percentage. If you only have 3000 storage on a trader, but several 100ks on the SPP, and the producing capability, it never falls. So after a while the outer regions of the races sectors are stalling, no matter what you're doing. The storage room on the NPC traders is the absolute limiting factor. If not, the distribution of traders across the sectors is completely messed up. The best example are the paranid sectors south of Loo'Manckstrats. With only exchanging the size of some stations (and adjusting their position of course), you can stabilize the whole region. It's a lot better to place M and L factories, especially M ones. This keeps also the original God engine from turning them down. It's design flaw, as the vanilla map is a complete mess, and most of the helpless tries to get better results are changes made on the map itself and not in WareTemplate. So it gets so clunky that the reasons aren't obvious. The last try to fix this where the company traders, but they failed due to not taking in consideration that upping the jump range also creates a massive flight time for a best buy/sell run.
Anyway, if your just looking for demand and supply on stations, you're missing the fact that the wares have to be transported first, and the ways and storage capabilities are a lot more limiting the economy than you may think. Only in case of existing complex tubes you can calculate without these transportations. Consider placing stations, size of stations, amount of race traders/dock traders for a given ware, and their average speed/storage 
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Aydan
Joined: 08 Sep 2007
|
Posted: Sun, 24. Jun 12, 19:11 Post subject: |
|
|
I know.
The problem is, that you are creating centralised structures. If you assign a trader to a station, and he cares only about the problems of this single station, he has only a limited pool of suppliers and consumers. Theoretically you can get a map to work with this, but a single accident, some pirates blowing up a station which is a key element, and a complete region stalls. A single build mission somewhere placing an L Mine or an XL SPP and your map doesn't work anymore, because the dock trader needs to fligh further away, or the former consumers are supplied a lot faster than the actual station is able to do. /edit: If a key station is stalling, the whole error is cascading down (or up)
You will realise that the cunsumption of high end tech wares and weapons/shields/missiles is limited by your GOD engine eating up the products on EQ Docks and Trade stations. You can raise the efficiency artificially, but your system will be a lot more vulnerable. Relying on a chance based system and customised trader scripts is a lot more effective and the whole thing will be more flexible. You can, for example lower the priority for your GOD engine to respawn destroyed stations, you can reduce the time for the needed checks if your assigned traders are still existing, without the fear that a branch of sectors would stall.
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
EmperorJon


Joined: 29 Dec 2008 Posts: 6666 on topic Location: Leicester

|
Posted: Sun, 24. Jun 12, 19:31 Post subject: |
|
|
Er no... not quite. A single station is destroyed, and the game notices it needs to be rebuilt. The economy in that area maybe suffers whilst those who required that product need to go further, but well, that's what happens.
I don't quite see what the issue here is that you're finding.
For example, you say it's much more effective to use customised trader scripts... which is what I said I was doing in the last post. The general basis of this is already hammered out, though I need to talk to some of the experts in this area.
_________________ _______________________________
The Trade Plugin - Finally out of Beta.
STFUnit - Military Plugin
Find All Crates/Ships!
I Feel Like Killing GoD. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Aydan
Joined: 08 Sep 2007
|
Posted: Sun, 24. Jun 12, 21:00 Post subject: |
|
|
I do not want to change the outline of your project I want to point out that there's an inbuild weakness you may be able to work around, as you do not divide between stations and ships (traders).
Just an example, if you have a station somewhere near the south gate of CEO's doubt, and it needs E-cells, then your station assigned trader will probably for the nearest source of e-cells from this specific point. It never changes, and if there's a bigger (XL) SPP in Cardinals Domain, he'll jump/fly there, every time, as the price of e-cells is always the lowest. If there's an enemy cruising around, he'll jump there over and over again, being destroyed every time. So you must include something that reminds a newly spawned trader that he was destroyed there. Kind of blacklist. All the other stations with similar distances will prefer this single SPP. Your trader losses will be relatively high, while other SPPs, although not that far away, won't be considered. Instead of this, if the starting point is random for a trader, the chances that this specific SPP is chosen as a e-cell source is considerably lower, so your losses of traders, because of this incident are a lot lower right from the beginning. Also the fact that other sources of SPP are contributing to the e-cell supply is keeping sectors from stalling. A station sleeping for only a single hour may result in a delay for several other stations which is a lot higher, because you have for your station : flight time to supplier+flight time back home+cycle time+flight time to consumer. If the station is supplying two others, the problem essentially doubles, resulting in a double amount of time for their consumers. This is cascading up, and it'll stall from a certain amount of time build up. Think of the war zones in AP for example, or highly frequented pirate sectors, race sectors with a fix pirate patrol route. Your ships would need to fly faster than the actual cycle time for your product to lessen the limiting factor of NPC traders. Even if you use the CAG strategy and jump your ships to 0,0,0, there's still amount of time to fly.
Now you can raise the efficiency artificially by letting your traders fly faster, letting them jump closer to their destination and whatever else. The resut is that the trading delay isn't limiting production anymore, and you will find the the consumption of high end goods is the limiting factor. The vanilla God is pretty slow when it comes down to consuming goods, and you'll see EQ docks filled to the brim. You'd end up adding additional trade stations/EqDocks.
ONE solution, which i'm suggesting, is to handle the over/under production on the side of the traders and not on the stations, as this is the original idea behind the X series trading. It creates a lot less static economical progression. If you have a massive amount of goods in the bellies of trader ships trnsporting them, a single failed station (destroyed, straving, whatever) is not that important, as the traders are spread out, instead of using a centralised command. Centralised is more predictable from a scripts point of view, but it's also not able to handle problems flexible. Especially overproduction is a lot more hreatening then under production, as overproduction means only god removes goods from the economy cycle. Instead of this you can reduce it by having randomly destroyed NPC traders, delay through slower transportation, and so on. Have you calculated how much your god is consuming over all?
It's not that i'm insisting on this I'm trying to point out that there's a weak point in your plan, and you may save a lot of scripting time/load of scripts running, nothing more Streamlining the trader scripts and jobs gets a better result overall. But that's not a MUST, it's only a suggestion I'm not trying to force you to do so, even if it sounds like this. It's not intended 
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
 |
|
|
|
|
|