Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Broken Circle: need feedback (and cheats)

Oh wait, now I remember why this happens. I was debugging this while trying to find a new exploit and discovered that this only happens because the cast animation changes the hero's z coordinate, triggering the other fail condition for the traps to blow up—this explains the “occasional exploding” you have mentioned earlier, and this is also why I asked for a trick to skip this animation earlier in the Slack channel while delving into another possible exploit for this level.

So, in sum, the first frame exploit does work for all of my test cases, however it does not work for cast in this level due to the fact that the cast method has a side effect of increasing the hero’s z during the animation which triggers an unrelated fail condition.

1 Like

It’s an interesting research. Thanks!

I’ve made a test case level for this issue, to whom it may concern (@nick @Bryukh).

Referee code:

{  
  onFirstFrame: ->
    @hero.valueIntroducedOnFirstFrame = 'Ok'
    @hero.apiProperties.push('valueIntroducedOnFirstFrame')   
}

Test code and results:

valueInFirstFrame = hero.valueIntroducedOnFirstFrame
hero.wait(0.01)
valueAfterFirstFrame = hero.valueIntroducedOnFirstFrame

hero.say("Value introduced in the referee's OnFirstFrame retrieved in the game's first frame: " + (valueInFirstFrame or "Undefined")) # -> "Undefined"
hero.say("Value introduced in the referee's OnFirstFrame retrieved in a later frame: " + (valueAfterFirstFrame or 'Undefined')) # -> "Ok"

Here’s the link to the test case level, though I’m not sure if it is accessible to others while in dev mode.

1 Like

Now I suppose that onFirstFrame runs not before an user code, but really on the first frame. We can check it with different wait and framerate. Thanks!

‘onFirstFrame’ is executed inside chooseAction, but I’m not sure is it executed before user code or after or at the same time. As @Serg supposed it can be a race condition.

Btw, now I remember that I got the similar problem when for example I put enemies at the firstFrame or add some properties and as the results I got errors when tried to use them in the user code immediately.

Interesting. Can anyone do this if they have their session id? And how long does it last for?

I guess so.

It seems the current system holds just a single game session for each level a player has played. So, until the developers decide to change it, I believe the game session lasts forever. However, if the player edits their code for the given level (even without submitting), the game session will display the updated code instead of the one they had previously submitted.

This is a very difficult level. How I can do for start it?

@Bryukh
I found another exploit:

hero.blink({'x':114,'y':67})
hero.blink({'x':93,'y':67})
hero.blink({'x':68,'y':67})

Using Ritic, this level was too easy, patch this up to restrict ritic the cold.

Thanks, but I won’t restrict Ritic. I will think what to do.