Skip to content

anthonyjclark/raycasting-simulation

Repository files navigation

RaycastWorld

Generate mazes and navigate through them with turn-by-turn directions.

Requirements

RaycastWorld/RaycastWorld.cpp requires lodepng, which is included as a submodule.

PycastWorld/pycaster... requires pybind11, which is included as a submodule.

Download both submodules with the following command (run it from the root of this project):

git submodule update --init --recursive

Game/Game.cpp depends on GLFW3. This is not included as a submodule. It will need to be installed separately.

MazeGen/MazeGen.py depends on matplotlib, but this dependency can be avoided if you don't need to view the output.

Getting Started

Here is the process to get the game up and running (all steps assume you are in the root project directory):

  1. Generate a maze using MazeGen/MazeGen.py
MazeGen/MazeGen.py --width 8 --height 8 --out > Mazes/new_maze.txt
  1. Compile Game/Game
cd Game
make
  1. Run Game/Game with the new maze
cd Game
./Game ../Mazes/new_maze.txt

Working With Python

Aside from Game/Game, you can use the raycasting engine in Python. To do so, you must compile the bindings. The easiest way to do so is to:

cd PycastWorld
make

Working on the server

Use the project's conda environment so that we are all using the same library versions:

source /opt/mambaforge/bin/activate arcs-summer21

When working on dgx01, place all datasets in: /raid/clark/summer2021/datasets.

Models and data will be saved inside their corresponding dataset directories.

Working With Notebooks

We will use mwouts/jupytext to more effectively work with Jupyter Notebooks. Each notebook should be paired with a percent Script. This has the following benefits:

  • It will make it easier for me to review notebooks.
  • It will make it easier for others to make changes to notebooks (e.g., if an API call changes).

Please do not add notebooks to the repo, instead we will only keep the corresponding python files.

Textures

Textures are from . These are under the Creative Commons CC0 License.

License

RaycastWorld/RaycastWorld.cpp is based heavily on raycaster_pitch.cpp by Lode Vandevenne. The original file contains this copyright notice.

Copyright (c) 2004-2020, Lode Vandevenne

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Notes

Things to do:

  • add lighting
  • add levels (e.g., three levels of cast rays)
  • agent height
  • skybox
  • https://github.com/sizmailov/pybind11-stubgen
  • wall heights: for each vertical line
    • cast ray
    • fill from bottom until height
    • repeat until full screen height
  • we can use the raycast distances to label pixels for getting depth
  • compile to JS and work in browser
  • switch to Julia? (pyjulia, juliaimages)

Resources:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •