>>3784452Chatgpt -
Standard Programming Techniques for (Grid-Based, First-Person)
1. Grid Map Representation
Usually a 2D array or tilemap-like system (int[,] mapGrid)
Each tile has:
Type: Wall, Floor, Door, Stairs
Visibility / Discovered
Events (monsters, treasures, traps)
Coordinates for logic (x, y)
2. Player Movement
Grid-based (1 tile per move: forward, back, turn left/right)
Movement (enum Direction { North, East, South, West })
Player has position and facing direction
Turning changes facing; moving forward uses current facing
3. Rendering the View
Raycasting (pseudo or real): Many modern DIY versions use simplified raycasting to render fake 3D from the grid.
Quad/Plane stacking: Stack planes (walls, floors) in front of camera based on the map and player facing.
4. Encounter Triggers
Random encounter % per step
Or manual triggers placed on tiles (mapEvents[x, y])
Boss encounters use flags or state to lock movement
5. Minimap / Automap
Stores visited tiles separately (bool[,] visited)
Renders simple top-down map
6. Save System
Player position + direction
Dungeon visited state
Party stats, inventory, map discoveries
Tools, Frameworks, or Engines
Unity URP or HDRP (for fancier rendering)
Use ScriptableObject for encounter tables, enemy data
Use tilemaps or a custom dungeon generator
Open Source / Leaked or Educational Codebases
Open Source Projects
Delver (first-person roguelike with code)
GitHub: https://github.com/Interrupt/delverengine
Procedural generation, simple 3D dungeon rendering
Dungeon Crawl Stone Soup (DCSS)
Not first-person, but great monster AI + dungeon logic
GitHub: https://github.com/crawl/crawl
DungeonMaster JS clone
JS/browser remake: https://github.com/arnaudjuracek/dungeon-master-js
Video / Blog Tutorials
"Brackeys-style" devlogs or dungeon generation tutorials in Unity
YouTube search: โUnity Wizardry cloneโ, โFirst person tile-based movement Unityโ