SyntaxBomb - Indie Coders

General Category => Worklogs => Topic started by: RemiD on February 18, 2018, 00:13:08

Title: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 18, 2018, 00:13:08
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.
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-Map-All-20180218.png&hash=fc4762a170be71da8ccccc0f17dbb1e107b1b355)

Using Blitz3d, i have read the pixels of the image to create the areas made of fwcs, the passages, the entryexits
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-DebugTiles-20180218.png&hash=fb43c21cfe9e5efa0748d02a32a7a85b4dc90b08)

Using Fragmotion, i have modeled all the fwc parts without passages, with passages :
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-FWCsPassagesShapes-20180224.png&hash=3227dd7e9f571d4215853aa7c1933f253c91457c)


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...
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: iWasAdam on February 18, 2018, 10:09:25
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 (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 :)
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 18, 2018, 10:33:48
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 !
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: iWasAdam on February 18, 2018, 10:55:49
I think you're missing my point.

Take a look at the wolfenstein editor:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Flodev.org%2Fcgtutor%2Fimages%2Fwolfmapedit.jpg&hash=13db3814364c67124fa6d53e1cb735d35287b669)

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.

... ;)
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 18, 2018, 11:08:24
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...
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 18, 2018, 15:34:32
this seems to work :
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-AreasFWCsPassages-oview-20180218.png&hash=106cd78dc878dd588dbe13600cb3fe3e2a61ac6d)
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...
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 18, 2018, 18:41:48
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.
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-AreasFWCsPassages-fpview-20180220.png&hash=5cbe3b59c281a7e853a8a9296dffe58e48efedd6)

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
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: Yue on February 18, 2018, 19:57:36
I have a phobia of holes... that image scares me.   :-X
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 18, 2018, 20:23:30
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.
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 20, 2018, 20:42:51
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...

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-identify-vertices-near-passages-20180220.png&hash=4bd20a65cc34827062ed463b067167197ba2162a)

Here you can see the result with debug markers...
Title: Re: "caves 3d" (similar to "catacombs 3d" on DOS)
Post by: RemiD on February 23, 2018, 08:25:27
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 !
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 24, 2018, 10:56:35
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 !)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: iWasAdam on February 24, 2018, 11:27:08
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....
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 24, 2018, 11:35:50
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...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Derron on February 24, 2018, 11:44:15
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
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 24, 2018, 19:28:37
Quote
You can still use multiple floors. A*star will work the same. A floor change is just another "step".
try it, always easy in theory...

In my case it would have been more complicated because i want each area (cave) to have a different height depending on the "largeness" of the area, so all levels would not have had a uniform height...

But i have chosen a simpler approach : the areas will have a different height depending on their "largeness", however there will be only one level.
And to go to another level, you have to use an "entryexit" (to go from one level to another level)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Derron on February 24, 2018, 19:42:12
For path finding the "height" of a cavern should be of less importance. Just think of yourself drawing a map of the cavern system - does it include all the different heights or do you try to "abstract" it into floors?
Same is done when doing the pathfinding.

And A*Star contains some kind of "weighting" - so you could add "height changes" in the calculations too. At least I would try to do so.


bye
Ron
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 24, 2018, 20:05:08
I was not talking about the pathfinding, but about the generation of the caves, with different heights and passages to down or to up, and of course it is possible to generate such caves, but i don't want to complicate things at the moment...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 25, 2018, 16:08:00
Today i have coded a procedure to identify the outlines (pixels) of the shape of an area, from the exterior to the interior, the idea is to create a kind of heightsmap for each area so that different areas will have differents reliefs / heights. (on the ceiling)

Not sure if this will look good once applied to the surface of each mesh, but the procedure works well :
the shape :
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-shape-of-area-20180225.png&hash=47b88ac234a65e1cd08cb7e5112b81e1f6f9d4f5)
the different outlines :
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-heights-of-area-20180225.png&hash=fbbd5649a7a42e7b2c4349d7bb9d524009f6cbe0)
each outline corresponds to a height, starting at 3units at the exterior, and i think that i will add 0.1unit for each outline (from exterior to interior)

It should be easy enough to identify each vertex inside each cell (corresponding to a pixel)

anyway !
Title: Re: "caves 3d" (explore caves, avoid harmful things / creatures, find the exit)
Post by: RemiD on March 01, 2018, 18:19:50
today i have added the "outlines heights" (to add some "depth" on the ceiling of areas) and irregularities to the floors walls ceilings depending on the vertices normals.

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-outlines-heights-and-irregularities-oview-20180301.png&hash=3d76632ee2e03c0befb6a28f0dac1ac517f1e2f1)

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-outlines-heights-and-irregularities-fpview-20180301.png&hash=2c19fb209866a83e9f4453e8f5d9af37344e9c9d)

This looks natural enough for my taste...


Next : i will try to add "statics" like stalagtites, stalagmites, columns, rocks, crystals, and then lightsources...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: iWasAdam on March 02, 2018, 11:12:43
looks really nice.
Here's a different approach for you to think about.
Taking the 'general' map from above I created a grid map:
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-02-at-11-06-58.png)
where green is a corridor, ochre is low and orange is heigh.

All you need is a set of pre-defined 'cave' meshes for the walls and ceilings, the ground 'could' be a different mesh entirely.
You don't have to do any 3d collision you just use the grid...

Don't like the caves, then just change the mesh's for something nicer like a castle...
You haven't changed the game code one line, apart from importing different meshes...

Enemies, dressing, bonus, etc. Just add a layer to the grid with the references you want...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: iWasAdam on March 02, 2018, 11:33:31
I'm going to give you some reference pics and things to think on:
fallout and Skyrim - possibly one of best 3d rpg there is. let look at how skyrim is put together.
1. there are two parts: The open world (we're no looking at that)
2. Closed spaces, caves, etc (were going to look at how they do it)
Here's a closed cave system in skyrim:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fwww.predragpesic.com%2Fimages%2Fpg_projects_maps_skyrim_ogmundstomb_03.jpg&hash=f04cb6e87ceb5efa9927c66e13bea174229395cf)

Here's a view of how it is put together:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2F1.bp.blogspot.com%2F-gxtUDEvKUoU%2FUXBjJ6tbfAI%2FAAAAAAAAAbU%2FU-bRUopZKnU%2Fs1600%2FwebCaveShellStages.jpg&hash=30f372322c337ad764db239653cabbe483fda44e)

Here's a full overview of a 'map'
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fwww.predragpesic.com%2Fimages%2Fpg_projects_maps_skyrim_ogmundstomb_layout_01.jpg&hash=7cb1e545ea9fa395d5146e84ba56c7d23dfe773f)

And here's a top down and 3d view:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fwww.predragpesic.com%2Fimages%2Fpg_projects_maps_skyrim_ogmundstomb_guardians.jpg&hash=1807dce9d2dfc54f08e8bbd3b0564764d5ca068c)

Everything is predefined to a grid, brought in to the mapping system. and then placed and aligned, then with dressing added sent to testing.

Nothing is 'createmesh' it is all imports... all neatly accessible and all very fast to create and test and debug. You just start with a basic box, add a deform = instant cave, now texture.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 02, 2018, 12:30:55
About collision detection and repositionning, i could use a similar system that what you suggest : the map / areas are divided in cells, and the smallest area is 3x3cells, so i could allow movement only on the cells which are floor + ceiling (not floor + wall + ceiling) and floor + passage + ceiling.


About using premade sections, i know about this approach (i used to create mods for Morrowind, similar to Skyrim and Fallout 3), but i wanted to create something where each area being completely different than the others, and my current system works rather well. (even if it is limited)


About examples for the graphics, i have found these :
assetstore.unity.com/packages/3d/environments/dungeons/low-poly-caves-93612
assetstore.unity.com/packages/3d/environments/dungeons/low-poly-crystal-caves-81340
assetstore.unity.com/packages/3d/environments/dungeons/underworld-mobile-cave-environment-11144
assetstore.unity.com/packages/3d/environments/dungeons/underworld-cave-environment-10875

and also the movies "the descent 1", "the descent 2", "the cave"


however i will try to keep it simple to manage to finish it !
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: iWasAdam on March 02, 2018, 12:31:32
ok, heres a practical version:
(https://vjointeractive.files.wordpress.com/2018/03/screen-shot-2018-03-02-at-12-27-26.png)

5x10 grid, deformed and textured, vertexes moved to form a half arch, combine and flip and merge

It took 5 minutes to do this. and I can go back and re-edit the mesh mad it smoother use a different texture and fit it to a grid, etc.

No-one is criticising your methods, just attempting to bring you from the dark side and into the light. it really will make your life soo much simpler...  :D
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 02, 2018, 12:35:50
this is a possible approach, i know, but your environments will look very similar since you always use the same parts. (this was the case in Morrowind, in Oblivion, in Fallout 3)

now that my procedures are coded, i just have to draw the 2d map in an image editor, (one different color for each area), to draw the passages between each area (2pixels for each passage), to draw the entryexits (1 pixel for each entryexit), then save the image, then put the files in the Maps directory, then push the compile button, and the program identifies, then builds, the areas, the fwcs, the passages, the entryexits, the surfaces, then save them. And if the files already exist, it loads them...
So this is quicker than assembling parts on a grid ;)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rooster on March 02, 2018, 17:08:45
@ iWasAdam
Thats really cool seeing how the stuff works under the hood, thanks for posting that. :)

Also it's neat to see the different ways that you guy's going about solving the same problem.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 02, 2018, 17:35:02
@Adam>>also, something that i have not mentionned, is that i have no desire / motivation to create maps / environments manually... That's also why i prefer the "procedural generation" (i still make premade meshes / textures in a modeling tool / image editor, but i don't want to position / oriente them myself in a map editor !)

But apparently you have created all the maps in your previous game, manually, so maybe you like that, each his own preferences...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 03, 2018, 13:28:21
first experiment with lighting shading, using vertices lighting shading with the command LightMesh() (i have put a code example in the codes archives)

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-vertices-lighting-shading-%28lightmesh%29-oviewBB-20180303.png&hash=e8602da8d10aca1c7e92589b43c2e24d77177708)

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-vertices-lighting-shading-%28lightmesh%29-fpviewBB-20180303.png&hash=88d6400b70c51c2ab065e90d1720b3a5c19d43cb)

This looks nice imo, but not the lighting shading that i want, it is too bright, this is because the default vertices lighting shading of directx 7 lights and of lightmesh, in Blitz3d, has lights which have a infinite range... (lights have an infinite range in reality, but there are some particles in the air which make their intensity decrease with distance, that's what i will try to code, so that there will be lighting shading around lightsources, but also dark areas)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 04, 2018, 16:56:40
Today i have added crystals (as lightsources), and stalagtites stalagmites.

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-crystals-stalagtites-stalagmites-20180304.png&hash=7ce2dbf497d546b60b52dc24262c1be893784703)

I have not coded the vertices lighting shading procedures yet, so it is still too "bright" for the ambiance that i want, but nice nonetheless...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: STEVIE G on March 04, 2018, 17:18:57
Quote from: RemiD on March 04, 2018, 16:56:40
Today i have added crystals (as lightsources), and stalagtites stalagmites.

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fwip-caves3d-crystals-stalagtites-stalagmites-20180304.png&hash=47aac9e91f39cae0643868d22060ed5eb76107e4)

I have not coded the vertices lighting shading procedures yet, so it is still too "bright" for the ambiance that i want, but nice nonetheless...

Looks excellent.  It would look better if the stalagmites and tights were better merged with the floor / ceiling - might just be the normals though. 

Have you considered un-welding the triangles to get a nice flat shaded look, I have a simple function here if you want to give it a try?
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 04, 2018, 18:27:29
Quote
It would look better if the stalagmites and tights were better merged with the floor / ceiling - might just be the normals though.
this is because the stalagtites / stalagmites are not merged with the floor or the ceiling, however, you just gave me an idea on how to "fake it" (by adding more vertices at the base, with the normals pointing downward (for stalagtites) or upward (for stalagmites)), i will try...


About the structure of surfaces, for this game is use "shared vertices shading", what you use in your polymaniacs game is "flat shading" if i remember correctly. (i have also another procedure to rebuild a surface in what i call "realistic shading" where new vertices are created if the angle between 2 triangles is more than +89 or less than -89). Each his own tastes / preferences...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rooster on March 04, 2018, 22:27:30
Looking good RemiD. :)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Naughty Alien on March 05, 2018, 05:01:25
..so far looks very nice..i like it..ill keep my eye on this :)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Qube on March 05, 2018, 06:03:13
Quote from: RemiD on March 04, 2018, 16:56:40
Today i have added crystals (as lightsources), and stalagtites stalagmites.

(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fwip-caves3d-crystals-stalagtites-stalagmites-20180304.png&hash=47aac9e91f39cae0643868d22060ed5eb76107e4)

I have not coded the vertices lighting shading procedures yet, so it is still too "bright" for the ambiance that i want, but nice nonetheless...

Looks kinda eerie :o - Nice nice nice :)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Derron on March 05, 2018, 07:15:10
I vote too for improving the way the stalagmites/-tites "come out" from the wall - they should more look like "growing". So ground must slowly morph into these objects to avoid "sudden changes" (just look at the lighting of the stalagmites in the front right)). Maybe that changes when texturing them by hand (painting a bit darker here and there) but just keep an eye on it.


@ glowing crystals
They seem a bit "unified" in their length, maybe make them here and there a bt shorter - and also some should be thicker. maybe it is the scaling which hides that.


@ narrowness
make either sure that you can walk on all areas (just look at the screen's left) or that you cannot move into areas making you either see clipping errors or to get "stuck" needing exact maneuvres to get out of there.

bye
Ron
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 05, 2018, 07:26:49
What is interesting to note, is that, apparently, from the comments that you wrote, it is possible to create a nice scene without using "detail textures". (in this scene there is only one material using one 8w8h texture per kind of shape (one for the floorswallsceilings and stalagtites+stalagmites, one for each crystal)

This means that the modeling of shapes and the UVmapping is greatly simplified.

What makes the environments looks nice, is mostly because of irregularities and the different shades produced by vertices lighting shading.

I already talked about this approach, basically, instead of spending time UVmapping precisely and texturing, you create one 128w8h texture (or something similar) and you put several 8w8h colored rects on it, one for each color you want in your mesh, and then you model the different parts using different colors so that you can select the triangles of a part and UVmap all the vertices at the center of a 8w8h rect on the texture.

I plan to create all the models for this game, using this approach, and rely on the shades produced by vertices lighting shading, to make it look nice. We'll see...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 05, 2018, 07:44:04
@Derron>>i will focus on little details and variety later, i focus on the essential for the moment.

About narrow passages, all is ready for nodes, links, path calculation, path following, no worries...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 06, 2018, 07:52:12
I was searching on the interweb for infos about things which compose / are in caves, and i found this :
https://www.youtube.com/watch?v=JC41M7RPSec
https://www.youtube.com/watch?v=AlLKjKgV5So
So beautiful and surprising isn't it ? Lightsources in caves !
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rick Nasher on March 06, 2018, 19:24:43
Breathtaking. Perhaps was the inspiration for the Avatar forest?
https://www.youtube.com/watch?v=5xUyNdisu2M
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Steve Elliott on March 06, 2018, 19:54:02
Quote
..so far looks very nice..i like it..ill keep my eye on this :)

Agreed.  Keep experimenting...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 08, 2018, 21:50:31
A few updates :
->i have replaced the pointy stalagmites by roundy stalagmites
->i have removed the luminous crystals, and added luminous worms on the ceiling
->i have started to code a new procedure especially for this game, for the vertices lighting shading
After some thinking about how to produce a nice lighting shading, similar to the "glow worms" in the videos, i have decided to use this approach :
each light source (each luminous worm) (up to 30 per area), will emitt 2 kinds of light, an intense light with a short range, and a weak light with a far range. This way there will be nice intense colors on the surfaces near the lightsources, but the surfaces which are far from lightsources will be lighted only slightly, just to discern them, but i want to keep a dark ambiance, similar to what we can see in the movies "the descent".
I plan to maybe update the lighting shading in real time, depending on on fast it is to do that...

Here is a screenshot of the first step of the vertices lighting shading system :
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-verticeslightingshading-distanceattenuation-fpview-20180308.png&hash=054ac879ec4c1d579306af4d13393271799b06f4)
you can see the lightsources of different colors, and a distance attenuation, and a blending between different colors when they overlap.

Next step : add an angle attenuation (depending on the angle between light->vertex vector and vertex normal vector)

Then add the intense lighting shading of near vertices, and the weak lighting shading of far vertices.

Then add a glow effect on the luminous worms.

(Then maybe add a custom cone light, to reproduce how a torchlight lights)

Then i don't know, maybe work on the gameplay ;D
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rick Nasher on March 08, 2018, 22:31:48
Looking really good. Vid/gif? Can't wait to see this in action.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 09, 2018, 07:48:23
Quote
Looking really good.
this is a debugging render, ;) , (to check if the distance attenuation is calculated correctly, and if the different colors blend properly) but glad that you like it


After a new look at the "glow worms" videos, i think that to reproduce this kind of lighting shading it would be simpler to have lightsources which produce an intense light with a very short range, and then an ambient light on all surfaces, and a circular flare on each lightsource...
Not sure which method i will end up using, but what i have just explained would be really fast to update/render compared to the previous method.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rick Nasher on March 09, 2018, 17:49:08
Looks uniquely different. Unlike so many things looking all the same.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 09, 2018, 18:31:28
Quote
Looks uniquely different.
indeed, that's because the method / formulas i use for this lighting shading system, is unique, unlike most others devs who use the built in lights which have the exact same method / formulas for lighting shading... ( except Gabor  :D ) ( impressive screenshots about lighting shading and shadows, on the nuclear glory forum )

Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 09, 2018, 23:29:54
some updates :
->i have added the angle attenuation, so now there is a distance attenuation and an angle attenuation of the color of the light (depending on how far, and how oriented towards, the vertex is)
->i have added the intense lighting of near vertices, and the weak lighting of far vertices
->i have added a glow effect using circular flares
->i have decided to have only one color per area, in order to make the environments more different and to know where you are and where you have been in the map
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Frd-stuff.fr%2Fblitz3d%2Fwip-caves3d-verticeslightingshading-distanceattenuation-angleattenuation-fpview-20180309.png&hash=829e33a3e6b14e998f42aa2dadef37799e090ce8)

I am happy with the result, the ambiance is "dark" (like in "the descent" movies) but with enough light to see the environment and obstacles.
I could make it even more dark, but then i would have to add a torchlight, and i don't want to work on that at the moment...

However i don't know if i will keep the flares, because i have to use up to 30 linepicks per frame to determine if a flare is visible or hidden behind a wall or an obstacle in order to set its zorder appropriately (or maybe i could update only 1 per frame ? or maybe precalculate the visibility of each lightsource from the center of each cell ?)

Or maybe use a volumetric glow effect of a 3d sphere ?

Not sure, i will do some tests...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 10, 2018, 21:48:43
Quote
or maybe i could update only 1 per frame ?
yes it is fast enough to linepick a few times per frame, and to update only a few flares per frame, so i keep the circular flare for the glow effect...

Next : hidden surfaces culling system (to only render the area where player is and the areas connected to this area... (hence the usefulness to split the map in areas and passages...)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 11, 2018, 11:15:23
I am currently doing some experiments with vertices lighting shading in a cone shape (to have a kind of torchlight effect) and i clearly see the limits of vertices lighting shading... The result is ugly...

An alternative would be to use texels lighting shading, with a big enough texel size, so that it is fast enough to update... I have never seen this done in any game... (because it is too slow to determine which texels are in range (in a sphere shape or in a cone shape) in real time)

In this case this shows the superiority of per pixel lighting shading... (using a custom shader, something i will have to learn)
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rick Nasher on March 11, 2018, 14:15:41
Pixel lighting.. You mean like:
(https://www.syntaxbomb.com/proxy.php?request=http%3A%2F%2Fi68.tinypic.com%2Fo5c19t.jpg&hash=bef56eae4438f43b5d9fae98e34bfebf53ccdb61)

Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 11, 2018, 16:14:20
I don't know, you tell me...
Depending on how the scene is made, it could be per vertex lighting shading (with subdivided surfaces), or per texel lighting shading (with "lightmap" textures), or per pixel lighting shading (with a custom shader)

Usually omni lights look good even with per vertex lighting shading, but cone lights ("spot lights") do not.

I had an example of a cone light using per pixel lighting shading in Xors3d and the result was really nice...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rick Nasher on March 11, 2018, 16:47:48
I found the vertex lighting in AGK more suitable for explosions and such for it's fast, but pixel lighting has better quality.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 11, 2018, 18:54:19
Quote
but pixel lighting has better quality.
of course...

In your scene, do the per pixel lights go through walls / floors / ceilings ? or is there a way to illuminate only some surfaces and not others ?
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Rick Nasher on March 11, 2018, 23:23:42
I've found it depends on the thickness of walls and brightness of the color. AGK offers the option to oversaturate when going above the usual 256 for RGB which also appears to increase it's effective range.
e.g. a value of 1256 gives some really bright effects with a longer range which can bleed through if not handled carefully.
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 12, 2018, 08:07:18
Quote
I've found it depends on the thickness of walls and brightness of the color.
my question was more : can you set a light to light only one / several specific surfaces and not others in a scene... if yes, that's a useful feature, if not, it will be slower to render, and the light will go through walls...
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 14, 2018, 22:28:53
I have decided to stop to work on this game, because i don't think that the gameplay will be fun and i have no inspiration to go further with that...

On the positive side : i have improved my understanding and skills to create procedural meshes. And i have improved my procedures about lighting shading.


I am going to take a few days without coding, and then i will try to make a game similar to catacombs-3d on DOS (gameplay and graphics style), like what i initially wanted to do.