3d (monster) Maze

Started by iWasAdam, October 31, 2019, 14:45:05

Previous topic - Next topic

iWasAdam

 :o


There seems to be loads of talk around mazes, so in further extension to the maze code I released, here is a purely 2d (3d) maze - currently no monster...

Steve Elliott

Yep, maze games are cool.   8)
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Xerra

Quote from: iWasAdam on October 31, 2019, 14:45:05
There seems to be loads of talk around mazes, so in further extension to the maze code I released, here is a purely 2d (3d) maze - currently no monster...

Do it, Adam. You know you want to. I'd do it in GMS2, if I could think of a way.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

RemiD

#3
well, to be honest, it is easy to build a big maze map all in code, so yes it is a good approach for lone devs...

curious to see what you can create (in 3d!) ;)

iWasAdam

#4
@RemiD Yep, the maze create code is very simple (as posted elsewhere), but the actual 2d drawing is not quite as straightforward as it first seems as you need to write all the 2d code to deal with the correct drawing - there's no bitmaps used here.

A (true) 3d version would be much more simple, just create the base primitives and display - but (in this case) what is the fun in that?  ;D

current version with some design lines to aid with the 2d plus a slightly modified 'maze':

TomToad

Reminds me a bit of a maze game I created on my C64.  For rendering,I had an array of PETSCII strings for each wall and path. I would check left of the player, if blocked, then I'd draw the wall string, otherwise, I'd draw the path string. Id do the same for right and in front. If the front is not blocked, I'd then check that space's left and right and front. I'd continue this way until the path was blocked, or I had gone the maximum depth.
------------------------------------------------
8 rabbits equals 1 rabbyte.

iWasAdam

now with doors and 'visited' map

It's very 'pure', no graphics getting in the way of things and distracting me.
Next step is to work on some zoning and logic. E.G. there might be something that needs attention in zone 1 before progressing to zone 2, maybe the you need to collect something, etc.

I like the fact that it is neutral, so it could be a spaceship, or a pyramid, etc

iWasAdam

automatic zones completed and being shown in different colors:

RemiD

defining zones is also good for combining surfaces / textures, and determining what is visible and what to hide/show/render, and which entities to update, so yeah, way to go (i do something similar)

Derron

@ RemiD
Do not mix up what iWasAdam might understand with "zones" (game logic wise) and your "zones" (render/physics engine wise).
So "zoning" can be useful for what you propose - but it cannot be the same as what "game logic zones" would be.

Adam's zones are possibly there to eg allow stuff like "explore the area to open a door" stuff whilst your is there to improve performance by skipping handling of certain elements - or to skip rendering walls or so.

I think for now Adam is using them to display what you have visited (he wrote that :D) so on bigger maps you can have some "auto (mini-)map" which draws what you "know" + some area around. So it is a visual helper which could be used for game effects too (explore 75% of a map and trigger a special event - like a new boss mob spawning).


But maybe I assumed wrong and just brought in some new ideas :D - it is up to Adam to clarify.


bye
Ron

iWasAdam

#10
Quote(explore 75% of a map and trigger a special event - like a new boss mob spawning)
That is pure genius  :o

Just to clarify my use and creation of zones for everyone.
zones are just arbitrary numbered areas. Where the number refers to it's position in the abstract map logic.
E.G.
a door has a zone of 3
therefore placing the key to zone 3 anywhere in zones 0/1/2 is valid. As zone 3 can be accessed from possibly zone 0 or 1 or 2. But not anything higher.

So lets say you have 6 zones (0,1,2,3,4,5)
and the exit is in zone 5, but is full of acid
in zone 4 is a handle to drain acid
But zone 4 needs a key to enter
in zone 2 you find a key to zone 4

:)

Xerra

All this chat about mazes reminds me of the the "Hunt the Wumpus" simple grid maze game that I posted the source into the old forums a few years back. I wrote that bugger with a stinking hangover as well as it was new years day, I think :) That used a data structure that was a grid with different numbers indicating what kind of hazard was in it. Just didn't have the ability to put a 3d maze graphic system into it. Not sure if I could do it now with gamemaker, hmmmmmm......
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

RemiD

zones can be defined in different ways : cells of a grid or other shape (made of flat triangles), and useful not only to uptade / render only some entities, but also for gameplay (keys and locks/doors or triggers and events), i am aware :)

there can be all kinds of zones : youtube.com/watch?v=C2VfmhAlTO8  :))

iWasAdam



More or less done. There are monsters and some other stuff. The green diamond above is a monster!

What I have found is that using 2d to represent 3d is not a brilliant idea, but is great to learn general concepts.
The 2d top down map view, could become it's own game

doors and zones makes things complex for no reason, so they were removed

Will be interesting to see about doing a 3d conversion. possibly Faux to begin with

RemiD

Quote
using 2d to represent 3d is not a brilliant idea
no need to reivent the wheel ? :P


Quote
doors and zones makes things complex for no reason
not really... but ok


Quote
Will be interesting to see about doing a 3d conversion
curious to see.
maybe go for a graphics style similar to this :
store.steampowered.com/app/249630/Delver/
(seeing how you already know how to make such "animated images")