Posts

IWBS Training (6)

Image
 In the sixth training, I have modified the reward system a lot. Also, I modified the environment a lot. I found out that the environment has to be designed to offer more and more possible situations in order to let the agent learn different situations so that the agent can find the general knowledge to complete the task. The result is good, the agent finds the convergence. Video of the trained model.

IWBS Training (5)

Image
 Add distance again with distanceX and distanceY Config for 5th training. Remember to change the Prefab. The training is still going, it will end and 30000000 steps. This training will finally converge to the optimal. Not sure if it can reach the goal in 30000000 steps. Result: not in convergence.

IWBS Training (4)

Image
 Modified to calculate the X and Y distance instead of distance. Result: better than 3rd training, but failed

IWBS Training (3)

Image
 Config for 3rd training. Result: failed

IWBS Training (2)

Image
 Modified rules:     Add "onGround" to determine if addRewards Add 3 more Observation (onGround, SecondJump, direction) Config for this training Remember to modify the Prefab instead gameObject. Result: failed

IWSB Training (1)

Image
 First day of training. Terrible result. This is the OnActionReceived function. Add Ray Perception Sensor 2D. The first try of training. Too few steps, and terrible result. Then, add a reward every time when the agent gets closer to the target. Another reward is -1/MaxStep every run of OnActionReceived.  End of training. About 0.5 ave. reward. Failed. Next time, I will modify the reward system, and add more observations to the agent. 

Experiment on Unity ML-Agents -- IWBS project

Image
 This time I have made my own environment for ai agent to train. The environment is a 2d game that I modified one of my old game projects. First, create a unity project and add the Unity ML-Agents package into your unity project. Then search for Too Cube Forest in the asset store and download it. I use 2d pixel art cubes from it to build my 2d game. Then, build the ground with cubes. Create a tilemap. Add tilemap collider 2d component to it. Then, export the assets from my old project. And import them to this new project. Then, modify the player script to an agent script. Add  CollectObservations, OnActionReceived, OnEpisodeBegin, Heuristic Now let's test the game with heuristic mode. The only thing left before training is the config file. I will need to learn more about it and then make one. The next step is building a config file and then training.