schrum2 / MM-NEATv2

MM-NEAT version 2.0 is no longer supported. Please get MM-NEAT 3+ from https://github.com/schrum2/MM-NEAT
Other
11 stars 5 forks source link

Combining gradient from buildings with unit locations #448

Closed schrum2 closed 7 years ago

schrum2 commented 7 years ago

This is a new input substrate that tracks unit locations, but assigns scores to them in accordance with the building gradient from #418.

Here is how you will accomplish this. 1) Generalize AllOfPlayerTypeSubstrate so that different units can have different scores (I've done this in the upcoming commit) 2) Extend AllOfPlayerTypeSubstrate to make a new class that is the same, overrides the new scoreForUnit method. 3) To do this, the new class you make (AllOfPlayerTypeOnGradientSubstrate) must also construct an instance of BaseGradientSubstrate (as a private instance variable). The AllOfPlayerTypeOnGradientSubstrate class can call the getInputs method of BaseGradientSubstrate whenever it gets a new game state, and then use the resulting gradient grid when computing the value to return from scoreForUnit (since units can tell you their x/y location)

schrum2 commented 7 years ago

All that is left is to incorporate AllOfPlayerTypeOnGradientSubstrate into the complex eval constructor.