Economy milestone

posted in KrisWolfe
Published April 09, 2019
Advertisement

So just a few minutes ago, I got my economy sim up and running. I really love C#. It allows me to do a lot of things I couldn't do in programming languages, or at least so cleanly.

I finished the code a week ago, but it was extremely rigid. For instance, I had farms able to produce goods, then make a contract to send goods to someone. Stores could acquire that contract, and goods could get sent to them.

But it was only for farms and stores. What I wanted was an object that did not care what type of company was hooked up to it...it just passed along goods from one company to another until the contract expired, and didn't care what class type they were.

So I rewrote the classes so that there was a superclass called Company that other types of companies inherited from, and then the contract didn't care what type they were. I was super impressed with how the code handled that kind of coding. Much easier to do than I thought.

I have a working economy. I ramped it up to over a thousand agents, 200 farms, 20 stores. The farms all hired the exact amount of employees they needed, they paid their employees and owners, they put contract out on the market for their recipe, they produced goods. Stores acquired contracts with Farms to send them goods, they hired employees to sell them in store, and everyone purchased food and kept themselves fed, receiving salaries, and choosing different goods based on consumer preference.

I'm so proud. And the code is extendable easily.

Next step, hooking up a player to the economy to own a business or get a job at one of these companies and get paid. I have a skill system in place already, although they don't do anything at the moment. I want skills that are unlocked to affect their job or company different ways, and the more you use a skill, the better you get at a job.

Eventually I want other types of companies, like service companies. You could become a janitor, or create a janitor service for other companies...phone services, IT services, manufacturers, different types of retail stores...and the ability to own any of these companies and affect the market.

For tonight, it's happy hour.

2 likes 0 comments

Comments

Rutin

Thanks for sharing! :)  When can we expect to see some new screen shots?

April 09, 2019 04:39 PM
KrisWolfe

Thanks for the reply! Currently most of the game is in code, and the only thing I have visible is debugging screens. The scheduler is up and running, and will spawn any skills that are unlocked in the skill tree.

I am attempting to get the player object to be fully multiplayer ready, so that when I hook the game up to a matchmaking service, each player will have their own set of skilltrees and companies and so forth. Once I have that running, hopefully by the next update, I'll have some new screen shots.

April 09, 2019 05:11 PM
Rutin

Looking forward to it! :) 

April 09, 2019 05:31 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement