A top down 2D tile-based roguelike game written in C and python using SDL2 and pygame respectively. The purpose is mainly to improve my own coding skills and teach myself more about a lot of cool algorithms while making something fun in the process.
The project is thus far split in two. The python part is a random dungeon generator. It is mainly an exploration of different ways of randomly generating the basic layout of a classic dungeon(rooms and corridors). It is not intended to be playable, although it sort of is. Python is fast when you just want to test an algorithm. After testing things in python, the valuable insights gained can then be incorporated into the - hopefully - more "proper" C-version which is more of a game than a mashup of algorithms.
This is a general list of the things that I'm currently working on, should you have any tips or wanted to contribute.
- An easy way to display/handle how in-game messages. This is important as most things will be conveyed via messages. My initial thought was to have a message module which could handle all messages displayed(up to a max number), this way, displaying them could be done by querying the module for the last 5 messages and display them. One thing I cannot decide is if the module should handle its own drawing, or if it only stores the messages like the map does. I'm leaning towards the latter.
- General clean-up. The code base, though relatively tidy so far is becoming messy, which I don't like. If this project is to handle scaling, it needs to be tidy. So, the main loop should perhaps have its own header file as the number of functions grow.
When all the above are fixed, what then?
- Start looking at a module which will generate the actuall dungeons and handle them. It will move monsters, players, handle items, etc. Or, should it be wider than that even? Should it perhaps be the main engine itself which will handle AI, movement, VOF(Field of View), generating levels, npcs, time-management etc? I don't know.
- Start looking at actual mechanics and physics.
Copy the project folder or clone it.
So far, it only runs/compiles in linux. A future version might feature Windows support, but it's not high on my priority-list.
python3.6 pygame for linux and python3
Run with:
python3 dungeon.py
Example:
python3 dungeon.py 1300 700 4
To play/test: "L" resets all lists and spawns a new level Keypad numbers 1-9 moves the blue "@" around Upon reaching the green arrow going down, a new level is spawned.
SDL2 SDL_image and SDL_ttf libraries. All are to be found in standard linux repo.
Compile with:
make
Run with:
./dungeon
or
make run
Example:
./dungeon 1000 500
To play/test: Keypads or arrows to move around Level is a hardcoded for display-testing purposes. No mechanics implemented. But a hardcoded alpha in the middle of the map-view.
- SDL2 - Simple Direct Media Layer
- pygame - For quick and easy graphics
- python3 - For quick and easy code
- C - For more learning and control
- Raymon Skjørten Hansen - Initial work - Raymon on Github
- Isak Sunde Singh - Tips and help - Isak on Github
- Mads Johansen - Tips and help - Mads on Github
- Thomas Biskups Ancient Domains of Mystery
- Jamis Bucks Growing Tree Algorithm Jamis Bucks Blog