A 3D Maze Engine
Moderator: Moderators
A 3D Maze Engine
I've always been really fond of 3D mazes, like those found in the Golgo games, Ultima, etc. Well, I finally figured out a decent way to do them, and so far, it's pretty efficient, I think. I've been messing with this for the past... 6 or 7 days, so about a week.
What I was looking to do was take the speed of Golgo 13 - Top Secret Episode mazes, and combine that with the smoothness of the Mafat Conspiracy mazes. I opted to use the same kind of screen layout from Mafat, with the big status bar at the bottom. In this way, I have less tiles to load. My initial build was good, because I got the actual maze loading and you were able to navigate around. The problem was with the screen loading, though. You could move VERY fast, but the screen flashed too much, kinda like Top Secret Episode. I believe this build is that one:
http://robertlbryant.com/temp/maze.nes
What I really wanted to incorporate was how Mafat Conspiracy loaded in one nametable, then switched to the other nametable to have a seemless transition. After alot of time debugging, going through my code, and some folks on #nesdev testing it out via different emus and a powerpak, I believe I've finally found the right balance I was looking for. Please note that if you try this in a powerpak, the currently blank status bar may have some garbage data in it, as I don't do anything to initialize how that area should look; my main focus right now has been the engine itself.
In the NMI right now, I am doing the sprite DMA (OAM, whatever it's called), loading 40 background tiles vertically, strobing the controller, and running some music. I also had a RAM palette loading with success and no lag, but for one reason or another the palette was getting screwed up when I did it, so I left it out for now. I'll get to that bit some other time though hehe The music that is in this build is from another game, but I just threw it in here to test for any dragging during background loading in the NMI.
If you download this and test it out, hold the controller like a Wiimote. The reason for this is because I would like to make this a zapper game, where the other hand holds the zapper. Anyway, this means have the left directional button pointed towards the screen. This is the UP button. Pressing backwards turns you around in the maze 180 degrees, and pressing to the sides rotates you in those directions.
http://robertlbryant.com/temp/maze4.nes
Here is a map for anyone that would like to see it:
http://robertlbryant.com/gaming/images/maze1.jpg
With this engine, maps are only allowed to be one page of RAM big, but then again, 3D mazes are a bit of a pain if they are too big, IMO. Also, if anyone wants to see any code snippets, I will paste them. Once I get the game done, the full source will be available. I just wanted to post and get some thoughts on how it runs right now: Speed of loading vs. How it looks while playing.
Thanks for your time!
What I was looking to do was take the speed of Golgo 13 - Top Secret Episode mazes, and combine that with the smoothness of the Mafat Conspiracy mazes. I opted to use the same kind of screen layout from Mafat, with the big status bar at the bottom. In this way, I have less tiles to load. My initial build was good, because I got the actual maze loading and you were able to navigate around. The problem was with the screen loading, though. You could move VERY fast, but the screen flashed too much, kinda like Top Secret Episode. I believe this build is that one:
http://robertlbryant.com/temp/maze.nes
What I really wanted to incorporate was how Mafat Conspiracy loaded in one nametable, then switched to the other nametable to have a seemless transition. After alot of time debugging, going through my code, and some folks on #nesdev testing it out via different emus and a powerpak, I believe I've finally found the right balance I was looking for. Please note that if you try this in a powerpak, the currently blank status bar may have some garbage data in it, as I don't do anything to initialize how that area should look; my main focus right now has been the engine itself.
In the NMI right now, I am doing the sprite DMA (OAM, whatever it's called), loading 40 background tiles vertically, strobing the controller, and running some music. I also had a RAM palette loading with success and no lag, but for one reason or another the palette was getting screwed up when I did it, so I left it out for now. I'll get to that bit some other time though hehe The music that is in this build is from another game, but I just threw it in here to test for any dragging during background loading in the NMI.
If you download this and test it out, hold the controller like a Wiimote. The reason for this is because I would like to make this a zapper game, where the other hand holds the zapper. Anyway, this means have the left directional button pointed towards the screen. This is the UP button. Pressing backwards turns you around in the maze 180 degrees, and pressing to the sides rotates you in those directions.
http://robertlbryant.com/temp/maze4.nes
Here is a map for anyone that would like to see it:
http://robertlbryant.com/gaming/images/maze1.jpg
With this engine, maps are only allowed to be one page of RAM big, but then again, 3D mazes are a bit of a pain if they are too big, IMO. Also, if anyone wants to see any code snippets, I will paste them. Once I get the game done, the full source will be available. I just wanted to post and get some thoughts on how it runs right now: Speed of loading vs. How it looks while playing.
Thanks for your time!
-
Celius
- Posts: 2159
- Joined: Sun Jun 05, 2005 2:04 pm
- Location: Minneapolis, Minnesota, United States
- Contact:
Hey, this is pretty cool!
I was actually thinking of making something similar a while back. I wanted to make like a first person type ray caster or something where you could have a gun along with the controller. But this idea hasn't really gone anywhere with me. Oh, and I was thinking of making the main character a wizard that shot "rays" at enemies, and the game would be called "ray caster", haha.
One thing I would recommend (though it could be difficult to implement) would be a half-step graphic so that any action you'd do would display 2 frames of motion. So if you go forward, it would show you move forward half a step, and then the next half. Or if you turn, it will show you turn 45 degrees and then the next 45. It might get a little disorienting if you don't do something like that.
I was actually thinking of making something similar a while back. I wanted to make like a first person type ray caster or something where you could have a gun along with the controller. But this idea hasn't really gone anywhere with me. Oh, and I was thinking of making the main character a wizard that shot "rays" at enemies, and the game would be called "ray caster", haha.
One thing I would recommend (though it could be difficult to implement) would be a half-step graphic so that any action you'd do would display 2 frames of motion. So if you go forward, it would show you move forward half a step, and then the next half. Or if you turn, it will show you turn 45 degrees and then the next 45. It might get a little disorienting if you don't do something like that.
- MetalSlime
- Posts: 186
- Joined: Tue Aug 19, 2008 11:01 pm
- Location: Japan
Hey guys, thanks for the comments : )
About the moving thing! There are different things that I considered when making the engine, and one of them was giving the appearance of movement. The main way I was thinking was having a few different ways of doing things. Like if you move forward, have the screen start from the middle, and load it from the middle out, left and right. When turning, have it so the nametable scrolls onto the screen depending on which way you are going, and when doing a 180, something like a fill from top to bottom. When I started thinking about it though, I figured this might ending up taking longer than I would like for the pacing I want for this game, or even take away from the overall pacing of it.
I am thinking about making another engine sometime though that does these things, but I think it would be more suited for a dungeon crawler, myself.
About the moving thing! There are different things that I considered when making the engine, and one of them was giving the appearance of movement. The main way I was thinking was having a few different ways of doing things. Like if you move forward, have the screen start from the middle, and load it from the middle out, left and right. When turning, have it so the nametable scrolls onto the screen depending on which way you are going, and when doing a 180, something like a fill from top to bottom. When I started thinking about it though, I figured this might ending up taking longer than I would like for the pacing I want for this game, or even take away from the overall pacing of it.
I am thinking about making another engine sometime though that does these things, but I think it would be more suited for a dungeon crawler, myself.
- marvelus10
- Posts: 243
- Joined: Fri Feb 09, 2007 5:01 pm
- Location: Nanaimo, BC Canada
OK, so I must add a "Wiimote controller friendly" next time in my emulator...Celius wrote:Left - Move forwardFx3 wrote:- Quite confuse. I barely know the controls...
Down - Turn Left
Up - Turn Right
Right - Turn 180 degrees
It's designed so you hold the NES controller vertically instead of horizontally like the Wii controller.