"caves 3d" (explore caves, avoid harmful things, find the exit)

Started by RemiD, February 18, 2018, 00:13:08

Previous topic - Next topic

RemiD

edit : same environment, new theme / gameplay based on the movie "the descent"

For the moment the map structure looks like that :
maps
areas
  fwcs (floor wall ceiling parts, to make the inside of a cave)
  passages (to go from one area to another)
  entryexits (to go from one level to another)
  statics (columns, stalagtites, stalagmites, rocks)
  lightsources
  items
turningmovings (traps, creatures, player)

First step : design a way to create a map quickly

I have chosen to create the map in an image editor on a 100w100h image, with 3 layers :
one layer for the areas, made of fwc parts, (each area is a cave)
one layer for the passages (to go from one area to another)
one layer for the entryexits (to go from one level to another)

Using an image editor, i have drawn quickly several shapes of areas connected one to another, each area of a different color.


Using Blitz3d, i have read the pixels of the image to create the areas made of fwcs, the passages, the entryexits


Using Fragmotion, i have modeled all the fwc parts without passages, with passages :



next step will be to replace the debug tiles by the appropriate fwcs parts and merge all fwcs of each area in one mesh one surface one texture...

iWasAdam

One thing to have in your mind. THIS IS NOT 3D!

Have a look at how it constructed here:
http://lodev.org/cgtutor/raycasting.html

It shows you how the map and everything else is 2D. So maybe do it completely in 2d with just block graphics - get the sliding collision right, the firing, etc. all in a 2D map.

Then you can think about moving the view into 3D :)

RemiD

Quote
THIS IS NOT 3D!
ok! ok! i am just trying to make a similar game, i don't care about the underlying technology / method used !

iWasAdam

#3
I think you're missing my point.

Take a look at the wolfenstein editor:


It's a simple 2D grid of cells.

Although you are using a sort of similar method of using bitmaps for the map. I think you will run into some really nasty problems in the long run.

If one of your colors is even slightly not expected it will be read in wrong!

Much better to start with a simple (say 5x5) internal grid, with walls/doors on one layer. Test out your movement system with this simple map and get the movement right, sliding collision, etc. You don't need any data coming from bitmaps, or anything, just a few lines of data.
0 = no contents
1 = wall
2 = red door closed
3 = red door open
4 = red key
5 = door closed
6 = door open
7 = enemy
8 = your start

if cell = 0 then move
if cell = 1 then stop its a wall
if cell > 1 check for other things

IT IS 2D, but really easy to get your head around, but incredibly hard to 'get right' - but nice and simple to draw onscreen top down.

Once 'everything' works then transfer the display from 2d to whatever 3d you are going to use. you have already got all the collisions sorted (in 2d), key, doors, etc.

... ;)

RemiD

#4
Quote
Although you are using a sort of similar method of using bitmaps for the map. I think you will run into some really nasty problems in the long run.
If one of your colors is even slightly not expected it will be read in wrong!
I only use an image to quickly design / build the map, then i don't use it. the turns moves will be done in 3d, the collisions detection and repositionning will use linepicks and 3d pickables (low details meshes), the pathcalculation pathfollowing will use 3d nodes, the occlusion culling will use the passages from one area to others areas to determine which areas to display around the area where player is.

So no problem in sight... But i keep your advices in mind...

RemiD

this seems to work :

now i want to merge all fwcs of each area in one mesh one surface one texture (to improve the vertices lighting/shading, and to decrease the rendering time), and then add iregularities to the floors walls ceilings depending on the normal of each vertex...

RemiD

Ok i have managed to merge all fwcs parts of each area in one mesh one surface and to update the normals, and it seems to work as expected.


Also i will probably need to subdivide each fwc part a little more (each 0.5unit) so that the vertices lighting / shading will look better.

Next step : subdivide each fwc part, and then code a procedure to add irregularities to the floors walls ceilings

Yue

I have a phobia of holes... that image scares me.   :-X

RemiD

There is nothing to fear at the moment, but when i will add the others components and the creatures, a nice lighting/shading, it may become scary.

RemiD

Today i have modeled new passages, and fixed an annoying bug in the code, and tested a way to identify the vertices which are near the passages (on the border between 2 areas)
Because each area has one mesh one surface one texture (made of several premade fwcs and passages), and i want to add irregularities to the floors walls ceilings of the area, but the vertices which are on the border between one area and another area must not move, or there will be holes in the mesh !

So what i did is to put a pivot at the center of the passage, and if some vertices of the surface of an area were within a specific range (distance), they will not be considered when adding irregularities to the floors walls ceilings...



Here you can see the result with debug markers...

RemiD

Well, i have decided to follow Adam's recommendation and to (try to) create a video game similar to the movie "the descent",
I can always use the procedures i code for this game, for others games...

Let's see how far i can go !

RemiD

So, yesterday i tried to add a more complex structure to the caves, more diverse passages, and then i realize that it will be  more complicated to code the ai and the pathfinding, so i just simplified the structure... (not to end up with another never ending project !)

iWasAdam

I'm going to say (very quietly), think of this not as 3d, but a 2d grid.
AI and pathfinding on a 2d grid is much simpler to do than in pure 3d - where it's horribly complicated.

3d is HARD.
3d collision is VERY hard.
3d collision with strange shapes and forms is very VERY hard.
3d AI and Pathfinding is Uber HARD.

Mostly all of these are NOT done in 3d, but on a 2d map of some form to make thing easier to do. with 3d collision only for very specific things - and usually some form of custom (read bought in) engine.

Using Blitz or Max or Monkey1/2, you are going to find your own way, and there will be problems along the way.

Try with something simple like a 2d grid and work from there up....

RemiD

Quote
think of this not as 3d, but a 2d grid.
AI and pathfinding on a 2d grid is much simpler to do than in pure 3d - where it's horribly complicated.
i agree ! that's why i forgot about my previous idea to have passages to areas below and above (through the floor / ceiling), now i only have passages at front back left right (through walls)

The added complexity is not only for pathfinding, but also for collision detection and repositionning, and more animations to create, so for now i have decided to work only on the basic functionalities / components...

Derron

You can still use multiple floors. A*star will work the same. A floor change is just another "step".


But you should see an organically shaped cavern as if you need to draw as a map on checkerboard paper. All the little dents can be ignored.


Bye
Ron