Virtualresolution and tiles

BlitzMax Forums/BlitzMax Beginners Area/Virtualresolution and tiles

Robb(Posted 2009) [#1]
I am in the process of fleshing out a game concept that will (for stylistic reasons) have the appearance of retro GBA quality art at a 320x240 resolution.

The project is going to be primarily tile based, however I understand that 320x240 resolution is not supported anymore and this resolution will have to be faked. What is the best way of achieving this?

I tried a projection matrix by setting the game resolution to 640x480 with SetVirtualResolution(320.0,240.0) however it offsets the tiles and create whitespace on the right and bottom of the screen.

I have read through other threads about this issue and it seems fairly complicated. I have only just updated to Blitzmax 1.36 so these new functions are pretty alien to me.

Would it be easier to fake the resolution in the art?


Dreamora(Posted 2009) [#2]
if it is meant to run at 320x240, why don't you just write into an area of 320x240 thats centered around the middle of the screen? (the same way the gba expansion did for gc)


MGE(Posted 2009) [#3]
I "think" if you set all your textures to non filter you might have better results for the pixel/retro look when scaled up using the 1.36. Give that a shot and see if it works.


Robb(Posted 2009) [#4]
Thanks for the replies!

I could opt for the centre-screen method but if I can do it, I'd rather go fullscreen 320x240.

I thought that it might be filtering so I disabled filtering on all image loads and changed the auto filters. The sprites look great but they seem to be offset by -1px on both x and y.

This example shows what I mean. It's subtle, but annoying!
The top image is the windowed 320x240 image scaled up in photoshop while the second is the fullscreen image produced by bmax's virtual resolution function.


The error is visible on the right-hand side (the red line is not the edge of the image) and on the bottom. Also the sprites do not line up in both images.


ImaginaryHuman(Posted 2009) [#5]
Did you subtract 1 from the width and height of the virtual resolution/viewport?


Robb(Posted 2009) [#6]
No, I was unaware that I had to! As I said these new functions are completely alien to me at the moment.

So I should use setvirtualresolution(319.0,239.0) instead of 320.0, 240.0?


Muttley(Posted 2009) [#7]
640x480 is not a particularly safe resolution to use either. Lots of graphics cards/displays don't go below 800x600 any more.

If you're using virtual resolutions anyway, why not let the user choose whichever resolution they prefer?


ImaginaryHuman(Posted 2009) [#8]
I wonder if there is a bug in Mark's resolution code which causes the display to be 1 pixel too tall/wide. I know when dealing with textures and stuff sometimes you have to think in terms of coordinates being the gaps between pixels rather than whole pixels, and can easily get an extra pixel around the edges.


Robb(Posted 2009) [#9]
@Muttley: Yeah I had thought about this, I am currently using 640x480 for testing as my laptop does support it. I'll put choices into the final product if it gets that far! (though because of faking the 320x240 resolution I could just set the app to the user's desktop resolution I guess.)

@Imaginary Human: I had wondered about this. The strange thing is that when I use the drawline command, a 1pixel line does not match the thickness of a sprite that has a 1pixel border.