Skip to content

Comment on Show HN: SineRider, a game inspired by my TI-86parent

Comments

The graph goes crazy. The sine is spiky, like there were too few samples or some kind of sampling aliasing. This happens in the web plugin and standalone Windows exe.

It's so hard to explain, but I loved the game so much I'll download a screen recording tool to show what's going on. Will edit as soon as I get the video captured.

EDIT: Downloaded the worst video capture tool but here it is:

- Default state, zooming in and out: http://i.imgur.com/N34bRcS.gif You can see spikyness and the graph changing with zoom.

- Default function, changing x's scale: http://i.imgur.com/LQ99RY7.gif This does not make sense at all.

- Sledding with x scaled to 7: http://i.imgur.com/9QukafO.gif The graph changes over time.

Ah, I see what you mean. The problem is indeed sampling. For performance reasons the graph only plots a point every 8 pixels each frame, so if you have drastic changes that happen below that interval you get weird rendering artifacts. Unfortunately this will inevitably be the case until I can get a parser that's fast enough to sample for every pixel.

Well, it kinda breaks the game, doesn't it?

Can you decouple rendering from simulation? I guess so, since it's easy to test whether a point lies below or above the curve. If at least what was simulated were reliable that level would be (somewhat) playable.

I would suggest having reliable visual sampling too (samples in absolute space, growing in number with zoom out), but I'm not aware of the actual performance implications.

I still think there's something else going on besides sampling error. Why is it (visually) working correctly for x*7 until I sled? Why does it change so dramatically over time?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.