Author Topic: My first 3D game engine: Cubes6!  (Read 1672 times)

Jobert14

  • Full Member
  • ***
  • Posts: 233
  • BAHHH!!!
    • Email
My first 3D game engine: Cubes6!
« on: September 02, 2011, 07:18:22 AM »
I started working on this cube engine in September 1, 2011 and you might find it very interesting that I finished making this in less than 2 days.

As the name says, this engine looks like a Wolf3D type engine but its in 6DOF, cubes placed in varying heights (like ROTT), 32-bit color textures, variable sized maps, and automatic room-over-room. This also includes seamless collision detection code and my new hidden face/cube removal algorithm.

During the development of this engine, I discovered a bug in the QB64 IDE that it crashes instantly after a certain period of time while editing code. Try it by making a bunch of QB64 statements anywhere.

Download it here (5.56MB):
http://www.mediafire.com/?h76vdghihsmrge2
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

cr0sh

  • Full Member
  • ***
  • Posts: 149
  • QB64 rox the box!
    • phoenixgarage.org || crazy ideas, irrational projects
    • Email
Re: My first 3D game engine: Cubes6!
« Reply #1 on: September 02, 2011, 11:03:16 AM »
Nice work!  :D

Felt something like playing Descent (although I noticed that the controls "reversed" when you were "upside down" relative to the map - heh).

I'll have to look at this closer later; unfortunately for me it won't work under Linux (on my home box) and .935... :(

I'm left wondering how difficult it would be to munge my _MAPTRIANGLE cube code into this GL system (probably more difficult than I think)...

Brent

  • Guest
Re: My first 3D game engine: Cubes6!
« Reply #2 on: September 02, 2011, 02:51:57 PM »
Jobert14, I must admit that I am overall pretty darned impressed with the 3D engine!  The only thing I wasn't really fond of was the "tipsy" feeling it gives you when you move the viewpoint.  Great work, though!  ;D

Lachie Dazdarian

  • Sr. Member
  • ****
  • Posts: 280
    • http://games.freebasic.net
    • Email
Re: My first 3D game engine: Cubes6!
« Reply #3 on: September 04, 2011, 01:54:52 PM »
Plays very cool and smooth. And nice anime chicks.

Hope you'll think about making a Descent type of game. Even a mini one. People should make more mini games! ;)

LeChuck

  • Hero Member
  • *****
  • Posts: 895
  • 18 * 37
Re: My first 3D game engine: Cubes6!
« Reply #4 on: September 05, 2011, 12:03:28 PM »
Are you Ken Silverman in disguise?! Great work Jobert, I had fun navigating through Crapland. My brain is tuned for these kind of graphics, I felt at home in an instant.
Two or more, use a FOR!

Jobert14

  • Full Member
  • ***
  • Posts: 233
  • BAHHH!!!
    • Email
Re: My first 3D game engine: Cubes6!
« Reply #5 on: September 07, 2011, 04:15:02 AM »
Are you Ken Silverman in disguise?! Great work Jobert, I had fun navigating through Crapland. My brain is tuned for these kind of graphics, I felt at home in an instant.
I'm not ken silverman in disguise! I just used his interesting looking textures from his Build test game (I love KenBuild damn a lot!) for this demo since I wanna finish this cube engine as fast as possible. I actually sent the download link of this engine to ken and he was impressed by it.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).

Cyperium

  • Hero Member
  • *****
  • Posts: 3305
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: My first 3D game engine: Cubes6!
« Reply #6 on: September 07, 2011, 03:03:11 PM »
Very nice and promising!

I agree with Dazdarian that a mini-game would be nice!

Wayne123

  • Guest
Re: My first 3D game engine: Cubes6!
« Reply #7 on: September 28, 2011, 07:01:36 AM »
I started working on this cube engine in September 1, 2011 and you might find it very interesting that I finished making this in less than 2 days.

As the name says, this engine looks like a Wolf3D type engine but its in 6DOF, cubes placed in varying heights (like ROTT), 32-bit color textures, variable sized maps, and automatic room-over-room. This also includes seamless collision detection code and my new hidden face/cube removal algorithm.

During the development of this engine, I discovered a bug in the QB64 IDE that it crashes instantly after a certain period of time while editing code. Try it by making a bunch of QB64 statements anywhere.

Download it here (5.56MB):
http://www.mediafire.com/?h76vdghihsmrge2

Excellent work man, i am got impressed from 3D engine.Please keep share with us valuable experiences and information's.

unseenmachine

  • Hero Member
  • *****
  • Posts: 3285
  • A fish, a fish, a fishy o!
Re: My first 3D game engine: Cubes6!
« Reply #8 on: September 28, 2011, 10:21:17 AM »
Jobert14, it's good but i only get 24fps on my pc so i reckon you could speed things up a bit and then have enough CPU/GPU left to add lighting and surface normals.

I took a good look at the code and here are a few things you moght want to look at.

Your drawing the cubes using vertex co-ordinates rather than translating to the co-ordinates and then drawing a cube. You should allways think of the objects you draw as if their center was at 0,0,0 and then use gltranslate(f/d) to position them in the world.

Your world only needs drawing once! ;) You can draw your entire world using a list and then just call the list (it makes for much faster rendering) but you'll need to follow the advice i gave above to make this work properly. Check out my wolf3d engine to see how it's done : http://www.qb64.net/forum/index.php?topic=3560.msg35300#msg35300

Also, i suggest you add the ones not in Galleons GL package so you can push this even further.
Code: [Select]
    '// OpenGL
    '// INIT
    SUB glBegin (BYVAL X&)
    SUB glEnd
    SUB glEnable (BYVAL X&)
    SUB glDisable (BYVAL X&)

    '// DISPLAY
    SUB glClear (BYVAL X&)
    SUB glClearColor (BYVAL r!, BYVAL g!, BYVAL b!, BYVAL a!)
    SUB glClearDepth (BYVAL X!)
    SUB glDepthMask (BYVAL X&)
    SUB glDepthFunc (BYVAL X&)

    '// Object positioning
    SUB glRotatef (BYVAL amount!, BYVAL x!, BYVAL y!, BYVAL FACE)
    SUB glTranslatef (BYVAL x!, BYVAL y!, BYVAL FACE)

    '// VIEW and CAMERA
    SUB glLoadIdentity
    SUB glMatrixMode (BYVAL X&)
    SUB gluPerspective (BYVAL fovy!, BYVAL aspect!, BYVAL zNear!, BYVAL zFar!)
    SUB glViewport (BYVAL x%, BYVAL y%, BYVAL width%, BYVAL height%)
    SUB gluLookAt (BYVAL eyex#, BYVAL eyey#, BYVAL eyez#, BYVAL centerx#, BYVAL centery#, BYVAL centerz#, BYVAL upx#, BYVAL upy#, BYVAL upz#)
    SUB glOrtho (BYVAL Left!, BYVAL Right!, BYVAL Bottom!, BYVAL Top!, BYVAL Near!, BYVAL Far!)

    '// SHAPES
    SUB glVertex3f (BYVAL x!, BYVAL y!, BYVAL FACE)
    SUB glVertex2f (BYVAL x!, BYVAL y!)
    SUB glVertex3fv (Vertex!)
    SUB glVertex2fv (Vertex!)
    SUB glVertex4f (BYVAL x!, BYVAL y!, BYVAL FACE, BYVAL w!)
    SUB glVertex4fv (Vertex!)

    '// COLOUR
    SUB glColor3f (BYVAL r!, BYVAL g!, BYVAL b!)
    SUB glColor3fv (Clr!)
    SUB glColor4f (BYVAL r!, BYVAL g!, BYVAL b!, BYVAL a!)
    SUB glColor4fv (Clr!)
    SUB glMaterialfv (BYVAL face&, BYVAL Flag&, params!)

    '>>> Lighting
    SUB glColorMaterial (BYVAL face&, BYVAL mode&)
    SUB glLightfv (BYVAL Light&, BYVAL pname&, Array AS SINGLE)
    SUB glLightModelf (BYVAL pname&, BYVAL param!)
    SUB glNormal3f (BYVAL x!, BYVAL y!, BYVAL FACE)
    SUB glLightModelfv (BYVAL pname&, params!)
    SUB glShadeModel (BYVAL Flags&)

    '>>> Atmospheric stuff
    SUB glFogf (BYVAL X&, BYVAL pname!)
    SUB glFogCoordf (BYVAL coord!)

    '//Textures
    SUB glTexCoord2f (BYVAL x!, BYVAL y!)
    SUB glReadPixels (BYVAL x&, BYVAL y&, BYVAL sx&, BYVAL sy&, BYVAL GDK_GL__rgba&, BYVAL GDK_GL__unsigned_byte&, offset&)
    SUB glGenTextures (BYVAL num_to_generate&, offset AS _UNSIGNED LONG)
    SUB glBindTexture (BYVAL eg__GL_TEXTURE_2D&, BYVAL texture&)
    SUB glTexParameteri (BYVAL eg__GL_TEXTURE_2D&, BYVAL eg__GL_TEXTURE_MAG_FILTER&, BYVAL eg__GL_LINEAR&) 'GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR
    SUB gluBuild2DMipmaps (BYVAL eg__GL_TEXTURE_2D&, BYVAL eg__GL_RGBA&, BYVAL sx&, BYVAL sy&, BYVAL eg__GL_RGBA&, BYVAL eg__GL_UNSIGNED_BYTE&, offset&)

    '// Lists
    SUB glNewList (BYVAL List AS _UNSIGNED LONG, BYVAL Mode AS LONG)
    FUNCTION glGenLists~& (BYVAL range AS LONG)
    SUB glCallList (BYVAL ListID AS _UNSIGNED LONG)
    SUB glEndList

    '//Other
    SUB glFlush
    SUB glFrontFace (BYVAL x&)
    SUB glHint (BYVAL target&, BYVAL mode&)
    SUB glPushMatrix
    SUB glPopMatrix

Look forward to seeing more...

Unseen

OlDosLover

  • Hero Member
  • *****
  • Posts: 3918
  • OlDosLover
    • Email
Re: My first 3D game engine: Cubes6!
« Reply #9 on: September 28, 2011, 08:22:29 PM »
Hi all,
    Very nice 3D demo Jobert14! Take a bow , you deserve it.
OlDosLover.

Jobert14

  • Full Member
  • ***
  • Posts: 233
  • BAHHH!!!
    • Email
Re: My first 3D game engine: Cubes6!
« Reply #10 on: September 29, 2011, 02:09:38 AM »
I'm planning to make a totally new version of this cube engine that uses smaller cubes to make it look like minecraft! I already know how to play around with lists and I first used that on a 3D voxel model viewer but I'm busy working on a 2D shooter+platform game.
The C.E.O guy of Meido-Tek Productions (please warn me if this name is already taken).