10.26.07

NS-Tower in a Canvas Tag

Posted in programming, web at 2:49 pm by danvk

nsticonw.gif I recently noticed that Rice has unceremoniously purged my Owlnet site, so I’ll be moving some of its content over here. First up: my JavaScript implementation of Nagi-P Software’s NS-Tower.

This is one of the few games I’ve ever seen with only one control: jump. Your character bounces off the walls and you have to power him up for jumps. My record is 282 floors on Hard. Can you beat it? No fair using the JavaScript version, though. More details below (warning: it takes a hard right turn for the nerdy)…

The main problem with my JS-Tower is that the levels don’t get harder as you climb. To come up with a method for placing platforms, I disassembled the bytecode of the Java version of NS-Tower and discovered this method:

public int getPlatCol(int row) {
int r = 16 + Math.round( 4.0 * Math.random() )*16
+ 64 * ( Math.floor((row%4)/2) )
+ 144 * ( (row%2) );
return r;
}

It’s basically a pattern of four repeating platforms, plus some randomness. My JavaScript version would be more fun if I could discover the function used for platform generation by the Mac/PC versions. Here are some of the options, in order of increasing difficulty:

  1. Contact Nagi-P software and ask for source. This was painless, but seeing as their site hasn’t been updated in years, I doubt I’ll get a response. I’ve tried tracking Akihiko Kusanagi down, but have had limited success.
  2. Disassemble the Windows NS-Tower. This is orders of magnitude more difficult than disassembling Java bytecode, but it may be just the excuse I need to try out IDA Pro. Presumably platform generation uses just a few opcodes, it’s just finding them that will be the trouble.
  3. Do a statistical analysis of NS-Tower platforms. I’ve gone surprisingly far down this road, but I’m afraid it only will only lead to madness. The same four-platform sequence is present, but it starts to break down around floor 100. Here’s a sample run.

Any other ideas?

Comments are closed.