{"id":15659002,"url":"https://github.com/danielholmes/wolf3d-haskell","last_synced_at":"2025-05-05T17:11:19.561Z","repository":{"id":145825883,"uuid":"107333959","full_name":"danielholmes/wolf3d-haskell","owner":"danielholmes","description":"Wolfenstein 3D style game engine implemented in haskell","archived":false,"fork":false,"pushed_at":"2020-03-01T10:49:20.000Z","size":852,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-25T14:03:06.009Z","etag":null,"topics":["doom","game","haskell","haskell-game","id-software","sdl","sdl2","wolf3d","wolfenstein","wolfenstein-3d","wolfenstein-3d-engine"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielholmes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-17T23:13:25.000Z","updated_at":"2023-12-20T22:44:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3a34e13-9cc1-40aa-83c6-5e2eb0fdfe76","html_url":"https://github.com/danielholmes/wolf3d-haskell","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fwolf3d-haskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fwolf3d-haskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fwolf3d-haskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fwolf3d-haskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielholmes","download_url":"https://codeload.github.com/danielholmes/wolf3d-haskell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242756952,"owners_count":20180202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doom","game","haskell","haskell-game","id-software","sdl","sdl2","wolf3d","wolfenstein","wolfenstein-3d","wolfenstein-3d-engine"],"created_at":"2024-10-03T13:14:37.962Z","updated_at":"2025-03-09T21:32:42.283Z","avatar_url":"https://github.com/danielholmes.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wolfenstein 3D in Haskell\n\n![Build](https://github.com/danielholmes/wolf3d-haskell/workflows/Build/badge.svg)\n\nWolfenstein 3D in Haskell. Inspired by [John Carmack's Quakecon 2013 Talk](https://youtu.be/Uooh0Y9fC_M?t=4660) and\nmentions of trying to implement games (and Wolf3D in particular) in functional programming/Haskell.\n\nThe implementation aims to use similar runtime data structures to the original source. I want to get a better \nunderstanding of how the original works and also reap the performance rewards (my naive attempts at a ray caster before\nperformed badly). Also I hope this helps getting the same feel as the original.\n\nThis is a work in progress and is still in early stages.\n\n\n## Requirements\n\n - [Stack](https://www.haskellstack.org) (tested with 1.9.1-1.9.3)\n - [SDL2](https://www.libsdl.org/) (tested with 2.0.8-2.0.9)\n - [SDL2 Image](https://www.libsdl.org/projects/SDL_image/) (tested with 2.0.4)\n - [SDL2 TTF](https://www.libsdl.org/projects/SDL_ttf/) (tested with 2.0.14)\n\n\n## Setting up Development Environment\n\n```bash\nstack setup\nstack build --pedantic\n```\n\n\n## Running\n\n```bash\nstack exec wolf3d\n```\n\nor\n\n\n```bash\nstack exec wolf3d-debug\n```\n\n\n## Running REPL\n\n```bash\nstack repl\n```\n\n\n## Running Tests\n\n```bash\nstack test --pedantic\n```\n\nOr continuous:\n\n```bash\nstack test --pedantic --file-watch\n```\n\n\n## TODO\n \n - have press m to toggle map for debug\n - move sprites forward a bit. This was fudged in original:\n   - https://github.com/id-Software/wolf3d/blob/05167784ef009d0d0daefe8d012b027f39dc8541/WOLFSRC/WL_DRAW.C#L227\n - id system for items\n - multi engine approach outlined in first 60 or so slides of https://www.slideshare.net/naughty_dog/multiprocessor-game-loops-lessons-from-uncharted-2-among-thieves\n - static sprite targets that hero can shoot and kill\n - SimItem infrastructure - Update each item to produce events, process those events which generate new events\n - Split SDL dependency into own module\n   - split Display into multiple modules\n   - merge UI into display? - simplifies some things like disposing and setting up renderer\n \n - rendering alternatives\n   - https://github.com/bkaradzic/bgfx looks good for rendering\n   - OpenGL renderer - https://hackage.haskell.org/package/OpenGL\n   - See https://github.com/jxv/sdl2-fps\n   - SoftwareRenderer provides much better performance (in createRenderer)\n   - try using SDL.opengl ?\n   - do some research on spritesheets, is it faster?\n     - abstract textures into class - TextureSource, AnimatedTextureSource, etc.\n \n - Hold multiple weapons and change between them with key presses\n - read levels from shareware files (see https://devinsmith.net/backups/bruce/wolf3d.html)\n - shoot Uzi\n - animate Uzi\n - difference for pistol and uzi - auto vs semi auto\n - Structure cabal project in such a way that modules not exposed to main can still be exposed to test\n   - Do general deeper research into cabal project and possibilities - multiple libraries?\n - Dont render hidden sprites\n   - only render within field of view bounds\n   - only render in front of walls\n - sprite items stop hero moving movement\n - pickup items\n - doors\n - enemy\n - secret doors\n - All events together at the end of game loop passed to audio handler, which plays audio\n - mouse look horizontal\n - mouse look up/down (move projection plane up/down)\n - SDL dispose textures at the end\n - Example world that shows off diagonal walls, etc\n - Console menu system at start\n\n\n## Nice to haves\n\n - better index for weapon animation data\n - Optimise render - a lot of calculations can be done once\n - Try reading original data file? See carmackExpand in wolf3d-html. Or maybe just use the format from wolf3d-html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielholmes%2Fwolf3d-haskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielholmes%2Fwolf3d-haskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielholmes%2Fwolf3d-haskell/lists"}