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.
Thanks for sharing! When can we expect to see some new screen shots?