We apply Ant Colony Optimization concepts to the problem of finding appropriate reward values after successful task completion in serious games. Our algorithm is deployed within the InLife platform, which leverages the power of serious games augmented with real-world IOT sensors for educational purposes. The platform is deployed on four actual pilot sites in Spain, France and Greece with two distinct applications: teaching sustainable behavior to university students and improving social interaction skills for autistic children. In a decentralized, swarm intelligence fashion and based on individually released success and failure pheromones, our generic reward computation strategy seeks, by adjusting reward amounts on the fly, to achieve maximum efficiency in catalyzing behavior change while balancing adaptivity, parsimony, fairness and variety. On top of the necessarily limited real-world data, large-scale numerical validation of the algorithm is obtained with a specifically designed simulator, whose underlying cognitive model was validated by a clinical psychologist. Conducted experiments confirm the relevance and adaptive nature of the obtained pheromone map: the system automatically adjusts to changes in the environment such as the introduction of new students or pedagogical items. Experiments also validate all aforementioned desired characteristics and show substantial quantitative performance gains with respect to a static reward scheme in behavior change metrics, speed and success rates, of up to 40 percent with equal reward budget.