Prime Pathing feedback

I found Prime Pathing a pretty good and interesting level overall. However, there are two points that caught my attention.

1. Momentum preservation

I understand that we are on ice, but I found that the momentum preservation here is really frustrating. That is, when you move to a given position and then stop moving, the momentum will push you a little further. After I had a working solution, I had to submit multiple times because the momentum would often break my solution. In fact, even my session’s replay is broken due to the momentum.

But again, I’m not sure if this behavior is by design. Is dealing with momentum part of the level design?

2. “The end”

The goal and instructions often mention “reaching the end”, but it is not quite clear where the end is. Seeing as the bear traps are the bonus part, one can deduce that “the end” is somewhere between the mine field and the bear traps, but this is not obvious nor clear, in my opinion. Also, I’ve watched some replays where the player walked to the extreme north-west part of the level, because the goal was not quite clear.

Would it be possible to give a visual feedback of where “the end” is, or be more explicit in the text about where “the end” is? Perhaps “reach the end of the mine field” would be good.

Thanks for the awesome challenge. :smile:

You should try a pre-release older version, ~10 normal sized minions. :wink: (I had a working solution but never submitted it.)

I don’t have the problem with overshooting a targetPos (maybe try replacing instances of “not moving” with a this.move(this.pos))…rather perhaps because of the small sizes of the minions I had a minor incompatibility with my solution and my units would at random times pause movement before moving on to their next target (but that’s just my problem).

Personally I really don’t care much where “the end” is; it really isn’t too hard, IMO, to complete the bonus objective, because the guide already tells the player how to (assuming they can pass the primes + mines).

Other nitpicks:

  • Brian’s shadow is much smaller than everyone else for some reason.
  • Maybe disable the starting gold; it might be possible to summon soldiers on a suicide run…
  • The level apparently requires the Telephoto Glasses or higher, but one can do a findByType('bear-trap/fire-trap') (Kithgard Worker’s) to get the hazards. (Though everyone at this point should have the Twilight Glasses…right?)

Overall a very fun level, though testing for a prime numbers was certainly much easier than actually navigating the maze (for me, at least).

Maybe the problem happens because I’m using moveXY() and wait(). With constant movement the momentum doesn’t seem to interfere.

The pre-releases are work in progress, right? The goals don’t include moving all the troops to the end it seems. For some reason, this pre-release version seems much harder than the current live one.

I’ve made a new submission which beats my previous scoring, and this one’s replay is not broken.

Yeah, the second goal doesn’t work because the goal trigger was set to the wrong goal marker.

But yeah, the “pre-release” (clarification: older version) was much harder because of more minions and minions blowing up due to larger (normal) size.

I was using flags to manually move through the level. I think I ran out of time before passing the last row of mines but still got the first reward.

Interesting level. At least one puzzle that involves calculating prime numbers is obligatory for a site like this.
For my approach I tried generating a list of consecutive prime numbers before looping through the hazards to figure out which were duds. Getting through the path is another matter.

A problem with something I tried:
I tried writing a function but it wasn’t working properly so I made Tharin say things for testing purposes.

def binSearch(num,mini,umax,array):
    self.say("bin"+num+" "+umax+">="+mini)
    while mini <= umax:
        # more things

Some lines later I had

test = binSearch(31,0,412,primes)

But Tharin would always say "bin31 412>=undefined"
He was also saying that umax was undefined until I changed the variable name from imax to umax.
Any suggestions?
Edit: The issue looks similar to this one.
Edit: I got it to work. I might post the details on the linked thread.

Very fun level for me. Follow the leader with troops wanting to cut corners was not trivial.

My only comment is I had to put a strict limit on the initial generation of my list of primes to avoid the program thinking there was an infinite loop. Before I coded the pathing, I could generate the first 500 primes reasonably easily. Once the pathing array was developed and in place, I had to cut that down significantly, unfortately … like 350 additional primes to the 20-30 I hand entered into an array. ( I did continue to generate more primes as I moved through the various mines though, so I was more ready for the bear traps.)

Which I guess brings me back to my question. Is it possible to write Python or JavaScript code which manually stores a variable array in the code itself? There are a couple languages out there historically where that was possible, but never easy. :wink:

I think checking the numbers (if they’re primes) on the spot is rather quick and simple (find some algorithm on stackoverflow, e.g.), so there is no need to precalculate all the primes up to a certain limit. But of course you can do that, or you could even copy-paste the first n primes as an array from wherever you like.

As for commanding your troops, yes, that’s a bit tricky - basically you have to wait for them to catch up and then go again…

Not exactly my question … I did not feel like manually pasting a bunch of numbers into the code, so was wondering if the source code area could be manipulated somehow by the program. It is sort of a weird concept and only very rarely supported in a language. To put it another way, can Python (in the wild or just in CodeCombat) generate and save a flat txt type output file that I could have subsequently cut-and-pasted into my code?

Personally, I went with the generating a primes list as I worried regarding the size/number of calculations in the bear trap area … Linear with Math.sqrt(value). Whereas once you have a good list of a couple hundred primes, you do not have to check if the large number is divisible by non primes and checking the fire traps becomes really trivial and painless.

As to moving the troops, I started with them moving once for every 4 moves by my character (2 moves per trap area). Once my character was through, just moving the troops was trickier and involved a testing loop to avoid issuing the next command until after the follower reached the last spot. :sunglasses:. Good practice for moving down an array of points though.