Pixel Perfect OpenBOR Problems.

aL BeasTie

Well-known member
From time to time I'm working on an original game.  It's platform based and copies some gameplay from NES games like Metroid and Megaman.  But to capture this style I'm using tiles to create stages and platforms.  16x16 - 48x48 sized.  (the original assets I am licensed to use)

My game is 480x272 - Not really trying to be NES style.  But I hadn't done much work with platforms before, to better understand what the process should be I created a small demo to make the 'real thing' using METROID (NES) sprites and tiles.  These are all 16x16 tiles.  And the module is using NES resolution (256x240)

I'm noticing some things that makes a mod like this troublesome to do because you want to get things pixel perfect.  My own game is varied so this isn't such a big deal, but with NES style it really starts to make things more fiddly.  Just thought might be interesting to discuss and see what people think. Maybe others have had tried to do this sort of thing before and have a 'rule of thumb' for dealing with it.

Sorry if this is hard to explain...

Stage Images - They can't stick to 16x16 format - A little extra space must be added or everything is a few pixels out.  So the whole plan of working as 16x16 grid is out the window :p (because of screen shake the extra is needed)  Might not sound like a big deal, but you can't simply repeat a panel in a tile based mod when it has extra black edges, so another entire image is required.

Panels - Panel don't display in game from the bottom of the image, it's always cutting off half the floor.

(section of) Panel image

map.png


Floor cut off in game
map_bad.png



Platforms - They don't work properly if the offset is 0 16 - it has to be offset 1 16 or you will fall though invisible gaps between platforms.

platform entity
Code:
anim	idle
	delay	100
	offset	1 16
	platform	1 16 0 0 64 64 16 16
	frame	data/bgs/tiles/teal.png

platform image (16x16 block)
TEAL.png


So working out placement of things in the map is becoming a pain.  Instead of just knowing something will be 32 pixels from the wall, you have to allow for..

A - The platform offset is always actually one pixel off.

B - screen edge and floor are not on grid.

I mean I've already worked around these things, follow the maths to adjust it etc.  But it's so much extra mucking around just to place a platform for example.  If it were truly pixel accurate stage building could be done about 10 times faster.  when stage get wider/taller.  The number's aren't even anymore, which is half the beauty of a tile/NES based game.  Just use multiples of 16 and you know where things go.  You don't need to do maths in your head, you know 256 is screen edge.  16x16 is the tile etc.  ceiling is 320 etc.

Another problem is character OFFSETS.  naturally we have offset at the centre of a sprite, but in the game the engine will only block movement via offset, not BBOX.  So walking into a platform it blocks you from the offset and it looks really bad in game because the sprites will overlay the platforms. 

I'm also using platforms for walls, because it's just too much trouble to create walls for every map.  Although I'm probably going to have to eventually add walls, I'd prefer not too.  Because they're invisible entities that are hard to manage.  As you can see my platform sprites are merely a visual guide for placement.  I have platform entities for 1, 2, 3 & 4 blocks in width.

METROID_0001.png
METROID_0002.png

Notice how they all display 1-2pixels off, but the platforms are working correctly.

And just to add in case anyone is curious.  I'm not planning to remake Metroid, thou I have done a few things like screen panning/working doors, etc.  If can work out some other things it would just be a matter of recreating the levels and enemies.

Another thing I tried is the enemies that will crawl up the walls/celings/platforms.  It's actually fairly easy using entities placed near corners that force the enemy to change animations and directions.  But the 'pixel perfect' make this tedious and buggy.  Again the offset problem of sprites.  So crawlers have to have offset on the edge of sprite, instead of centre.

(a screen from my custom game)
custom_game.png

(I had him crawling on wall with correct offset, but I must of changed something.)


I've also done similar tests in a Megaman mod.  Restarting after death, door transitions/boss rooms etc.

These things are not hard, it's more than possible to make NES like games.  The problem is keeping everything pixel accurate  :-\
 
I went out drinking tonight so maybe my comprehension is off.I ve been working on my own 8 bit thing for the longest. I started using 8x8, 16x16, 24x24, 32x32, tiles to make the levels. It helps me plan out the levels screen by screen. things dont always fit that way thought. I've taken to cutting it short a row or two at the bottom, then use the black space to set up the HUD stuff. This way, things stay as pixel perfect as i can get it. 
 
Back
Top Bottom