This article is the first in the series about the development of my artificial intelligence project. I'll try to introduce you to it. I had to give it a name especially for this article so that it would be easier to refer to it later.
In the beginning, IntelSim was just fun, without any specific purpose. I was implementing things that I learned at the moment and sometimes testing some of my ideas. But as time went by it grew and grew and since then I found the main purpose for
my life it. The Purpose is...
...to implement graphical, 3D environment in which we could simulate the evolution of creatures controlled by artificial intelligence.
Artificial Intelligence does what?
Let me explain...
The 3D environment part is presented on the image below. It's generated procedurally and doesn't have borders, or in other words, when you reach any border you enter from the opposite side. The terrain is huge as it has 2^32 chunks in each direction (2^32*2^32 = 2^64 = 18446744073709551616 in total) and each chunk has 32x32x256 blocks. So I don't expect anything to ever travel through the whole of this. The terrain is also modifiable. Currently only manually by players, but when creatures will be implemented they will have this ability as well. Creatures are easy to explain. Those are just entities that can receive inputs from the environment, process it and react. Then we have 'controlled by artificial intelligence'. There are many implementations of AI but I will focus mainly, but not only, on recurrent neural networks (RNNs). Each creature will have their own. Those neural networks will be processing inputs and will produce reactions. More about that in future articles from the series.
What is implemented at the moment?
One feature of IntelSim is 'multiplayer'. I thought that 'singleplayer' simulation would be boring and that we could achieve more diversity and complex behaviors among creatures easier when multiple simulations could be conducted simultaneously in the shared environment. Then, creatures of one player could interact with creatures of other players, and the situation where the whole simulation is dominated by a single species will be avoided. The creatures could evolve interesting behaviors like symbiosis or competition for resources. So I split IntelSim into server and client. The server handles:
- all the rules that creatures have to obey like dying when they have no energy or using energy when they do some actions
- the environment, like generating terrain shape, placing resources, time of the day, temperature etc.
- keeps all the clients synchronized
And the client's role is to evolve a creature that will survive in the environment as long as possible. The server could dynamically change the difficulty level based on how well the creatures perform to avoid stagnation.
Here you can see two creepy 3D .stl models looking at each other.
Don’t judge them, they were born so ugly. What matters is what’s inside. This is how one client sees other clients. From the same screen, you can deduce that .stl files can be loaded to the client.
Next screen fragment: chat functionality. It serves as a basic method of user-user and user-server communication. There is also support for TrueType fonts and special characters (like ąćęłńóśźż in my native language).
And the next screen shows the shared and modifiable terrain. We can see 3 distinct clients looking at the same spot from different angles.
I want for everyone to be able to conduct their own simulations so I decided to make the client cross-platform. Currently, it works on Linux, Windows and OS X.
Technologies I used and why.
As IntelSim was supposed to be 3D I had to choose 3D API. My choice was: DirectX, OpenGL. Vulkan API specification at that time was long before release. So together with the cross-platform requirement, I had no other choice than stick to OpenGL. Probably in the future, I will transfer to Vulkan, but that's not a priority for now.
The language choice was pretty straight forward for me: C++. Both server and client are currently written in it because of efficiency and because that is the language I know the best. There could be more clients in the future for different platforms which would require another language, like java on android.
GLFW API takes care of creating windows and OpenGL context in each system I target at the moment. It is not the crucial part of IntelSim so it saves me time.
- Make IntelSim a game-like experience, so it is easy to start and more people can have fun with it.
- Plugins which will allow extending functionality, like:
- dedicated algorithms for controlling creatures, natural selection, evolution etc.,
- graphics shaders
- and probably more on demand.
IntelSim is part of my engineering work so I'll have to allocate time to features that matter. If you got interested while reading or have questions, leave a comment. Maybe even share if you know someone who might be interested. And if you are interested in 1080 TI STRIX OC, then I guess you may do the same 😉 Have a good day.