Data Driven City Life AI

How to design and implement a system which makes city lifelike

I have been following the problems CD Project Red is having with Cyberpunk 2077. I noticed that one of the problems is AI related, namely police officers, who seem to appear in a very illogical manner, even in locations where it would be highly improbable to encounter them. Also, their response time to crime events (done by player) is something that any police force would be envious. In normal life police arrive at crime location after a long period of time, if at all, and response time varies depending on priorities. But the problem does not limit itself only to police officers - at the launch time the whole city was kind of bland. The buildings are there and some NPCs, but it does not feel realistic nor full of life, as a city of that size should. And I do not accept any of those excuses that "we tried hard" or "we have never done anything like this". If a studio has a history like CDPR, they simply are not acceptable explanations.

Instead of developing a game with dynamic, living city, it seems that CDPR has designed and old-fashioned linear game with detailed quests, but the city is designed around and on top of them, almost as an afterthought. Basically it is the quests that run the city. Later they have tried to add dynamic features to city, but obviously these "last minute additions" leads to problems, because it is like building on mud - eventually it will start to slide.

There seems to be no overall structure which binds all the details and elements together. Events may seem illogical, NPCs do not seem to be doing anything worthwhile, city does not seem to response reasonably to player's action… in short, there is no feeling of real, living city, and that was something which CDPR talked about when marketing their CP 2077 project.

This gave me an idea to write about how I would design a City AI, which handles events and everyday life of large simulated city. Of course I do not claim that my approach in this matter could be better than something from the bright minds of a multiple award winning AAA game studio. After all, I am just a inexperienced and unsuccessful dabbler, while they have a legion of talented game developers with several decades of experience publishing flawless and bug-free games.

Advantages of Well-planned City AI

In a big project it is important that the groundwork is done properly. When groundwork is solid, then it is easier to build on top of that, add new pieces, and even change them - as long as the groundwork holds. We should start from ground up, and leave the decorative details, storylines and adventure plots for later. It seems that the design in CP 2007 has proceeded just the opposite - in wrong order. I cannot understand why, because there surely was no lack of source material. I have been a game master in tabletop Cyberpunk since the first edition, and second edition has plethora of sourcebooks published.

As a veteran of designing adventures for RPGs I find the city setting to be one of the most enjoyable settings to design narrative content. It offers a plethora of opportunities just by itself, and more you design the environment, even more ideas and possibilities will literally flood into your mind, just waiting to be used. Best thing about a city is that you cannot design it thoroughly, you will always have plenty of room to add new ideas during the game. Players do not see this, because their perspective to the city is limited. However, they will always get a feeling of real city, where there are lots of individual people living their lives, and also lots of adventure possibilities.

It does not matter whether the game itself is quest oriented or not, the city should be like a living city, because it is a very important part of game immersion. If the city seems illogical and shallow, it does not matter how detailed the quests are - actually, the deep details in quests just emphasize it how empty the game is outside the quests. If there had been a deep design of living Night City, implemented as game mechanics, then it would have easy to design quests of top of that - even in such way, that if player sidesteps from a quest, he just faces normal life in the city, but it still seems immersive and living.

In my opinion it is best to start with designing the world, or city in this case. You design its layout, prominent personalities, organisations, companies, power groups, laws etc. But most importantly you should also design how that world or city lives. What kind of events happen there, daily cycles etc. You start the design with general things, and then step by step add more details.

As an experienced AI  and simulation designer and programmer I know there is an excellent, easy and quite compact way to implement this as a Data Driven Citylife AI, which controls what kind of things player will encounter. This doesn't have to very complex, because in a single player game we only have to simulate a small part of the city in detail - namely the part that player is currently observing and its surroundings.

There is no need to simulate everything all the time, as long as the city is designed to follow logical and consistent rules that generate believable and immersive situations wherever player goes. This makes all AI functions easier to implement because the life and events in the city have been generalized as logical, consistent rules and data. Same applies to narrative storylines, adventures and quests. They can exploit the City AI to make the narrative more immersive and reactive. This is not rocket science but just common sense storytelling system, and that is why I don't understand how an experienced studio with lots of designers and developers can even fail in a task as simple as this.

Idea of System

In order to accomplish a light simulation of city life, first we have to define several concepts, which will be used for data. Although the core mechanism is rather simple, there will be lots of data, since this kind of AI is totally data driven. It is the data which defines the behavior of whole city, its areas, and its inhabitants. This kind of system works in any RPG setting, both in computer games and tabletop games. When fleshed out, this system could work easily in Cyberpunk RED or any scifi setting.

As a programmer I see this City System as a master AI which controls NPC AI, traffic system, media broadcasts and creates dynamic procedural content like characters and small events. It is an independent module, but it has to be able to work in unison with mission/quest system. Neither of them should totally override the other one, both systems should exist and work all the time, but depending on the situation the mission system might be mostly passive, or actively put events and NPC into play.

Thus it is very clear that we should design the city system first. When we have defined what normally happens in the city, it is easier to integrate narrative missions and adventures without destroying the flow of normal city events. Actually, this way we have the advantage of mixing the normal events with special adventure events, and get more flexibility in the narrative flow.

City Divided

Our assumption is that the actual city, its map, layout, general atmosphere and history is already available. What follows is just a system, which makes it easier to handle its intelligent simulation. It is like a set of AI behavior rules and data, that will instantly provide description of what is happening around player, wherever he may be. Before we are there, we have to break the city into pieces.

First you divide whole area into sections and subsections. Sections are large areas with similar activity, like industry, commercial, business, office, administrative, cheap housing, moderate housing, expensive housing, suburban, development, energy. These areas can be of any shape and size. They do not have to be of same size. Usually they would be the same as named city sections in real cities.

Each section is divided into arbitrary number of subsections which should be of similar size in all sections. These subsections are most important units in this city simulation, since they are used to track players movements, and simulate what happens around the player based on the data of each subsection. Since they are roughly the same size throughout the city, they make it easier to estimate distance and travel time calculations.

Time Units

Anyone who has lived in a city knows that the life you encounter there is not always similar. There are rush hours and quiet times. Some areas are quiet during the day, but full of activity during night, and vice versa. So we need appropriately descriptive time units - something that is general and not too accurate.

For most situations following units are sufficient

  • Day: Normal day, Weekend, Holiday

  • Time: Night, Dawn,Early Morning, Morning, Noon, Afternoon, Late afternoon, Evening

Those units and values give us a way to differentiate the behavior of the city as a data when we combine it with city sections and subsection. If necessary, we can also define certain special dates. But we need even more definitions than this.

Encounter Groups and Individuals

Now we should decide what player can encounter in this little world. People with different occupations, vendors, officials, police, gangs etc. One group should be General citizen, a catch-all group for ordinary citizens of area. We can go into more detail, and divide this group into several groups according to social status and income like

  • Poor Citizen

  • Worker

  • Middle-class

  • Teens

  • Children

  • Salaryman

  • Specialist

  • Executive

and what ever kind of basic citizens may live in this world. These are meant to be used as kind of window dressing. They do not need any special behavior, they are just going to work or home, shopping or just passing time. They are like those extras used in filming, people who make the scene look real. Outwards these NPCs look natural and any special NPCs will easily blend in the crowd, thus avoiding the usual problem where some character is so obviously "important clue for the mission", perhaps even highlighted. As a player I do not want clues offered on silver plate, I want to find them myself and use my brains for it. I do not see any point of playing a game where everything is already solved for me, and I just have to click on the spot pointed to me.

Now we should decide what special groups are relevant in our game. In a real city there would be hundreds of different occupations, so in this example I am only going through some of them. In modern, cyberpunk or science fiction environment we can imagine that at least following classes could be relevant; meaning that they can affect the choices player has, or provide random encounters.

  • Police (uniform, plain clothes, undercover)

  • Gangs

  • Organized criminals (bodyguards, henchmen, leader)

  • Urchins (pickpockets, muggers, bullies, hustlers, beggars)

  • Performers

  • Reporter

  • Fixer

  • Prostitute

  • Corporate person

  • Business person

  • Maintenance

  • Cleaning (window washer, carbage collector)

  • Courier

  • Celebrity

This list is not exhaustive, of course, these are just examples. In real game I would add much more, to cover all possibilities. Also, I would add several options to many classes. For example, a corporate person could be either some low ranking office clerk, or a high ranking department boss etc. Police officer could be a rookie or veteran, perhaps he is corrupt etc. Performers could be just annoying, or extremely good, drawing enthusiastic crowds.

If I need more background on any of these characters, I would create it with a character background generator I have made for this kind of situations. It creates a background history with events, family and relatives, profession, skills, possessions etc. Once created these characters may be stored and used again, later. Seeing a same NPC in another event would strengthen the illusion of a real world, even if it were just a random NPC.

Probability of Being There at Certain Time

When we make a  selection of classes like we did above, we should keep in mind that in an average, normal city most of the people are just average workers, trying to make their living in there. Not everyone is some kind of high level criminal or pumped up violent gang member. However, in some locations or area almost everyone could be a gang member of an affiliate.

As in any city anywhere there are totally different areas in the terms of demographics - meaning that you may usually encounter certain groups of people in one area, but rarely in some other area. These differences can be expressed as probabilities.

At this point we can define for each NPC class a probability to appear in a subsection of the city for certain day and time unit. Of course we have to define these probabilities for each every subsection, every day unit and every time unit, and their combination. At the same time we also define other values like how many persons there are representing that class, are they in groups, their outlook and mood.

  • Appearing probability

  • Quantity expressed as a function with minimum and maximum

  • Grouping as single individual, pairs, small groups, large groups etc.

  • Outlook as expression like stylish, shabby, poor, expensive, fashionable etc.

  • Mood as expression like busy, lazy, angry, joyful, relaxed, edgy etc.

Probablity of Doing Something

It is not enough to determine what people are on the scene, we should also determine what they are doing. Just like the actual probability of presence may change during the day, their actions may change. In the morning workers are probably heading towards their work, while in the afternoon they may go home, or go to some bar, shopping etc.

  • Chilling

  • Eating/Drinking

  • Socializing (conversation, debate, arguing)

  • Idling

  • Commuting (going to work, going home)

  • Shopping

  • Demonstrators

  • Street Performers

  • Hustling

  • Selling

Player does not always know what all those NPCs are really doing, but they should have a logical basis, which affects the selection of necessary animations and general movement. For example commuting and shopping both may use similar animations, but the pace and routes of the movement are different. A person heading to work or home will walk faster and most direct route possible through a mall, while someone shopping there probably walks slower, stopping now and then to look at something etc.

Again, all these differences in the behavior will make the whole scene more natural. Otherwise it could look like a place, where dozens of robotic persons walk monotonously in a hurry, giving an artificial feeling.

Atmosphere and Attitude

Usually, most areas have some kind of atmosphere, a first impression of what kind of area it is. This could also be an attitude, like an animosity or disdain towards people who are not part of the people native to that area.

We should define two specific things - a general atmosphere, which is something that anyone visiting the area would kind of sense after being there for a while. But there is the other side of the coin too - how does the residents of that area react to visitor, what is their attitude towards them. This usually depends on the class of the visitor, his profession, outlook etc.

To make it easier to handle, we would store data only about attitudes that are not neutral. Thus we could describe an area to have attitudes like

  • Hostile

  • Suspicious

  • Aversive

  • Wellcoming

  • Friendly

These are expressed as probabilities again, which means that the attitude will be different. This attitude factor only affects the behavior of NPCs who are residents of that area, work there or otherwise consider it their domain (e.g. gangs).

Regular Routes

Although the real city seems quite unpredictable it still follows certain patterns and mechanisms, but the outcome of those mechanisms is usually unpredictable. Above we have already defined most of those mechanisms, but not all of them. Usually modern cities have certain highly predictable, regular elements which function almost like a clockwork.

These regular elements bring order into the chaos, and strengthen the illusion of real city. Usually these are things like bus lines, trains, subways, trash trucks, and delivery trucks, but they could include regular police patrol routes and guard patrols. In gamedev terms, we can simulate regular routes with splines, and even define timetables with varying accuracy. These routes may define how various regularly trafficking units move on their route.

This way it makes more sense how e.g. police patrol will respond to some event. They don't just teleport behind your back. They are somewhere along their patrol route, and may respond quickly, or after half an hour, if they are behind heavy traffic. Or they may not come at all, because you are middle of an area which is highly hostile towards police officers.

Also, we have already checked from our data (defined above) what kind NPCs there are present in that subsection where player is, and thus we know whether there are police officers present on this subsection, and neighbouring subsections etc. If there are, they may respond very quickly.

Together these randomized patterns and regular mechanisms give a good balance of predictable and unpredictable events - just like a real city life - and even unpredictable events follow a certain logic and pattern.

Quests, Missions and Adventures

When we have defined the behavior of the city as data, we already have a good understanding how it will work during play. Now it is much more easier to design quests, missions and adventures in such way that they really fit in, and work well with normal events of city.

More importantly, we know that there could be multitude of ways the city reacts to player, they may be small, so called random events, or large pre-scripted  missions and adventures. However, now we have the possibility to avoid railroading the player along linear storylines, and instead give more freedom, since we know that there is always something happening around the player. NPCs are not faceless characters anymore, they have behavior and player may not even understand that some encounters were not part of pre-planned adventure.

Player may encounter a fixer, who is desperate to raise some cash and would sell exceptional piece of hardware for a low price, or player may encounter instead some con-man who just tries to rob the player - or he may not encounter them now, but next day. If larger missions and adventures are appropriately divided into smaller sequential pieces, it is easy to blend all these different levels together, so that they appear as on seamless narrative.

Learning and Evolving City

We have to remember that this is a game simulation, and its primary purpose is entertainment. There may be storyline or ad hoc events which change the city, perhaps even in big scale. City may evolve gradually, changing the demographics and layout, depending on time scale. Sudden catastrophes, like blockwide fires, large accidents, or large riots can happen, and they affect not only on their location but sometimes on several surrounding subsections.

So, it is clear that this City AI has to be able to react both small and large events. Also, it must learn to react to anything player may do. This will be the hardest part to define, but not impossible. Basically, most of this is just changing the data according to events. It may also involve introducing new NPC types, that did not exist in the beginning. However, this is beyond the scope of this article, and I just mention it to point out the dynamical nature of city in a game world.

Fleshing out and Linking

All we have done here is just a design concept. This is the point where the real work would begin. We should program the City AI mechanisms and develop all data structures. We should test that and watch out if we have included all details we need. After that we should link all that to other pre-existing game mechanism like NPC characters and their AI, animations, background generation, minor events, major events, missions etc.

If everything works properly, we should have a city that really feels alive, where small encounters blend with major adventures, enhancing them. Of course it would get repetitive eventually - depending on amount of work we would put in it - but within the average playing time it would feel more realistic than without these mechanisms, so I think it is worth all the work.

Understanding the Evolution Tree of Game Developers

X Never Marks the Missing Link

If you ignore the advice I game in the first thesis I talked about in my previous newsletter, and happen to participate actively in social media, you will notice - like I did - that there are all kinds people calling themselves game developers. Do not make the mistake and think they are really game developers - at least not in the same sense one could define a video game developer during 80's or 90's.

Nowadays it is really important to identify and understand different groups, especially in social media. If you do not understand what groups they are, you cannot know what group do you belong to… and that could mean trouble. As we all know, our current culture feeds on “us against them” attitude, if someone is not with us, then he is an enemy. This guide will help you to understand who you can communicate with, and who is right and who is wrong.

This brings it to my 2nd thesis:

Understand the Evolution of Modern Game Developers

Before 2005 all game developers were hard working and skilled professionals, who had learned their skills through continuous decade-long self-improvement and learning for experience in a fierce struggle for excellence. Anyone who had not enough skills, or enough willpower to learn those skills, simply dropped out. There were no free game engines or ready-made game assets. You had to build your own engine - developing a game was practically synonymous with developing a game engine - and make your own assets. Alas, a modern "idea man" (a person with only an idea but no practical skills) had really hard times.

But this last decade is totally different. There are still people who have that 'oldschool pro' mentality, but nowadays they are a very small minority, unfortunately. Game developers have been evolved into a number of distinctive groups, which I call Wannabes, Idea Man, Hobby Developers, Pretenders, One Hit Wonders, Career Professionals, Old Pros and Outsiders.

Wannabes

Wannabes are perhaps most numerous, and they overwhelm all FB groups. Wannabes are persons who suddenly have decided that they want to be game developers, because it seems like an easy job to get lots of money and fame. Usually they think that after so many years of playing games, they understand what games are, and thus they can easily develop games. Often they have a really ingenious idea to start making a MMO game on their own, and they think it shouldn't take longer than a month or two of one developer's worktime. Unfortunately, they lack all skills and all the required experience and understanding to proceed much further. You will notice it from the fact, that it is usually a Herculean effort for them to even install the game engine. There are many clear behavior patterns in this group like

  • Not reading any documentation

  • Not reading any learning material provided by engines publisher

  • Barraging FB groups and forums with constant noob questions which anyone could find an answer just by looking at documentation

  • They mix assets from several projects without checking do those assets even function together

  • They assume that engine should be able to read their minds

  • They always blame either engine  or the assets or other developers

  • They often ask "what is the best engine", "what is the best 3D tool" etc. because they think that the tool will somehow make you "the best developer".

  • If they seem something "cool" in social media, they immediately demand a tutorial

  • If you make such a tutorial, they demand the assets which they can copy-paste in their project.

  • If you give them such assets, they just blindly put it in their project, probably in wrong manner, and then they are whining and demanding that you should help to make everything work again.

  • They are always asking and looking for a mystical tutorial, that will give them AAA level mastery in 10 easy tricks in a couple of days.

  • They do not understand that to achieve mastery in some skills, it takes years, or a decade of constant learning and practice

  • They often take free assets, arrange them as a pretty scenery (this is really easy nowadays and demands no skills), then they post a picture of it in a FB group, where other wannabes are awed, give hundreds of like and comments like "cool!", "wow!" etc. For a wannabe this gives a (false) proof that he is a skilled game developer now.

  • As such they seem to be unable to develop any real skills because they lack patience, effort and self-criticism.

Ideaman

There is special breed of these Wannabes, that you may encounter occasionally. While usually wannabes are encountered as flocks (you can imagine a flock of seagulls, flapping their wings, screaming constantly, trying to snap some food from your hand, and dropping their guano everywhere) this special breed is seen alone. It is like a vulture, and it is called Ideaman. Ideaman is Wannabe that has evolved, in a way that he realized his lack of skills. But he still wants to be a famous and rich game developer, it is his destiny, this world should provide him that if he wants it.

These Ideaman persons lurk in FB groups and in every social media, looking out for those stupid enough to catch their lure. Usually they first make a post about their "ingenious and unique idea", and ask people to join the project.  When they see persons who clearly have enough skills to really develop a game, they will contact him offering lucrative future developing an unique game that will generate millions. These persons can paint a pretty picture of something really big, and he is offering this unique opportunity just for you.

Well… he cannot pay any kind of salary now, but everything will be compensated when game is ready and millions just start to pour in after its success. Actually you should invest not only your skills and time, but some money too… but you will get all it back with interest. Of course, since the idea was his - and idea is the most important part of this - the Ideaman will take 80%, and rest is divided amongst others. You are a major idiot if you jump into this bandwagon.

Sooner or later Ideaman notices that no one reacts his post except with sarcastic comments. So, Ideaman changes his strategy and contacts directly anyone who posts something cool in the social media. Ideaman tries to convince you to join the project using the same arguments, and giving some cheesy and honeyed praise how your skills would be absolutely crucial to make the project successful. Of course, the benefits are the same - you will get paid handsomely when the game is launched and starts to generate millions.

Hobby Developers

It is inevitable that some of Wannabes evolve into another direction, acquiring real skills. They are able to develop simple features and perhaps package it into a game. However they miss the experience, self-criticism, originality and devotion to excellence. Thus, they become Hobby Developers. These people are quite happy developing their simple games. They usually have their own special communities where they worship some 30 year old pixel art games, and fanatically try to reproduce them.

Quite common characteristics of Hobby Developers are:

  • They are very community oriented

  • Most of their time is spent chatting and mingling with other hobby developers, less actually developing a game

  • They are very eager to participate in Game Jams

  • Their dialogue is filled with quotes from game media, books etc., and

  • generally there is a deep void of original thought in there.

Hobby Developers are quite harmless group, unlike Wannabes who are usually just annoying, and they seem quite positive. Do not let it lead you into false assumptions, like you could have a meaningful conversation with them. Oh no… they are always interested only in their special subject like retro pixel-art games, platform games or any other decades old nostalgic stuff. If you show them your project that uses latest 3D technology and genre-defying features, it is totally beyond their comprehension, they cannot see it, because their brains are totally hardwired to see only pixel-art or something similar.

Pretenders

Some people will stay as hobby developers, but there are always few who evolve - or devolve, depends on viewpoint - further to either Pretender or Career Professional. Pretenders are a group that seems much larger than it is in reality. This is due to the fact that they have no practical skills, and thus they do not do anything productive, so they have lots of time to generate lots of fuss about themselves especially in social media - that is why they seem to be everywhere, always organising some events, game jams, discussion panels, workshops. They organise things, but rarely develop anything by themselves.

Pretenders have their focus on their self-importance, gaining power in the community and industry, making themselves look important in the game development, without doing anything real work. They wear many guises, using fancy titles to hide the shallowness of their so called "work", like

  • Community consultant

  • Business consultant

  • Monetization manager

  • Community manager

  • Studio manager

  • Product owner

  • Producer

  • Creative manager

  • Social media content producer

  • Influencer

  • Advisor

  • Keynote speaker

  • Top Voice

  • Board member

  • Chairman of board

Pretenders just pretend to do something very meaningful work, but practically they are just live action roleplaying game development. They have two sandbox environments for this. First environment consists of game development studios, with heavy preference of start-up studios. Another environment consists of game development organisations and associations, and social media, of course. These are ideal environments to grow your importance, because no real skills are needed, and it is very rare that someone could call your bluff. Usually it is enough to just flex your social influence, and quite soon these Pretenders are chairmen or something else. Then they use their authority to organise rules and codes of conduct that all other game developers should follow.

Pretenders working in some studio have their own distinctive behavior patterns. They often have a totally insane idea that meetings and conferences are actual development work that pushes the project forward. They are always organising meetings, which are just a burden to others, because no one can do anything productive in a meeting. They seem to think that when they have presented their latest core loop or monetization scheme on PowerPoint, it is the same as done. They do not seem to understand that others have their hands full of coding, modeling, animation etc. Pretenders have only their slides, decks and Excel sheets. However, they often are eager to take all the credit for ideas and hard work done by other people.

Career Professionals

Career Professionals are another breed. For uninitiated they may seem like Old Pros, but there is a clear difference. Old Pros have their focus on making better games with better technology, and constant improvement of skills. Career Professionals may have quite high skills, but they are always more interested in their career. It is usual to see them hopping from one studio to another, and then again after a while to third etc. Often, they do not stay very long anywhere, because they have to improve their career, collect more accolades, titles, awards etc.

Usually their social media profile is filled with ex-AAA titles from several studios. It may sound impressive, but in reality it is very hollow world, where career, business and money mean everything. For Career Professional games are just a commodity to generate money, and more the better. Even awards are a mean to generate more money. That is why they have their network where they give awards to each other and their games, fooling consumers to think that those awards would really guarantee good quality.

One Hit Wonders

One Hit Wonders is a special group which sometimes evolves from Hobby Developers. This is a totally unpredictable and spontaneous event. These are developers who published their simple game… perhaps pixel art… and suddenly it started to sell very well or extremely well. This is always just pure stroke of luck. It just happened because… well… because stars were right. There probably were no big budget, no expensive marketing. It just simply went viral for reasons no one understands. These things just happen occasionally, but you cannot really plan them.

The problem for One Hit Wonder developer is that they do not understand, that their success was just luck, nothing else, it did not happen due to their superior planning or divine level skills, because there were none. However, One Hit Wonder started to believe that he is some kind of superior game designer. So, after that he tries to reproduce his commercial success with whatever happens to come into his mind.

Of course, it is very rare that such stroke of luck happens twice in a row, so they cannot understand why their new came flopped… "I am a genius designer, this cannot be"… The cause of this catastrophe has to be some outside force, because One Hit Wonder cannot believe that he himself would make any mistake. It has to the market situation or something else. Some One Hit Wonders may even start to develop conspiracy theories that there is group of envious or evil.

Truth is that if you want to reproduce your success, you should be able to really understand the reasons why you succeeded, all the details. You can do that only if you had a detailed plan from the start, and have not only succeeded, but failed too, several times, and you have always checked how each detail contributed to success or failure. Then you may have learned how you should do something if you want to achieve an other thing. Problem with luck is that you do not learn anything useful, but may stick to totally false beliefs of your own superiority. But One Hit Wonder never learns this, because he believes in his own genius, and trusts his intuition only.

Real Old Pro or New Old Pro

Real Old Pro types are like dinosaurs, they seem to belong to another era. Some of these have really started game development during 80's or 90's, but sometimes a Hobby Developer may suddenly develop an Old Pro -like attitude.  Sometimes they found a new small studio, and intentionally try to keep it small, without unnecessary roles, and keep the focus on making interesting games.

There is another possibility how Old Pros appear. When Career Professional advances too much, he actually starts to devolve into a Pretender. This can happen accidentally when someone becomes a Lead, Manager or some other managerial role. Usually the lure of money and fame is too much, and devolution process proceeds beyond the point of No Return, and becomes irreversible. However, some Career Professionals notice this before it is too late, then detach themselves from the loop, and start developing games the way "like it used to be", thus becoming Old Pros.

However, it is not clear whether these could be considered a same group or not. Scholars are still debating on this matter, and a large number of them think that they should be divided into two separate classes: Old Pros and New Old Pros. Prominent game research departments in several universities have furious battles on this matter of utmost importance.

Outsiders

Then there are the Outsider developers. They are kind of a missing link in evolution tree. In many ways they are like Old Pros or Hobby Developers. These persons are often highly skilled generalists, who avoid other developers. They have their own view about development, and they are not interested what others think about them. They often avoid social media, and generally have low social interests, almost bordering a case of autism. Sometimes they can be cynical, or even pessimistic.

However, it was an early mistake in game research studies to label them as sociopaths holding some kind of grudge towards community. Later research found out that this was just a misinterpretation. They do no really care about game development community at all. They are not interested in gamedev societies, social media, meetings or conferences. They just put all their focus on their development of games and skills.

Game Scholars

Beyond those groups described above there is one group which is often encountered in this environment, namely Game Scholars. However their inclusion is problematic, because they float around in their own parallel universe, which does not really affect game development universe. Game Scholards are theoreticians, living in their Ivory Tower land. They spend all their time writing down theories about game design, game development, sociological and cultural issues in gaming. They are like many academic studies, having no practical use in game development. They have their own award systems. Usually they endorse highly some obscure games that no one really plays in real life. Thus, in this evolution tree, we can compare Game Scholars with elves, bogey man and other fairy tale creatures - we have heard tales about them, but no one has actually seen one.

Life in Constant Core Loop

or Theses of Game Development

Most of the people probably do not know it, but I have been involved in game development community before last decade. So I have seen all kinds of things during these decades, not only on video games, but other games too, like tabletop RPGs, live-action roleplaying, boardgames, strategy games etc. I have also seen how this scene has changed. In certain aspect the change has been dramatic, sometimes to good, sometimes to bad.

Based on my observations and analysis I have developed several theorems or theses, actually, which occasionally contradict "official" views shown in game media or endorsed by game development community organisations. These are purely my views only, but they have been tested in so called real life, and in the future I try to stick to them. I could give this some grandiose name, like Manifesto of Outsider Developer, which would be appropriate, because I consider myself an outsider developer, but in the grand scheme of things it really does not matter.

This is a lengthy subject, and there are several thesis, so this time I will introduce the first, and continue next time with others.

Thesis 1. Avoid game developer community as much as possible since they do not bring any value to your life

One thing that I heard often was the claim how well-coming and friendly this game developer community is, how everyone is so helpful, and how everyone encourages others. According to my experiences none of this seems to be true in general. There are clearly certain insider cliques, that endorse each other and their projects, give awards to each other. They build a kind of gamedev celebrity status for themselves, thus ensuring that anything they say on these matters is taken as authoritative.

This kind of gamedev community is very active in social media - Facebook groups, Twitter, YouTube and Twitch. This elite group has number of disciples, worshippers and other hangarounds who repeat and spread their masters word. For these acts of servitude, the master occasionally give their blessing and may endorse loyal disciple's project in social media.

But if you are not part of that "elite" group or their hangaround friends - especially if you are different and not showing proper respect for community gospel -, then you are just nobody, and your proper place is shown either with total ignore or by trolling, dislike, disqualification and other kinds of negativity. You will get lots of sneer comments, underlining their message that no one should take you seriously.

Usually this gamedev community gospel has focus on start-up studios, game monetization, business aspects and getting rich. Your importance in community is measured by your business attitude, how much money your studio got (either as sales or investments). Latest trend seems to be to endorse studio employee quotas for special groups like gender or ethnic background.

I support equality, but it is these kind of things that separate me from the rest. I try to think with my own brains, and my logic says that only criteria for hiring an employee are his or her skills, not his gender, race, or anything else. For me the whole concept of gender and race is totally irrelevant. I do not even care if someone has different opinions than me. Actually I find it to be a bonus. Diversity in opinions gives better results, so I do not want a group of yes-persons who agree with everything I say. I am not that foolish that I assume me to be always right. Development should be something where you go through several possible solutions, instead of sticking to the first solution that pops into your mind (and others just blindly agreeing with it). If team members have different views and are not afraid to show them, it gives wider perspective for everyone involved. This is why I hire people only according to their skill and mindset, nothing else matters.

Anyway, as a side note, I think that this sudden enthusiasm to promote all kinds of Social Justice Warrior issues, in the manner that the whole concept of equality is perverted with quotas for underrepresented groups, is just a shield polishing gimmick for social media, which organisations, companies and individuals use to show "how I am now so good human being". It is quite similar to indulgences which you could "buy" to delete your sins (I know that Church outlawed outright sale of indulgences in 1567, don't bother pointing that out). Mechanism is similar, with a certain action you gain a kind of social media sainthood. Also, as a person belonging to underrepresented groups I find it intellectually insulting because it turns the whole problem upside down, it does not solve it. Instead of giving everyone equal chances based on their skills and experience, suddenly those two things don't seem to mean anything anymore, and I want to be judged and chosen solely by my skills, experience and intellect. If they are not enough, I do not want to be chosen based on some special quota.

What I said above makes me different, a person who just does not fit in with that gamedev community. But it is not just that, in reality the differences stem from early on. After I got more involved in modern video game development this decade, I noticed how my opinions about game development were very different compared to official gospel. First of all I am not interested in business side of game development, or at least I am not interested in this modern "lets found a start-up and make millions" attitude. I see game development as a normal business that may provide you a living, in a way that you make a good product, sell it to customers, and you get money in return for your own living and keep the development going for future years, too. But current gospel says differently, with a message that either you should make billions or you are nothing.

My focus in game development is to produce quality content, worlds deep in stories, history and atmosphere (this stems from my years in tabletop RPGs), games that should give a feeling of "being there" and experiencing something that seems to even continue beyond the mountains you see in the horizon. I am very imaginative person, and that seems to be the another problem here. I have an enormous respect for developers like Tarn Adams (Dwarf Fortress), Richard Garriot (Ultima series) and Miller brothers (Myst series) and several others who have persistently created whole worlds and universes. However, I do not respect current gamedev culture which idolizes shoddy ultra-monetized simplistic mobile games which all look the same, or 120th remake of retro pixel art games, or games that are clearly just quick asset flip to make lots of money fast with some latest hype trend.

Another problem that I just cannot digest, is how much of incompetent wannabes there are who call themselves game developers but who lack in skills and experience so much that I do not even know where to begin. Compared to previous decades, especially pre-2000 era, jumping into game development has never been easier. Before year 2000 it was really difficult to start game development, unless you already were a quite competent programmer or modeler, because usually you had to develop your own engines and tools, and most of all you needed lots of dedication to learn.

Now… you just pick one of several available and free engines or tools. Sadly, most of these wannabes then lack the dedication, and they assume that their "idea" should be enough. Don't take me wrong, I have nothing against amateurs or hobbyists, because all of us has started from zero. But the major difference is whether you have enough dedication, persistence, determination to learn, make mistakes and learn from those mistakes, and continue that for years and years, or do you instead assume that everything should just come for you with no work, no sweat, gaining AAA level skills from that magic 10 trick tutorial that so many wannabes seem to be searching. I just cannot tolerate that kind of stupidity, and since that type of persons seem to crowd every forum and social media group, I decided it to be best that I am not there.

In the beginning I tried to blend in, I helped other developers, gave advice to solve their problems. I made and published some tutorials. In the beginning, when I published pictures or videos from my own projects, the response was first positive, but then, gradually it started to change from general ignore to more and more negative or targeted trolling. That was really no loss as such, since I am not interested in empty endorsement, but I am interested in intelligent discussion and exchange of ideas. However, there was practically none. Gamedev communities seem to be mostly boozing societies meeting in bars, where they endorse each other in half-drunk stupor. Unfortunately, I drink only water and natural juices.

At some point I was hit with the revelation - other gamedevs are not your potential customers. Basically, other gamedevs do not put bread on your table now or in the future. You are not making your game for other developers - you are making it for gamers. This is a big difference. So do not assume, that you get any kind of benefit from gamedev community, because you won't, ever. Of course there are exceptions to the rule, I have some game developer friends, but they are individual cases. By all means try to find friends, but generally I advise people to stay away from that big game dev community for several reasons like

  • Other developers want you to help them

  • Other developers try to get your hard earned techniques and tricks for free

  • Other developers try to lure you to make tutorials for them, that will benefit them only

  • Likes and other popularity in social media may feel nice, but does not fill your empty stomach

  • Usually other devs like and endorse you when they try get some favours from you.

  • When you need some help, no one has time for your problems.

  • They may give you advise and insights which are totally useless because usually they judge your game based on first impressions they get from one picture (drive-by-advise)

First three cases will waste your precious time, but you gain nothing. Other cases just show that you will gain nothing else, either. Drive-by-advise from other developers does not give you anything useful to make your game better. It may just lead you astray, and in the worst case brainwash you (through social media) to try to please other developers to gain popularity. So, it is advisable to disregard all comments from other developers. Don't go down that vicious loop.

Instead of wasting time with other developers and social media, I urge people to stick to their own plan and development. Concentrate on self-improvement and selfcritisism. In the end only you know yourself what your game is about. Mingling with other developers just confuse your thoughts. Make your game in a way you think is best, even if it contradicts what those so-called gamedev gurus say.

In the next newsletter I will introduce my second thesis, which presents different game developer groups and their evolutionary scales.

How Artificial Intelligences Learn Teamplay in 3D Ballgame

Progress Report after 5 Rounds

ROT-8 Supra Series started over a month ago, and Artificial Intelligence teams have played five rounds of league matches. They have progressed half way in this experiment, there are still four rounds left before play-offs. At this point it is interesting to analyse how these AI teams have fared.

Background

ROT-8 Supra Series is an AI experiment, where individual AI programs learn to play video games in competitive manner. It has following phases

  1. AI learns to play video game using computer vision, image analysis and human-like virtual inputs.

  2. AI learns to understand tactics of the game

  3. AI learns to play as a team with other AI players against another team with AI players

In this case the game is a futuristic 3D ball game in a closed arena. At the first phase the AI has to learn basic movement and actions. AI uses a special API to control game character, just like human player would do. Player character can move freely in the 3D arena environment and observe its environment with a camera that can rotate independently from directional movement. This camera is used in computer vision analysis (OpenCV) and machine learning to make AI understand the gaming environment and different elements like other players, the ball, goals etc. At this point the focus is on learning basic actions like moving towards the goals or ball, picking up the ball, and throwing or kicking it into one of the goals.

After AI has learned the basics, it starts to learn higher level actions in the second phase. Now AI has to accumulate spatial sense of game environment, which means that it not only builds a conceptual 3D map in its memory, but also a layered semantic map used to understand and analyse game situations and tactics. AI can use machine learning to build logics which handle its behavior in the context of game situation, like

  • where other players are,

  • where the ball is,

  • Should I advance to goal or defend own goal

  • How to prevent opponents getting the ball

This leads to third phase where AI learns to play as a team instead of just as an individual. At this stage things are measured as effectiveness of tactics, how long team can keep the ball, how fast they make a goal, and how effectively they defend while keeping offensive going on.

  • Should I pass the ball or advance myself

  • How to find tactically good position

  • How to communicate with other team members

are examples of logics that players have to learn.

The Game

Game itself is fairly simple. There is a closed arena with number of goals. Each team has its own goal, and in the midfield area there are several common goals. These common goals are active only occasionally, for a short period of time. Team gets points if it throws the ball through the goal, and gets penalty points if it accidentally throws the ball through the team's own goal. This penalty point is used (instead of increasing opponents score) for machine learning purposes. This way the score reflects only team's own efficiency.

Players are small cube shaped robots, which can roll around, climb the walls and also jump using air thrusters. They have limited energy battery, which can be recharged either resting or getting a battery pack. Robots may ram each other, causing physical damage to opponents and themselves, but they have slow self-repair functions. The video above shows how game works.

The League

There are 10 teams in this competition, each team using a different machine learning scheme to train its opponents in game actions and tactics. It does not mean that team uses only that method listed, it just means that it is the primary method used for training or for AI logics, there may be other, secondary methods used in some stages of learning. The teams are

  • Deepstate (Deep Learning)

  • DataKrush (Fuzzy Logic)

  • CrashBanger (Neural Network)

  • NullZero (Memetic Algorithms)

  • Eternal Loop (Reinforcement Learning)

  • Singularity (Generative Adversarial Network)

  • Gladiators (Structured Modular Logic)

  • Trojans (Genetic Algorithms)

  • Neptune Oilers (Inductive Logic Association)

  • Sunfounders (Bayesian Networks)

All teams were trained through phases 1 and 2 to ensure that the games in these league matches were real games, instead of players just tumbling around erratically. The focus is more on learning advanced gameplay and tactics.

League consists of 9 rounds, and all teams play against all other teams. After that the best teams will advance to play-offs, where at each stage a number of teams will advance towards final match, using best of 3 matches scheme. As said above, teams have now played through 5 rounds, and we can already make some analysis on their progress.

Analysis of first 5 rounds

Current ranking of teams is as follows:

Teams have accumulated match points and goals as recorded:

If we look at how teams accumulates match points cumulatively as graph we can see that Fuzzy Logic and ILA have a straight upward curve. Other teams have progressed with mixed success. However this does not tell much about their differences.

Although it is the winning that gives you match points, the primary focus for each team is to make as many goals as possible. Number of goals scored is the primary metric of efficiency. Following graph shows that each team has clearly learned to make goals, in ever increasing manner.

However, that graph gives us a false figure that every team would be learning efficiently. If we change the perspective and plot those numbers in such way, that the scores are a difference from median of cumulative scores in each round, we see more clearly that there has been ups and downs in contrast to how other teams have learned to make goals. It is interesting to notice that based on this, the efficiency of Fuzzy Logic is not so dominative as match points show, and its efficiency seems to be decreasing.

This leads to another metric. If the team wants to  win the game it has to make goals as much as possible, but it also has to make goals more than the opponent. That is why I used the difference of goal scores for each match as a secondary metric to measure the efficiency of teams. Following graph shows how the cumulative figures of such score have evolved so far.

In some respect this shows a bit different results. Again, this shows that ILA has a steeply rising curve, while Fuzzy Logic is much more "flat". It is also interestenting, that Neural Networks has partially outperformed Fuzzy Logic. Reinforcement Learning has now a steep upward progress, but how reliable that is - time will tell.

It will be interesting to see how the teams manage the 4 last rounds. If you are interested you can follow matches in Youtube channel

ROT-8 Supra Series

And Twitter

ROT-8 News

Year 2019 Development Retrospective

What I developed with Unreal Engine

When the year is ending, it is always interesting, valuable and self-educational to look back and reflect what I kind of development I have done. Some distance allows me to see if I achieved anything worthwhile or if I improved my skills.

Year 2019 was interesting since I was still recovering from health issues which almost devastated my physical health during 2018. Even when I was not in 100% working capacity, I somehow managed to develop number of features for ROT-8 and Planetrism. Probably I have forgotten to list some features, but this seems to be quite comprehensive list:

  • ROT movement system

  • ROT camera system

  • ROT multiplayer

  • ROT AI player

  • ROT ballgame camera director system

  • Machine Learning & AI - Computer AI learns to play ROT

  • Git tutorials and reference for UE developers

  • Basic multiplayer tutorial

  • Multiplayer physics objects, grabbing etc

  • Multiplayer peeing

  • Multiplayer mountable flying and walking exoskeleton robot which can use its arms as legs, and manipulate things

  • Several other newsletters

  • Comprehensive hierarchy and system for surface, physical materials and object types, to support better game mechanics using object identification used in path finding, interactions and procedural generation

  • Generic animal and NPC framework with AI behavior and task system

  • More stable car physics

  • Procedural colony building system

  • NPC AI visual path finding system (non-NavMesh) using environment analysis

  • Self-driving robot car system with visual path finding, obstacle avoidance etc.

  • Winch and towing system

  • NPC driver and passanger system

  • Generic communication system for animals, robots and NPCs

  • Grappling hook and rappelling

  • Procedural dynamic environment and ecosystem

You can watch this as a video in YouTube

Year started with our side project ROT-8 game which has different game modes like adventure mode, capture the flag and ballgame. There were two primary challenges in its development. ROT-8 is physics based game, where the player pawn is just a cube, meaning that it has no clear front side. It can move in any direction, and use jump engine. Not only is the design of controls peculiar, but it makes it very interesting to design a camera system that makes playing as smooth as possible. So, I put it my goal to develop an automated adaptive camera, which minimizes the need to adjust camera manually, while keeping important game elements in focus, and player still has option to turn camera manually. Although there is still some room for improvement it seems to work quite well

Capture the flag and ballgame needed AI players so I had to develop such. Since AI and machine learning are my main skill area, it was really interesting to make AI players that can learn to play ballgame in co-operative manner as a team, and use some basic strategies. Ballgame needed also an camera director system which could be used either manually or totally automated, switching from one camera to another, choosing automatically good angles, so that viewer can understand what is happening in the game.

I also continued to put out a newsletter with tutorials and other stuff. I wrote a two piece tutorial on effective Git use for UE developers. Later I also made a lengthy tutorial on how to make a basic multiplayer game in UE with only Blueprints. I also had to create an example project where I used Kimmo's Moonbase assets to show a concrete environment for player pawns and multiplayer interactions. Those multi-limbed robots were an interesting experiment, since their limbs are both arms and legs. Robot can walk with them, but it can also use them as arms to interact, grab items and manipulate tools. Walking animation is totally IK-based, there are no animation blueprints at all.

Actually, I prepared lots of other stuff for newsletter and tutorials like

  • multiplayer physics object interactions,

  • multiplayer exoskeleton robots with articulated limbs

  • Procedural colony building system

and some other subjects (that I was developing in my projects), but I noticed that these tutorials and newsletters just did not find enough interest. There were couple of readers, but they did not generate that much interaction that I could justify spending large amount of hours on writing them. My primary purpose was to arouse some discussion, swapping ideas and experiences, but that just did not happen.

Based on those statistics, I decided to put this newsletter on hold. I understand that my writing and skills are poor, and I am not a media celebrity, which are both also a valid reason to discontinue posting any more newsletters or tutorials. Besides, it seems that these times are such that it is practically impossible to have any kind of intelligent communication. Extreme polarization, constant trolling, whining and self-centered attitudes combined with algorithms that endorse only click-bait content intended to trigger people is not really a fertile ground for serious discussion which tries to focus on boring subjects like programming, algorithms, artificial intelligence etc.

While I was developing ROT-8, I was also preparing a big overhaul of everything developed for Planetrism so far. We started the development with such speed, that after a while there started to appear all kinds of problems. Hasty start was one reason for this problem, but the bigger reason was that since our focus was Virtual Reality in the start, and the whole VR field was largely at experimental stage, many things were developed with ad hoc mentality. The lack of coherency in the implementation started to show. There were independent solutions to different features.

Problem was not in the game design, since our vision of game and its features has not changed. We knew that it is large and complex, and it will take lots of time to develop. The problem was in the implementation, and we just had to refactor and redo most of the stuff - otherwise there would be serious problems maintaining and expanding the game.

That refactoring took lots of time, and partly  it is still going on, one component after another. But it is necessary, since it will make further additions easier, keep different features manageable when they are based on more generic solutions, and  optimize whole system. Anyone who has developed games knows that the development involves lots of prototyping, and quick ad hoc solutions. That is a necessary evil, because it will quickly show whether the feature works or not. But then, when it seems to work, you should tidy up you implementation.

But this process gave an opportunity to implement everything better, and develop features that fit together, in a way that there is a comprehensive system behind everything that happens in the game. During this time I redesigned the set or parameters that define surface types, object types, physics materials and trace channels, so that they support many features that depend on that data - features like

  • Custom navigation and path finding

  • Procedural dynamic environments

  • Construction system

I cannot emphasise enough how important it is to understand thoroughly how the whole collision system, trace channels, object channels and profiles work. If you design them well in the beginning, it will save lots of time later and it will make it easier to manage how your actors interact.

When that groundwork was done, I started the work on generic creature framework, that would support animals with relatively simple behavior plus robots and NPCs with more complex behavior. Main idea in this framework is to generalize creatures, their behavior, movement, animations etc in data oriented way, so that the creature is like a collection of parameters, animations and visual assets. Creatures can be customized individually with configurable parameters, but they share the code that controls their actions. This will make it faster to add new creatures, since we only have to define parameters and certain animations.

Since these creatures can move anywhere - on ground, indoors, on water, under water, in air and climb trees etc - I had to develop a custom navigation and movement system. Normal navmesh has many problems, and updating a dynamic navmesh can be a hit to performance. So, I developed a system that analyses the environment and creates paths. This has numerous advantages. One of them is that the path can go anywhere, even under the landscape. Path can lead up to the tree top. I can control animations based on analysed path, e.g. character can jump, crouch and crawl when necessary.

Somewhere between all this I also made a procedural generator for sci-fi bases which could generate multilevel structures that conformed to ground. It uses component based approach and several algorithms which control the overall architecture.

After this I put some focus on vehicles. Unreal Engine uses PhysX, and its car physics have some quirks which made vehicles quite unstable. Since our idea is that also NPCs could drive vehicles and vehicles could be even self-driving, it was a serious problem. But I developed some corrections to car physics, and now those vehicles are extremely stable. While I was doing that, I also developed jump jets for the car (because I am a fan of Knight Rider). After that I had to develop towing system for those vehicles, and grappling hook with winching capability.

Since the car was now stable, I developed a self-driving AI system for vehicles, with visual environment analysis, navigation, path finding and obstacle avoidance. It uses similar approach as the creature navigation I developed earlier - it does not use nav mesh - but is adjusted to fast speed, too. After that I programmed NPCs to drive the car themselves, and made a driver-passenger system, where player can swap places with NPCs. Player can drive the car, or sit as a passenger while NPC drives the car, of car can drive itself (with passengers or not), or player can steer car remotely.

I also started the work on climbing system for player, NPCs and other creatures, which includes not only free climbing, but rope assisted climbing with rappelling. Again this was something that I developed and tested in a separate sandbox project, and then imported that solution into Planetrism.

Planetrism is a game, where gameplay is very community oriented. Player has to manage the colony, all non-player characters and robots. Game world itself has several other creatures which can live in packs. So there is a need for general communication system that covers all possible methods of communication ranging from simple gestures and olfactory signals to complex dialogue of humans.

At the end of the year I also put some work on a procedural environment generator, which makes dynamic biomes. It is intended to complement those tools already existing in Unreal Engine, not to replace them. This generator produces environments with dynamic ecosystem, resources you can harvest, vegetation that can grow, seed new samples and expand. Trees can fall, wither and die. Mushrooms and other vegetation can spread and grow on anywhere on horizontal and vertical surfaces, on any object. Water level on lakes can rise or sink, and vegetation adapts to situation. Everything is linked to game mechanics.

Overall, it was quite interesting year, and I learned many new things while inventing creative ways to make Unreal Engine do what I wanted it to do. My approach is such that I experiment a lot, make several prototypes, test and iterate. Unreal Engine makes it all very easy and enjoyable. Will I continue to write these newsletters? I really don’t know. It depends on whether I have some extra time or not.

Loading more posts…