48

Permafrost Engine – OpenGL 3.3 Real Time Strategy Engine in C

 5 years ago
source link: https://www.tuicool.com/articles/hit/ZnUjY3i
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

fq6Bnim.png!web

Permafrost Engine is an OpenGL 3.3 Real Time Strategy game engine written in C. It is made in the image of old classics, but incorporating some modern ideas.

Engine Showcase

Hellknight from DOOM 3 by id Sofware

fii6Rbj.gif

Sinbad by Zi Ye

VvYf6fV.gif

Tile-Based Map

jEBZBbJ.png!web

Map Editor

6RrUriN.png!web

Baked Navigation Grid

uYN7Nbq.png!web

Unit Selection + Flocking

yqEfAv2.gif

Flow Field Pathfinding

In2Y3yu.gif

Engine Summary

  • OpenGL 3.3 programmable pipeline
  • Custom ASCII model format with Blender export script
  • Skeletal animation with GPU skinning
  • Phong reflection model with materials
  • RTS camera, FPS camera
  • Rendering of tile-based world parsed from ASCII file
  • Export/Import of game entites to/from ASCII files
  • Engine internals exposed to Python 2.7 for scripting
  • Event system
  • UI framework (Nuklear-based)
  • Efficient raycasting
  • Map/Scene editor
  • Fast rendering of huge maps (map size only limited by memory)
  • RTS minimap
  • RTS-style unit selection
  • Map navigation graph/grid generation
  • Implementation of 'boids' steering/flocking behaviours
  • Hierarchial flow field pathfinding
  • Cross-platform (Linux and Windows)

Dependencies

  • SDL2 2.0.7
  • GLEW 2.1.0
  • python 2.7.13
  • stb_image.h
  • khash.h, kvec.h
  • nuklear.h

All dependencies can be built from source and distributed along with the game binary if desired.

Building Permafrost Engine

On Linux

  1. git clone https://github.com/eduard-permyakov/permafrost-engine.git
  2. cd permafrost-engine
  3. make deps to build the shared library dependencies to ./lib
  4. Optionally, set as few compile-time configurations in ./src/config.h . Defaults are provided.
  5. make pf
  6. make run to run the demo or make run_editor to run the map editor

On Windows

  1. Python must be compiled using MSVC build tools and the solution file found in the the source's PCbuild directory. Afterwards, copy python27.dll (and extension shared libraries if you wish) and the Lib folder to ./lib . Alternatively, you may try to link against an existing Python installation elsewhere on your system.
  2. The rest of the source code can be built with MinGW and MSYS using largely the same steps as on Linux.
  3. run.bat or run_editor.bat will launch the binary with appropriate arguments.

License

Permafrost Engine is licensed under the GPLv3, with a special linking exception.

Contributing

Wishing to contribute to the development of the project or simply wanting to make a question or comment regarding the source code? E-mail: [email protected]


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK