amidos2006 / gym-pcgrl

A package for "Procedural Content Generation via Reinforcement Learning" OpenAI Gym interface.
MIT License
113 stars 27 forks source link

Unable to figure out how the rewards are decided when comparing states. #7

Closed ChintanTrivedi closed 4 years ago

ChintanTrivedi commented 4 years ago

Could not find the methodology used for calculating rewards in both paper and code. Could you please point me to relevant text/code? Thanks!

Edit: To be more specific, how does the problem module (section 3.1) assess level quality? What are the factors used to determine this and how to decide these factors in other games?

amidos2006 commented 4 years ago

In the paper, we talked about the goals for each of the problems and the reward function is just a reflection of how close to that goal. For example: if you want to have one region and before doing a certain action the number of regions is 4 and after that action, it became 3. Then the reward will be 1 * scale factor. You can check the actual code about rewards or anything related to the problem such as width or height or whatever in the Problem module in the environment. For example: here is the reward function for the binary: https://github.com/amidos2006/gym-pcgrl/blob/master/gym_pcgrl/envs/probs/binary_prob.py#L98