|
3 hours ago | |
---|---|---|
amt | 1 month ago | |
assets | 3 hours ago | |
magick | 4 weeks ago | |
scratchpad | 4 weeks ago | |
scripts | 5 days ago | |
shaders | 1 week ago | |
tests | 5 hours ago | |
tracy | 1 month ago | |
wraps | 2 weeks ago | |
.gdbinit | 1 month ago | |
.gitignore | 2 months ago | |
.vimrc_proj | 2 months ago | |
Makefile | 2 days ago | |
README.md | 2 days ago | |
animator.cpp | 3 weeks ago | |
animator.hpp | 2 weeks ago | |
ansi_parser.cpp | 5 days ago | |
ansi_parser.hpp | 2 weeks ago | |
ansi_parser.rl | 5 days ago | |
camera.cpp | 1 week ago | |
camera.hpp | 1 week ago | |
color.hpp | 17 hours ago | |
combat.cpp | 1 week ago | |
combat_ui.cpp | 3 hours ago | |
combat_ui.hpp | 5 hours ago | |
components.cpp | 5 days ago | |
components.hpp | 5 days ago | |
config.cpp | 1 month ago | |
config.hpp | 1 month ago | |
constants.hpp | 5 days ago | |
dbc.cpp | 1 month ago | |
dbc.hpp | 2 months ago | |
dbg.h | 1 month ago | |
devices.cpp | 1 week ago | |
dinky_components.hpp | 1 week ago | |
dinkyecs.hpp | 6 hours ago | |
events.hpp | 3 hours ago | |
fsm.hpp | 2 weeks ago | |
guecs.cpp | 3 hours ago | |
guecs.hpp | 3 hours ago | |
gui.cpp | 3 hours ago | |
gui.hpp | 3 hours ago | |
inventory.cpp | 1 week ago | |
inventory.hpp | 1 week ago | |
lel.cpp | 17 hours ago | |
lel.hpp | 17 hours ago | |
lel_parser.cpp | 2 days ago | |
lel_parser.rl | 2 days ago | |
levelmanager.cpp | 1 week ago | |
levelmanager.hpp | 1 week ago | |
lights.cpp | 5 days ago | |
lights.hpp | 1 week ago | |
main.cpp | 5 days ago | |
map.cpp | 3 weeks ago | |
map.hpp | 1 week ago | |
map_view.cpp | 5 days ago | |
map_view.hpp | 1 week ago | |
matrix.cpp | 3 weeks ago | |
matrix.hpp | 3 weeks ago | |
meson.build | 5 hours ago | |
meson.options | 1 month ago | |
panel.cpp | 2 weeks ago | |
panel.hpp | 2 weeks ago | |
pathing.cpp | 3 weeks ago | |
pathing.hpp | 3 weeks ago | |
point.hpp | 1 week ago | |
rand.cpp | 3 weeks ago | |
rand.hpp | 3 weeks ago | |
raycaster.cpp | 6 hours ago | |
raycaster.hpp | 1 week ago | |
render.cpp | 2 weeks ago | |
render.hpp | 6 days ago | |
save.cpp | 1 week ago | |
save.hpp | 1 week ago | |
shiterator.hpp | 3 weeks ago | |
spatialmap.cpp | 2 weeks ago | |
spatialmap.hpp | 2 weeks ago | |
stats.cpp | 1 month ago | |
stats.hpp | 1 month ago | |
status_ui.cpp | 5 days ago | |
status_ui.hpp | 5 days ago | |
systems.cpp | 6 hours ago | |
systems.hpp | 4 days ago | |
texture.cpp | 6 hours ago | |
texture.hpp | 6 hours ago | |
tilemap.cpp | 1 week ago | |
tilemap.hpp | 1 week ago | |
worldbuilder.cpp | 6 days ago | |
worldbuilder.hpp | 1 week ago |
README.md
The Artisanal Handcrafted Retro-Future "3D" Dungeon Crawler
Welcome to my latest obsession, and turn based dungeon crawler in the style of old school raycasted games like Wizardry, Might and Magic, Ultima, and similar games. The game uses SFML 3.x as it's "cross platform layer" but other than that everything is hand coded by me. It's fully artisinal, created manually, with nothing but a terminal and vim. No LSPs, AI, or anything.
This code is truly a work of art. Like an espresso at that Speakeasy Coffee bar in Brooklyn nobody talks about. You know the one? You don't? Oh sorry, I thought you were cool.
STATUS
Currently it's only officially tested on Windows, but I'm not really using anything OS specific (I think).
Where's the LICENSE?
You don't need a LICENSE that gives everything away to thieving corporations just to publish your works online. Nobody makes artists, musicians, painters, photographers, or sculptors get a license before posting online, so why do programmers need one? You worried you'll get sued? Ok, so just put a disclaimer but why do you also have to give your hard work away for anyone to steal and profit from just so they don't sue you?
You don't, and no matter what the OSI says, nobody can sue you if they steal your code and cause a plane to crash. They would get sued for stealing your code and putting it in a plane, not you. Requiring only programmers to release their code with a license to avoid lawsuits creates a Chilling Effect on programmer free speech and that violates the First Amendment.
So this code isn't licensed, it's copyright by default. I'm publishing it using my free speech rights to express myself and that means you can look at it the same as if I posted a painting or an essay on my blog. I obviously can't sue you for just looking at it and playing the game because I published it so you can, but that doesn't mean you own it. You can't resell it, fork it, nothing.
Just grab the code and play it. That's it. Tell people about it. Fair use says you can even record videos reviewing it and talking about it.
See? That's how Free Speech works. You don't need a LICENSE.
Build Instructions
On all platforms you'll need these components:
- Meson -- which needs Python.
- C++ Compiler -- Tested with Clang and G++. You can use my Windows C++ Setup Guide which features an automated installer for Windows.
- GNU make -- For the convenience Makefile. On Windows you should have this if you used my setup scripts. Otherwise
winget install ezwinports.make
will set you up. - git -- Which should be on almost every platform, and is installed by default with my Windows setup scripts.
Windows Instructions
I primarily develop in Windows using the above setup, so this should work the best. Open Windows Terminal and run these commands one at a time. Don't copy-past bomb this:
git clone https://git.learnjsthehardway.com/learn-code-the-hard-way/raycaster.git
cd raycaster
# ignore the errors the first time
./scripts/reset_build.ps1
# first compile takes a while
make
# this copies the binary so you can run it
make run
After that the game should be running. It'll be in different states depending on how far I've pushed it, but you should at least have a few enemies, some loot, and rooms light in it. Go find them.
Linux and OSX
Linux and OSX have the same requirements as Windows and almost the same install steps. The only difference is that once you get your developer tools installed then you only need Meson. Linux and OSX should have everything else you need or there's a package for it.
Once you have that installed you can run these commands:
git clone https://git.learnjsthehardway.com/learn-code-the-hard-way/raycaster.git
cd raycaster
# ignore the errors the first time
./scripts/reset_build.sh
# first compile takes a while
make
./builddir/raycaster
You don't need make run
because Linux and OSX are sane operating systems that don't lock every
damn thing a process touches.
Other Platforms
No testing done on other platforms but let me know if you get it to build somewhere fun and I'll mention it.
Development Guide
You can look in the notes.txt
file for my informal TODO list of things to fix and make. I'm not
really accepting contributions from others, but if you want to follow along then that's what I'm
doing.
If you're just starting out in C++ or programming then the project is designed to be readable by someone who knows very little. Every file is small and should be easy to read. I don't use any insane tricks or weird C++ idioms. I also try to avoid too many external libraries so I'll use plain old std::vector and std::unordered_map rather than external libraries that might be faster. This is done on purpose so people (myself included) can learn about the basics of C++ and the STL.
I also don't do a lot of performance tuning or obsession over THE CACHE. Clean, simple, readable code is more important than squeezing 4% performance out of the code. I do however attempt to design things so that it doesn't do useless work because the fastest thing you can do in a computer is nothing. If I can architect away a performance issue and not make the code too complex then I'll do that instead.
That means if you have a suggestion for a micro-benchmark improvement that will dramatically boost performance, but the code is convoluted and hard to understand, then it won't work. If your suggestion is interesting and provides a massive boost then let me know and I'll check it out. But, I would also like statistics that show it's better, not just your word.
Known Bugs
It's early so probably a bunch of bugs.
OSX Build Notes
- Quite a bad experience. Need to install Python, cmake, meson, and ninja all which are in homebrew but if you don't use homebrew then this is a problem.
- You need to run the .command script in Application/your python that updates the SSL certs.
- You have to give iTerm access to your keystrokes...because wtf it already has them?