chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.32k stars 466 forks source link

Ideas #521

Open pyanmcbride opened 3 years ago

pyanmcbride commented 3 years ago

Please add the ability to change scenes without a transition!

animasodo commented 3 years ago

There is a transition because the screen updates when the scene changes. To hide that, the screen turns off.

pyanmcbride commented 3 years ago

Well change the background while still in the same scene that would be nice...

eishiya commented 3 years ago

Both changing scenes and changing the background while keeping the rest of the scene would cause garbage to appear on the screen while the new scene loads, as loading both the new scene tilemap and the new scene's tiles takes time. So, you'd essentially still have a fade, except instead of a nice fade-out/in, you'd get nonsense on the screen instead. The fade hides the garbage.

pyanmcbride commented 3 years ago

What if it did not update the screen until it loaded the background? It would hide the garbage and make it where you can change things in the background while the player is still in it.

RichardULZ commented 3 years ago

@pyanmcbride you may need to research the gameboy hardware to understand why it is so difficult, the screen is always refreshed while it is on, and there is a limited number of vram tiles available.

If both your background were less than 128 uniuqe tiles ( in our case as we reserve vram 192-255 for ui, so less than 96 tiles each ) it would be possible to modify an area of vram not currently in use, causing no graphical errors while loading vram. However, setting the new tiles on vram is hard to do in a single frame while the screen draws, you would see the new background draw from top to bottom over a few frames, (technically there's an idea to draw it to window/overlay map, show the overlay instantly, then draw it again on the normal bg, but that's real hard). None of this takes into account sprites, which would go bad for a few frames as they are replaced in vram and initialised for position again.

Fade to black is available in the latest github beta build, which is only possible now that music is on an interupt timer and can but in during high cpu loads. Other transition effects could be attempted, such as pokemons fill the screen to black in creative ways.

A switch background only event is planned for 2.0 to help users with complex battle scenes, but this will likely still fade.

A long distant goal might be placing/changing background tiles, which could eventually allow pokemon esq sprites changing during battles. Go watch some footage of pkmn red, it can still be glitchy for a few frames, but only in the updating area, so a bit passable.