This Week In Veloren 76

8 minute read13 July 2020

Authored by AngelOnFira

This week we see lots of progress on UI as the crafting screen is coming together. @lobster gives us an overview of their progress on the particle system. @xMAC94x gives us a tutorial on how to get started writing translations for people who know other languages.

- AngelOnFira, TWiV Editor

Contributor Work

Thanks to this week's contributors, @zesterer, @xMAC94x, @XVar, @yusdacra, @Fexii, @Songtronix, @Sam, @gSpera, @.c, and @Slipped!

@Pfau has released another art blog. @Goldenrevolver is working on implementing opening and closing doors. @Kalculate is working on fixing a UI bug with the language selector. @Pfau finished the first implementation of the crafting UI alongside @zesterer. @Pfau is now working on groups with @imbris.

WIP particle system. Check out the writeup to see how it's progressing!

@Sam has been working on diversifying creatures by changing how much health they have, how much damage they do, and how much XP they give. They are also working on adding a protection stat to armor, which will reduce incoming damage. @Fexii added a free-fly camera mode for debugging purposes. @Sharp has been doing some cleanup on his LoD/lighting branch to prepare it for merging.

Crafting preview

Particle System by @lobster

I've been working on creating an ECS particle emitter component. It can be configured and attached to an entity, like smoke trail emitter component on a fireball entity, or a campfire entity. Below you can see what types of parameters we can currently change on particles:

// spawn X particles per Y, that live for Z, at W location
pub struct ParticleEmitter {
    pub count: u8,
    pub frequency: Duration,
    pub initial_lifespan: Duration,
    pub initial_offset: (Vec3<f32>, Vec3<f32>), // range; upper-lower
    pub initial_scale: (f32, f32),
    pub initial_orientation: (Vec3<f32>, Vec3<f32>),
    // ... WIP ...
    // initial_velocity etc
}

And then I implemented a system that handles the emitting of particles and the particle lifecycles, for each of the emitter components. Below we can see what some of the math looks like when rendering particles:

Mat4::identity()
  // initial rotation
  .rotated_x(rng.gen_range(
    particle_emitter.initial_orientation.0.x * std::f32::consts::PI * 2.0,
    particle_emitter.initial_orientation.1.x * std::f32::consts::PI * 2.0,
  ))
  .rotated_y(rng.gen_range(
    particle_emitter.initial_orientation.0.y * std::f32::consts::PI * 2.0,
    particle_emitter.initial_orientation.1.y * std::f32::consts::PI * 2.0,
  ))
  .rotated_z(rng.gen_range(
    particle_emitter.initial_orientation.0.z * std::f32::consts::PI * 2.0,
    particle_emitter.initial_orientation.1.z * std::f32::consts::PI * 2.0,
  ))
  // initial scale
  .scaled_3d(rng.gen_range(
    particle_emitter.initial_scale.0,
    particle_emitter.initial_scale.1,
  ))
  // inition position
  .translated_3d(
    pos.0 // relative to parent entity
    + Vec3::new(
      rng.gen_range(particle_emitter.initial_offset.0.x, particle_emitter.initial_offset.1.x),
      rng.gen_range(particle_emitter.initial_offset.0.y, particle_emitter.initial_offset.1.y),
      rng.gen_range(particle_emitter.initial_offset.0.z, particle_emitter.initial_offset.1.z),
    ),
  )

This is only a very basic implementation without many optimisations. I am using instancing and trying to avoid communication between the CPU and GPU, which is expensive. So once the particles are configured and uploaded to the GPU it's best to let them be independent, without further communication from the CPU. However, this means the particle having a fixed trajectory.

There are many optimisations to be made around efficiently managing particles regarding the hardware properties and limitations. This includes buffer management and scheduling.

We need your help for translations, this is how it's done (by @xMAC94x)

This is a tutorial on how to extend Veloren with new languages. It is targeted for everyone who wants to enjoy Veloren in their native language. In Veloren we are using the i18n technique to translate text in the game. For every language, there is a file in assets/voxygen/i18n.

Veloren developers tend to only update the English version when they add a new feature. Other languages are not updated by us developers. We simply don't speak all the languages to be able to do this. So rather we need your help, if you are a native speaker and have good English knowledge you can check what needs to be updated in your language to include the latest features.

Fix Missing Translations

To help you, @yusdacra fixed and improved a language test which is automatically executed every time a feature is added to Veloren. This tutorial shows you how to use his awesome test!

Open (1) this link where you see a list of pipelines currently running in our CI system. Try to find a relatively new (top is new) pipeline which is already green and contains the title unittests. Not every pipeline might have one and it is not essential to get the newest one, just unittests and you are probably good enough to go (2). Click on it (3). A page will open with a black box and a lot of text. You have to scroll up a bit and find something like what we see below:

-----------------------------------------------------------------------------
Overall Translation Status
-----------------------------------------------------------------------------
            | up-to-date | outdated | untranslated
tr_TR.ron   |     206    |    11    |      19
pt_PT.ron   |     123    |    15    |      98
es_ES.ron   |     213    |     5    |      18
fr_FR.ron   |     100    |    18    |     118
it_IT.ron   |     120    |    17    |      99
ru_RU.ron   |     198    |     6    |      32
de_DE.ron   |     223    |    10    |       3
pt_BR.ron   |     199    |     8    |      29
73.20% up-to-date, 4.77% outdated, 22.03% untranslated
-----------------------------------------------------------------------------

This is the indication that you did everything right and got to the statistics. This is an overview page that shows you the available languages and if there are some missing or outdated translations. Let's say we want to focus on the German one, de_DE. We have to scroll further up till we get the detailed info:

-----------------------------------
"assets/voxygen/i18n/de_DE.ron"
-----------------------------------
Key hud.bag.stats_title does not have a Git line in its state! Skipping key.
Commit ID of key hud.bag.stats_title in i18n file assets/voxygen/i18n/de_DE.ron is missing! Skipping key.
State       | Key name                                                    | assets/voxygen/i18n/de_DE.ron            | assets/voxygen/i18n/en.ron
[Unused   ] | char_selection.chest_color                                  | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | None
[Unused   ] | char_selection.create_charater                              | ecb7963730ad2eb8d6e10f6df5dfaf99abccca5b | None
[Outdated ] | char_selection.eye_color                                    | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | ddaa0a9246abddcd623d32c2c1fcf4cd794882df
[Outdated ] | char_selection.plains_of_uncertainty                        | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | ecb7963730ad2eb8d6e10f6df5dfaf99abccca5b
[Outdated ] | char_selection.skin                                         | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | f7d6f76a0458716ceaf5a53d3a70ee7f0fb9eda6
[Outdated ] | common.sound                                                | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | 45217915911ddf1b5ea6a8ff36c2394fd755fcc6
[Outdated ] | gameinput.slot2                                             | f24ba71d9446ea8bcf259020125eaa4290bfde49 | ddaa0a9246abddcd623d32c2c1fcf4cd794882df
[Outdated ] | hud.auto_walk_indicator                                     | 9b2785aeae5b60984691c18a324b1d62ce2b9ed2 | ddaa0a9246abddcd623d32c2c1fcf4cd794882df
[Unknown  ] | hud.bag.stats_title                                         | None                                     | 88a938653be9a95128e938d24afba559bf57fdf5
[Outdated ] | hud.chat.loot_msg                                           | 89400264dc0fb9babb93bcdd04f97c4252dcd772 | ddaa0a9246abddcd623d32c2c1fcf4cd794882df
[Outdated ] | hud.chat.offline_msg                                        | 89400264dc0fb9babb93bcdd04f97c4252dcd772 | ddaa0a9246abddcd623d32c2c1fcf4cd794882df
[Outdated ] | hud.press_key_to_toggle_debug_info_fmt                      | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | e10f27f4806d9c9493bda4b5990a3d44b317fe10
[NotFound ] | hud.settings.reset_keybinds                                 | None                                     | 8e523364ac8b3a155938c98010562c664d577c57
[Outdated ] | hud.settings.toggle_shortcuts                               | 1af82604b55839275998d6afe7ee51a9ffbfdfe4 | ddaa0a9246abddcd623d32c2c1fcf4cd794882df
[NotFound ] | hud.settings.unbound                                        | None                                     | 198c875559dbb1895249ea5d959b61dbff8901bf
223 up-to-date, 10 outdated, 2 unused, 2 not found, 1 unknown entries
94.49% up-to-date, 4.24% outdated, 1.27% untranslated

Here we have detailed information about all language keys used in the German de_DE file in comparison with the standard en.

  • Unused: The key exists in German but not in English, these can probably be removed in the German version.
  • NotFound: The key exists in English but doesn't exist in German. Here we need your translation!
  • Outdated: The English name was changed and the German wasn't updated. This might be a hint that the German version is outdated and needs an update.

Okay, let's say we want to add the correct name for hud.settings.reset_keybinds. So we first want to look it up in English: assets/voxygen/i18n/en.ron Behind the key we find the English sentence: Reset to Defaults. We know that the German equivalent would be Standarteinstellungen wiederherstellen (Well, some of us do :P). So we open the German file: assets/voxygen/i18n/de_DE.ron. If you are already a developer in GitLab you'll now see an edit button. If you are not familiar with GitLab or Git, you can also ask people on our Discord to help you, we are happy to support you any time :) Feel free to ping @git-wizard, who will always be on deck to help with this.

You can click on the edit button here

Once you are editing the file on GitLab, go to the respective place where our entry is missing and add it here:

"hud.settings.awaitingkey": "Drückt eine Taste...",
"hud.settings.reset_keybinds": "Standarteinstellungen wiederherstellen",

When you're done, enter a specific commit message such as update the German translation. You'll then create a target branch with <yourname>/<language>. For example, mine would be xMAC94x/update-de. Finally, you'll need to create a merge request. Check the boxes to agree that you're code will be under GPL3 license.

You now requested to change the file, and we will then take a look at it and if we found it okay we will merge it into the game! From that point on your contribution will land in the master branch, and in the next few days will be shipped to you via Airshipper. Thank you for your contribution!

Help Review Other Translations

Maybe someone already did a translation for your language. If so, you'll find a pending merge request with your language (e.g. de_DE) this list: https://gitlab.com/veloren/veloren/-/merge_requests. Ask us in Discord for reporter privileges and you can open it and add your thoughts to it.

When clicking on the Changes tab you can see the details of this change. Red lines are old ones that are removed and replaced by green lines. If you disagree with something that was added, you can start a discussion by clicking on the respective line. If you don't see any issues with the proposed changes, feel free to approve the MR or comment on it. It's important that you approve MR for translations as we the developers don't have the knowledge to verify the language (and we don't want to put everything through Google Translate). So you help us to verify others contributions resulting in improving the game quality :)

Thank you!

Watching an unbelivably rare harmonic convergence of celestial bodies. See you next week!