Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / 3D Maze example

Author
Message
dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 8th Dec 2014 02:32
Hi, I want to build a 3D maze with simple textured walls, ceiling and floors, and a basic character in the view. However I cannot get my head around how to use the 3D commands.

Can any tell me / point me at some info about using AGK2 3D? Sample code would be good too, since the one that comes with AGK2 is made with FPS and doesn't really show how to do it directly with commands.

Thanks!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Dec 2014 09:30
you can build your walls with cubes (CreateObjectBox)
or better make a maze level in a 3d editor,export as .obj
and load it in agk.

u need a moving camera, should not difficult.
for collision checking i would use one of the ObjectRayCast commands.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 8th Dec 2014 21:02
You might want to have a look at this 3D driving game I made. It was written in V1 but works in V2 alpha 9.

If this was a proper game there are a number of things I'd do different (like put all the map data into an external file) but it should give you something to play with.

dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 9th Dec 2014 01:03
Thanks, I will check them out!
dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 10th Dec 2014 02:24
Hi "29 games", I tried your sample - awesome.

A question though - if I'm trying to make a maze, do I use cubes as the walls, i.e. you need to walk through them (can that be done), or do I need to create each wall as a thin box?
Yodaman Jer
User Banned
Posted: 10th Dec 2014 05:02
You could certainly use either boxes or thin walls for your maze, it's entirely up to you!

Now one thing that I'm not sure has been asked - do you mean you want to generate random mazes (that still have a pattern so that they're not impossible), or do you mean you want to build it, import it and go from there?

dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 10th Dec 2014 05:41
I have a couple of algorithms for building a random maze that can be solved. I just want to present them in 3D, and use it as a basis for a game.
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 10th Dec 2014 23:08 Edited at: 10th Dec 2014 23:09
If I understand your meaning, you want to make corridoors with walls, floor and ceiling.

You wouldn't use cubes to walk through, ie a single cube wouldn't make up the floor, ceiling and walls of the corridoor.

What you makes the walls from all depends on what the maze looks like.



In both examples, the floor can be made from a single plane or you can use an individual plane for each square in the grid. The same will be true for the ceiling.

I would say the option on left is easier to code as you don't need to worry about the orientation of the cube but it does generate a lot of unnecessary polygons which could affect performance.

The other way to do the version on the left is to create planes for the wall between the red and green squares but you have to orientate the planes to face into the corridoor.

The option of the right give less polygons but require a bit more coding as the plans would need to be orientated in the correct direction. The problem here is that the planes can only been seen from one side. The back face is invisible (test this by making a plane and just rotating it and you'll see what I mean). This also effects the collision detection as it only detects collision on the front of a polygon not it's back face. You might have to create each wall using two planes back to back.

In both case, the floor/ceiling can be made from a single plane covering the whole of the maze or you can use individual planes for each square. The latter gives allowance to have many different floor textures, possibly making it look more visually interesting.

Hope all that makes sense.

Attachments

Login to view attachments
dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 11th Dec 2014 04:21
Thanks. I have gone the plane model (as you suggest). I don't need to worry about collision as I don't allow them, i.e. you stay in the centre of the "hall". I really appreciate your help. I am well on my way now.

Login to post a reply

Server time is: 2024-11-25 13:43:59
Your offset time is: 2024-11-25 13:43:59