SyntaxBomb - Indie Coders

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

Title: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on February 18, 2018, 12:13:08 AM
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.
(http://rd-stuff.fr/wip-caves3d-Map-All-20180218.png)

Using Blitz3d, i have read the pixels of the image to create the areas made of fwcs, the passages, the entryexits
(http://rd-stuff.fr/wip-caves3d-DebugTiles-20180218.png)

Using Fragmotion, i have modeled all the fwc parts without passages, with passages :
(http://rd-stuff.fr/wip-caves3d-FWCsPassagesShapes-20180224.png)


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 AM
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 AM
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 AM
I think you're missing my point.

Take a look at the wolfenstein editor:
(http://lodev.org/cgtutor/images/wolfmapedit.jpg)

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 AM
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, 03:34:32 PM
this seems to work :
(http://rd-stuff.fr/wip-caves3d-AreasFWCsPassages-oview-20180218.png)
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, 06:41:48 PM
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.
(http://rd-stuff.fr/wip-caves3d-AreasFWCsPassages-fpview-20180220.png)

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, 07:57:36 PM
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, 08:23:30 PM
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, 08:42:51 PM
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...

(http://rd-stuff.fr/wip-caves3d-identify-vertices-near-passages-20180220.png)

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 AM
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 AM
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 AM
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 AM
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 AM
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, 07:28:37 PM
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, 07:42:12 PM
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, 08:05:08 PM
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, 04:08:00 PM
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 :
(http://rd-stuff.fr/wip-caves3d-shape-of-area-20180225.png)
the different outlines :
(http://rd-stuff.fr/wip-caves3d-heights-of-area-20180225.png)
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, 06:19:50 PM
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.

(http://rd-stuff.fr/wip-caves3d-outlines-heights-and-irregularities-oview-20180301.png)

(http://rd-stuff.fr/wip-caves3d-outlines-heights-and-irregularities-fpview-20180301.png)

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 AM
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 AM
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:
(http://www.predragpesic.com/images/pg_projects_maps_skyrim_ogmundstomb_03.jpg)

Here's a view of how it is put together:
(http://1.bp.blogspot.com/-gxtUDEvKUoU/UXBjJ6tbfAI/AAAAAAAAAbU/U-bRUopZKnU/s1600/webCaveShellStages.jpg)

Here's a full overview of a 'map'
(http://www.predragpesic.com/images/pg_projects_maps_skyrim_ogmundstomb_layout_01.jpg)

And here's a top down and 3d view:
(http://www.predragpesic.com/images/pg_projects_maps_skyrim_ogmundstomb_guardians.jpg)

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 PM
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 PM
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 PM
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, 05:08:45 PM
@ 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, 05:35:02 PM
@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, 01:28:21 PM
first experiment with lighting shading, using vertices lighting shading with the command LightMesh() (i have put a code example in the codes archives)

(http://rd-stuff.fr/wip-caves3d-vertices-lighting-shading-(lightmesh)-oviewBB-20180303.png)

(http://rd-stuff.fr/wip-caves3d-vertices-lighting-shading-(lightmesh)-fpviewBB-20180303.png)

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, 04:56:40 PM
Today i have added crystals (as lightsources), and stalagtites stalagmites.

(http://rd-stuff.fr/wip-caves3d-crystals-stalagtites-stalagmites-20180304.png)

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, 05:18:57 PM
Today i have added crystals (as lightsources), and stalagtites stalagmites.

(http://rd-stuff.fr/wip-caves3d-crystals-stalagtites-stalagmites-20180304.png)

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, 06:27:29 PM
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, 10:27:30 PM
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 AM
..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 AM
Today i have added crystals (as lightsources), and stalagtites stalagmites.

(http://rd-stuff.fr/wip-caves3d-crystals-stalagtites-stalagmites-20180304.png)

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 AM
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 AM
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 AM
@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 AM
I was searching on the interweb for infos about things which compose / are in caves, and i found this :


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, 07:24:43 PM
Breathtaking. Perhaps was the inspiration for the Avatar forest?
Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: Steve Elliott on March 06, 2018, 07:54:02 PM
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, 09:50:31 PM
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 :
(http://rd-stuff.fr/wip-caves3d-verticeslightingshading-distanceattenuation-fpview-20180308.png)
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, 10:31:48 PM
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 AM
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, 05:49:08 PM
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, 06:31:28 PM
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, 11:29:54 PM
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
(http://rd-stuff.fr/wip-caves3d-verticeslightingshading-distanceattenuation-angleattenuation-fpview-20180309.png)

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, 09:48:43 PM
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 AM
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, 02:15:41 PM
Pixel lighting.. You mean like:
(http://i68.tinypic.com/o5c19t.jpg)

Title: Re: "caves 3d" (explore caves, avoid harmful things, find the exit)
Post by: RemiD on March 11, 2018, 04:14:20 PM
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, 04:47:48 PM
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, 06:54:19 PM
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, 11:23:42 PM
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 AM
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, 10:28:53 PM
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.