Currently there is no good method for mixing human and AI interactions. Mixed interaction may be desirable in the case of a competitive game, such as two player pong. A proposed solution is to have the go function in Chip8VM (chipgr8/vm.py) take a function that is called every loop iteration to allow for AI interaction. Usage of the API would look like:
def aiFunc(vm):
...
vm = init(ROM=pong.ROM, display=Trrue)
vm.go(aiFunc)
This solution has two unsolved problems. First, there is no easy way to reconcile human and AI input. Every call to vm.input will clear prior inputs (ie. the AI does not know what buttons the player is holding down, and vice versa). So there needs to be some means of combining the input from both agents.
The second problem is that having an AI act every step may not be ideal. An AI of any complexity is likely to cripple the game performance whilst also reacting to nearly identical VM states each step (as a single step changes the VM state very little). In the AI-only API there is already a proposal for sampleRate, which indicates how many steps occur between AI interactions, ideally this API would allow for a similar parameter.
@jbarlo as input master, if you could look into this issue, that would be appreciated.
Currently there is no good method for mixing human and AI interactions. Mixed interaction may be desirable in the case of a competitive game, such as two player pong. A proposed solution is to have the
go
function in Chip8VM (chipgr8/vm.py
) take a function that is called every loop iteration to allow for AI interaction. Usage of the API would look like:This solution has two unsolved problems. First, there is no easy way to reconcile human and AI input. Every call to vm.input will clear prior inputs (ie. the AI does not know what buttons the player is holding down, and vice versa). So there needs to be some means of combining the input from both agents.
The second problem is that having an AI act every step may not be ideal. An AI of any complexity is likely to cripple the game performance whilst also reacting to nearly identical VM states each step (as a single step changes the VM state very little). In the AI-only API there is already a proposal for sampleRate, which indicates how many steps occur between AI interactions, ideally this API would allow for a similar parameter.
@jbarlo as input master, if you could look into this issue, that would be appreciated.