-
Notifications
You must be signed in to change notification settings - Fork 0
Blog
05/05/2022
2D Rotation using input 'Speed' to determine the direction and speed.
transform.Rotate(new Vector3(1, 0, 0) * Time.deltaTime * speed, Space.World);
To make the world 3D, the ship will need 3D rotation, to I changed the rotation code to the following where the input is changed to three values (x, Y, Z).
transform.Rotate(new Vector3(x, y, z) * Time.deltaTime, Space.World);
13/05/2022
After talking with the Machine learning & Neural Network teacher Coen Crombach, I got a couple of new idea's that I might be able to implement in the project.
To determine what 'Ship' has the highest fitness only the latest value of distance to the object is used. This can be improved by adding more ways to determine the fitness. For example, by giving a score for the closet distance to the target the ship has been or facing direction to the target.
Besides determining the fitness, mutating and respawning the ship can have some improvements too. For instance, spawning in the same ship without mutations or combining the stats of the best % of fittests and checking how it will effect the end result.
20/05/2022
After thinking about it some more, I have decided to change the way test is started. Right now the ships all spawn on a random point and need to go to the same target. As a result this can make some ships spawn closer to the target or already face the target. This gives them a advantage over the other ships that are not so fortunate.
For this reason I have devided to make all ships spawn on the same point and make the target location spawn on random coordinates. This way all the ships have the same distance to the target and makes it easier to measure the fitness.
26/05/2022
I want to be able to see how the ships are doing, I will be doing this by updating the color of the ship depending on the distance to their target or score. I will be using a piece of code I have seen Brackeys use in his [MESH COLOR in Unity - Terrain Generation] video, where he uses a gradient for the colors and uses a Mathf Inverselerp formula to give his terrain color depending on the hight of the terrain.
Furthermore I want to be able to see the neuralnetwork in work, for this I need a GUI that will open up when the ship is clicked.
29/05/2022
After letting my project run a couple of times, I noticed not much improvement in the overal movement towards the objective. So I removed a bit of code that gave a 'random' location to the target every time a ship has colided with it. But instead opted for a button that I can press whenever I want a new location. This way I can let the neural network evolve a bit longer on the same target before moving the target to a new location.