GithubHelp home page GithubHelp logo

stefankubsch / narc Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 1.0 70.41 MB

A 2.5D raycasting game engine written in C++, based upon lwmf and OpenGL!

License: The Unlicense

C++ 100.00%
game-engine fps-shooter raycasting-engine windows public-domain

narc's Introduction

NARC

"Not Another RayCaster"

A raycasting game engine in C++, built using my own library lwmf and OpenGL.

I am working on a 2.5D, "Wolfenstein 3D"-like game engine, written in modern C++.

Currently I´m developing in Visual Studio 2022, for Windows as the target platform.

The project began with GDI+ and pure software rendering, but I switched to OpenGL for better handling and performance.

There is a long way to go with the engine, from entity AI to weapon handling, level editor etc. The project is still at the very beginning, although the render engine itself is stable and powerful, but lacking features, which will come in the near future.

The whole engine is modular and written in C++ 17/20.

All low-level functions for OpenGL, graphics, audio, bitmap and input handling, multithreading, logging, game-relevant math etc. are provided by my own C++ library, "lwmf - lightweight media framework". This framework is still under development, but already stable and fast.

Due to (partial) use of SIMD Intrinsics a CPU with SSE 4.2 support is needed (virtually all Intel CPUs from 2007 on).

The demoproject resembles a "between Wolfenstein 3D and Doom" retro style: Textures are 64x64 in size, everything is pixelated, but you can also use crytal-clear hires textures...

If you want to check it out without building it by yourself, just download "Release.zip", unzip and run the exe. Everything you need is included!

The whole engine is public domain - you can do what you want with the code. It would be nice to state that it´s my initial work when you use the code in your projects, but hey...

Current features :

  • hardware accelerated by native OpenGL 4.5 Core (Shader, not immediate/direct mode!)
  • own OpenGL wrapper - no need for glew, glad & Co. !
  • windowed or fullscreen
  • vsync by option
  • changed options will be saved
  • indoor & outdoor levels (ceilings and/or skybox, lighting or not)
  • you can shoot entities and they will die in a nice animation after they lose their hitpoints
  • entities will attack you - and you can die...DIE...
  • pixel-precise detection of hits on enemies (used technique here is "hitscan")
  • A* pathfinding algorithm (started, path between entities and player is calculated)
  • pickup ammo boxes and gain new ammo
  • variable texture size (from 64x64 to 8192x8192) for level textures and entities
  • entities and weapons implemented as structures
  • really large map size if desired
  • maps, weapons and entities can be defined in textfiles which will be loaded into program at runtime
  • complete separation of content/config from code
  • fixed timestep gameloop with 60fps (or chooseable) framelock
  • multidirectional, animated or non-animated billboard sprites/entities with basic automovement
  • animated doors with audio
  • multi-threaded rendering of graphics with dynamic resolving of concurrent threads and use of a threadpool
  • collision detection between walls, entities and player
  • per-pixel softwareshading for viewsize-dependent darkening of environment
  • real time lighting (somewhat faked, needs more work)
  • movement via free mouselook (x- and y-axis) and wasd (including strafing)...
  • ...or just use a connected XBOX 360 gamepad!
  • adjustable input sensitivity
  • basic audio functions (background music, steps, weapon sounds, entity sounds, door sounds)
  • basic weapon behaviour (sway, muzzleflash, shooting, reloading, ammo pickup, change weapon)
  • realtime minimap showing entity positions and pathfinding waypoints of enemies
  • basic implementation of HUD (weapon, healthbar and ammo info) / Crosshair
  • fps (frames per second) counter
  • error handling, file checks
  • basic implementation of main menu, options
  • really fast & lightweight text rendering via a modified stb_truetype.h and pre-generated glyph textures (OpenGL)

NARC_PIC1

NARC_PIC2

Used libraries/APIs:

Controls (configurable):

Gamepads are supported

Left analog stick 	- forward, backward, strafe left, strafe right
Right analog stick 	- look left/right/up/down
Right shoulder button 	- fire single shot
Left shoulder button	- rapid fire
X			- open doors when standing in front of them
DPAD Up/Down 		- change weapon
DPAD Right 		- reload weapon

---

Mouse 			- look left/right/up/down
Left mouse button 	- fire single shot
Right mouse button	- rapid fire
Mousewheel up/down 	- change weapon

'W' 	- forward
'S' 	- backward
'A' 	- strafe left
'D' 	- strafe right
'R' 	- reload weapon
'Space' - open doors when standing in front of them

'H' - toggle HUD
'M' - toggle Minimap
'+' - increase mouse sensitivity
'-' - decrease mouse sensitivity

'N' - switch level ingame (skip to next level or first if last level is reached)
'L' - switch lighting on/off

'ESC' - pause game / break into menu / return to game

'Cursor Up' & 'Cursor Down' & 'Return' - navigate through menu

narc's People

Contributors

stefankubsch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

meowboy326

narc's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.