I have optimised the AI code quite a bit, to make it more balanced and functional, and it seems to work ok now.
I have also fixed some additional issues, etc.
The AI improvements are mostly done for now. I want to add some new randomly generated events to the space sim, and test some existing features, and then I can do some more debugging.
I have added the ability for the AI to be persistent on the server.
This means that even when all players leave a zone or log out, the AI ships remain on the server and their position changes gradually.
When another player enters a zone, these AI are downloaded to that player, with their correct position.
The next goal is to properly test and improve the AI movement when it is chasing the player. Both the AI and the player can move at very high speeds, and this needs to work properly.
The AI is now capable of travelling to the players last known position after detecting them, and then entering into a search pattern once there.
I am now in the process of adding “waypoints” and new commands that will allow the player to navigate entirely from the 2D map screen.
The idea is that they will be able to evade AI enemies and travel to their destination more easily at long range by using this map screen.
The existing helm and radar guis are more useful at close range. Adding the 2D map screen opens up the scene and allows combat and movement over more realistic distances.
I have made more improvements to the new strategic guis.
It is now possible to view a “breadcrumb trail” that allows players to track enemy ships more easily, and I have improved the text display and readout, in addition to fixing some bugs.
I have also started the process of improving the enemy AI. Currently, the AI always spawns near the player, and only works at close range.
I need to improve this so that the AI can spawn anywhere in the star system, and can detect and track the player based on their speed and position, etc.
It may be necessary to spawn AI entities, and possibly stellar objects like stars, planets, etc, witha reduced-height z axis.
So, the X and Y axis would be the entire length of the solar system, but the Z height (Or, Y-height in unity) would be much shorter.
This would mean that the game is still a 3D game, but the guis can be designed to show almost all relevant information using just the XY plane. This will make gui interaction, etc, much easier.
The AI can now be spawned, and moved, correctly at any location within the solar system, the issues with 32-bit precision have been solved.
The AI movement patterns, etc, are also working.
There are, however, quite a few minor issues with the guis and the AI movement. These changes and improvements will take several weeks to implement properly, since they are quite complex, but the space simulation part of the project should work a lot better once they are done.