Main Menu

2D game viewed with 3D Camera

Started by kevin, February 04, 2006, 12:20:22 PM

Previous topic - Next topic

kevin

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

Download Demo + Src (login required) (1.3 meg ish)


  Free LearnToCode


Video





Draco9898

DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

Digital Awakening

Wisit my site at: DigitalAwakening.net

kevin

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 .. :)

Calypson

hey i recognise those tiles  :D  I think a VERY cool person made them... hmm.. i wonder who that could be.

Fash

QuoteI think a VERY cool person made them
Nice gfx Calypson :)

Look forward to seeing that in action Kevin...
For PC game/demo music visit
Future Developments

kevin

Yeah the image format on the grabbed animation isn't correct.  Cut an paste the above 3 lines in the MAIN source.

thaaks

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

kevin

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.

Draco9898

#9
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...
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

Calypson

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

kevin

#11
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.

Digital Awakening

Various SNES animations passes before my eyes :)
Wisit my site at: DigitalAwakening.net

kevin

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.

Draco9898

Well, techniquely, that's my kinght guy design in Blink's animation, but whatever :)

cool beans...
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin