Skip to content

Akaban/doom-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doomSimulator

This project is a doom-like graphical engine simulator written in OCaml with the library Graphics

Getting started

  • A recent version of OCaml is required
  • ocaml-findlib and ocamldep are required
  • Ocaml Graphics (graphics.cma) is needed (sometimes installed with the base ocaml package, on ubuntu/debian its libcamlimages-ocaml)
  • If all requirements of the above are meet, compile the projet with make
  • The resulting binary will be named doom

Example

This program loads a labyrinth source, written with the following syntax

P: Coordinates (x,y,z) of starting point in the map
Coordinates of all the segments in the map, representing walls

P : 400 100 90
300 0 300 300
500 0 500 300
300 300 150 500
500 300 650 500
400 350 300 500
400 350 500 500
300 500 400 650
500 500 400 650
150 500 400 800
650 500 400 800

We can now start the program with for example ./doom source\_file.lab

While in the game you can move using ZQSD (WASD not supported)

Example with lab1.lab in 2D:

Example with lab1.lab in 3D:

A funny rainbow maze ./doom -maze -mode 3D -rainbow:

Change the maze's wall size with -mazewidth eg. -mazewidth 300 for big walls.

Keys in game

  • e: Rotate the camera to the right by one
  • a: Rotate the camera to the left by one
  • c: Crouch
  • b: Rush mode
  • r: Teleport to the lab init position

There are others keys used for the debug mode but they're not documented here.

Options

  usage: ./bsp file.lab
    -mode <2D      | 3D> 2D or 3D display
  -fov           field of vision (angle de vision)
  -dims          set the dimensions of the graph
  -scale         scale of the 2D map
  -map           set a minimap in the lower left corner
  -step          set the distance between two steps
  -xmin          set minimum distance of display
  -debug         debugging 2D rendering
  -debugbsp      debugging bsp
  -maze          generate random maze
  -mazesize      set size of maze
  -mazewidth     set width of maze's walls
  -xmax          set maximum distance of display
  -rainbow       set rainbow colors to walls
  -minimap_xmax  set maximum distance of display in minimap
  -help          Display this list of options
  --help         Display this list of options

About

A doom-like graphical engine simulator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages