[WIP] UzeJump

Use this forum to share and discuss Uzebox games and demos.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: [WIP] UzeJump

Post by ry755 »

D3thAdd3r wrote: Fri Jan 12, 2018 5:14 am Cool, looking good so far and the intro is a nice touch!

If you end up wanting a mini map later on, I think you could do a static "translucent" map that doesn't move, laid over the scrolling tiles(you could still see the tiles underneath). (...)
Thanks!

That would be really cool, however, I don't think I really know enough about how ram tiles work to be able to pull that off yet. I'm pretty much just learning as I go along. I can certainly give it a try though! I'll read though the wiki pages about ramtiles and VRAM
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: [WIP] UzeJump

Post by ry755 »

New update! There are now some basic sound effects. I updated the downloads in the first post. (sorry for not updating this for a while. I had midterms to study for. Now that those are over I should have more time to work on this! :) )

Also, I was thinking it would be nice to load levels from a file on the SD card. That would also make custom levels possible. Do you think Jubatian's new SD card library is right for that?
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: [WIP] UzeJump

Post by D3thAdd3r »

I have yet to use the new bootloader functionality, but someone should because it is awesome. SdSimple I guess is the fallback? If you can afford the flash, it should save a lot in the end, and turn the game to your desire to generate content. I plan to embrace it for my next game, and others should too IMO.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: [WIP] UzeJump

Post by ry755 »

The way I'm trying to do it is to have a binary file called UJDATA.BIN. This will hold all of the levels, and possibly other data in the future. This is what it looks like right now:

Code: Select all

FFFFFF00 104FFFFF 89FFFFFF 103FFFFF 104FFFFF
The "FFFFFF00" is the version number of the BIN file. That's not important right now though.
What I'm trying to do is to have it print the tiles 104, 89, 103, and 104. That's what "104FFFFF 89FFFFFF 103FFFFF 104FFFFF" is.
But while PrintHexByte prints out the correct number, using SetTile prints the wrong tile.

So my question is, how can I store Tile IDs in a .bin file that can then be printed to the screen using SetTile?
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: [WIP] UzeJump

Post by Jubatian »

ry755 wrote: Sun Jan 21, 2018 5:32 am But while PrintHexByte prints out the correct number, using SetTile prints the wrong tile.

So my question is, how can I store Tile IDs in a .bin file that can then be printed to the screen using SetTile?
In Mode3 tiles are offset with RAM_TILES_COUNT. That is, when you request tile zero with SetTile, it will actually write 0 + RAM_TILES_COUNT in the VRAM. This may be a source of confusion when designing, particularly when accessing vram directly for speed.

My bootloader API library's limitations are performance (it is much slower than SdSimple) and that it loads full 512 byte sectors (I might remedy the latter later, it is possible to create a load function which only puts a range from a sector in RAM, discarding the rest, while still calculating and checking CRC). But currently only that can handle all SD cards and filesystems which the new bootloader is capable to do. You can roughly expect it to process one sector in one video frame's VBlank (taking the entire VBlank time when you have no sprites).

(It isn't smaller by the way than an old MMC + FAT16 SD library since it has one contained, but it is much smaller than an SDHC + FAT32 + Fragmentation supporting library as it takes those features from the bootloader)

Audio sure gives some life to the game! However right now as I see, the player may stop in mid-air over the door before falling down onto the platform, ending the level.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: [WIP] UzeJump

Post by ry755 »

I figured it out! What I was originally doing was typing Tile IDs into the sidebar
Image
(picture from Google)
That was converting the IDs into what I'm assuming is ASCII. But my game isn't looking for ASCII which is why it always showed the wrong tile. By converting the IDs into normal hexadecimal (29 = 1D, 30 = 1E, etc) the game was able to read it and it shows the correct tiles!
Jubatian wrote: Sun Jan 21, 2018 8:14 am My bootloader API library's limitations are performance ...
I don't think performance will be an issue, as I don't think it's going to be continuously streaming from the SD card.
Jubatian wrote: Sun Jan 21, 2018 8:14 am ... However right now as I see, the player may stop in mid-air over the door before falling down onto the platform, ending the level.
Yeah, I noticed that too. I'll see if I can fix that.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: [WIP] UzeJump

Post by ry755 »

Big update!! :D UzeJump now loads it's levels from a file on the SD card! This is important because I plan to make a level editor (used on the computer, not the Uzebox) in the future, and loading from SD is needed for that.

Only level 1 is in the data file so far, so trying to access level 2 just shows a bunch of garbage on the screen. (Actually, that garbage is because of ASCII data from some comments I left in the .BIN file)

I'll upload the code later. The code is even crazier than before :shock: and I want to add some comments so people know what the heck is going on.

Updated download in the first post. (It had to be a .zip file, as it wouldn't let me upload the .bin data file)
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: [WIP] UzeJump

Post by D3thAdd3r »

Very nice, now you can have unlimited levels and also you then have experience and a codebase to work off to use that feature elsewhere; so quite a powerful implementation you have done there.

How did you end up doing it, with simpleSD, PFF, bootloader?
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: [WIP] UzeJump

Post by ry755 »

D3thAdd3r wrote: Thu Jan 25, 2018 3:09 am also you then have experience and a codebase to work off to use that feature elsewhere; so quite a powerful implementation you have done there.
I kept putting it off because I thought it would be difficult to implement, but it was surprisingly easy! I just had to read up about how SD cards use sectors, then it all made sense.
D3thAdd3r wrote: Thu Jan 25, 2018 3:09 am How did you end up doing it, with simpleSD, PFF, bootloader?
I used the new bootloader library, which means it should also be compatible with SDHC and FAT32, although I haven't tested that yet.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: [WIP] UzeJump

Post by Jubatian »

I checked it out and took a look at the code: It seems like you are using it right! (and of course thanks for testing it, remember, notify me in the Bootloader API's topic if it seems like there is anything behaving incorrectly in it).
Post Reply