GideonMarsh / RL-Mega-Man-v2

Reinforcement Learning in Mega Man, Version 2
1 stars 0 forks source link

Weapon change script #5

Open GideonMarsh opened 3 years ago

GideonMarsh commented 3 years ago

Add the ability for Mega Man to utilize the different weapons

Add 12 new output nodes to each brain, 1 for each weapon (Mega Buster, 8 robot master weapons, 3 number weapons) The highest of the 12 is the weapon that is currently chosen

Handle ties with simple priority order (is there a more sophisticated way?)

3 ways to handle unobtained weapons:

  1. Treat all unobtained weapons as the Mega Buster
  2. Ignore the nodes of any unobtained weapons, check second highest and so on
  3. If an unobtained weapon is highest, stick with current weapon
GideonMarsh commented 3 years ago

Having 12 different output nodes for the different weapons disrupts the program. Having most of the outputs not be related to controls reduces the effect of mutations. Need to figure out another method of selecting weapons.

GideonMarsh commented 3 years ago

I like having 1 node for weapon selection, and making different values of the node signify different weapons. The values may need to be adjusted.

GideonMarsh commented 3 years ago

While running the first stage, the weapon change node gains a lot of mutations. It very quickly gets to the point where it is rapidly changing weapons. If it moved on to another level after gaining a weapon, it would be switching weapons every frame.

Is this going to be a problem with this method?

Here is a potential 2 part fix:

  1. After the first stage, disable all possible connections on the weapon change node. This should have no effect on its behavior, as that node only effects weapon selection and no weapons are available before that point.
  2. Keep the frame counter going while selecting weapons. This will deincentivize weapon changes as fitness is partially determined by time, and it should work with all existing systems.

More steps may need to be taken to reduce the amount of rapid weapon switching, such as having a cooldown period between weapon switches.