Ogre Gorge Gouger not requiring hammers


#1

see title

(more characters to make it happy) :frowning:

edit:

fence also has no cost, so one can “win” by just running behind the wall and building the fence without collecting anything (let alone 60)

(I’d make patches for those but I have no idea where those are set (and don’t know what a proper fence cost would be)

also getting slow/inf-code with moveXY boots
while self.now() < 25:
    coins = self.findItems()
    booty = None
    closest = 9999
    for coin in coins:
        dist = self.distanceTo(coin) / coin.value
        if dist < closest:
            closest = dist
            booty = coin
    self.moveXY(booty.pos.x, booty.pos.y)

#2

Ah, it does require the hammer, but it fails to restrict the weapons, so the requirement doesn’t work. It still won’t restrict a super high level weapon, but it should at least restrict basic weapons now.

Fences are free, since we didn’t want to make gold management be a thing during all the early fence levels. I guess that works… but you can’t get the bonus goal that way.

I’m not seeing the infinite loop with that code, which should be pretty fast; are you sure it’s an infinite loop and not some other sort of error that might show up in the JS console?


#3

Sigh. Now I’m not either.

That was (and is just now) on my windows 8 machine, maybe it was downloading updates or something back then.

The slow/inf-loop error is the bane of my codecombat existence. It loves to follow me around. (I can get it with move() I can get it with moveXY() . . . I am just that good…) :stuck_out_tongue_winking_eye:


#4

using python

  1. (picture below) completed the level with 60 coins and wasn’t awarded the bonus (for collecting 60 coins). Attempted it again where I collect 61 before I run back and it worked that time (although I’m not sure if that means that was the issue).

  2. One of my attempts only spawned 59 coins total

  3. I received an “infinite loop” error, so it commented out my code. Removed the comment and it ran fine.


#5

Fixed it so 60 gold will count correctly for the bonus.


#6

The problem of missing hammer or boots requirement before starting a level is very common.
Same problem with hammer for level treasure cave I think. We need to build fire trap but hammer not required.
Maybe there is problem in the test process before publishing a level, or in the way it is required which not safe enough.

Edit : I also got an infinite loop when the hero try to pass the fence. She’s stopped against the wall, and then : infinite loop detected. Even If I did not reach the x<16. Same with moveXY or move.


She try to do that :

while(this.pos.x > 16) {
    // Retreat behind the fence
    this.move({x:16 ,y: 38});
    
}

#7

On levels where the hammer is, um, nice. but not REQUIRED it make sense to allow higher weapons for later, but for some levels this is not a matter of bonus but of actual completion…

It seems that Ogre Gorge Gouger requires you to build a fence. (I don’t have a strong enough weapon to kill all the ogres before time runs out so I don’t know for 100% sure that the fence is required…)

Treasure cave requires that you lure the yeti, and it appears that the only way to do that is with the boom of a fire-trap. (I tried running around and leading him to the spot, but that doesn’t count as “lure”)

If there is a later “Trap Belt” that does fences and fire-traps, well then, there we are. :smile:


#8

For the infinite loop, the problem is worse. I tried to avoid the fence, targetting the entry, but then I’m blocked in the middle to reach the fence:


(same code than above, just the target change this.move({x:23 ,y: 38});). And it make my chrome tab crash.


#9

Tracking the issue with move over here: https://github.com/codecombat/codecombat/issues/2516

I’ll make it so that even the high-level weapons can’t be used, since as you say, the fence is required.


#10

@Nick, as said in my last post, not sure it’s because Anya was blocked. In the last picture, she was not blocked at all. It seems more random, or maybe linked to enemy arrival.


#11

I made few tests. I’ve got a code that wins. I just need to add this:

while(this.pos.x > 23) {
    // Retreat behind the fence
    this.move({x:23 ,y: 38});
    
}

to make it enter in the infinite loop. The position is not behind the fence, so nothing’s blocking.
BUT, if I change the code like this, it’s working:

while(this.pos.x > 23) {
    // Retreat behind the fence
    this.move({x:22 ,y: 38});
    
}

I just change the target x-1. So maybe the move detect that the position is reached and do not go farther, but the this.pos.x is not updated and the value is still 24. So infinite loop. A wrong rounding somewhere ?


#12

I have fixed it to not infinitely loop when you are moving towards a place that you’re already at (or very, very close to) inside a while loop. Let me know how that goes.

Not sure whether whether you need to move slightly past your target, since the move will determine it’s close enough if it’s within 0.1m, and you might end up at, say, this.pos.x == 23.000023519. But at least it won’t infinitely loop any more.