|
Post by Robert on Oct 7, 2006 21:33:11 GMT -5
I've been quiet for the last few months... probably since Epoch GBA... but for good reason. I've taken to trying to create my first 3D engine. But, also for kicks and an absolute challenge, an engine compatible with Nintendo DS. Anyone even remotely familiar with the DS knows of its deliberate "minimal implementation" patterns that Nintendo has always been good for. That means it's no simple hop-skip-jump to get PC 3D Hardware to duplicate NDS 3D Hardware, especially since PC hardware is primarily floating-point fueled but NDS hardware is integer fueled. So it's been a painful, hair pulling trip trying to learn first off a ton of basics about 3D projection math... then how it applies to computer graphics... and then finally finding ways to scale it to apply to both PC and DS seemlessly. Tonight... the first render has occured. Blurry photo (DS's are so hard to get pictures of..?) versus PC version. I've generalized everything this time. The engine is fueled by external "binary module" files among other things. This one is no "Sv4". This is the beginnings of a solid-yet-simple 3D project. For the programmers: the binary modules are built out of regular GCC ELF/COFF object files (just using my own linker instead of GCC's LD), meaning that this time the coding of the game will be more familiar and powerful C++ instead of the silly thing I did last time with Sv4. The main reason I'm keeping an equal PC runtime is that at this point in time I can't expect people to have DS flash equipment and DS emulators are still too poor to rely on evening starting my programs! So the terms are known, the shell, which is a customized executable that takes care of the "glue" logic that implements all hardware calls on its respective platform, is known as "Koneko3D". The engine, which will simply be a loaded module, is currently known as "Watarigarasu" (or WATA for short, usually). It is a full 3D BSP based system, based on ideas from Quake III's format, but obviously optimized for NDS operation and otherwise proprietary for my own operations. It simply is not possible for NDS to do all the graphical effects Q3 did, such as lightmap support (at least, the way ID did it), so I won't be doing any of that. But I'll have texture mapping obviously a bit later. Texture support I've already figured out, but I have to apply it to the NDS world... again, a problem of short-changed registers. But not the same scale of problem as the vertices were. Anyway, this probably won't be a technical marvel, and I can hope at best to look as good as say Mario Kart when I'm all done. It's more an educational experience that, hopefully soon, will generate some new generation projects for me for all you to enjoy. If you're wondering, no, I haven't decided on anything officially yet. Of course, if you have suggestions on a project, I'd be interested...
|
|
|
Post by Sz on Oct 7, 2006 22:08:54 GMT -5
A) Cool.
B) How do you not have a job doing this stuff? :E
|
|
|
Post by Robert on Oct 7, 2006 22:26:38 GMT -5
B) How do you not have a job doing this stuff? :E I blame upbringing. Both of my parents never had "professional" jobs the entire time I was growing up. My dad was a brilliant man who should've gone to college and become a great programmer or something. I first started QBASIC as a programming language when I was about 10 years old or so thanks to his example and old programs he wrote on some mainframe in the late '70's. But when he said he wanted to go to college, his mother told him that a life of hard work was his requirement in life. And, being the good son he was, he went to work. Of course, at first the job was a trade and thus good paying. Until it had been repeatedly obseleted by current technology. At this point it's a not-paying-enough job that cut its benefits and at any year his contract could not be renewed. Not a good thing for a man in his 50's with debt still under his belt. The point is, there's always been this subtle, subconscious atmosphere of failure-even-though-you-could-do-better in the house. Part of the reason I graduated with a 2.0 in high school and spent a year without even thinking about college. It's not that my dad wanted to repeat his life -- in fact, the only reason I'm FINALLY in school is that, after years of his own pressuring despite himself, he finally got me to realize I might have potential... Now I'm just trying to get over some final hurdles. I'm working on a 4-year Computer Engineering Technology degree, got a 4.0 last semester, and have a friendly professor of the higher ranks who's personally taking me under his wing. But I'm a little old to be where I'm at... I might not graduate until I'm 25. And even though it's been proven by both my work and external feedback, I'm still dealing with the ingrown depression of my father. If I can just beat that, sell myself to a decent employer... then, maybe, finally, I'll have my name on something reputeable. At least I can use things like this to my credit.
|
|
|
Post by Kulock on Oct 7, 2006 22:35:05 GMT -5
Absolutely, especially with the market flooding to the popular DS platform.
I'm not going to lie and say "That looks awesome," but I realize how much work it can take to even get to a point like that, and that in itself is impressive. I'm curious, though, you compared your goal work "to Mario Kart." Which one? SNES? N64? DS? I would assume at least N64 given that you've got 3D walls in that shot, instead of just a deformed Mode 7 texture... ;P
|
|
|
Post by Robert on Oct 7, 2006 22:45:20 GMT -5
Absolutely, especially with the market flooding to the popular DS platform. I'm not going to lie and say "That looks awesome," but I realize how much work it can take to even get to a point like that, and that in itself is impressive. I'm curious, though, you compared your goal work "to Mario Kart." Which one? SNES? N64? DS? I would assume at least N64 given that you've got 3D walls in that shot, instead of just a deformed Mode 7 texture... ;P Heh, I was thinking DS. I guess I figured it'd be implied. MKDS was what I consider a "simple" 3D game; it had 3D elements, but wasn't trying to shoot for an overly elaborate display. It did its job without going overboard. I'd be happy with the way it looked.
|
|
|
Post by Sz on Oct 7, 2006 22:54:33 GMT -5
My point is, Rob, is that you've completed all these little yet technically marvelous projects -- most CS majors graduating from top schools don't have anything close to what you've done. You just need to find the right company to pitch your skills to.
|
|
Matsrik
Behind The Logo Team
Gnome
Posts: 1,094
|
Post by Matsrik on Oct 8, 2006 0:34:06 GMT -5
Bob's already on my "Internet-talent-to-hire-should-I-start-a-studio" list.
|
|
|
Post by Robert on Oct 8, 2006 12:50:03 GMT -5
My point is, Rob, is that you've completed all these little yet technically marvelous projects -- most CS majors graduating from top schools don't have anything close to what you've done. You just need to find the right company to pitch your skills to. Right. Finding the right person to work for is part of what it's all about. Actually, a girl who was a couple years ahead of me and graduated this past semester got to working for some small game company that hides somewhere in this state. I forget their name... I think they make cellphone games or something. My professor mentioned it to me, perhaps as a nudge if I needed an idea (and I certainly do. ) But it'd be a start if I were to go in that direction someday. As for interviewing, even though I have a history of lacking self-confidence, I've found the best way to keep myself from faltering is to take the spotlight off of myself personally. This worked well in customer service jobs; I just think of myself as some robot who is designed to answer prompts and perform services. So, in theory, in a professional interview I should be able to change my mindset from just focusing on me and unrealistic faults and try instead to remember I've created things like this. Preestablished success should keep everything going well. Once I'm in a job I've really never had a problem going with it. Generally always on time, communicating as I should, etc. So it's just that speed bump to get over. Bob's already on my "Internet-talent-to-hire-should-I-start-a-studio" list. I always thought going into business with some other people on our own would be neat. But I do wish it were about 10-15 years ago when any group of guys in their garage could run a software company. But in the day with distributing free shareware on floppies with "Mail us $10 to register" and all that stuff. People were more into actually buying stuff back then instead of pirating it. At this point in time, the trick is to create something so "known to be awesome" ahead of time (i.e. hyped well) that the majority of people have no aversion to purchasing it legally.
|
|
Seph
Behind The Logo Team
Luigi and Marth for the win.
Posts: 3,390
|
Post by Seph on Oct 8, 2006 14:45:03 GMT -5
Nice going, Rob. Looks neat. How fast does it run on the PC, out of curiosity?
|
|
|
Post by Robert on Oct 8, 2006 16:02:41 GMT -5
Nice going, Rob. Looks neat. How fast does it run on the PC, out of curiosity? Well, it hasn't been stress-tested yet with anything in particular. But for NDS compatability it's frame-locked to 60fps, the refresh rate of NDS. With any remotely modern computer I don't expect the PC to ever be worse than the NDS, considering the CPUs in any computer built in the last five years at least is a great magnitude over the NDS CPUs.
|
|
Seph
Behind The Logo Team
Luigi and Marth for the win.
Posts: 3,390
|
Post by Seph on Oct 8, 2006 19:27:35 GMT -5
Well, I was primarily interested in knowing it because I've been told that unless it's OpenGL, it's not worth working with in terms of 3D. Hence, I was curious if this application suffered any performance issues.
|
|
|
Post by Robert on Oct 8, 2006 20:32:54 GMT -5
Well, I was primarily interested in knowing it because I've been told that unless it's OpenGL, it's not worth working with in terms of 3D. Hence, I was curious if this application suffered any performance issues. Do you mean programming in general in today's computing world kind of thing? First off, like I said, this project was more a challenge plus the kick of making it work on NDS. If I were just programming 3D for the sake of 3D, I'd probably stay PC side and, yes, use OpenGL because it's portable AND easy to work with. NDS is "OpenGL like", however. Nintendo probably modeled the hardware registers after OpenGL. A major pitfall though is this integer math stuff. OpenGL is really for the current computing generation where floating point math is hardware assisted and just all around the better way to do things for accuracy, precision and whatnot. XBox of course doesn't use OpenGL because M$ wants to push DirectX, but I'm sure it's possible that it COULD be rigged to do it. (And maybe already has?) Ironically, OpenGL was introduced to Windows by Microsoft back with Windows NT 4 and later a patch to Windows 95 as a software library. (Prior to its current primary incarnation as a hardware acceleration connection library, though the software version still ships with Windows.) What it comes down to is, if you're going to program on any remotely modern computing platform EXCEPT NINTENDO DS, yes, please, go OpenGL. It's definitely an excellent and portable system. But having said all this, I sort of implemented a hack version of a "minimal OpenGL" on the NDS; that's what Koneko3D does. On the PC side, K3D uses OpenGL (albeit pervertedly) to render. So I'm still (Sort of) going the OpenGL way.
|
|
|
Post by Bartman3010 on Oct 10, 2006 10:02:19 GMT -5
One thing I'd like to see is the ability for the DS version to take advantage of wireless connection, probably to even send special programs to the other system that can send out demos or Single-Card Multiplayer modes.
Also, for some stupid reason, maybe Anime Rally 2 would work best on the DS, although that would have to require modeling the characters into 3D, although how would 3D output work on your dev. software? Can it produce 3D on both screens? What about 2D maps?
I also think that the NekoKonneko could be a hilarious kart to drive in AR2 =P
|
|
Seph
Behind The Logo Team
Luigi and Marth for the win.
Posts: 3,390
|
Post by Seph on Oct 10, 2006 11:46:59 GMT -5
I don't think Rob is making an SvDS or anything, he's just trying to get a working renderer on the PC and the DS...
|
|
|
Post by Robert on Oct 10, 2006 12:59:44 GMT -5
One thing I'd like to see is the ability for the DS version to take advantage of wireless connection, probably to even send special programs to the other system that can send out demos or Single-Card Multiplayer modes. Of all the things I know, networking hardwired much less wireless is something I know very little about. There is a guy who has been working on DS wireless and perhaps he'll be the answer to that later. At this time, wireless anything will be an afterthought. 3D on BOTH screens is not supposed to work; technically each screen is drive by two VDPs, core A and core B. Core A contains all functionality of GBA plus the new 3D components (and some additional truecolor graphics support). Core B only contains basically GBA stuff though again with the new truecolor graphics support. That is, core B has no natural support for 3D. Which screen is core A and which screen is core B is easily selectable. I know dual 3D screens showed up at the end of race screens in Mario Kart DS. (And perhaps elsewhere?) Like I said, it's not SUPPOSED to work that way, so I don't really know how they're doing it. (Maybe swapping between Core A and Core B rapidly? Or maybe there's a yet undocumented trigger that does "double height" 3D?) For now I plan to the regular one screen as 2D and one screen as 3D thing. I haven't completly decided on how I'll set up the 2D screen to be interfaced, especially since the PC side will have to emulate it as well. (Probably will be switched-in instead of dual-displayed, or optionally dual-displayed, which would be a design consideration...) Almost what happens in the Azu Racers fangame. I don't think Rob is making an SvDS or anything, he's just trying to get a working renderer on the PC and the DS... Well, "SvDS" or "Sv3D" or any such name actually makes no sense, since "S" referred to Scroller (i.e. my 2D engine) "v" was version, etc. But yeah, conceptually, I'm not exactly doing an Sv4 type of thing. This is more like an interface library, though a bit more advanced due to the common runtime shell coupled with dynamic loading in / dumping out of binary files. In the end... if you want to do Anime Rally on a DS ... or have someone do it for you... who ever is doing it will have to learn at least C programming. The good news is that I should hopefully contain all the nasty math inside the Watarigarasu 3D engine that I plan to have "prepackaged" as a download for K3D. (I doubt anyone will really have the desire to program their OWN 3D engine, but the option will be left open.) Ultimately it'll be pretty nice as it could be used in its simplest form as (in somewhat pseudo-code): map.open("file"); while(k3dbusy) { map.render(camerapos); k3d-display; } A little more work will be required of course for objects and whatnot, but the idea is that it's very easy for the end-programmer even though it may contain a few thousand lines of code to render / detect / etc...
|
|
|
Post by Bartman3010 on Oct 10, 2006 13:06:09 GMT -5
Uh...theres an Azumanga Daioh racing fan game? Thats...probably not good for my game =P Oh jeez there is...but thats not for the topic at hand... I assume that games that do dual 3D are constantly refreshing the screens, alternativley, which is why when you usually see 3D in games like Mario Kart DS is that it runs half the framerate. Though I wasnt looking foward to that in ARDS (If there ever will be one) Also, I'm trying to jump into programming, as I am indeed tired of using Click and, well...I'm not too insane on the idea of jumping into Flash, but I'm sure its a start. Besides, I would like to be on top of the project as much as possible, so being the head programmer is something I would like to do.
|
|
Oni Lukos
Behind The Logo Team
Still spinning, for some reason...
Posts: 6,060
|
Post by Oni Lukos on Oct 10, 2006 15:07:11 GMT -5
So wait...the DS does have 32-bit color? Weird, I've never really seen anything that would make me think that's the case. Or is it just Capcom syndrome? Use 16-bit colors even though you have more? (Look at MMX4 sprites if you will, you'll notice that they only ever use 16-bit colors. Or sometimes 19-bit, I believe, which is a rather odd number.)
E] Bwahahaha! Qt ads!
|
|
Seph
Behind The Logo Team
Luigi and Marth for the win.
Posts: 3,390
|
Post by Seph on Oct 10, 2006 17:04:17 GMT -5
I know, I know, but SDS didn't sound as obvious =P
|
|
|
Post by Robert on Oct 10, 2006 19:20:35 GMT -5
Uh...theres an Azumanga Daioh racing fan game? Thats...probably not good for my game =P Oh jeez there is...but thats not for the topic at hand... Sort of. At first I had a hard time finding that, and I was almost ready to spend money to get it (since some years back I think it actually was sold... ah, fanworks in Japan...) but finally found a torrent containing it. Let me just say I'm glad I didn't spend a dime. The visibility is rather horrid, the gameplay happens all too fast (the CPU is like constant aggressive and just sort of bunches up all drivers.) The items don't seem to work well, the courses are short, and I think there's maybe only a total of four of them... no rewards or anything... it was an interesting ripoff of Mario Kart, but a piss poor one. I've actually considered doing a proper remake of it (ripoff Mario Kart better), but we'll see. Half the frame rate? Supports my theory of rapid switching then. There is latency in the 3D redraw that is sort of one frame behind constantly... I think it takes one full frame for the VDP-A to clear its previous drawing after commands have stopped. Maybe sometime I'll try that experiment. Well, once the library is finalized we'll see where you're at. If I actually do an AzuKart remake thing, then that would actually set you up nicely. (Still an "if", but me and my brother talked about it a while ago and did actually make some nice plans for it... so we'll see.) So wait...the DS does have 32-bit color? Weird, I've never really seen anything that would make me think that's the case. Or is it just Capcom syndrome? Use 16-bit colors even though you have more? (Look at MMX4 sprites if you will, you'll notice that they only ever use 16-bit colors. Or sometimes 19-bit, I believe, which is a rather odd number.) Sorry, TrueColor was an overstatement. The DS supports 15-bit "Hi Color" in 2D and 3D graphics as an option. Still non-palettized either way. 2D continues to support legacy 256 color (8-bit) and 16 color (4-bit) graphics. The 3D modes have 15-bit textures, 8-bit textures, 4-bit textures, and 2-bit textures, along with some other odd modes like "I5A3", which is 32 colors (5-bit) with 8 levels of alpha (3-bit). Why so many? Well, they only give you a MAXIMUM of 512KB texture memory out of the 656KB of VRAM. (VRAM is weird on DS; it is broken into segments, and each segment can perform only particular tasks or work with particular cores.) So with such a short space, palettized textures are quickly going to become your friends... this also would explain why you won't see a lot of games operating with palette-free color modes. There's just not enough room. For those kind of titles, you simply need the PC's idea of 3D with several megabytes of VRAM. Given all the weird modes, I've built-in a simple and small PNG decompressor since the format is popular, generally compresses well, and supports a whole bunch of weird modes. (24-bit will work for the 15-bit mode with just a touch of downscaling; PNG then supports 8, 4, 2, or even 1 bpp modes. 1bpp isn't supported in DS hardware, so I just internally upgrade it to 2bpp just for completeness.) (For the programmers: In the interest of space, my PNG implementation uses neither libpng nor libzlib; I wrote the chunk decoder with only the most critical chunks supported and hooked it with a minimal version of Zip decompression only.) To make it as simple as possible, you request what palette space the PNG should load into. I've tried to virtualize the VRAM for the end-programmer such that it is basically a set of 32 256 color palettes. Ideally in a racer game you could say give a palette to every driver's "skin" texture and then the course textures themselves have a palette (or more than one.) So it's actually not too bad. Just have to remember what your palette assignments are and be careful. For the 16-color (and less) textures, the palette access changes to 512 16-color textures. (Same palette space, just differently accessed.) This doesn't quite give the full flexibility of being able to put the 4 color palettes everywhere like it should... I'll either fix that or just assume that 4 color textures are going to be rare enough that no one will care.
|
|
|
Post by Bartman3010 on Oct 11, 2006 13:40:23 GMT -5
The game also seems to lag horribly when all the CPU characters fire off their weapons.
|
|