Thread history

Fragment of a discussion from Talk:Wave Surfing/GoTo Surfing
Viewing a history listing
Jump to navigation Jump to search
Time User Activity Comment
No results

It might be causing you to skip turns. Goto surfing does a lot more calculations in a single tick.

Otherwise I would say it is a bug, maybe with the starting conditions of your second wave surfing. Most difficult to get right for me was aligning the time I switch to surfing second wave with when I actually stop surfing the first wave in my real movement.

Skilgannon (talk)13:06, 1 September 2017

I would say it's perfectly aligned, from the debug graphics the predicted next wave path is exactly the same as when it really happens.

However, I create a billion of new objects per surf ;p for every predicted new position, every stop status, etc.

But I never ever skipped a turn on my computer :( whereas I see a lot of very low score on the literumble which I can never reproduce on my computer.

May be I should eliminate all the object allocation in loops ;( I used to thought Java would use stack allocation for those objects after escape analysis (which is available since Java 6 update 14), but it doesn't.

Xor (talk)04:16, 2 September 2017

My thought are, why take the risk? Making an allocation pool or hoisting the allocation outside of the loop for frequently created/deleted objects is fairly easy. Also less pressure on the GC will make a GC run during your tick less likely, so you are less likely to skip turns. Stack analysis is good, but I'm not sure how it deals with nested objects. I suspect there is still a heap allocation internally, which can be hoisted out of most loops quite easily.

Skilgannon (talk)21:34, 2 September 2017