Old-school FPS raycast engine written in C++11 and using SFML 2.3.
Please note that this is not a complete game or even really a game at all. This project focuses on the rendering engine for the raycasting. You can build off of this to add movement, combat and the other things that make a real game. The included example showcases how to do a few of these things.
- Ability to render walls, floors and ceilings as textures or colors
- Rendering of sprite objects (
Entity
class)
These are things I would like to explore and try to figure out, when I have more time available to do so.
- Walls with different heights
- Animated entities
- Animated walls and floors/ceilings
- More rendering methods and options to give more choices to the developer as to where to cut corners
Check out my random Youtube videos that show sort of snapshots of the development of the engine:
- Simple Colored Walls
- Textured Walls and Floors
- BSP Map Generation and Floor Casting Performance Boost. First Sprite.
- Engine codebase restructure
- Major performance increase
And here is probably the absolute best tutorial for a starting place. Note: this tutorial was not done in SFML, but the basic idea is how this is done and what I based my version off of.
The example program (located in main.cpp
) shows basic usage. I've tried to
clean it up and add comments.
- Floor, ceiling and wall rendering methods
- Toggle entity drawing on and off
- Camera movement and collision
- Overlay "gun" example (defaults to hidden, see keybindings to key to toggle it to visible).
- Frames-per-second output to help debug performance gains/losses.
Arrow Keys
: movement/rotationZ
: Cycle floor rendering methodX
: Cycle ceiling rendering methodC
: Cycle wall rendering methodV
: Cycle entities on and offB
: Cycle overlay example on and off
There are different rendering "options" for walls, floor, ceiling and entities.
- None
- Colored
- Textured
- None
- Colored
- Textured
- None
- Colored
- Textured
- None
- Textured
The MIT License (MIT). See LICENSE for more info.