Joined: 10/6/2011
Posts: 1697
Location: RU · ID · AM
Simple answer: game consoles usually cannot process float values. Thus they operate with integers, in particular, when calculating positions. For the game’s physics to be more or less realistic, those integers should represent fractions of a pixel. They are what’s called subpixels.
(upd) even simplier answer: subpixel position is position inside the current pixel.
S3&A [Amy amy%] improvement (with Evil_3D & kaan55) — currently in SPZ2
my TAS channel · If I ever come into your dream, I’ll be riding an eggship :)
Really? I thought it was just that you can't display a raster graphic in less than 1 pixel interval so in other to make an object have a varied momentum, it use subpixels to achieve such.
In terms of TASing, check here:
http://tasvideos.org/GameResources/CommonTricks.html#SubpixelCarryover
Whenever you find a memory address for x or y position on screen and it looks like it's measured in pixels, look 8 bytes in either direction and if the game has subpixels you usually have already found the address containing them.
Look at the Somari run (which doesn't use subpixels) to see one of the problems of not using them where they could be used. (hint: abrupt movement speed changes)
More modern consoles can also render sprites at positions that are not an integer number of pixels, in which case the sprite is interpolated (i.e. the value for a given pixel is based on the values of the sprite pixels that are closest to that pixel). This can look pretty terrible so it's usually not used unless in conjunction with scaling or rotating, where you're stuck doing interpolation anyway.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
It has nothing to do with whether the console is capable of making floating point calculations or not.
Subpixel coordinates are simply coordinates that have higher accuracy than the screen resolution. (Internally this can be achieved by either using floating point or fixed-point values.) If you are using integers, you could eg. have all your coordinates multiplied by 16 (and perform all calculations like that.) Then when you actually need the physical pixel coordinates on screen, you divide by 16.
Old consoles can't draw at subpixel coordinates, but the reason to do this is that it allows better movement calculations (such as acceleration).