Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Economy #94

Closed
wants to merge 92 commits into from
Closed

Economy #94

wants to merge 92 commits into from

Conversation

AlanVolny
Copy link

Hail!

The way it works is that every system's price is the weighted average of it's neighbor's and it's own preferred price (if it has one).

So, if you have system A, B, and C, where A has a jump to B has a jump to C, and A has a preferred price of 2, B doesn't prefer any price, and C has a preferred price of 3, here's what you get:
http://imgur.com/lRwEgxr
(where "g" is the preferred price, and "r" is the real price)

How much a system likes it's own values is it's weight; a weight of 0 means that it's real price is simply the average of it's neighbors. A system with a weight of inf prefers it's own values infinitely more than it's neighbors, and has a real price basically equivalent to it's own preferred price.

This setup means that if you give values to two systems, all the systems in between will have a steady gradient of price, from the price in the first system (for systems close to it), to the price in the second system (for systems close to that one), making it convenient to handle for the most part.

The preferred price is set in the system xml, and the commodity base price is simply a price multiplier. If you want prices to be higher throughout the galaxy, you can simply change the base price.

I have a version in python and a replica in C if you want to examine the setup more closely.


Also, there's dat/events/neutral/econ_events.lua, which creates economic events that change the prices for a short period of time (and are highly lucrative!), and appear in the news.

I haven't found any memleaks, i've checked and everything seems be good.

@AlanVolny
Copy link
Author

oh uh, this economy is not the same as the one I proposed on the forums. This is more like price control, along with some economic events

@onpon4
Copy link
Contributor

onpon4 commented Aug 5, 2014

Why hasn't this been merged? I made a branch from bobbens/master and merged this branch into it. There were some conflicts and I changed some things to get rid of some warnings, but it seems to work well.

Perhaps I can open a new pull request to merge my "economy" branch, which is the result of merging BariumBlue's economy branch with conflicts resolved and some small fixes? It should be possible for that to be merged automatically.

@onpon4
Copy link
Contributor

onpon4 commented Aug 5, 2014

Alright, I've gone ahead and done it anyway. #150 is an update to this pull request: it resolves the conflicts and removes some changes that I feel don't really belong.

@Mutos Mutos mentioned this pull request Sep 11, 2019
@bobbens
Copy link
Member

bobbens commented Jun 17, 2020

Alternate economy system has been merged.

@bobbens bobbens closed this Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants