December 09, 2019, 08:49:15 AM

Author Topic: 3d (monster) Maze  (Read 2018 times)

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #30 on: November 13, 2019, 08:25:02 AM »
Excellent - looks like i'm on to something :)

Next up is dealing with FOV and only showing what can be seen. I can then begin culling the 3d models as needed. that way I can have big levels...

well step 1 - what's in the fov triangle wasn't too bad:


Just need to do a recursive check through the visible fov positions next

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #31 on: November 13, 2019, 12:14:14 PM »
it took a bit of wierdness with checking floats to int and making sure that a .5 and above would be rounded up (and not down).
But in the end the recursive routine starts from your position, and works it's way around the field of view and outputs the correct result - even taking into account doors that can be opened:


You can see on the minimap the dark red squares are the active field of view. The bright red squares is the current visible cells. the door is shut, so no further cells are added.

Final stage will be to take the bright red output, feed it into a list, and render the contents of the list - nice and simple process :)


Offline Derron

  • Hero Member
  • *****
  • Posts: 2607
Re: 3d (monster) Maze
« Reply #32 on: November 13, 2019, 12:16:59 PM »
> it took a bit of wierdness with checking floats to int and making sure that a .5 and above would be rounded up (and not down).

local rounded:int = int(floatValue + 0.5)
2 = int(2.4 + 0.5)
2 = int(1.5 + 0.5)
1 = int(1.4 + 0.5)


bye
Ron

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #33 on: November 13, 2019, 12:28:36 PM »
Even simpler - thanks Derron :)

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #34 on: November 14, 2019, 07:27:27 AM »
ok, next step is to introduce objects into the map - these are static things that will need movement checking, etc.

But for now, this is the first revision of a 'hold' with a barrel. There is only the light from the door.
Because there are no walls, you can also see that the 3d objects behind the door are no visible and being properly culled  8)

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #35 on: November 15, 2019, 07:14:20 AM »
and now with some walls and lights and crates - The Hold!


And here we are crouching behind some crates and looking up at the Hold ceiling showing details that might be missed. My thought is to have some form of mist coming from the overhead vents?


I like the way the lighting is subdued - it's actually a warm yellow, but the light fixtures have a nice glow to them :)

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1024
Re: 3d (monster) Maze
« Reply #36 on: November 15, 2019, 07:09:48 PM »
so, is this "emissive lighting" (with a shader) or just fullbright surfaces ?
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #37 on: November 15, 2019, 08:03:50 PM »
Neither, it’s a variation of light propagation.

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #38 on: November 17, 2019, 12:30:06 PM »
First look with some particle stuff going on - lots of recoding to get it to work :(

and something less subtle with some additional motes

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1024
Re: 3d (monster) Maze
« Reply #39 on: November 17, 2019, 01:09:17 PM »
in blitz3d, smoke / fog, looks better with the blendmode "add" (instead of only considering color+alpha), maybe this can help...
Quote
Alpha:
This blends the pixels according to the Alpha value. This is rougly done to the formula:

Rr = ( An * Rn ) + ( ( 1.0 - An ) * Ro )
Gr = ( An * Gn ) + ( ( 1.0 - An ) * Go )
Br = ( An * Bn ) + ( ( 1.0 - An ) * Bo )

Where R = Red, G = Green, B = Blue, n = new pixel colour values, r = resultant colour values, o = old pixel colour values.

Alpha blending is the default blending mode and is used with most world objects.


Multiply:
This blend mode will darken the underlying pixels. If you think of each RGB value as being on a scale from 0% to 100%, where 0 = 0% and 255 = 100%, the multiply blend mode will multiply the red, green and blue values individually together in order to get the new RGB value, roughly according to:

Rr = ( ( Rn / 255.0 ) * ( Ro / 255.0 ) ) * 255.0
Gr = ( ( Gn / 255.0 ) * ( Go / 255.0 ) ) * 255.0
Br = ( ( Bn / 255.0 ) * ( Bo / 255.0 ) ) * 255.0

The alpha value has no effect with multiplicative blending. Blending a RGB value of 255, 255, 255 will make no difference, while an RGB value of 128, 128, 128 will darken the pixels by a factor of 2 and an RGB value of 0, 0, 0 will completely blacken out the resultant pixels. An RGB value of 0, 255, 255 will remove the red component of the underlying pixel while leaving the other color values
untouched.

Multiply blending is most often used for lightmaps, shadows or anything else that needs to 'darken' the resultant pixels.


Add:
Additive blending will add the new color values to the old, roughly according to:

Rr = ( Rn * An ) + Ro
Gr = ( Gn * An ) + Go
Br = ( Bn * An ) + Bo

The resultant RGB values are clipped out at 255, meaning that multiple additive effects can quickly cause visible banding from smooth gradients.

Additive blending is extremely useful for effects such as laser shots and fire.
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #40 on: November 18, 2019, 02:35:10 PM »
great read there :)

Looking down I found some sort of space tool so I picked it up...


it took bugger long time to get that glove sorted too  8)

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #41 on: November 19, 2019, 02:22:54 PM »
Here's a quick look showing the tool + your arm and pressing escape brings up the option, map window...

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #42 on: November 20, 2019, 07:21:26 AM »
just working on the 'dos' part when you lift your arm.
Here's the map view:

You can also see the debug map in the bottom left

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1413
Re: 3d (monster) Maze
« Reply #43 on: November 22, 2019, 08:56:06 AM »
Got the noise sorted and a new widescreen viewport.
Also now has stable 60fps windowed or fullscreen :)
As it's a monster maze I thought we needed a monster...
I think inspiration is going to be halflife, alien and the thing!

Offline BasicBoy

  • Full Member
  • ***
  • Posts: 144
Re: 3d (monster) Maze
« Reply #44 on: November 22, 2019, 10:14:46 AM »
I think this looks really good!