2D Platformer in 3D World Tech Demo + Source Code
This example (techdemo) is viewing the map from the 2D plat former example using a first person camera (ie via rotating a vertex list to the camera). The example is written in PB v1.27 as a testing ground for future camera enhancements.
This version includes source code, it's a bit bloated now as various functions have become redundant due to the new
TranslateMeshToScene command, but you get that. :)
Download [plink] Download Demo + Src (http://www.underwaredesign.com/files/pub/PlayBasic/Examples/UW/2D_Platformer_In_3DWorld_V004.zip)[/plink] (1.3 meg ish)
Free
LearnToCodeVideo
Woah, very cool
Yeah, that's looking cool.
In this update the player can run around within the 2d map within the 3D world. There's two modes 1) a sort of attach to player and 2) is a FPS mode.
Performance wise on my good old Duron 800 it's not express (20fps), but considering this demo has no polygon clipping and is written in PB and not a part of the engine. I'm actually staggered it's even capable of moving let alone being playable.
The clipping is a major issue. Currently it just turns every tile into a polygon and attempts a brute force render of every tile. This is really not necessary. As only the region of the map what is within the camera should be considered. Which removes truck load of overhead. but a good exercse for the time being
But anyway.. Also, the Running animation is by BlinkOK, which i've seriously butchered when resizing it .. :)
hey i recognise those tiles :D I think a VERY cool person made them... hmm.. i wonder who that could be.
QuoteI think a VERY cool person made them
Nice gfx Calypson :)
Look forward to seeing that in action Kevin...
Yeah the image format on the grabbed animation isn't correct. Cut an paste the above 3 lines in the MAIN source.
That's really impressive, Kevin!
And all this zooming in and out - I see a lot of "drunken camera" games ahead :D
Only worked with Beta 1.13 - the 1.11 didn't have the ScreenModeExist() function...
Cheers,
Tommy
lol - Now there's an idea. A sea sick simulation ! Coming soon "The vomit commit"
I prolly should mention that, you can also create a ground effect like in those 'wacky wheel's style games using the same approach. Just simply rotated the map plane around the X axis. Although at the moment there's no near and far zclipping. So negative polygons will just vanish.
Anyway you could make this a native command in the language?
This looks like a great way to make those 2d/3d 'flat' world maps I've always been trying to emulate. A.K.A MarioKart on SNES...
simply amazing... great concept for a game - although i can't quite think of how it'd work... either way - it sure does make my map look way more depthy
QuoteAnyway you could make this a native command in the language?
From the first post-
The example is written in PB v1.11 as a testing ground for future camera enhancements. Meaning yes, 3D camera support will be native to PB, since it's required for PBFX. It'll be a little more complex than just a command though. Camera's need at least 2 modes, these will effect how items are viewed. The same applies to the captured items as well. The user will need a way to control how or if perspective/rotation effect them
Another difference is the Y axis in 2D and 3D, point in opposite directions. Which will no doubt be confusing at first.
QuoteThis looks like a great way to make those 2d/3d 'flat' world maps I've always been trying to emulate. A.K.A MarioKart on SNES...
There's nothing new about it, it's a textured vertex plane. That's about it. I'm surprised somebody hasn't already done it.
Various SNES animations passes before my eyes :)
Update
I've been updating this demo today, since I had always intended it to be a Tech demo, but I just don't have any decent animations. But BlinkOK has been kind enough to not only create a ultra new smooth running animation, but grant permission to use some of his characters animation in the tech also.
Apart from adding the animations I've been quietly implementing a TranslateMeshToCamera function. This function takes the rotated vertices and pushes a prebuilt mesh of polygons into the scene buffer. Lifting the bulk the work off the VM's shoulders. Which result in it running around 30 fps in 640*480*32bit on my Duron 800mhz / GF2 machine. And only fractionally slower in 800*600*32bit (25fps)
While at the moment the rotation and mesh translation are fairly hands on, they do give you a much greater canvass to bring your creations to life.
I was going to post the new demo, but i'ts got a few bugs in it. So you'll just have to put up with an updated screen shot.
Well, techniquely, that's my kinght guy design in Blink's animation, but whatever :)
cool beans...
Sounds as though this is coming on in leaps and bounds :)
Another Demo With Source Code requires testing !
Here's the updated version of the 2d Platformer in 3D scene demo. This version include an exe and the source code. The code requires PB1.23 (i'll upload that later on tonight) The main difference is that this version used the newly incorporated TranslateMeshToScene. Which can take a static mesh and a set of rotated vertex and translate them directly into the scene buffer. Thus removing the main brute force operation from the original demo.
Note: I've released this version early as I need your help verifying the crash problem has been eliminated. Previously in roam mode you could get the odd lock up when flying around. I believe this was now caused by from rouge division that hit infinity within the projection code. While i'm pretty sure, i'm not 100% sure. (although it hasn't crashed here since i fixed that) So just in case, this version only runs in windowed mode.
Download
Old Download Removed
picture
Very nice :D
Even on 1024x768 32 Bit resolution I'm getting over 75 FPS (typically 80+) - too fast to play!
No crashes despite throwing it around a fair old bit.
That's pretty nice rate in windowed mode at that res !
I'm glad you've not been able to kill it either, so i think this issue has been fixed.
2D Platformer in 3D World Tech Demo with Source Code
Since the previous version was stable, here's the final update of this tech demo. I've added a few tidbits on open/close, but the core demo is the same really.
This version includes source code, it's a bit bloated now as there's various functions that have become redundant due to the TranslateMeshToScene command, but you get that.
Download
[plink] Download Demo + Src (http://www.underwaredesign.com/files/pub/PlayBasic/Examples/UW/2D_Platformer_In_3DWorld_V004.zip)[/plink] (1.3 meg ish)
Very impressive and very cool. :D
Live the new logo btw :)
yes - i must agree that the new logo rocks.
also, with my new compy, I get 60 FPS at 1024 by 768, 32bit.
too fast to play the game actually - i'll hafta put a FPS cap on it
Yeah, Kohai's version of the PB logo is really growing on me. The newest version has slightly different colours than that one. More blue than greeny
When compiling the source under the latest pb (+beta ide) I get a 288 fatal error - bank #0 out of legal range
compiler 1.28c
ide 1.1.0
(the exe runs fine though, albeit a tad fast, LOL)
Steve
PS The new logo looks fantastic :)
There's a line of code that's not used. It were it'd die with a fatal exception :)
Open the project, go to MAIN and find line 286. It's just inside the demos main DO/LOOP
which looks like this
[pbcode]
Do
RenderToScreen
; BackDrop()
CaptureToScene
ClsScene
; Rotate vertex list (with XYZ rotation order)
CameraAddress=GetBankPtr(CameraObject)
; ObjectAddress=GetBankPtr(VertexObject) <<< remove this one line
[/pbcode]
Perfect :)
Thanks Kevin.
Steve