Hi all - after waiting over an hour I decided to post here instead of in Announcements.
I am making some headway into my first "real" game. I am a 32 year old PhD Economist that left academia for better pay and hours in banking. My dissertation involved teaching thousands of computer agents to play a modified form of rock paper scissors to investigate patterns of honesty and lying (I won't bore you with that here) that can arise in society.
Anyways I have always been a fan of 4X games - I have been a Civilization fan since Civ I. However, I was always annoyed that on the harder difficulties, the AI always simply cheats. They know where your units are, they get bonuses, etc. I got to thinking, could I develop a 4X type game with more of the elements I liked? I knew I had the programming skills - I made a few crappy games when I was 14 and you had to learn how to draw directly to video memory. I stopped because I am such a bad artist.
What I have at this moment:
- A randomly generated map of any desired size that can be scrolled around.
- Computer controlled characters (NPCs) that do a limited set of actions (they used to randomly attack each other but I took that away for now).
- Ability to form (one) settlement with another NPC, computer NPCs can also form one settlement.
- Settlements have a small radius in which production of one of two goods (wheat or cotton) is undertaken.
- Human controlled player can hit an attack button that shows the attack distance (but I disabled attacking for now)
- Rediculously bad graphics, I cringe but I keep telling myself "4X gameplay is the same if its text based, I can hire an artist in a year or so if I stick with it."
What I am going for:
I see human history as a struggle between chaos and order. The time frame this game will seek to emulate is Dawn of Agriculture to about 1400 AD. I picked 1400 AD because that is about the time that gunpowder gave urban dwellers a final advantage over the people of the Steppes. Prior to 1400, Mongols, Huns, and other non urban dwellers were a constant threat to urbanites. Players will be able to form a society that develops strong trading partners with neighbors (or seek to conquer them). Alternatively, a player can choose the life of a nomad and possibly develop into a society crushing barbarian force. I want to play the game and be trading peacefully and think "wow I am so smart at this game, everthing is so civil" and then wham, here comes a barbarian hoarde that developed slowly like a snowball starting 200 turns ago and from a land far away. Early on, barbarians will simply be raiders that survive by attacking trade and darting in and out of territory to pillage farms.
Also, there will be no year counter, only a turn counter. There will be no natural end and no technologies to research. Development differentiation will be through trade, internal development of a society, and policy decisions. Barbarian/raiders will develop differently but be able to go from single bandits to leaders of a hoarde. Development for both barbarians and societies will be two ways - you can develop to something higher but also fall flat back to nothing again. Victory conditions aren't decided at the moment but one could be a "victory over the barbarians" where all societies are at peace and barbarians are eradicated or a "barbarian victory over society." In addition, an individual society could become so dominant that they win as well.
Game design:
- Economics: real, market level economics will play a large role with trade and production borrowing heavily from economic theory
- Supply and demand will be handled with CES utility functions (for AI demand for either good) and production functions that adhere to economic theory. Only societies that are connected will form a market; there will be many markets at first but as the game progresses a world market will arise
- Say you decide to fortify your realm with walls and guard towers - these require stone. To get all this stone, you end up buying up a lot from your neighbor, AI Joe. In the course of this, you bid the price up, and AI Joe shifts workers to stone quarrying and before you know it, now AI Joe has an insurmountable hold on the local market for stone due to learning curves applied to stone workers. After you stop buying stone, AI Joe now can produce and sell stone cheaper to all your neighbors - who end up fortifying quicker because of this event!
- Similarly, lets say an unknown AI society, AI Billy, was out of contact of your trade network of 4 cities (right now 1 society = 1 city and I am holding that constant for the next few weeks). AI Billy suddenly comes in and it turns out he has specialized in cloth - same as you! Uh oh, now the additional cloth in your localized market drops the price and your economy crashes.
- Emergent systems - the balance of different specialties, plus the barbarian/society dynamic, will lead to games that can be chaotic, orderly, and everything in between.
Implementation
- To attempt this, emergent systems need a lot of AI players. This game will be designed for single player for the foreseeable future. To cut down on CPU load, each player will only have 1 unit they move and that one unit will be treated more like a RPG character (as you develop your character can move more, see further, have better attack values, etc). That way, a game with 1,000+ AI characters can be reasonably fast in between turns.
- Elements of genetic learning will allow those 1,000+ characters to have adaptability to the game. For genetic learning, the more the merrier; the drawback is large populations of genetic agents can bog down a machine. Before I left academia I worked on a genetic simulation that took 6 weeks to run even with multithreading. And that was only sampling 1/9th of the solution set. It was far more complex than the AI in this game will be.
For genetic agents, the length of time it takes is a function of the number of bits it takes the represent the strategy, the number of agents, and how long you let it run. You can run it for a few seconds but you might not get close to an answer. I think what I will do is limit the number of bits to 32-64, subgroup the agents to limit the population, and run it a little bit each turn (say, 3 seconds max).
Coding
- Two months ago when I started really thinking about this I thought a lot about my goals. This is for fun and I already have a full time career (that pays well and quite frankly I am overqualified for to the point that most days I sit at my desk and pretend to be busy - I was given 5 weeks to do a task that I completed in 3 days recently. I am not telling my boss just yet). So, people are going to flip when I say...
- I am aiming for only Mac. I am using SpriteKit and after looking at all the others (even Cocos2d) I just went with what was most comfortable. I actually like Objective C. If I do what I intend to correctly, it won't run well on mobile devices. It will be a processor hog and be doing tons of floating point calculations that have nothing to do with graphics.
- I see this as a "I always wanted to do this and now have a good idea and I don't care if it takes 5 years" type thing. I am working on it daily, keeping a developer blog, keeping goals, etc. But I don't care if anyone else likes it - I want to like it and thats it.
- If, by some stroke of luck, I really like it, I will hire an artist and think about porting it to Windows.