Krzysztof Wiśniewski 61268fb374
Add Structure Building Blocks based Generator (#1227)
* Revert "Remove SBBGen"

This reverts commit b49048412f21c57d5638144da7f039753a94cafc.

* Revert "Remove example SBB"

This reverts commit afc5d6fed0ba92b558ccda91893fdb3fc63f69ec.

* Revert "Remove blueprint code"

This reverts commit 2553950adbdcef9c1c68afe4109f9247b74abb92.

* Fix compilation errors

* Fix compilation errors #2

* Fix test errors

* Fix rotateZ

* Resolve structure reference while instantiating SBBGen

* Fix formatting issues

* Add new trees to forest

* Add new trees to grassland

* Decrease forest density so you can find new trees

* Add degradable paste mode

* Remove substitutions

* Apply review suggestions

* Use lookup table for alignment

* Apply suggestions from code review

* Update src/server/terrain/simple_structures/_list.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Fix inital SBB offset

* Never place air in placeInGeneration

* Integrate void block with paste

* Revert "Move hashInt and hashCombine to utils"

This reverts commit 9bb276f69f60ad60f1170d07ec30ebd02307a36a.

* Make PasteMode comptime

* Fix remaining issues with void block integration

* Fix formatting

* Apply review change requests

* Remove origin and child blocks while resolving sbbs

* Apply review change requests

* I hate indexing

* Fix example tree models

* Use single index for chunk and blueprint in pasteInGeneration

* Fix formatting

* Extract blueprintOffset

* Fix formatting

* Apply suggestions from code review

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Apply Quantums suggestion for Y and Z

* No cast

* Use pos instead of chunkOffset

* Remove test tree

* Apply suggestions from code review

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-05-02 16:11:10 +02:00
2025-04-29 17:49:59 +02:00
2025-03-05 21:41:02 +01:00
2025-04-29 17:49:59 +02:00
2025-03-09 17:21:53 +01:00
2025-04-19 13:13:09 +02:00
2023-10-23 23:23:02 +02:00
2024-09-25 20:45:47 +02:00

Cubyz

Cubyz is a 3D voxel sandbox game (inspired by Minecraft).

Cubyz has a bunch of interesting/unique features such as:

  • Level of Detail (→ This enables far view distances.)
  • 3D Chunks (→ There is no height or depth limit.)
  • Procedural Crafting (→ You can craft anything you want, and the game will figure out what kind of tool you tried to make.)

About

Cubyz is written in Zig, a rather small language with some cool features and a focus on readability.

Windows and Linux are supported. Mac is not supported, as it does not have OpenGL 4.3.

Check out the Discord server for more information and announcements.

There are also some devlogs on YouTube.

History

Until recently (the Zig rewrite was started in August 2022) Cubyz was written in Java. You can still see the code in the Cubyz-Java repository and play it using the Java Launcher. // TODO: Move this over to a separate repository

Originally Cubyz was created on August 22, 2018 by zenith391 and ZaUserA. Back then, it was called "Cubz".

However, both of them lost interest at some point, and now Cubyz is maintained by IntegratedQuantum.

Run Cubyz

The Easy Way (no tools needed)

  1. Download the latest source code
  2. Extract the zip file
  3. Go into the extraced folder and double click the run_linux.sh or run_windows.bat depending on your operating system.
  4. Congratulations: You just compiled your first program!

It doesn't work?

  • If it doesn't work and keeps running for more than 10 minutes without doing anything it can help to kill and restart the process. A few people seem to experience this, and I have not found the cause. It might also help to delete the zig-cache folder.
  • If you see an error message in the terminal, please report it in the Issues tab or on the Discord server.
  • Otherwise you can always ask for help on the Discord server. If you are unable to get it compiling on your machine, you can also ask on the Discord server and we may compile a release for you.

Note for Linux Users:

I also had to install a few -dev packages for the compilation to work:

sudo apt install libgl-dev libasound2-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxext-dev libxi-dev

The Better Way

  1. Install Git
  2. Clone this repository git clone https://github.com/pixelguys/Cubyz
  3. Run run_linux.sh or run_windows.bat, if you already have Zig installed on your computer (it must be a compatible version) you can also just use zig build run
  4. When you want to update your local version you can use git pull. This keeps everything in one place, avoiding repeatedly downloading the compiler on every update.

Contributing

Code

Check out the Contributing Guidelines

Textures

If you want to add new textures, make sure they fit the style of the game. It's recommended that you have baseline skills in pixel art before attempting to make textures. A great collection of tutorials can be found here

If any of the following points are ignored, your texture will be rejected:

  1. Resolution is 16 x 16
  2. Lighting direction is top-left for items and blocks.
  3. Keep colour palettes small. Do not use near-duplicate colours, do not use noise, filters, or brushes that create unnecessary amounts of colours. Most blocks can be textured with ~4-6 colours.
  4. Reference other block textures to see how colours & contrast is used. Test your textures ingame alongside other blocks.
  5. Blocks should tile smoothly. Avoid creating seams or repetitive patterns.
  6. Use hue shifting conservatively. Take the material into account when choosing colours.
  7. Items have full, coloured, 1-pixel outlines. It should be shaded so that the side in light (top left) is brighter, while the side in shadow (bottom right) is darker.
  8. Items should have higher contrast than their block counterparts.

Your texture may be edited or replaced to ensure a consistent art style throughout the game.

For further information, ask careeoki on Discord. She has made a majority of the art for Cubyz.

Description
Voxel sandbox game with a large render distance, procedurally generated content and some cool graphical effects.
Readme GPL-3.0 521 MiB
Languages
Zig 96.8%
GLSL 3%
Batchfile 0.1%
Shell 0.1%