Advertisement
Code-Akisame

Differences between MarI/O and LuigI/O

Jun 3rd, 2018
9,004
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.59 KB | None | 0 0
  1. So you wonder what are the changes between LuigI/O and the original MarI/O?
  2. I'll list them here together with an explanation where required.
  3. This is not the full list but it should be most of them.
  4. I would first like to note that we switched from the bizhawk emulator to the FCEUX emulator due to the lower requirements on the system and no ram leakage.
  5.  
  6. --Fixes
  7. Mario gained fitness from jumping into pits.
  8. Mario's fitness froze when entering a pipe.
  9. Being unable to load any saved pool.
  10. Mario gained 1000 fitness from getting past 3186 pixels
  11. Increased Mario's timeout timer by a lot. This was done to allow him to wait for the best opportunity to preform an action instead of just rushing forward.
  12.  
  13. --Simple additions
  14. Added a counter to see how many genomes made it close to the max fitness (max fitness - 30). That is the percentage counter next to max fitness.
  15. We are now keeping track of the second best species as well. That is the number between brackets next to the max fitness. This number shows the second best fitness from last generation.
  16. Added an indicator to show the current population. It is the number next to "pop:"
  17. Increased the staleness threshold to 25. Once a species hasn't made any improvements to its fitness for 25 generations and it is not the best species in the pool it will be killed.
  18. Added popups that prevent users from accidentally pressing functional keys on the AI. These popups can be turned off by setting "nopopup = true" on line 22.
  19. Allowed the AI to play as player 2 (Luigi). You can change this by changing "player =" on line 28
  20.  
  21. --Changes to way fitness is calculated
  22. Made speed a much smaller factor. I did this because often the AI will sacrifice future potential to go a little bit faster. By making this factor smaller it will focus more on progress in the level.
  23. Mario doesn't gain fitness while he is falling. This is to prevent Mario from gaining a lot of fitness from long jumping into a pit in a platform level
  24. Mario's fitness and timer will be frozen during pipe transitions to prevent him from timing out.
  25. Added the height to the fitness function. This allows him to still get a sense of improvement when he is stuck at a barrier.
  26.  
  27. --Changes made to the looks of the data the AI presents to the watchers
  28. Added hotkeys that allow the user to quickly change a few of the settings such as toggling turbo mode, showing the neural network, quick loading the last generation(with automatic savestate detection) etc etc.
  29. Changed the look of the top banner. Text is slightly smaller to fit in the extra data.
  30. Changed to neural map to show everything in the early generations and only the active neurons in the later generations. This significantly speeds up the emulator while the neural map is turned on.
  31. Changed the colors of the neural map
  32. Added a opaque box around the outputs so we can see them in dark levels
  33. Added a fitness tracker. This creates a file with the last breakthroughs of the AI and in which level they happened with which species and which genome.
  34. Added a way for people to give species nicknames. These nicknames will stay with that species even if the species number changes.
  35. Added a "ShowBasicInfo" function that prints specie specific information such as the max fitness that species has reached and the staleness of that species and that species nickname.
  36. Added an automatic turbo function. This allows the AI to automatically jump into turbo mode when it detects that it has been stuck for a long time. This includes a function that slows the AI down when it gets close the the max fitness. There is also an option to have the turbo turned on until the AI reaches a certain fitness.
  37. Made the first generation run in turbo mode (except the very first genome). The first generation is usually a lot of Mario's (or Luigi's) that stand still and do nothing.
  38. Allowed the AI to change the save pool file name to include the correct level and world.
  39.  
  40. --Changes made to the AI itself
  41. Mario is now able to detect when he has entered a looping level and stop his fitness from increasing to infinity.
  42. Created oscillating nodes. These are the black or white squares you can see below the minimap. These turn black or white depending on a mutatable timer. This allows the AI to wait for a little bit before doing something as well as walk left and some other things. I opted for 3 timers to allow the AI to create a 4th long timer by using the off sync times of the other 3. These oscillating nodes also help to prevent the AI (slightly) from getting stuck in a local maximum. This is one of my original changes that (as far as I know) hasn't been reported before.
  43. Added switching nodes. These nodes can rapidly turn on and off when activated. They allow for constant changes and prevent the AI from falling still.
  44. Added the ability to split the Neural network in 2. This is my solution to getting around the complexity problem. The complexity problem is that as the AI solves a difficult puzzle and passes it when it encounters another difficult puzzle it needs such complexity to find a network that can solve both problems at the same time that it takes an exceedingly long time to solve that. Since this AI will usually not be sped up and is learning in real time this is undesirable. The ability to split the network in 2 (all based on random chance) allow it to create separate networks for both problems effectively sidestepping the complexity problem.
  45. Created a way for the AI to go on to the next level and keep the best genome of the previous level. This includes the ability to create a new savestate (in slot 3)
  46. Mario is now aware of the world and level he is in. I might use that in the future to create level specific fitness maps for some of the levels.
  47. Added a function that triggers the reset when Mario dies or is send to the demo/title screen.
  48.  
  49. --Changes to the breeding process
  50. Created a way for Mario to do inter species cross breeding (3% chance per species). This usually results in a new species.
  51. Created a function that allows Mario to replace the second neural net by the neural net of a different species. This allows a species to show abilities of both species.
  52. allowed the AI to up the mutation rates if it has detected that it has been stuck for a long time (23+ generations)
  53. Added mutation functions for the oscillating times
  54. added mutation functions for the network switch location
  55. Added dynamic population control. This will increase the population if no breakthrough has been found in a certain amount of generations and starts to lower and rise it if this goes on for a longer period of time. It will also lower it once it detects that is has reached a new max fitness.
  56. the second best species is no longer removed by the staleness function.
  57. The max fitness of a species and its difference to the max fitness that has ever been achieved now plays a role in the likelihood for breeding.
  58. The AI will select a random bias node from below the input window when it is forced to choose a bias node.
  59. The lowest half of the species sorted by max fitness will have their reproduction probability reduced in order to promote the better performing species. This is done based on the standard deviation. A species that has a lower max fitness than the average max fitness -1 standard deviation will have its average fitness rank divided by 3. 2 standard deviations below the average max fitness will divide it by 6. At the same time species that perform exceptionally well are promoted by 1.5 times and 2 times respectively. The consequence of this is that monolithic species with a high average fitness but low maximum fitness (something which often occurs in levels with a major bottle neck) will be removed automatically.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement