This Week In Veloren 23

5 minute read 08 July 2019

Thanks to all of the contributors this week, @Pfauenauge, @Zesterer, @Songtronix, @Qutrin, @Sheldon, @Timo, @AngelOnFira, @Slipped, @Imbris, and @Desttinghim!

This week, we reached 100 stars on the Gitlab repo! The stars are impacting the project quite a bit. Veloren is currently the 100th most starred project on Gitlab! This helps the project become more visible, and shows the contributors that their work means something. So if you can spare the star, we would love to have it 😀

Saturday Screenshot Winner

Thanks to @Zesterer for this week's screenshot. We're excited to see what comes out next week!

The river that splits biomes

Programming

Veloren in the Terminal, Teloren

A little something that @Zesterer has been working on this week is having Veloren be playable from in the terminal. You are able to see a top-down view of the game.

Veloren in the Terminal!

You can navigate with simple controls, WASD. Alternatively, it has click-to-move controls. This is just a small step to the level of accessibility that the team is aiming for with Veloren. Why shouldn't you be able to play the game from a server that only has a terminal? :P

Be sure to check out the Teloren project here!

ASCII character representations of the terrain

Changes to CI

This week, CI was updated to include some new checks. When Veloren is compiled, previous success has been achieved if an executable is produced at the end. However, there are many other warnings that the compiler was giving, from issues such as unused variables or imports. On compiling, you would get a massive spew of these issues.

warning: unused import: `log::warn`
 --> common/src/sys/combat.rs:7:5
  |
7 | use log::warn;
  |     ^^^^^^^^^

warning: unused imports: `AnimationInfo`, `Animation`, `ForceUpdate`, `HealthSource`, `OnGround`
 --> common/src/sys/controller.rs:3:22
  |
3 |         ActionState, Animation, AnimationInfo, Attacking, Controller, Gliding, HealthSource,
  |                      ^^^^^^^^^  ^^^^^^^^^^^^^                                  ^^^^^^^^^^^^
4 |         Jumping, MoveDir, OnGround, Respawning, Rolling, Stats, {ForceUpdate, Ori, Pos, Vel},
  |                           ^^^^^^^^                               ^^^^^^^^^^^

warning: unused variable: `platform_specific`
   --> common/src/assets/mod.rs:124:13
    |
124 |         let platform_specific = "/usr/share/veloren/assets".to_string();
    |             ^^^^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_platform_specific`
    |
    = note: #[warn(unused_variables)] on by default

Some of the warnings

A task force comprised of @Timo, @Songtronix, @Slipped, and @Qutrin remedied this problem. Much of it consisted of cleaning and removing "dead" code, or other things that were out of place. Now, the warnings have been fully eradicated.

To keep this from happening in the future, CI is set to fail when any warnings are given on a branch. This will force whoever is working on that branch to fix all of these warnings before merging.

The next step is another level of verification. There is a Rust project called Clippy that provides even deeper linting on top of what is given by the Rust compiler. Linting is defined as:

Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise known as linter). A lint tool is a basic static code analyzer.

The checks that Clippy does help improve performance, maintain readability and find redundant code. There is, however, an issue with Clippy. It is quite nit-picky.

This can be alright in certain situations, but in others can be detrimental. For example, when working on preliminary ideas for complex modules of Veloren, it can be obnoxious to make sure that your code is always readable.

The first results of Clippy CI showed that it intruded too much into the development process. For now, we are going to try and get at least a small portion of Clippy working. That way, as we add more of the features Clippy has to offer, we can make sure it doesn't intrude on any developer's work.

The dark tunnel to where the unresolved warnings used to be stored :P

General Work

This week, we saw many smaller contributions.

@Qutrin has been working on a build mode. This was done quite easily due to the raycasting API and @Zesterer's work on block updates.

The Linux Mint logo partly built in Veloren!

@Pfauenauge has also been putting in work on some new models. He has created both Acacia trees and tower ruins. He has also set up the bag UI so that it scales with the available space. Lot of work has also been put into crosshair designs to make them more customizable, and user-friendly.

A look at the new crosshair. Great cliffs too!

@Timo has finished their work on opening the command chat with /. This was complex in the past because conrod, the 2D GUI library Veloren uses, doesn't allow cursor position to be changed easily.

The problem was that when the chat input was empty and / was inserted into it using code, the cursor was in front of it so it looked like this: |/ (| is cursor, / is slash). @Timo updated our fork of conrod to remedy this problem. Now, it is easy to enter the chatbox through the code with:

TextEdit::new(input)
  .w(460.0)
  .color(TEXT_COLOR)
  .font_id(self.fonts.opensans)
  .cursor_pos(pos);

@Imbris modified the client to spawn .vox models with the new block modification capability

@Cedric has been working on integrating mod support into Veloren. However, there are some technical difficulties with this task. It is important that memory is passed properly between the core game and the mods. @Cedric has first started by trying to make animation mods.

By modularizing them, there can be a more effective separation between the math that runs the animations and how they execute in game. This will also allow animations to be tweaked while the game is running. Since it takes quite a bit of time for Veloren to compile, this will greatly improve development time.

This methodology of designing for separation would help Veloren out in the long run, however much of what has already been implemented would have to be re-organized. We will look further into this in later posts.

View from a tower at sunset. See you next week!