Forays Into The Unknown (Officially "Cancelled" Pending Analysis Of Rebirth!)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I don't have that much time for development now, my first exams are on wednesday so I'm pretty much in full steam revision at the moment.

Although I may not have time to do much, I do have time to think and plan in my head.

I've mentioned what I'm working on and hope to achieve, but just in case you missed anything, here's a list:

NPC traders will use a bank account which they cannot overdraw on.
NPC traders upgrade their own ships in order to improve their trading ability.
Upgrades like this may include general ship extensions and upgrades, things like jumpdrives, new ships, escorts...
All these will be bought with their real earned money.
Stations will all belong to a company, even if the company is only that station.
Companies will deal with keeping the economy strong; they'll fill in holes with needed factories, update and improve their infrastructure, buy more ships, defences, and similar with real money.
Companies will also have a bank account; they can overdraw on it but will have to sell off assets or go back into profit quickly to prevent bankrupcy.
The GoD engine will not place or destroy any stations in the universe.
Economies will be created/strengthened for groups such as the Pirates/Yaki with very few stations, due to companies belonging to these factions expanding.


Those are my ideas... but... what are yours'?
What do you want to see? What do you not want to see?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
bluenog143
Posts: 885
Joined: Wed, 26. Oct 11, 23:35
x3tc

Post by bluenog143 »

Good luck with your exams.

And since you insisted :lol: I guess I can give you some ideas.

Basically I just don't want to see anything just spawn out of nowhere.
I would like everything in the universe to be bought and paid for. So basically no wares spawning out of nowhere, no station spawning from nowhere, no ships spawning from nowhere etc.

So basically stuff needs to be bought and paid for. So race governments could also buy ships and stations instead of them spawning (with TL's of course)

For ship building/timing I have two ideas. They conflict with each other so only one could be added.

1) Ships, when bought, need to have a timer so that they don't appear there right away.

2) Shipyards would need to work like factories which will have the ships built with a production timer.

The nice thing about point two is that you could add primary resources to shipyards that will be needed to build the ships (besides credits). If you like the idea you could probably do the same with stations if you think it could work.

Later on probably if you like you could also add a xenon economy. You could even disable the ship limit with this idea because it would no longer be needed. Basically xenon ships/stations could be made using resources (not sure if credits mean anything to them afterall). So there could be xenon factories with xenon transporters that load and unload certain wares to the shipyard to make ships/stations etc. that will work like idea two above. Then Xenon TL's could carry xenon stations to conquered sectors and deploy them (for example) after they made them with the resources.

I am assuming that this is for AP (and from the images I have seen) so the Kha'ak we won't have to worry about.

And as for credits themselves, I guess I can assume that individuals and companies will no longer have infinite credits from what I've read so that's pretty good. But what about the race governments? Have you already figured out how credits will work for them?

For now that's all I've got since you seem to have gotten to some good stuff already, but basically as long as nothing spawns out of nowhere (not even for the governments) and everything is bought and paid for, and the factories produce wares and the AI and player buy from factories the wares (no more ware spawning), etc. etc.

Hopefully this isn't too overwhelming but if I have any more ideas I'll be sure to add them.
SinisterDeath wrote:This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Dark_Ansem wrote:Seeing your creation in-game and working makes one feel all warm and fuzzy inside.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I'm not worried about being overwhelmed with ideas, I want to get a good feeling for what people are interested in.

Race governments, ahhh... this is where things get interesting.
For now, they're not going to be touched. Indeed, in future they may get a looking at, but... hmm. I'm worried that I may indeed reach a point where jobs have to be removed from the jobs file and recreated as an AL plugin (I think that's how some other mods have handled it), but then other inbuilt things like RRF and ships spawned for missions would still cause issues.

When it comes to shipyards, I don't know what's possible.
My dream would be to have a certain ship stock of each type at a shipyard, with more made to replace them when necessary, using resources. I find it odd that a shipyard would have to produce ships when someone wanted to buy them; they'd have some sat around read for sales, surely. But I like the idea of a shipbuilding industry.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
bluenog143
Posts: 885
Joined: Wed, 26. Oct 11, 23:35
x3tc

Post by bluenog143 »

EmperorJon wrote: When it comes to shipyards, I don't know what's possible.
My dream would be to have a certain ship stock of each type at a shipyard, with more made to replace them when necessary, using resources.
That's what I was trying to say.
SinisterDeath wrote:This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Dark_Ansem wrote:Seeing your creation in-game and working makes one feel all warm and fuzzy inside.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Heheh.

What would your ideas/opinions be when it came to altering civilian ships/behaviors to make them more part of the economy... how about some sort of generic food requirement for every sector? Or something? Any genius mechanics to implement something to do with ferrying people around? Workers and such?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
Falcrack
Posts: 5577
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack »

I would like to echo a lot of the comments by bluenog. As far as races, I would give them unlimited credits. Governments after all do have the ability to issue currency at will.

I had an idea regarding a civilian aspect to the economy. Basically, it works like this:

1. Goods produced by factories can be sold at trading stations. Trading stations will buy typical civilian goods (food, microchips, space weed, etc), more or less the type they buy now. You would need to make sure that the mix goods bought there would require both ore and silicon to produce, so that in the absence of conflict both types of mines would still prove useful.

2. The local sector population will buy goods at the trading stations. Since we can't have ships landing at planets, when civilians buy the goods they simply disappear from trading station inventory (trading station still gets credits for the sale). Alternatively, instead of goods disappearing from trade stations, civilian ships flying around sectors will buy the goods (at the rate dictated by civilian population), and goods will then disappear from civilian ships after purchase.

3. The size of the civilian population dictates the rate at which goods can be sold to civilians at the trading stations. Larger populations will buy goods faster.

4. If civilian populations are consistently "fed" by sales at trading stations, sector population will further grow, further increasing demand. If not fed, they will stagnante, and maybe even start to slowly decrease in population.

In the absence of conflict, this idea will keep up a strong demand for goods. When there is war and ships are being destroyed, the price shipyards will pay for goods to construct ships will be more competitive due to high demand, so freighters will prefernetially sell their goods to shipyards instead of trading stations. With a minor conflict, both civilian and military needs may be met. It is all dictated by which aspect has higher demand, civilians or military. The price shipyards, laser fabs and shield fabs will pay for goods when they are low on resources would of course need to be made high such that they will preferentially be sold goods rather than trade stations.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

I wonder if the rate at which goods disappear from trading stations is hardcoded or note... if it isn't, I'd significantly increase it to simulate a much larger civilian demand.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
Falcrack
Posts: 5577
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack »

In my current scenario, races would run the shipyards. Shipyards would of course needs raw materials to build stuff (including factories). You do run into the problem however where if you need to make factory X, and building factory X requires product X, but no product X is available, the factory could subsequently never be built.

X-timelines has a mechanic in place so that if the shipyard is lacking materials to build a ship, then it can spawn in the necessary materials, but at the cost of decreased build speed. The more resources it has to spawn in, the greater the build speed penalty. Maybe make it an option so that if you want, you can turn off the AI ability to spawn resources, or increase the build time penatly for spawning resources.
Falcrack
Posts: 5577
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack »

EmperorJon wrote:I wonder if the rate at which goods disappear from trading stations is hardcoded or note... if it isn't, I'd significantly increase it to simulate a much larger civilian demand.
As I was trying to explain, the civilian demand would not be hardcoded, it would be dynamic, flucuating according to the size of the population. Population size would be determined by how well they are supplied. The size of the civilian population could be viewed by looking at the sector name on the universe map. The currently useless number that represents civilian population would thus have meaning now.

It should probably be set up so that multiple trade stations per sector does not mean further increasing civilian demand. So 2 trade stations will not double the amount of goods disappearing from trade station inventories, they would just each sell half as much, for example.
User avatar
bluenog143
Posts: 885
Joined: Wed, 26. Oct 11, 23:35
x3tc

Post by bluenog143 »

Falcrack wrote: As I was trying to explain, the civilian demand would not be hardcoded, it would be dynamic, flucuating according to the size of the population. Population size would be determined by how well they are supplied. The size of the civilian population could be viewed by looking at the sector name on the universe map. The currently useless number that represents civilian population would thus have meaning now.

It should probably be set up so that multiple trade stations per sector does not mean further increasing civilian demand. So 2 trade stations will not double the amount of goods disappearing from trade station inventories, they would just each sell half as much, for example.
I think what he meant to say was that he isn't sure if the time it takes for wares to disappear is locked away in the core game programming (the one that can't be modded). I'm sure you'll figure something out though EJ.

Falcrack makes a good point at two and three. Four is an idea, maybe not too much fluctuation but some might be good. I think that trading stations should act kind of like stores. They only buy and sell goods, so goods are still made in the factory. Once the goods are made in the factory they can be bought and then sold to trading docks.

As for governments and credits, I think unlimited credits might be the best way to go.


I got some new ideas so I will list them below.

Firstly, all stations should be bought and owned only by companies and the player (or individuals who have enough money to buy a station thus becoming a company).

Secondly, stations will not need wares to build, only credits (since they are pre-fab construction kits).

Thirdly, ships should require both wares and resources to build. In the event that there are not enough wares to build a ship, then no ship will be built :).

[WIP IDEA] Fourthly, each race will have just one station that will sell shipyards only. Each one will be located in each race's respective home planet system. Each shipyard must be extremely costly and take a LOT of resources to build, as well as a long time to make. Race governments can buy these shipyards when they have been produced (in order to produce a shipyard, the purchaser needs enough credits, and the needed wares, then followed by a large build time). Each one of these "Mega Stations" must have massive shielding and massive hull because if they get destroyed then that's it. If a race's shipyard get's destroyed it must buy another one from the mega station. But like I said above the mega station must have 1) money, 2) wares, 3) time to build. It can only store two shipyards at a time.

At the moment these are all the ideas I have if I get any more I will post.
SinisterDeath wrote:This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Dark_Ansem wrote:Seeing your creation in-game and working makes one feel all warm and fuzzy inside.
User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 »

Falcrack wrote:As I was trying to explain, the civilian demand would not be hardcoded, it would be dynamic, flucuating according to the size of the population. Population size would be determined by how well they are supplied. The size of the civilian population could be viewed by looking at the sector name on the universe map.
The problem is that editing or even viewing the population size with the script editor is impossible. I THINK it is possible with MD, but MD and scripts don't work together real well. You could probably write an MD script that does your idea but good luck in finding someone to code it.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

bluenog143 wrote:I think what he meant to say was that he isn't sure if the time it takes for wares to disappear is locked away in the core game programming (the one that can't be modded). I'm sure you'll figure something out though EJ. (Yes.)

Falcrack makes a good point at two and three. Four is an idea, maybe not too much fluctuation but some might be good. I think that trading stations should act kind of like stores. They only buy and sell goods, so goods are still made in the factory. Once the goods are made in the factory they can be bought and then sold to trading docks.

As for governments and credits, I think unlimited credits might be the best way to go. (Probably.)


I got some new ideas so I will list them below.

Firstly, all stations should be bought and owned only by companies and the player (or individuals who have enough money to buy a station thus becoming a company). (Already does this.)

Secondly, stations will not need wares to build, only credits (since they are pre-fab construction kits). (No, but the kits should.)

Thirdly, ships should require both wares and resources to build. In the event that there are not enough wares to build a ship, then no ship will be built :). (Wares and resources... which means? o_O)

[WIP IDEA] Fourthly, each race will have just one station that will sell shipyards only. Each one will be located in each race's respective home planet system. Each shipyard must be extremely costly and take a LOT of resources to build, as well as a long time to make. Race governments can buy these shipyards when they have been produced (in order to produce a shipyard, the purchaser needs enough credits, and the needed wares, then followed by a large build time). Each one of these "Mega Stations" must have massive shielding and massive hull because if they get destroyed then that's it. If a race's shipyard get's destroyed it must buy another one from the mega station. But like I said above the mega station must have 1) money, 2) wares, 3) time to build. It can only store two shipyards at a time. (I don't really like this idea. :P Too complicated. I think government buildings will just spawn a TL to rebuild them if they die, or something. Assuming I can remove the default rebuild mechanic.)

At the moment these are all the ideas I have if I get any more I will post.

(EDIT: Woah it'l late... :oops: )
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
bluenog143
Posts: 885
Joined: Wed, 26. Oct 11, 23:35
x3tc

Post by bluenog143 »

Yeah nevermind my point two that really doesn't make sense :lol:
and for point three I guess I should have said wares/resources (same thing) and credits. And you already covered one so that's water under the bridge.

Oh and I got another idea this time a replacement for my fourth point.

Fourthly, Shipyard will be rebuilt (by TL after X amount of time) but sector must be owned by the race that is attempting to rebuild the shipyard.

This way, the TL can't rebuild the shipyard if it's in a conquered sector what do you think (Assuming the TL idea comes through.)?
SinisterDeath wrote:This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Dark_Ansem wrote:Seeing your creation in-game and working makes one feel all warm and fuzzy inside.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Maybe, but I definitely don't intend to build in any kind of invasion stuff into this!
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
bluenog143
Posts: 885
Joined: Wed, 26. Oct 11, 23:35
x3tc

Post by bluenog143 »

EmperorJon wrote:Maybe, but I definitely don't intend to build in any kind of invasion stuff into this!
I don't think you'd need to code anything (for the invasions). The built in RRF should be enough to keep things interesting, and along with lazcorps claim sector script it should be good to go (and plenty of other RRF related scripts for AP just incase). :D

If you decide to though of course. It's the economy that matters most anyways.
SinisterDeath wrote:This reminds me of something...

"I don't believe in GoD, but GoD sure believes in blowing up my factories."
Dark_Ansem wrote:Seeing your creation in-game and working makes one feel all warm and fuzzy inside.
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

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.

:)
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Tonight, "full time" work will reinitiate! :D

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.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______
User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 »

EmperorJon wrote:Tonight, "full time" work will reinitiate! :D
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.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
UberWaffe
Posts: 69
Joined: Wed, 25. Apr 12, 10:06
x3ap

Post by UberWaffe »

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 :D : 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. :P )

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: Select all

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]
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

Well currently nothing happens, but the selling of assets was planned.

As for everything else, it seems to be more relevant to what you're doing than what I'm doing; don't get me wrong, it's interesting, but it's confusing me how you're jumping between "This is what mine is going to do" and "This is what yours could do". :oops:
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”