Skip to content

ronjakoi/ylikuutio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ylikuutio. A 3D game and simulation engine.

A hobby project of mine. Work in progress.

License: AGPL v3 Travis CI build AppVeyor build Coverity Scan Codacy Badge Coverage Status

License

Ylikuutio is under The GNU Affero General Public License 3, or (at your option) any later version. See COPYING file. All my code copyright (C) 2015-2020 Antti Nuortimo.

An exception in licensing of Ylikuutio code are Asio example source code files modified by me, which have their original Boost Software License - Version 1.0.

Data preprocessing scripts that use Blender Python API are not a part of Ylikuutio itself and they are under The GNU General Public License 2 or later (at your option), following Blender's licensing.

Overview

Ylikuutio is a 3D game engine designed for 3D games and simulations. Ylikuutio aims to run fast and support also older hardware. Currently Ylikuutio works on 64-bit Linux and Windows systems. Android support is a work in progress. macOS and iOS will be supported in the future. OpenGL 3.0 or newer is required.

Ylikuutio 0.0.8 screenshots

View of Helsinki with cats and Ylikuutio console Turbo polizei and cats Cats and debug console commands Turbo polizei and debug console commands

Articles

In Skrolli 2018.4 there is an article "Pelimoottori harrastusprojektina" (in Finnish, translation: "Game engine as a hobby project"). Skrolli 2018.4 can be freely downloaded as PDF.

In Skrolli 2019.2 there is an article "GPGPU-laskenta" (in Finnish, translation: "GPGPU computation"). Skrolli 2019.2 can be freely downloaded as PDF.

Compiling

Ylikuutio can be compiled with GCC, Clang or Visual Studio. In Visual Studio compiling may break due to compiler-specific bugs. Cross compiling from Linux® to Windows using MinGW-w64 works fine. C++17 support is required. CMake 2.6.2 or newer is needed for the compiling process, but external libraries such as glm require CMake 3.2 or a newer version. CMake uses git for downloading Google Test testing framework.

Ylikuutio repository in GitHub has 2 branches: master & coverity_scan. master is the branch that should be up to date and it's the one to build. coverity_scan is for Synopsys© Coverity Scan© analysis tool which is run through Travis CI.

In Linux it's simple.

First, install all the necessary compilers, tools and libs. You may use your favorite package manager such as apt, aptitude, apt-get, yum etc. You all need these packages: cmake make g++ gcc libx11-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-dev libxcursor-dev libxrandr-dev libxext-dev libxi-dev libxinerama-dev

Eg. with apt:

$ sudo apt install cmake build-essential libx11-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-dev libxcursor-dev libxrandr-dev libxext-dev libxi-dev libxinerama-dev

If you are doing a cross compile from Linux to Windows, you need also:

$ sudo apt install g++-mingw-w64 gcc-mingw-w64 binutils-mingw-w64

If you are doing a cross compile from Linux to Android™, you need also:

$ sudo apt install android-sdk-platform-tools-common ant google-android-ndk-installer openjdk-8-jdk

However, cross compiling from Linux to Android does not work yet!

Then, to compile with GCC, in Ylikuutio install directory:

$ mkdir build
$ cd build
$ cmake ..
$ make

To make compiling faster you probably want to use several threads:

$ make -j $(($(nproc) - 1))

Or, to compile with Clang, again in Ylikuutio install directory:

$ mkdir build
$ cd build
$ export CC="$(which clang)"
$ export CXX="(which clang++)"
$ cmake ..
$ make

If you have problems compiling tests or for some other reason don't want to compile tests, in CMakeLists.txt comment out the line that says: set(DO_UNIT_TESTS_WITH_GOOGLE_TEST true)

To cross compile from Linux to Windows:

$ mkdir build_windows
$ cd build_windows
$ cmake -DCMAKE_TOOLCHAIN_FILE=../w64.cmake ..
$ make

Crosscompiling from Linux to Windows fails to compile tests. This is a known bug in Google Test. Just run make again if compiling ends before you get nirvi.exe, tulevaisuus.exe, ajokki.exe, gpgpu_test.exe, and yli_edit.exe.

By default compiling tests is disabled when crosscompiling from Linux to Windows, due to this issue: google/googletest#606

To cross compile from Linux to Android (using Android NDK):

$ mkdir build_android
$ cd build_android
$ cmake -DCMAKE_TOOLCHAIN_FILE=../android.cmake ..
$ make

However, cross compiling from Linux to Android does not work yet!

Compiling in Visual Studio is more difficult. The recommended way to get a binary for Windows is to cross compile from Linux to Windows.

Ylikuutio repository contains the following games/demos:

Hirvi is a first person action-adventure of the adventures of a moose/elk called Hirvi. Cities are dangerous places for moose, and in particular an encounter with the police may prove deadly for Hirvi, even through moose are well-known pasifists. "hirvi" means a moose/elk in Finnish. Hirvi is a work in progress.

Tulevaisuus ("the future" in Finnish) is a turn-based 3D tactical combat game with programmable robots. The robots controlled by an evil AI have taken over the world. Almost. The last hope of the human species is the Lisp Resistance Force. You, as the lead Lisp hacker of the Lisp Resistance Force, are responsible for the programming of the robots of the Lisp Resistance Force. Your task is write Lisp to control the robots reowned by humans. And save the human species, too. Tulevaisuus is a work in progress.

Ajokki is sandbox demo program to check out some properties of Ylikuutio 3D engine. "Ajokki" is a working title named after a Finnish bus body manufacturer.

GPGPU test is a simple GPGPU example. It computes e.g. the distances between some railway stations on the current passenger railway network of Finland using both floating point and unsigned short values, using Floyd-Warshall algorithm. GPGPU test includes also some simpler examples on how to copy data and how to shift textures. After computing, e.g. Bash scripts code/bash/print_float_results_of_width_32 & code/bash/print_integer_results_of_width_32 can be used to display the Floyd-Warshall results in Bash.

YliEdit is a universe editor for Ylikuutio. Work in progress.

In Linux:

$ ./hirvi
$ ./tulevaisuus
$ ./ajokki
$ ./gpgpu_test
$ ./yli_edit

In Windows:

> hirvi.exe
> tulevaisuus.exe
> ajokki.exe
> gpgpu_test.exe
> yli_edit.exe

hirvi.exe, tulevaisuus.exe, ajokki.exe, gpgpu_test.exe, and yli_edit.exe can also be executed in Linux, using Wine:

$ wine ./hirvi.exe
$ wine ./tulevaisuus.exe
$ wine ./ajokki.exe
$ wine ./gpgpu_test.exe
$ wine ./yli_edit.exe

Press `` to get console. Press F to toggle flying on off. Arrow keys work too. Ctrl is turbo. F1 toggles help display and there you'll see some more options to try.

To run tests (coverage is still quite limited but underway):

$ ./unit_tests_with_googletest

Ylikuutio usage

This part reflects the current usage of Ylikuutio and will change as new functionality is implemented.

At the moment, you need a main function (for an example, please see code/hirvi/hirvi.cpp and code/ajokki/ajokki.cpp) which starts your game/simulation (initialization), runs the game/simulation (the main loop) and ends the program (cleaning-up). In all these phases mentioned above Ylikuutio library functions may be used. Ylikuutio library code is located in code/ylikuutio/ tree. Ylikuutio code may change a lot and so far no stable API has been defined. There are also some application code snippets in code/ylikuutio/snippets/ directory. Hirvi, Ajokki and Ylikuutio code itself are the best references on how to use Ylikuutio in practice.

Some available console commands to try in Ajokki:

  • activate joensuu_center_and_west_scene
  • activate helsinki_east_downtown_scene
  • set red 1.0
  • set green 0.15
  • set blue 0.77
  • print red
  • print green
  • print blue
  • set x 123
  • set y 456
  • set z 789
  • print x
  • print y
  • print z
  • info
  • info cat_species
  • info cat2
  • set wireframe true
  • set wireframe false
  • activate turbo_polizei_camera
  • print turbo_polizei_bmp1.cartesian_coordinates
  • print turbo_polizei_bmp1.x
  • print turbo_polizei_bmp1.y
  • print turbo_polizei_bmp1.z
  • set turbo_polizei_bmp1.y 50
  • set turbo_polizei_bmp1.x 100
  • set turbo_polizei_bmp1.z 200
  • activate cat_camera
  • print cat1.cartesian_coordinates
  • print cat1 x
  • print cat1.y
  • print cat1.z
  • set cat1.x 123.45
  • set cat1.z 210
  • bind helsinki_east_downtown_orange_fur_material helsinki_east_downtown_grayscale_shader
  • bind helsinki_east_downtown_orange_fur_material helsinki_east_downtown_shader
  • print cat1.speed
  • bind cat1 orient_to_south_brain
  • bind cat1 orient_and_go_east_brain
  • set cat1.speed 1
  • bind cat1 orient_and_go_west_brain
  • bind cat1 rest_brain
  • print framebuffer_width
  • print framebuffer_height
  • screenshot screenshot1.data
  • set framebuffer_width 2000
  • set framebuffer_height 1000
  • screenshot screenshot2.data
  • print window_width
  • print window_height
  • set window_width 1000
  • set window_height 500
  • create-object cat_species cat3 500 100 600 3.14 0
  • create-object cat_species cat4 500 100 650
  • create-holobiont turbo_polizei_bmp_symbiosis polizei3 500 100 700 3.14 0
  • create-holobiont turbo_polizei_bmp_symbiosis polizei4 480 100 700

FAQ

Q: What is "Ylikuutio"? A: In Finnish, "yli" means "over", and "kuutio" means "cube". So, "Ylikuutio" is a reference to a hypercube.

Q: How is Ylikuutio software developed? A: In Debian GNU/Linux (Debian Buster at the moment), using Vim. Other tools in use include Valgrind, KCachegrind, GDB, Travis CI, and Coverity Scan.

Q: For what kinds of software Ylikuutio can be used? A: Ylikuutio can be used for all kinds of 3D games and simulations. At the moment no specific support for 2D is available, but naturally 3D graphics can also be used to present a 2D world.

Q: What are the design goals for Ylikuutio? A: Ylikuutio aims to be a fast and flexible 3D game/simulation engine and fulfil my own requirements for my own indie game projects. Ylikuutio aims to run fast also on low-end video cards. Higher detail level may be offered for high-end video cards.

Q: What are the target platforms of Ylikuutio? A: Ylikuutio targets Linux, Windows and Android, in this order. Cross-compiling from Linux to Windows works! Cross-compiling from Linux to Android is not implemented yet. Currently only 64-bit environments are supported.

Q: What graphics APIs Ylikuutio uses? A: Ylikuutio targets OpenGL version 3.0.

Q: Are there plans to support other graphics APIs? A: Newer OpenGL versions may be supported in the future, but so far OpenGL 3.0 fulfils my requirements. Vulkan needs to be considered.

Q: Does Ylikuutio use modern OpenGL (VAOs and VBOs)? A: Yes, Ylikuutio uses VAOs (vertex array objects, VBOs (vertex buffer objects), and index buffers.

Q: Is Ylikuutio based on some other 3D engine? A: Some parts of Ylikuutio (some shaders, some file loaders, etc.) are based on https://www.opengl-tutorial.org/, which I really recommend for anyone interested in learning OpenGL programming. Ylikuutio also uses external libraries such as (in alphabetical order) Asio, Bullet, GLM, GLEW, OpenFBX, pugixml, SDL, and stb. The rest is written from scratch.

Q: Does Ylikuutio use right-handed or left-handed world coordinates? A: Ylikuutio uses right-handed world coordinates, so X grows eastward, Z grows southward, and Y grows upwards.

Q: Is there a scripting language in Ylikuutio? A: YliLisp scripting language is a work in progress.

Implemented functionality

  • 3D rendering
  • 2D text
  • support for different height map formats (SRTM, BMP)
  • instant rebinding of instances of classes belonging to ontological hierarchy
  • callbacks
  • fully functioning in-game console
  • multiple scenes in the same Universe (activate console command)
  • audio with Simple DirectMedia Layer (SDL)
  • option for wireframe models (set wireframe true, set wireframe false)
  • GPGPU using yli::ontology::ComputeTask class (see also Skrolli 2019.2 for an article in Finnish).

Future developments underway

  • full support for different keyboard layouts in console
  • custom keyboard mappings
  • command to read console command input from file
  • command to record gameplay
  • command to play recorded gameplay
  • copy-paste in console (Shift-Ins for paste)
  • console reference manual (man command)
  • rendering to texture (for mirrors and displays)
  • partially transparent 2D text
  • 3D text
  • partially transparent 3D text
  • coordinates relative to other objects, not only to Universe object
  • practically infinite voxel worlds (limited by float precision)
  • collision detection between objects
  • octree space partitioning
  • possibility to create scenes with different spatial scales
  • background loading of Scenes
  • objects (Species in Ylikuutio terminology) with modifiable vertices
  • making holes in objects
  • splitting of objects into 2 or more pieces
  • cementing of 2 or more objects into one
  • morphing between objects (Species in Ylikuutio terminology)
  • morphing between objects (Species) and 3D text (Glyphs)
  • ray casting for vertex selection and vertex modifications
  • vegetation created with L-system fractals
  • objects with 4 or more spatial dimensions, projected to 3D space before rendering to screen
  • more shaders
  • sky dome
  • railways
  • roads
  • trains, trams, and road vehicles
  • more realistic static water
  • flowing water
  • snow and ice
  • more physics
  • artificial intelligence (AI) creatures
  • A* and Theta* pathfinding
  • visual pattern recognition for AI: V1 (primary visual cortex) and V2 simulation
  • GUI for scripting, asset creation etc.
  • Network gaming

Libraries currently in use

Libraries not yet in use

3D models

Textures

Fonts

  • kongtext font is made by codeman38, see res/fonts/kongtext/license.txt for the license.

Map data

Audio

Trademarks

Contributions and bugfixes

  • Antti Nuortimo (most of Ylikuutio code)
  • Mikko Rasa (bugfixes)

Contact info

(found bugs and suggestions are very welcome!)

variable value
name Antti Nuortimo
GitHub https://github.com/nrz
Stack Overflow https://stackoverflow.com/users/1310991/nrz
email antti dot nuortimo at gmail dot com
(please write 'ylikuutio' to email title to escape /dev/null)

Work offers are also very welcome!

About

Ylikuutio 3D engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 95.2%
  • CMake 1.9%
  • Shell 1.2%
  • Other 1.7%