- Notifications
You must be signed in to change notification settings - Fork6
A space exploration game in OpenGL. Devblog:https://tatjam.github.io/index.html
License
TheOpenSpaceProgram/new-ospgl
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repo contains all code for the OSPGL program, despite being called 'new-ospgl', as the original ospgl is now legacy code.
There's an in-depth guide of the different OSPGL subsystems, available at theOSPGL docs repo. This includeshow to setup your development environment for lua autocompletion.
The project has a pretty big scope, so collaboration of all kinds is needed, from planning to coding and artistic work.You can check what's needed on the Issues and Projects. Feel free to create new entries with ideas!
We use CMake for building, so the procedure should be similar on all systems.
OpenSSL is a dependency (for ospm), on most linux distributions it's probably available on the package manager (it will probably come preinstalled),on windows it needs to be manually downloaded (Here's a good binary compilation:https://slproweb.com/download/Win64OpenSSL-1_1_1f.exe)
libdw-dev is required for stacktraces. You can disable this requirement by disablingstacktraces at compile time.
You may also needlibx11-dev,xorg-dev andlibgl-mesa-dev on linux, but these are usually installed on most systems.
Run these commands to obtain the source:
git clone --recurse-submodules https://github.com/TheOpenSpaceProgram/new-ospgl.gitcd new-ospglcmake .cmake .cmake --build .Running CMake twice is needed only the first time you build, otherwiseassimp will build all importers and make the build time really longYou may want to speed up the build usingcmake --build . -- -j [Number of CPUs]
Note: If you run cmake in a subdirectory (for example,build), then you may want to copy thecompile_commands.json file to the root directory for code completion in VIM and other tools.If your executable is not in the root directory, move it there as the game requires theres folder and theudata folder. You can always change these running./osp with command line arguments (checkOSP.cpp) if you want to keep the executables on a different folder.
Note 2: If you experience strange build errors, try changing the compiler version.g++-11,g++-10 andg++-9 should work fine-
Open the CMakeLists.txt using Visual Studio. You may need to copy thelaunch.vs.json to the.vs folder sothe debugger launches the executable on the correct working directory.
Set target to OSPGL.exe and build.
You may need to point CMake to the freetype libraries if they are not detected by default, or disable freetype and usestb_freetype, but it has lower text quality.
(Not done yet, I guess the linux procedure will work fine, too)
During development, you will need some packages which are "directly" linked to the game code.The final game will only need thecore package, but for now you must run these two commands toget the game to properly load:
(ospm must be run in the same folder as the/res folder)
./ospm fetch https://github.com/TheOpenSpaceProgram/new-ospgl/releases/download/ospm-test/debug_system.zip./ospm fetch https://github.com/TheOpenSpaceProgram/new-ospgl/releases/download/ospm-test/test_parts.zipIf there are weird runtime errors, they may be related to outdated assets. First try to update the packagesrunning the same commands as before and overwriting. If nothing works, ping@Tatjam on the discordand tell him to upload the latest files.
ospm is used for managing packages, but as of now it's only capable of downloading packages from an URL using the commandfetch.
We don't have a very strict coding-style, but these rules must be followed:
- Brackets on the next line
- Single-line blocks, when appropiate, are fine:
if(a) { return; } - Avoid "bracketless" blocks, it's very easy to introduce a hard to find bug with them
- Snake case naming for functions and variables (
my_function,current_velocity,parse_json)- Feel free to use contractions for common stuff, such as
posforposition,nrmfornormal...
- Feel free to use contractions for common stuff, such as
- Camel case naming for classes and file names (
MyClass,JSONFile) - Use
nullptrinstead ofNULL - There is no need to mark member variables with anything (
m_name, ...), unless it's absolutely neccesary - Using
autois recommended for long types such as iterators, but should not be abused as some editors may not be able to resolve them, making code confusing.
About
A space exploration game in OpenGL. Devblog:https://tatjam.github.io/index.html
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.