So, turns out implementing procedural colliders was easier than I had anticipated, so I did it! This should hopefully reduce the incidence of AI characters falling through the ground! At least during testings in the editor, I left the game run for a couple of in-game days, and there was no error messages of them falling through. So it should be good!
Here’s it in action:
You can see the grid of 9 or so cubes walking under the player character. This way the character is guaranteed to be standing on solid ground even as he walks.
So, NOW, I’m done with 0.4! And I can focus on 0.5. For real this time you guys. Already began scripting some of the new AI behavior that currently breaks the game because it’s not fully implemented! So, no turning back now!
In any case, enjoy! You know where to find the alpha by now, and if you haven’t signed up yet, you can still do so here!
Today is a quick but important update!
After wrestling with Unity’s physics system for a while, I was finally able to land on the settings I wanted for the ball physics.
The current system works like this:
-If the ball is in the air, apply a constant drag of 0.3 to simulate air resistance. This will guarantee that the ball has a nice arc when travelling.
-If the ball is touching the land, starting a 0.3, increase the drag by a factor dependent on the tile type. (IE: increase drag faster if on sand/grass, increase drag slower if on fairway/green)
The results are roughly as seen below:
In the image you can see the end position of the ball on the 4 different terrain types. The aiming of the arc was around the 5th tile from the tee. So on the fairway, it rolled about 2 tiles more, whereas in the bunker it rolled a lot less. The values still need to be adjusted, but the important point is that the new system works!
Next will be bounce! This will also come in handy if we add different types of fairway/etc. Harder surfaces = more bounce, softer surfaces = less bounce! This will be done tomorrow!
So here’s a couple of gifs should the ball rolling differently! Enjoy!