Hi all!
I have now finished the first phase of making this first prototype, so I felt like sharing it with the rest of you. Get the zip from here! http://www.kolumbus.fi/amjayee/economy.zip
Actually this is not yet the prototype version 0.1, but something like 0.09; I was planning to make it a little better, but I think it's good to finish it together.
The program runs now stable, I couldn't crash it; but of course I didn't have time to test it for very long time. So, if it crashes, send me email and include the text that is on the screen when it crashes, and the possible error messages. At least divisions by zero may occur, since I didn't have time to make very extensive exception-handling.
Also the program works much like expected; at least during my short tests the prices found an equilibrium, and the demands balanced around the supplies. Though it seems that clothing producers were getting clearly the poorest and the housing producers clearly the richest. The largest problem I want to fix is that demands are changing too rapidly; they jump back and forth around the supplies, instead of holding still. But otherwise I'm quite satisfied with the new demand algorithm; it is actually the first piece of AI in our game, since it analyzes the situation, reacts to events and tries to find the best solution to a situation. It is by far the most complex thing in the prototype.
There are of course many funny things in the program. First of all, it is kinda ridiculous that the balance is found by adjusting the prices so they fit the wealthiness of the people. But that's the limitation of the set for this prototype. Later it will be corrected.
I am going to send here a summary of the algorithms I'm using in the program, but now I haven't time, I'm at school and lectures are starting. This evening I will send those things. Until that, test the program, and if you like, check the code out. Though it is quite complex, and only partially commented right now. Also send me comments how I should improve the program for the real "version 0.1" of the prototype. I was going to add the possibility to change the program variables via a text file. What things should be change-able? And what things should be shown as results on the screen?
After my second message you can comment the algorithms also. They are mainly the same as presented by Joker; the demand system is re-made, and I made a change to the elasticity calculation. In its old form, the prices were changing very slowly, so I divided the elasticity by 1000. Now it seems fine.
I hope the link is working. As said, I will come back to this this evening. Enjoy that piece of programming s***.
I have now finished the first phase of making this first prototype, so I felt like sharing it with the rest of you. Get the zip from here! http://www.kolumbus.fi/amjayee/economy.zip

Actually this is not yet the prototype version 0.1, but something like 0.09; I was planning to make it a little better, but I think it's good to finish it together.
The program runs now stable, I couldn't crash it; but of course I didn't have time to test it for very long time. So, if it crashes, send me email and include the text that is on the screen when it crashes, and the possible error messages. At least divisions by zero may occur, since I didn't have time to make very extensive exception-handling.
Also the program works much like expected; at least during my short tests the prices found an equilibrium, and the demands balanced around the supplies. Though it seems that clothing producers were getting clearly the poorest and the housing producers clearly the richest. The largest problem I want to fix is that demands are changing too rapidly; they jump back and forth around the supplies, instead of holding still. But otherwise I'm quite satisfied with the new demand algorithm; it is actually the first piece of AI in our game, since it analyzes the situation, reacts to events and tries to find the best solution to a situation. It is by far the most complex thing in the prototype.
There are of course many funny things in the program. First of all, it is kinda ridiculous that the balance is found by adjusting the prices so they fit the wealthiness of the people. But that's the limitation of the set for this prototype. Later it will be corrected.
I am going to send here a summary of the algorithms I'm using in the program, but now I haven't time, I'm at school and lectures are starting. This evening I will send those things. Until that, test the program, and if you like, check the code out. Though it is quite complex, and only partially commented right now. Also send me comments how I should improve the program for the real "version 0.1" of the prototype. I was going to add the possibility to change the program variables via a text file. What things should be change-able? And what things should be shown as results on the screen?
After my second message you can comment the algorithms also. They are mainly the same as presented by Joker; the demand system is re-made, and I made a change to the elasticity calculation. In its old form, the prices were changing very slowly, so I divided the elasticity by 1000. Now it seems fine.
I hope the link is working. As said, I will come back to this this evening. Enjoy that piece of programming s***.


Comment