CodeReclaimers / neat-python

Python implementation of the NEAT neuroevolution algorithm
BSD 3-Clause "New" or "Revised" License
1.41k stars 490 forks source link

Concatenating Networks together #220

Open stearnsbq opened 3 years ago

stearnsbq commented 3 years ago

I am working on a project to try to train a network to play BTD6 (Bloons Tower Defense 6) Current my inputs are cash, lives, and the bloons in the next round. My outputs are the number of towers * a number of pre-determined spots on the map to place the tower.

However, I want to extend the functionality to support the dynamic placement of towers in the game (float x and y values) and support for upgrading towers. This would not be possible with a single network, I was looking to make a set of networks in a decision tree structure. I am having issues with how to implement this using this library.

Main Net - should output whether to buy a tower, upgrade a tower, or do nothing

If buy a tower was selected:

Sub Net 1 - should output what tower to build

Sub Net 2 - should output an x, y value (scaled to the height and width of placeable area)

If upgrade a tower was selected:

Sub Net 1 - should output what upgrade (0-0-1 0-0-2 0-1-0 ... etc)

Sub Net 2 - should output an x, y value to try to upgrade a tower