Shitty 2.5D - PoC
Shitty 2.5D - PoC
I just started in GB dev like 2 weeks ago.
Made a 2.5D proof of concept in GBDK 2020 - with 5 walls. "Map" is at the top.
https://github.com/sttng/gb-stuff/tree/main/shitty-25D
Main challenge is to get a screen redraw, which I couldn't get a decent solution so far - only one which induces heavy flickering. Not tested on real HW only BGB.
Also I didn't implement viewport clipping as of now.
Any tips for screen update appreciated. Also feel free to get the code and use it for whatever you think its helpful.
https://github.com/sttng/gb-stuff/tree/main/shitty-25D
Warning: Heavy Flicker if you test it in BGB !! Be careful if you are known to have records of photosensitive epilepsy
Made a 2.5D proof of concept in GBDK 2020 - with 5 walls. "Map" is at the top.
https://github.com/sttng/gb-stuff/tree/main/shitty-25D
Main challenge is to get a screen redraw, which I couldn't get a decent solution so far - only one which induces heavy flickering. Not tested on real HW only BGB.
Also I didn't implement viewport clipping as of now.
Any tips for screen update appreciated. Also feel free to get the code and use it for whatever you think its helpful.
https://github.com/sttng/gb-stuff/tree/main/shitty-25D
Warning: Heavy Flicker if you test it in BGB !! Be careful if you are known to have records of photosensitive epilepsy
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: Shitty 2.5D - PoC
You are most probably taking longer than a frame to draw the frame and hence you get flicker. You will need to double buffer, and you can them use memset to clear it rather than draw over the lines again. But doing all of this in C with actually multiplies don't expect anything over low single digits FPS.I'm not familiar enough with the GB to know if you are able to double buffer it though.
Re: Shitty 2.5D - PoC
Thanks for the reply. I'm actually quite surprised how far I got and without redraw (and the wireframe just 'smearing' over the screen) in this simple scene the framerates are much better then I expected. Given that I actually never developed any serious C (C++) or Assembler and also not a 3D engine guru I am pleasantly happy with the current state. Also there has not been any code optimization done. I guess some mults / devides can be replace with bit-shifts for example.
My 'current' solution is effectively draw the scene 2x. One time the original and the 2nd time overwriting in white color, to clear the the scene. So basically I waste half of the framerate.
Not sure if the GB can do double buffering - in fact I don't think it can as the 'GPU' is tile based rather. But lets see. Anyhow appreciate your feed back
My 'current' solution is effectively draw the scene 2x. One time the original and the 2nd time overwriting in white color, to clear the the scene. So basically I waste half of the framerate.
Not sure if the GB can do double buffering - in fact I don't think it can as the 'GPU' is tile based rather. But lets see. Anyhow appreciate your feed back
Last edited by M2m on Wed Feb 17, 2021 11:46 pm, edited 1 time in total.
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: Shitty 2.5D - PoC
You can double buffer anything. So in this case you double buffer the tile set. Looking it up you need 340 chars for a "bitmap screen" and there is not room for 2 sets. So you would have to have a working set in RAM and then copy over multiple frames to VRAM. Which will give you tearing but should stop flickering.
Re: Shitty 2.5D - PoC
Made some slight adjustments.
Can see some video here:
https://www.vrddit.com/?v=r/Gameboy/com ... f_concept/
Can see some video here:
https://www.vrddit.com/?v=r/Gameboy/com ... f_concept/
Re: Shitty 2.5D - PoC
Another small update. With some pseudo-clipping
https://www.vrddit.com/?v=r/Gameboy/com ... itty_with/
https://www.vrddit.com/?v=r/Gameboy/com ... itty_with/
Re: Shitty 2.5D - PoC
I've tried it on my Japanese SGB1, running on a real US NTSC SNES, with my Everdrive GB X5, and both ROMs work just the same as they do in your videos, and when I test the ROM in Sameboy.
Heavy flickering would be fine on the Game Boy DMG, as its screen is a pretty slow passive matrix display with heavy motion blur anyway.
It would not be fine for the GBC or GBA, but those systems already have a faster processor in GBC mode anyway.
It would not be fine for SGB either, which does not have a faster processor unless you're pulling a Space Invaders and loading a SNES ROM into the SNES' WRAM.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
Re: Shitty 2.5D - PoC
Cool ! Thanks for letting me know that it works on real hardware. Yeah I know the flickering is super-annoying. I definitely will try to figure out a way to get rid of it. With reduced framerate most likely.
I'm using BGB (and also occasionally mGBA) on Windows and Sameboy on macOS
I'm using BGB (and also occasionally mGBA) on Windows and Sameboy on macOS
Re: Shitty 2.5D - PoC
Yeah, that can work.
I've heard that SameBoy is already more accurate than BGB on Windows. Is this true?
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
Re: Shitty 2.5D - PoC
SameBoy indeed passes more behavior tests and has finer-scale emulation of the APU than bgb. However, the debugging tools in SameBoy for Windows and Linux are not quite as detailed as those of bgb.