untode.su

Voxelius devlog (0.0.1.2453)

This is a collection of public test release notes for Voxelius 0.0.1.2453. The entire release has been cobbled together in practically a day after I realized how much of a mess-up was my itch.io username and identity implementation.

Messed up the tree. Again.

After all that dynamically-linked dependency fiasco (which was objectively a bad idea to pull into the project in the frist place, oh well), I tried to prune all the DLL/SO files tracked by LFS and somehow ended up with about 60 dangling commits, and since GitHub doesn’t periodically call git gc anymore, the only logical solution was to start from a blank slate. Again. All the GitHub stars are gone and all the badges broke for like two hours while I was figuring out moving code from one tree to another.

New-old server password system

After a short discussion in “The Linux Space” Discord server, I decided to use server-based password storage instead; this introduced a few new things to the server-side configuration

The server password

A generic way to access a semi-private server. Players should be able to join only when they know this specific password and will be kicked if the password string is not equal to the server-side value. To set the server password, locate to your server.conf file, open it in a text editor, locate to a line (or add a new line if it doesn’t exist) that defines game.password variable and change it to the following (replace %PASSWORD% with your own thing):

game.password = %PASSWORD%

If you want to enter an empty password (in other words, disable password logins for players), just leave an empty space after the equal sign.

On the client side of things, the server browser edit mode has gained a new input field to the right of the server address field:

And when you try to join a server with an incorrect password, the server kicks you with this kind of message:

The whitelist

A minecraft-like way of allowing who can play on a server has been implemented; to enable the whitelist, locate to your server.conf file, open it in a text editor, locate to a line (or add a new line if it doesn’t exist) that defines whitelist.enabled and change it to the following:

whitelist.enabled = true

This will enable the whitelist and use the default whitelist filename which is currently defined as just whitelist.txt, so create a new file and just list different usernames you want to allow to the server. Additionally, if you want to specify per-player password, add a colon and specify a password after it:

untodesu
pqcraft:custom_password

The first line will allow a player with the username untodesu to connect to the server using default server password (game.password), while the second line will allow a player with the username pqcraft to connect to the server only using a custom_password as a password.

The hotbar

Since I consider previous release a part of this one, I shall also mention things added in that release as well. A new hotbar HUD element has been added to add visual feedback on what voxel the player is going to place. Currently nothing is rendered inside its slots and the hotbar items are only filled in whenever ENABLE_EXPERIMENTS is defined in the build config.

The voxel registry

I completely nuked JSON voxel definitions in favor of a more programmer-friendly approach of using the good old time-tested builder pattern:

game_voxels::grass = vdef::construct("grass", VoxelType::Cube, false, false)
  .add_texture_default("textures/voxels/grass_side_01.png")
  .add_texture_default("textures/voxels/grass_side_02.png")
  .add_texture(VoxelFace::CubeBottom, "textures/voxels/dirt_01.png")
  .add_texture(VoxelFace::CubeBottom, "textures/voxels/dirt_02.png")
  .add_texture(VoxelFace::CubeBottom, "textures/voxels/dirt_03.png")
  .add_texture(VoxelFace::CubeBottom, "textures/voxels/dirt_04.png")
  .add_texture(VoxelFace::CubeTop, "textures/voxels/grass_01.png")
  .add_texture(VoxelFace::CubeTop, "textures/voxels/grass_02.png")
  .build();

Resource management

I implemented a new resource management system that uses C++ reference-counted objects (std::shared_ptr<T>) to maintain resources. Currently the only things using it are images, 2D textures and binary files (which are used for the now memory-resident TTF font files):

if(auto image = resource::load<Image>("textures/gui/window_icon.png")) {
    GLFWimage icon = {};
    icon.width = image->width;
    icon.height = image->height;
    icon.pixels = reinterpret_cast<unsigned char *>(image->pixels);

    glfwSetWindowIcon(globals::window, 1, &icon);
}

Bug fixes

Get Voxelius