GGO16 - Day 16
Today MegaCorps has finally become a game! You can lose and you can win - none of the stuff that will make doing so fun is in yet, but from a purely academic point of view I now consider it a game. As a bonus I re-watched the first few episodes Ghost In The Shell S.A.C. 1st Gig which was certainly inspiring.
Outcomes
I managed to add the last two things that I needed to consider this a game:
- Victory conditions (just simple last man standing at the moment)
- A message system to tell you when you’ve won or lost.
- Started some initial design work on the economy system.
This is what the message system looks like when you’ve won:
Not the prettiest UI in the world, but it’ll do the job for now…
Next Up
The days of my City singleton class having a single responsibility are long since gone, so I might stop resisting the temptation to start refactoring and cleaning up for a little bit before I go add even more complexity to the code…
The first system I want to add is the economic system:
- How you earn money from controlling city blocks.
- Then figuring out ways to take the money away again (upkeep and expenses to buy stuff).
- A happiness system to allow other corporations to fuck with your income a bit if you haven’t CHIPed the whole populate yet.
Once all of that is complete squads and combat will be the next natural step, followed shortly after by a research and development system that will allow you to upgrade squads.
Economy Design
Here’s some scribblings for my initial basic city block economic calculations. A CityBlock will track:
- Population (int)
- CHIP Adoption (% of population)
- Tax Rate (% of individual income)
- Wealth (POOR, AVERAGE, RICH) (sets individual income)
- Happiness (%)
- Happiness Level:
- 0 - 19%: RIOTOUS
- 20 - 39%: UNHAPPY
- 40 - 59%: CONTENT
- 60 - 79%: HAPPY
- 80 - 100%: NIRVANA
- Non-chip tax rate (derived from various above)
Income per day would be calculated approximately like this:
baseIncome = taxRate * population * wealthIncomePerPerson;
guaranteedIncome = baseIncome * chipAdoption * chipIncomeBonusPercentage;
nonChipTaxRate = taxRate * 0.5f * (1.0f - chipAdoption));
variableIncome = baseIncome * nonChipTaxRate * happinessBonusOrPenaltyPercentage;
totalIncome = guaranteedIncome + variableIncome;
That’s still a quite rough and I just tweaked it while tired so it’s likely to change, but the intent is simple. CHIPed population provides guaranteed income, while non-CHIPs provide significantly lower base income and are subject to happiness fluctuations as well. The idea is to encourage players to convert their territories to using CHIP. Happiness will be adversely affected by enemy agents in your territory, combat in the streets and civilian casualties.