You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
She canna take any more, captain!
Posted on: 2013/10/21 3:04
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
FORWARD: The forum system shrinks images. Click them for the full-size versions.
__________

It's baffling, really. Perplexing. Curious, by anyone's reckoning. I'm still not sure what all is going on, but I know that it's in the way. That awesome project I've been working on? Virtual Boy can't handle it. It's too much for it to take!

You'll remember my September progress report thread, wherein I mention a game yet don't disclose its identity. The game was F-Zero Maximum Velocity, the first GBA game, and I aimed to remake it on Virtual Boy, because how cool would that be?

As mentioned, the project started out with a couple weeks of reverse-engineering. I hacked the GBA game to get its graphics and level data, which I then began implementing on Virtual Boy.

Open in new window


It was going quite well. A little scrolling here, a little affine there, a little optimizing over there... It all looked prettey good. Everything was taken from the GBA game, and care was taken to remain true to the original:

* All of the graphics came from the GBA game and were modified to work on Virtual Boy
* Palette animations on GBA weren't possible, so an equivalent solution on VB was used
* The GBA game used two affine layers, but I used one on the VB project and got it working pretty well, even so far as to have the same scrolling graphics the game had beneath the track
* All graphical animations from the tracks were implemented, including all course features and the stuff off to the sides.
* As it's on Virtual Boy, parallax was added for a depth effect, as seen in the screenshots.

Open in new window


As mentioned, the GBA game uses two affine layers, and I managed to get away with just one. The "floor", as I call it, is the same size pixel-for-pixel as the track layer, but it scrolls at a slower rate and therefore extends off to the sides of the track quite a ways. In order to achieve that effect, I had to modify the floor maps to fit on a bigger canvas.

I spent a good week making a program to help me do just that, and it worked great. The plan was to make an all-in-one utility which would be released alongside the game (source code for both) so people would get a taste of game development even without being a developer themselves. I specifically wrote it in Java so people would be able to play with the code. (-:

The utility was useful because it did three things:

* Loaded the GBA ROM for extracting and saving data
* Modified floor maps
* Processed image files to convert them to the VB character format

I painstakingly went through the course floors, increasing their size, and driving around the track in-game to make sure the floor features appeared in the correct spots relative to the edges of the track, so that it would still "feel" the same as in the GBA game. More time was spent on the floors than any other part of the project.

Open in new window


In the GBA game, the tracks and floors are both compressed. I mean, they represent 4096x4096-pixel images, so they can't just be stored in ROM as-is. I had a grand plan for this utility. See, I would implement the same compression algorithm used in the GBA game (compressors are harder to write than decompressors), then implement a level editor. The data produced by the utility would be in the same format as, and therefore compatible with, the GBA game. Buuuut, that'll have to wait for another time.

When I finished my compressor, I verified it was working correctly by running it on the track and floor data from the GBA ROM. It worked correctly, and quite well: my data was 10%-15% smaller than the source data I pulled right out of Nintendo's game!

I implemented the horizon layers, and those worked just fine. It was surprising, 'cause I wasn't sure if the VB could handle that much graphics stuff going on. Then I implemented the minimap, and that's when it hit the fan.

Open in new window


That little guy in the bottom-left corner. It's a 64x64-pixel BG map with a single OBJ sprite over the top of it to indicate your position. With that in there, the VIP entered overtime and the framerate dropped to 25 fps. "No problem," I thought, "I must have been at the edge of its processing power with those horizon layers. I'll just disable one of those and see what I can do later on to reduce the total number of pixels drawn."

It didn't work. Removing both horizon layers didn't work. And this isn't one of those "turn off the left/right display flags" kinds of dealies, I outright refrained from configuring windows for the horizon layers and it still didn't work. There's something about the fact that the minimap overlaps the affine window that just hits the VIP too hard.

I modified the program so I could resize the affine window, and... well, in order to get it to run full-speed again, the window had to be prohibitively small. It was simply an un-salvageable situation. I discussed matters with dasi, and now I'm posting this thread.

Consulting Mario's Tennis for some insight, I found that the game was taking up a mere half of the available screen real estate. Well no wonder it could run at 50fps!

Open in new window


I still have two months to put together a Virtual Fall submission and sample project for devkitV810, so I'm not out of the race. I just have to start over. Again. (-:
__________

Attached to this post is a zip file the last build of this F-Zero project. Controls are as follows:

Left D-Pad Left/Right: "Steer"
A Button: Move forward
L Button/R Button: Change current course
Select Button: Toggle 3D/2D mode
Start Button: Toggle minimap
Right D-Pad: Adjust affine window size (left/up make it smaller)

It runs just fine in Mednafen, but on the hardware it'll be at 25fps unless you disable the minimap.

This is not a Virtual Fall submission. This is just letting you guys know what I was working on since I'm changing projects now.

Attach file:


zip FZero_VF2013.zip Size: 323.65 KB; Hits: 379
Top

#2
Re: She canna take any more, captain!
Posted on: 2013/10/21 3:57
PVB Elite
Joined 2011/3/10
USA
888 Posts
Top10 PosterLong Time User (8 Years) 30+ Game Ratings
This is really amazing. It is awesome that you are going to stick with it and try to get everything working. My Virtual Boy thanks you!
Top

#3
Re: She canna take any more, captain!
Posted on: 2013/10/21 4:15
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Quote:

Lester Knight wrote:
It is awesome that you are going to stick with it and try to get everything working.

Wut? No. This is the exact opposite of what is going to happen. Sorry. (-:

It's a classic case of Too Broke to Fix. The Virtual Boy's affine functionality is just far too wimpy to pull off a game that relies on it like this.
Top

#4
Re: She canna take any more, captain!
Posted on: 2013/10/21 6:22
PVB Elite
Joined 2011/3/10
USA
888 Posts
Top10 PosterLong Time User (8 Years) 30+ Game Ratings
Oh, I'm sorry. I got the impression that you were going to start over from scratch on the same project. =P
Top

#5
Re: She canna take any more, captain!
Posted on: 2013/10/21 14:09
VUE(xpert)
Joined 2011/7/3
USA
435 Posts
CoderContributorLong Time User (7 Years) App Coder40+ Game Ratings
Phenomenal effort Guy! It's a shame that the vb can't do a game like this. So not even a black void on either side of the track could fix a game like this Ive noticed in VB games there's usually alot of black in them that wouldn't help out the VIP? also I wonder if you stuck the mini-map in the black void in the middle of the track. since the affine would'nt hit it maybe you could pull it off. Oh and also when the track hits the affine you could simply turn it off. Just an idea from a non programmer I just don't want to see all of that wonderful work go to waste.
Edited by morintari on 2013/10/21 14:36
Top

#6
Re: She canna take any more, captain!
Posted on: 2013/10/21 20:44
PVB Elite
Joined 2011/7/1
Germany
1107 Posts
CoderContributorTop10 PosterLong Time User (7 Years) App CoderPVBCC 2013 Entry
Cool demo, too bad it didn't work out. I played around with the affine mode myself lately but I couldn't get it to look the way I wanted.

Would you mind sharing the affine code/settings for the racing track?
Top

#7
Re: She canna take any more, captain!
Posted on: 2013/10/21 22:14
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Quote:

thunderstruck wrote:
Would you mind sharing the affine code/settings for the racing track?

That's akin to asking to see "the 3D code" for Faceball. (-: It's not like it's five lines of text that I can just paste into a forum post and call it good. There's quite a bit of concept behind it, and the implementation isn't trivial.

It's something that's better off for an article about perspective effects using affine windows.
Top

#8
Re: She canna take any more, captain!
Posted on: 2013/10/21 22:14
VUE(xpert)
Joined 2003/9/3
Sweden
438 Posts
PVBCC EntryHighscore Top10 3rdCoderContributorHOTY09 2ndLong Time User (15 Years) DonatorApp CoderPVBCC 2010 1st20+ Game RatingsPVBCC 2013 2nd
What about using memcpy/blitting to manually draw the minimap to the framebuffers instead of using a world for it? Could that make it faster? You'd have to use a mask and AND/OR it in two steps to make it transparent of course.
Top

#9
Re: She canna take any more, captain!
Posted on: 2013/10/21 22:31
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
I'm sure there are ways to make it work, but one of the goals of the project was to showcase libvue as a devkitV810 project. To get F-Zero the way I want it to be, it'll have a lot of assembly optimizations and CPU rendering, which doesn't make for a very good sample project since it's going to be A) over the heads of most people who look at the source and B) fairly inflexible since it's made for F-Zero and only F-Zero.

Though if anything, I'd rather offload the perspective viewport to the CPU for rendering and do all the 2D stuff with the VIP. VB's affine feature is a joke not just in its poor processing capability, but the parallax setting is severely limited. If it can be done on the CPU, I'll get the control I need to make it look the way I want.
Top

#10
Re: She canna take any more, captain!
Posted on: 2013/10/21 22:33
PVB Elite
Joined 2011/7/1
Germany
1107 Posts
CoderContributorTop10 PosterLong Time User (7 Years) App CoderPVBCC 2013 Entry
Quote:

Guy Perfect wrote:
Quote:

thunderstruck wrote:
Would you mind sharing the affine code/settings for the racing track?

That's akin to asking to see "the 3D code" for Faceball. (-: It's not like it's five lines of text that I can just paste into a forum post and call it good. There's quite a bit of concept behind it, and the implementation isn't trivial.

It's something that's better off for an article about perspective effects using affine windows.


I guessed it's not that easy. I've experimented with the affine tilt demo DogP released in some thread. That one was about 20 lines or so.

I managed to tilt a bgmap and it looks okish after all. Still, the way your track looks like is what I was aiming for. I don't wanted any movement or so. Just a bgmap titled so that it looks like a floor.

libgccvb and the tech scroll didn't help me allot with this. I couldn't find any demo (except for the affine tilt one) showing how this is supposed to work. I understand the basic principle of how the affine mode is supposed to work. I'm just having trouble getting around the math part.
Top

 Top   Previous Topic   Next Topic


Register To Post