renewal of the IA


For a change from last week, I'd like to introduce you to a subject that interests me a lot: AI. In "market", to survive, it is necessary to make others lose. This reality is cruel but actually quite realistic. Since the game is strictly for one player, the others must necessarily be artificial intelligences.

These artificial intelligences use a genetic algorithm that allows them to adapt to any circumstances. This has two advantages:

  • mod creators don't have to worry about programming AIs, they'll do it themselves;
  • the AIs can theoretically adapt to the player and take advantage of the situations you create.

In effect, these IAs are a success and a failure. It is a success in the sense that collectively they will make the game markets evolve in a plausible way. So the player can actually feel like they are in a real market with other companies. Nevertheless, they are a failure in that they do not manage to use all the possibilities that are available to them.

To take a simple example, in the base game, you can make a profit by speculating in the market or by creating plants. AIs tended to do nothing but speculate and take very little risk. This meant that only one company would eventually take over and survive indefinitely without any AIs being able to adapt to it.

Two corrections have been made to the AIs to avoid this situation:

  • the size of the neural networks has been reduced. Without going into details, by reducing the size of the networks, it is possible to make them adapt faster to a reduced size environment. It is as if to learn how to make a journey, you were to learn how to fly a plane, a car, a motorcycle and you were to learn the maps of all the public transport networks. This will allow you to go anywhere, but it will take you a long time to learn. If you have to stay in the same city, you can just be learnt the main lines of the transportation network, it's very fast and it allows you to get around well;
  • "ghosts" have been created to allow AIs to evolve during their life. Without going into details, genetic algorithms normally study a population and make it evolve and die before evolving a new population. In "market", the challenge is that we can't use these generation concepts and we need AIs that evolve in real time. The AI I created used each individual as a kind of generation and allowed for evolution in new AIs using the already eliminated AIs. One of the consequences of this was that the AIs already created could not evolve. Now, to correct this situation I have allowed each company to have a number of "ghosts", i.e. companies that do not really exist but can test possible alternatives. If a ghost performs better than the real company, the company's AI is replaced by the ghost's. The less efficient ghosts are also replaced by new ones testing new situations.

Both of these methods make for enormously more interesting AI. This should allow the player to go out and observe how other companies behave in the future without feeling like they are surrounded by idiots.

Get Market

Leave a comment

Log in with itch.io to leave a comment.