ft_vox [42 project]
![](https://github.com/zer0nim/ft_vox/workflows/ft_vox/badge.svg)
A Simple Voxel Engine in Opengl, with custom procedural generation
Try multiples texture packs or create yours
We used glfw3
API for creating windows and manage input and events,
and glm
to manage matrix/vector/quaternion.
-
Install depencies (for osx & linux)
make install
-
Compile the project
make -j8
make help # get info about make commands
-
Run the project
./ft_vox --usage
./ft_vox --name <map_name:string> # open or create 'map_name'
./ft_vox --seed <seed:uint32_t> # create world with given seed
In ft_vox, you have 2 gamemodes: survival and creative.
Change current gamemode with g
.
You can walk in the world but can't walk through blocks, the gravity is enabled.
You can fly and you don't have any collision detection with the world.
In both modes, you can add or destroy blocks in the world.
If you want to save the world, don't forget to set a world name (
./ft_vox --name worldName
).
You can move with arrows
or wasd
keys.
To run, just press shift
.
To fly up (creative) or jump (survival): space
/ e
.
To fly down (creative): ctrl
or q
.
Add blocks on the world with right-click
and destroy thems with left-click
.
To change the selected block, scroll-up
, scroll-down
, [
, ]
or select the block under cursor with middle-click
.
Save and quit the game by pressing escape
.
Feel free to change world settings in assets/settings.json.
In the file, you can configure:
- FPS
- Render distance
- Texture pack selection
- Window size / fullscreen option
- Speed / mouse sensitivity
- Destroy / add blocks speed
- Enable / disable fog
- Map seed (0 for random seed)
- Generation type (0 -> void world, 1 -> flat world, 2 -> classic generation)
- For classic generation, enable / disable cavern
- For classic generation, enable / disable tree
- For classic generation, enable / disable ores
- Starting position of the player
- Fully personalised flatMap generation
- Gamemode
- Days duration
- ...
You have more than 50 parameters to discover !
To change the texture pack, edit the settings file: (global->files->textures
).
You can set one of the two textures pack provided:
"./assets/textures/textures-default.png"
"./assets/textures/textures-smooth.png"
You will need to create 32x32px textures and merge them in one texture atlas.
If your textures are not in the right dimension (32x32px), you can resize them here.
You can design your own textures on this website.
You can merge them with this website (look at the settings in the image below).
You need to put blocs in the right order (example in assets/textures).
Run in debug mode (this command recompile the project if needed)
make DEBUG=1 -j8
Run with fps analitics
./debug/checkFPS.sh
./debug/checkFPS.sh re # if you want to recompile (needed in first use)
You can toogle debug panel with F3
.
To show the full list of commands: F3 + C
.
See more on the school subject.