Tanks VR devlog #9 - bots progress & better (tracks) physics
In a previous devlog, we discussed the decision making system of the bots. In this devlog, we'll talk about the navigation system, which resulted in a new improved physics system with realistic tracks. Tanks will be able to move over rough terrain and obstacles, which is a massive improvement over the current system. Bots will also avoid hitting eachother, using an avoidance system.
While creating the navigation system, we noticed that the current physics system would not suffice for future maps and the bots. The tracks were static and not controlled by physics, this resulted in the tank not being able to navigate on slopes and drive over obstacles. Visually, the current system is not pleasing, tracks are clipping through sidewalks and appear rigid. So we started looking into using track physics. We did a lot of research on track physics, as it can be very performance demanding. There are paid assets available, however these did not fit our requirements. Thus, we started developing our own. Our implementation is still in development, but we're confident that it will be a huge improvemnt over the current system. Therefore, we will include the improved physics in the next update. The gifs below show the Panzer 38 driving over various obstacles, displaying the new physics system.
|Tank driving down obstacles|
It can be seen that the tracks react accurately to the drops in terrain. Tanks will also be able to drive down larger drops, which is demonstrated in the next gif.
|Driving down large obstacles is not a problem|
Each wheel in the track has its own suspension, which results in dynamic wheel positions. The track will adjust accordly. This effect can be seen in the gif below, where the tank drives over highly irregular obstacles.
|Wheels and tracks adjusting to rough terrain|
The resolution of the track is still pretty low, which results in sharp edges on the track. This will be a future point of improvement, but doesn't have our priority for now. The suspension of the wheels give the tank a realistic feel when accelerating, braking or driving up and down obstacles. The gif shows the suspension pushing the tank up after it drives down a ledge.
|Tank's suspension at work|
After completing the new phsyics system, we could work on the navigation system. Just like with the physics system, navigation can become very performance demanding. We looked into multiple implementations and iterated through them. After some trial and error we arrived at our solution, which has good performance and feels like human behaviour. The bot receives a destination from the decision making system and is able to navigate correctly to that destination. The bot also detects other tanks that are on a collision course with itself. If there are any, it will try to avoid them. The gif below demonstrates two bots driving directly towards eachother. It can be seen that they change their direction to avoid collision.
|Bots changing direction to avoid collision|
As for performance, we're able to simulate many bots without any major performace hits. The gifs below show about 50 bots driving towards a destination. Each bot is simulating tracks in real-time, navigating and actively avoiding collisions with other tanks.
|Multiple bots navigating towards a destination|
|Multiple bots navigating over rough terrain|
The subsystems of all bots are now mostly completed, which we will combine to complete the full bot implementation. We're also working on the UI overhaul and are trying out variations of component damage systems. These are both things that we think are required before we can work on adding multi-crewed tanks. Check out the roadmap for more insight in Tanks VR development.