FreeBasic Games Directory Forum

FreeBASIC Game Development => Work In Progress => Topic started by: phycowelder on March 09, 2008, 11:14:04 PM

Title: Marble Maze Game
Post by: phycowelder on March 09, 2008, 11:14:04 PM
i am currently designing a Marble Maze Game....

eg...
(http://i265.photobucket.com/albums/ii225/phycowelder/tiltmaze.jpg)

does any one have any ideas what they would like to see in this said game?


-i plan on making about 10 mazes
-questing/goal games to!
-control....<still up in the air>

BTW....
this is going to be a openGL/Newton Lib game
I wanted to make a functional game while figuring newton.bi out!

Title: Re: Marble Maze Game
Post by: nkk_kan on March 10, 2008, 03:40:42 AM
I'm not sure what a marble maze game is but i guess we've to get the marble out of the maze by moving the whole game and avoiding the holes? :P

Well, you can add monsters in the maze as well..which are to be destroyed by guns or bubbles or something..and also, you can make different tiles or area with different attributes like a sticky tile..accelerating tile etc (remember skyroads?)
Title: Re: Marble Maze Game
Post by: vdecampo on March 10, 2008, 08:52:53 AM
This was my favorite marble game. You could get some good ideas from there.

http://en.wikipedia.org/wiki/Marble_Madness (http://en.wikipedia.org/wiki/Marble_Madness)

I always wanted to do a remake of this particluar game.

Cheers!
-Vince
Title: Re: Marble Maze Game
Post by: phycowelder on March 10, 2008, 11:01:13 AM
i remember that game! i loved that game!
good idea, i might make some thing like that also!
be it apart of this or not!

and NKK_KAN

i like the sticky tile idea, the monsters i was thinking of making Pitt's with monster images on them!
maybe fall into a 1 on 1  battle pit!
Title: Re: Marble Maze Game
Post by: nkk_kan on March 10, 2008, 01:12:43 PM
ahh 1 on 1 battle with a dragon :P

Rpg + Maze = new genre?  ;D

excellent! looking forward to it :)
Title: Re: Marble Maze Game
Post by: Lachie Dazdarian on March 10, 2008, 05:02:41 PM
Actually, he is not talking about a Marble Madness type of game.

I had to google Marble Maze game because Wikipedia has nothing about it. Your chance to start a wiki article about it! :P

Anyway, what I gather is that Marble Maze is a game where you need to guide a ball through a maze while avoiding the ball falling into holes strategically placed in it. Controlling the ball is done by tilting the playfield.

The only (sane) way I see this being done in a computer game is by making the playfield a 3D plane the player can tilt in any direction.

I remember only one similar computer game Balance (and obscure shareware DOS game) where you had to touch all the green sectors in the playfield with a ball to complete it, and each level was a 3D plane you could rotate in any direction. The biggest challenge was that the ball could fall off the playfield. Some levels even rotated. Quite cool concept.

EDIT:

Found Balance! Full version for that matter!

http://www.the-underdogs.info/game.php?gameid=4710

Once again, it's a game only with similar concept to Marble Maze.

Title: Re: Marble Maze Game
Post by: Xerol on March 10, 2008, 11:04:28 PM
I'd like to see something more involved, with ramps, multiple balls, moving hazards, different surfaces that cause the ball to roll differently, etc. Maybe even make it golf-like with a "par time" for each stage.
Title: Re: Marble Maze Game
Post by: Jonge on March 11, 2008, 12:31:29 AM
This is my favorite marble game: http://www.kororinpa.com/screenshots.html
Its for Nintendo Wii.
Title: Re: Marble Maze Game
Post by: Dr_D on March 11, 2008, 01:53:09 AM
This is a nice idea. I think something like this would be great with mouse control. I like the idea of dropping into some kind of battle too. That's totally cool. Also, I think if you made the mazes look more "arcadey" instead of that finished wood look, it would feel more fun. What I mean is, like on one maze, you could make it look like a hedge maze, where dropping into the holes would put you into battles with spiders, bears... whatever. Maybe on another maze, you could have an industrial look where you fight robots & stuff.

One downside is Newton wont allow you to rotate/translate the collision tree mesh once it's created.  You'd have to pull it off in the force_torque callback. You could just transform the model to make it looks like it's actually tilting though. ;)
Title: Re: Marble Maze Game
Post by: KristopherWindsor on March 11, 2008, 02:36:54 AM
(http://i265.photobucket.com/albums/ii225/phycowelder/tiltmaze.jpg)

I remember that! ;)
Try controlling two different marbles (each on its own map) at once! :D
Title: Re: Marble Maze Game
Post by: phycowelder on March 11, 2008, 03:34:36 AM
ya i was thinking about that with newton!
but the gravity(Force) could be ratio'd around the map!
if you tilt X( 15Deg ) then.....

Code: [Select]
yF=-9.8*(90/(90-xtilt-ztilt)
if xtilt>=0 then
    if xtilt<>0 then xF=9.8*(90/xtilt) else xF=0
else
    xF=-9.8*(90/xtilt)
end if
if ztilt>=0 then
    if ztilt<>0 then zF=9.8*(90/ztilt) else zF=0
else
    zF=-9.8*(90/ztilt)
end if


that would make the ball roll mostly Y+, and a little X+! also cause its a marble, only a marble, friction could be real low, making it travel just a tweak bit faster and longer to recover moving (X-15Deg)
then you just manipulate the land(camera matrix to look like the board moved to)

-this was all just ideas i was messing with and yet to try!

also I'm kind of glad this (GAME) is being received like it is!
i thought every one would think "3D Marble Tilt?" = GAY!  LOL

also my first maze was just a quick low skill wood Box type!

i will mess with good(arcade like GFX) levels later after the control is satisfactory!
Title: Re: Marble Maze Game
Post by: phycowelder on March 11, 2008, 10:50:12 PM
here is just a little control demo + very basice board!

 Source ZIP  (http://www.geocities.com/phycowelder/fbzips/Marble_Maze.zip)
Title: Re: Marble Maze Game
Post by: Hezad on March 12, 2008, 04:41:05 AM
Awesome :) But maybe, the camera's too close ? We can't see the orientation of the board. But still, awesome :p
Title: Re: Marble Maze Game
Post by: BadMrBox on March 12, 2008, 08:55:44 AM
Can I get a compiled version phyco? I cant do it myself for some reason.
Title: Re: Marble Maze Game
Post by: phycowelder on March 12, 2008, 02:29:35 PM
ok new Zip!
-compiled
-added maze rotation(tilt)
-zoomed out (-40) more units!

new zip (http://www.geocities.com/phycowelder/fbzips/Marble_Maze.zip)
Title: Re: Marble Maze Game
Post by: nkk_kan on March 12, 2008, 02:58:06 PM
glKillMyPc()

That command seems to work for my pc :P

Anyways, i got a super slow fps ...1 or 2  maybe i dunno
reason..crap video card :P

Good graphics though!
only the marble needs to be a bit shiny if you get what i mean!
Title: Re: Marble Maze Game
Post by: BadMrBox on March 12, 2008, 03:00:25 PM
nice :).
Maybe add more tilt?
Title: Re: Marble Maze Game
Post by: Dr_D on March 12, 2008, 03:48:32 PM
looking good man. ;)
Title: Re: Marble Maze Game
Post by: phycowelder on March 12, 2008, 03:49:51 PM
i really don't know what to say nkk_kan! i an really new to OpenGL and i didn't think it was that badly coded!

Quote from: BadMrBox
Maybe add more tilt?
i have the tilt divided by 8 so it didn't appear more tilted!
i guess i can make it an option! ill get you one with full tilt! its about 40Deg i think!

and thnx Dr_D!
Title: Re: Marble Maze Game
Post by: Hezad on March 12, 2008, 04:46:52 PM
Awesomer :)
Title: Re: Marble Maze Game
Post by: Lachie Dazdarian on March 12, 2008, 05:41:11 PM
Nice work so far.

I only wish you chosen a lower resolution so I would at least have a chance to play this with more than 1 FPS. :P
Title: Re: Marble Maze Game
Post by: KristopherWindsor on March 12, 2008, 05:51:48 PM
Nice, although I would prefer mouse controls. ;-)

BTW, don't listen to the people with 10-year-old hardware; they don't like progress. :) :P
Title: Re: Marble Maze Game
Post by: phycowelder on March 12, 2008, 07:12:51 PM
lol progress is perceptive! it depends were you want it or not!

and latchie ill make ya one for what res? 640,400, or 320? whats your poison?

edit!
i will make control for mouse,keypad and Joystick!
im hoping to do smoother controls with both mouse and joystick!
Title: Re: Marble Maze Game
Post by: KristopherWindsor on March 12, 2008, 08:00:55 PM
Progress is when you do something you couldn't do 10 years ago. ;)
Title: Re: Marble Maze Game
Post by: nkk_kan on March 13, 2008, 05:25:56 AM
Quote
i really don't know what to say nkk_kan! i an really new to OpenGL and i didn't think it was that badly coded!

I said nothing about your coding skills! And i don't think it was badly coded either! i DID take a look at the code even though it didn't run...it's NOT your fault! Just raving about my pc anyways :P

Quote
BTW, don't listen to the people with 10-year-old hardware; they don't like progress. Smiley Tongue

I never said i don't like progress...it's just that i can't upgrade my hardware currently but i know i should... :( :( :(
And yeah it is a 10 year old hardware..but it still works nicely V_V

Anyways, I may seem aggressive..though this is not true...i was just trying to help.
Title: Re: Marble Maze Game
Post by: Lachie Dazdarian on March 13, 2008, 04:23:38 PM
Yeah, same thoughts as nkk_kan's. I'm just raving about my PC too. You are free to ignore me and I won't blame you.

But if you don't want to ignore me, I would like to see a 320*240 version, if one is doable. At least for some initial testing. Thanks.
Title: Re: Marble Maze Game
Post by: Merick on March 13, 2008, 06:08:46 PM
Looking good, but the ball moves too fast, and maybe you should make it so that the plane returns to 0 tilt when the player stops pressing the arrow keys


Title: Re: Marble Maze Game
Post by: phycowelder on March 13, 2008, 10:18:40 PM
this is the code for 320x240 Res!
looks really bad but it may work much smoother!

just copy this code over the old BAS file!


Code: [Select]
randomize timer
#include once "GL/gl.bi"
#include once "GL/glu.bi"
#include once "fbgfx.bi"
#include once "libs/milkshapemodel.bi"
#include once "libs/bmpload.bi"
#include once "libs/createtex.bi"
#include once "libs/GL_ASCII.bi"
#include once "newton.bi"
#include once "libs/matrix.bi"
#include once "libs/apples_n_milk.bi"
using FB

dim shared Milkmodels(1) as model '<-Maze + Marble
dim shared Milk_Objects(1) as _apples '<-Maze + Marble
dim shared camera(15) as single
dim shared Grav as _vector3d2

dim shared i as short,ii as short,iii as single,iiii as ubyte,o as single,oo as ubyte
dim shared info as string
DECLARE SUB LOAD_SCENE
DECLARE SUB DRAW_SCENE
declare sub tilt_reforce(nW as newtonworld ptr,Object as _apples ptr,Torce as _vector3d2 ptr)
Open Cons For Output As #2

Const screenX=320
Const screenY=240
'----------NewtonBi--------------
dim Collision as NewtonCollision Ptr'<----------newton var
dim shared ID As Integer
dim shared Mtrx(15) as single  '<----------MATRIX array
Dim As NewtonWorld Ptr nWorld = NewtonCreate( 0, 0 )

Windowtitle "TILT MAZE as by Phyco"

Model_Init @Milkmodels(0)
Model_LoadModelData @Milkmodels(0), "maze1.ms3d"

Model_Init @Milkmodels(1)
Model_LoadModelData @Milkmodels(1), "Marbel2.ms3d"

Collision = NewtonCreateTreeCollision(nWorld,NULL)
i = NewtonMaterialGetDefaultGroupID(nWorld)
NewtonMaterialSetDefaultFriction   (nWorld, i, i, 1.2f, 0.6f)
NewtonMaterialSetDefaultElasticity (nWorld, i, i, 0.1f)
NewtonMaterialSetDefaultSoftness   (nWorld, i, i, 0.01f)
NewtonMaterialSetCollisionCallback (nWorld, i, i, 0, 0, 0, 0)
screen 14,32,,2
GLFontLoad
LOAD_SCENE
milk_objects(0).body_models=@Milkmodels(0)
milk_objects(1).body_models=@Milkmodels(1)
? #2, collision
clean_matrix @milk_objects(0).m_matrix(0)
'rotate @milk_objects(0).m_matrix(0),65,1,0,0
where @milk_objects(0).m_matrix(0),0,0,0
'rotate @milk_objects(0).m_matrix(0),65,1,0,0
Make_CollisionTree nWorld,collision,@milk_objects(0)
? #2, collision
clean_matrix @milk_objects(1).m_matrix(0)
where @milk_objects(1).m_matrix(0),10,-2,2
Make_Hull nWorld,@milk_objects(1),1000
Grav.xyz(0)=0
Grav.xyz(1)=0
Grav.xyz(2)=0
do:
    if multikey(fb.sc_left) then Grav.xyz(0)-=10: if Grav.xyz(0)<-30 then Grav.xyz(0)=-30
    if multikey(fb.sc_right) then Grav.xyz(0)+=10: if Grav.xyz(0)>30 then Grav.xyz(0)=30
    if multikey(fb.sc_up) then Grav.xyz(2)-=10: if Grav.xyz(2)<-30 then Grav.xyz(2)=-30
    if multikey(fb.sc_down) then Grav.xyz(2)+=10: if Grav.xyz(2)>30 then Grav.xyz(2)=30
   
    tilt_reforce nWorld,@milk_objects(1),@Grav
    NewtonUpdate(nworld, 60)
   
'   
    draw_Scene
    flip
loop until multikey(sc_escape)
NewtonDestroy(nWorld)


sub LOAD_SCENE
    glViewport 0, 0, screenX, screenY                  '' Reset The Current Viewport
glMatrixMode GL_PROJECTION                 '' Select The Projection Matrix
glLoadIdentity                             '' Reset The Projection Matrix
gluPerspective 65.0, screenX/screenY, 1.0, 1000.0  '' Calculate The Aspect Ratio Of The Window
glMatrixMode GL_MODELVIEW                  '' Select The Modelview Matrix
glLoadIdentity
    'SETTING SCENE
    Model_ReloadTextures @Milkmodels(0)
    Model_ReloadTextures @Milkmodels(1)
    glEnable GL_TEXTURE_2D                               '' Enable Texture Mapping ( NEW )
glShadeModel GL_SMOOTH                               '' Enable Smooth Shading
glClearColor .0, 0.0, 0.0, .5                      '' Black Background
glClearDepth 1.0                                     '' Depth Buffer Setup
glEnable GL_DEPTH_TEST                               '' Enables Depth Testing
glDepthFunc GL_LEQUAL                                '' The Type Of Depth Testing To Do
glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST     '' Really Nice Perspective Calculations
    glenable GL_Color_Material
    glEnable GL_BLEND 
    glBlendFunc GL_SRC_ALPHA, GL_one_minus_SRC_ALPHA
    'glPolygonMode GL_BACK,GL_point
    'glPolygonMode GL_FRONT,GL_FILL
   
end sub   
sub DRAW_SCENE
    glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
glLoadIdentity()
    glpopmatrix
    glenable gl_texture_2d
    '"""""""""SETTING CAMERA VIEW OVER BALL""""""""""""
    clean_matrix @camera(0)
    rotate @camera(0),(grav.xyz(0))/8,0,0,1
    rotate @camera(0),(-grav.xyz(2))/8,1,0,0
   

    camera(12)=- milk_objects(1).m_matrix(12)
    camera(13)=- milk_objects(1).m_matrix(13)-60 '<----20 Units Over Ball
    camera(14)=- milk_objects(1).m_matrix(14)
    rotate @camera(0),-90,1,0,0   
    glloadmatrixf @milk_objects(0).m_matrix(0)
    glmultmatrixf @camera(0)
    '""""""""""""""NOW SETTING MAP + MARBEL
    glpopmatrix
    glmultmatrixf @milk_objects(0).m_matrix(0)
    model_draw milk_objects(0).body_models
    glmultmatrixf @milk_objects(1).m_matrix(0)
    model_draw milk_objects(1).body_models
end sub

sub tilt_reforce(nW as newtonworld ptr,Object as _apples ptr,Torce as _vector3d2 ptr)
    Object[0].Force.y=-(Object[0].mass*(98*((90-abs(Torce->xyz(0))-abs(Torce->xyz(2)))/90)))
    if Torce->xyz(0)>0 then
        Object[0].Force.x=(Object[0].mass*(98*(abs(Torce->xyz(0))/90)))
        Object[0].Omega.x+=.001
    elseif Torce->xyz(0)<0 then
        Object[0].Force.x=-(Object[0].mass*(98*(abs(Torce->xyz(0))/90)))
        Object[0].Omega.x-=.001
    else
        Object[0].Force.x=0
    end if
    if Torce->xyz(2)>0 then
        Object[0].Force.z=(Object[0].mass*(98*(abs(Torce->xyz(2))/90)))
        Object[0].Omega.z+=.001
    elseif Torce->xyz(2)<0 then
        Object[0].Force.z=-(Object[0].mass*(98*(abs(Torce->xyz(2))/90)))
        Object[0].Omega.z-=.001
    else
        Object[0].Force.z=0
    end if
end sub

Title: Re: Marble Maze Game
Post by: nkk_kan on March 14, 2008, 03:30:06 AM
Excellente! Merveilleux! Magnifique!  ;D
I did some tinkering and managed to topple the ball over the board :P
good game! Still waiting for more exciting next version  ;D
Title: Re: Marble Maze Game
Post by: Lachie Dazdarian on March 14, 2008, 05:45:08 PM
Well, the low res version runs smooth like baby bottoms on my PC and I really like it. Doesn't look bad too me. I guess I'm not spoiled with high resolutions.

Anyway, I wish I could tilt the playfiled with a higher angle. Now it doesn't feel much challenging to control the ball. Tilting should be more tricky and sensitive by my opinion. And prefarable mouse controlled.
Title: Re: Marble Maze Game
Post by: phycowelder on March 14, 2008, 08:31:11 PM
ya i was thinking faster/trickier ball to!
with a bigger map n more holes!