Back to Recipes Homepage
recipe picture
Recipe: function_CheckLostPoints
Created by WBarme1234 71 40
3.5
Your rating: None Average: 3.5 (2 votes)

Profile

Name: function_CheckLostPoints
ID: 104366
Created on: Wed, 01/20/2021 - 04:46
Updated on: Wed, 01/20/2021 - 12:46
Description:

Insert function into Your recipies - This will detect and regain lost points



Best For


Comments

Joined: 03/08/2012
Groups: None
function_CheckLostPoints - Description

--Problem observed: One complete Cycle of Wiggle/Shake ends not always with the maximum of points possible
--This modification will detect and regain this lost points

scoreBestRanked = -999999.9
lscoreBestRanked = -999999.9
currentScore = -999999.9
scoreAtbestRanked = false
scorebestchge = true

function CheckLostPoints( )
currentScore = current.GetScore() -- Get current(actual) Score
-- print(" - Current Score : "..currentScore)
scoreBestRanked=creditbest.GetScore()
-- print(" - Credited best Ranked Score : "..scoreBestRanked)
--Running always to verify if best score reached
if ( math.abs(scoreBestRanked - currentScore) < 1E-3 ) then
if ( scoreAtbestRanked == false ) then
scorebestchge = true -- show 'change to best ranked score' only once
end
scoreAtbestRanked = true -- Set bit: Recipe started or running along best ranked score
end
if ( scorebestchge == true ) then
print(" - Running along my own best ranking =",scoreAtbestRanked)
scorebestchge = false
end
--Running always after shake, wiggle, ...
if ( scoreAtbestRanked and (scoreBestRanked>currentScore) and
(lscoreBestRanked creditbest.Restore() -- regain lost points
print("Reseting to CreditBest-RankedScore - due to lost points detected")
end
lscoreBestRanked = scoreBestRanked
end

function Score()--return score, exploration too
CheckLostPoints( ) -- Check for lost points
return uo.energy and current.GetEnergyScore() or current.GetScore()
end

Joined: 09/24/2012
Groups: Go Science
Suggestion

Thanks for the function !
Combining with a check of loss bonus point would be very useful at start (design) puzzles. In order to maintain achieved bonusses.

Want to try?
Add to Cookbook!
To download recipes to your cookbook, you need to have the game client running.
Parent

none

Children

none

Authors
Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, Boehringer Ingelheim, RosettaCommons