Game Design, Programming and running a one-man games business…

Economic model…strokes beard…

So I think you can probably see the problem here right…

economic_model

Behold my cutting edge game design tools!. Anyway, I got annoyed that ‘wasteful economy’ in Democracy 2 was pretty nebulous, and tried to fix it for the sequel, and realized I probably needed a measurement of wages for that, and then tried to avoid adding ‘competitiveness’ or ‘exports’ because frankly its complex enough as it is…

Generally I’m pleased with most of this,(BTW the bottom left circles are low and middle incomes), but I hav2 big phat question marks, namely

1) How does wages affect GDP and vice versa

2) how does productivity affect wages and vice versa

Can I fix this WITHOUT adding new variables? Do I really need wages? my plan is to be able to add a new item of ‘uncompetitive economy’ which is basically just an extreme example of low productivity. Essentially, we are paid too much and achieve too little (Italy! ahahahaha hahah ahah…). How does this fit in? Basically labour laws (restrictive practices) will keep wages high despite low productivity. Is that really possible? if so, maybe the combination of high wages and low productivity will reduce GDP (implicit hidden factor of reduced competitiveness).  maybe low wages could be another positive input into international trade, or perhaps I *do* need competitiveness and have both cheap imports and international trade (re:exports) keyed from it? with wages pushing competitiveness down and productivity pushing it up?

ARGHHHHHHH!

Democracy 3 and overrides

I have long wanted to code a particular system for Democracy 3, and finally got around to adding it, just before I (recently) put in mod support. I’m calling the system in general ‘overrides’. Essentially, what it is, is a way for someone to create a text file that specifies a connection between two game objects and define them with a new equation, or negate them, or add a totally new link. This is best served by an example…

“AND ON THE EIGHTH DAY HE CREATED GAMBLING”

There is a relationship, coded into the game (data-driven of course) between gambling policy and the happiness of religious voters. By default, as you legalize and liberalize gambling, religious voters become more upset, with a degree governed by an equation, such as -0.2*(x^3), where x is the intensity of gambling (degree to which it is legal).

This equation is picked by me, as being my best guess of the general effects of gambling on religious people. However… In the USA, I get the impression gambling has a more negative connotation. You guys banned online poker, for example. Maybe religious people should be more annoyed? maybe -0.4*(x^3) or maybe the curve should be 0-(0.45*x), or whatever else you like… Overrides allow this to happen, because each country has a folder full of overrides which get automatically applied when that country is played, enabling me to tailor each country a bit.

It gets better…

In theory, adding the capability for a folder of player-designed overrides is trivial, meaning players who decided that in their view, gun ownership reduced, not exacerbated crime, could save out an override to that effect, and never be offended by cliffs liberal gun-hating ways again! :D

Also… it’s a modders paradise, because not only can you add new simulation values, policies etc… now you can zero-out existing effects. So if the game has object A affects object B, and you want to mod it so in fact A affects C and then C affects B, to add some subtlety and complexity and extra feature… then you could do that without *ever* having to alter the original game files at all. This should make experimenting with player-made mods much much easier, and less risky than normal.

I hope people get stuck in and use them :D

 

Dumb multithreading question (how to safely quit a multithreaded app)

I’m not a multi-threading expert. my main process trundles along nicely then when loading the game it calls CreateThread() to do some loading stuff. Then, while the main thread is rendering my lovely loading screen, and the new thread is loading in data, some evil player hits the top right X button, or alt+F4s the game…

Instant crash!

Unless I add code which calls my thread manager and then calls TerminateThread(). This works…but then the app does not actually properly quit, so it can’t work right. Also… I now read that TerminateThread() is not the way to exit a thread anyway, and I’ve been using it all this time… arghhh!

How do you handle quitting a multithreaded app when the player arbitrarily exist it? Nobody seems to have a definitive answer…