Two Weeks in Veloren 226

11 minute read05 February 2024

Authored by Christof

These weeks, we marvel at the new colorful trees, and talk about aiming and grammatical gender.

- Christof, TWiV editor

Contributor Work

Thanks to last two weeks' contributors @floppy, @dsalt, @timvinc, @keeganjw, @Sam and @crabman, @evgenkot, @donovan, @zesterer, @jcoxeye, @juliancoffee, @Isse, @synis, @christof, @fvasco, @kHannibal, @Treeco, @woeful, and @Animoe.

The merged work includes an adlet elder sword fix, many many translation updates, kill_npc targeting pets, enter/return equivalence in chats, battlemode time fixes, digging tooltip fixes, recipes for charms, sword balancing, toggling lanterns on ground, item tiering fixes, more price entries, no cursor jump when un-grabbing, updated furniture models, terrain persistence crash fix, better network compression of sprites, sea decor block fix, weather optimization, better tab completion for items, hot reload fixes, random colored trees, new LoD tree types, WGPU 0.18πŸ₯³, better aiming, inventory overflow logic, more cursor position fixes, proper grammatical gender in chat messages, and item tooltip size.

Ongoing (unmerged) work is happening on item reinforcement, Mammoth AI, mining ore with multiple hits, separated event systems, snakes, hammer skills, flight aerodynamics and wind effects, a chat rework, item merging, LoD shader improvements, better balancing of beginner progress, learnable recipes, dwarven mine, poise based blocking, more NPC commands, an active glider (admin only), loading plugins over network and supporting WASI 0.2 components as plugins.

This developer blog is based on information collected in #blog-content, where game contributors are always invited to communicate their updates or simply post a link to a different channel.

Interactible lights by @zesterer

As a demonstration of the new sprite representation overhaul and sprite attribute system, I added an attribute to lamp-like sprites specifically (lanterns, street lights, etc.) that allows them to be toggled on and off. Players can interact with them as they can other sprites to toggle this attribute.

Also, you can read more about plans for moveable sprite parts in this discord thread.

Over the shoulder aiming by @Woeful

After being unsatisfied with the third person camera whilst using ranged weapons I decided to make a change. My first issue being unable to properly see what I was aiming at due to the player character obstructing the view. The second being projectiles weren't actually going towards where you were aiming!

To address the first issue I reworked the camera in third person to allow horizontal and vertical offsets, allowing for over-the-shoulder style camera gameplay. This is also completely customizable in the gameplay settings menu, where players can configure these offsets in any way they like.

But the problem now with moving the camera - the ranged projectiles no longer go where you are aiming! This is due to how the projectile spawning system works; projectiles are spawned at a specific position relative to the player body, and then fired forward, simply copying the player's look direction. Due to the camera now being offset, where the camera crosshair is positioned and where the player is looking is now different!

To fix this I needed to rework how the player's look direction is calculated; instead of just copying the camera rotation, we need to have the player look at where we believe the camera crosshair is pointing. To do this we cast a ray from the camera's position forwards and look if we intersect the terrain or any entity and return the closer point. (This required me to create a new basic entity ray cast method to check for intersections with entity hit boxes).

Once we have this point where the camera ray is hitting something, we can determine the direction from the player body's projectile spawn point to this camera hit point. This direction will now be our new player's look direction! This ensures that now matter where the camera is offset and positioned, the player will always look and aim to where the crosshair is pointing! And handily enough, this new aiming system fixes my second issue mentioned initially as well!

New configurable camera features and more crosshair accurate projectiles - two birds with one stone! I can answer any questions or clarifications needed for this new "QoL" ranged camera

WGPU update

@Isse's update across ten full versions of our GPU library WGPU finally merged. You should get it automatically with the next weekly release this Thursday. From then on DX11 support is history, but even older graphics cards should now be supported thanks to openGL. And newer graphics cards with Vulkan and DX12 drivers likely get a speed boost.

Please note that the related transition from shaderc to naga will happen in a separate merge. This will finally get rid of some compilation dependencies like a python interpreter.

Similarly migrating to 0.19.1 should be a low risk later update.

Multi-hit mining by @crabman

Chat tweaks by @Synis

Terracotta updates by @floppy

Various beautiful screenshots

Synchronized lightning (now fixed)

Thermal glider lift

Destruction in Lagrad

Translation updates by @juliancoffee

There are many ways to contribute to Veloren and the least technical one is to join the translation team. We do need both people who want to translate the game and people who want to review other people's translations, as well as just people in general who can give us a special perspective of their language concerning translation internal systems. We had @Translator role, but it was somewhat generic, yet at the same relatively difficult to gain.

For that, I want to make a special announcement, we now have a @TranslationPingSquad role that you can self-assign in #⁠rules-and-info, and get pings about different translation-related activities and discussions.

The next portion of translation news is going in, the biggest change is gender handling, grammatical gender to be precise. If your language has the concept of grammatical gender, you already have a glimpse of how complex this problem is, yet it's even more complex than you can imagine.

But complex problems shouldn't scare us!

In a previous blog, we proposed the idea of passing two variables, first for "he or she" and second for animacy, but later we decided to make very small incremental step and expose only player gender, which we derive from the character's sex, and expose it only in chat UI. This MR was mainly targeted at Slavic languages, as they have a verb-noun agreement, which means that you need to pick the right verb depending on the gender of the actor who 'executes' the action this verb represents.

Here is an example.

hud-chat-died_of_pvp_buff_msg =
    .burning = { $attacker_gender ->
        [she] [{ $attacker }] спалила [{ $victim }] ΠΆΠΈΠ²Ρ†Π΅ΠΌ
        *[he] [{ $attacker }] спалив [{ $victim }] ΠΆΠΈΠ²Ρ†Π΅ΠΌ
    }

Let me unpack it.

(I assume that you've seen Fluent already, but if you haven't, this declares message hud-chat-died_of_pvp_buff_msg and its attribute, burning, which says what should we display on death from Burning debuff)

First, we match on $attacker_gender, because it's PvP defeat, we do know[1] the gender of both $attacker and $victim.

The first branch is [she], which means that the attacker was feminine, and if you know Ukrainian, or at least can read Cyrillic, here we use "спалила", which is a feminine variant of the word "ΠΏΠ°Π»ΠΈΡ‚ΠΈ" in Past Tense, or "to burn".

The second branch is slightly more complicated, it declares a masculine branch and default branch, hence * mark at the beginning, It means, that if, for some reason, you get an unexpected gender to match, you will default to the masculine branch. Other than that, it's simple, you use the same template, except now you use "спалив", which is the masculine form.

Important note, you only have $attacker_gender with PvP-like notifications. For PvE-like notifications, it's much more complicated and we intentionally didn't add it yet, you only have $victim_gender, which is always the player.

Now, the asterisk.

We do know the gender of both $attacker and $victim.

That was a lie, we do not know. We derive it from the character's gender, which may or may not match the gender of the player, but it's a character you picked. This also means that we don't know the gender at all if you don't pick the character. In other words, when you join the server, and then instantly log out, without entering the world or if you did join the world but used Spectator mode, we can't provide gender to translators, and they should handle it with the default branch if possible, i.e. fallback to current behaviour before this MR.

hud-chat-offline_msg = { $user_gender ->
    [she] [{ $name }] вийшла Π· сСрвСру
    [he] [{ $name }] вийшов Π· сСрвСру
    *[any] [{ $name }] ΠΎΡ„Ρ„Π»Π°ΠΉΠ½
}

We do want to handle this better by providing a special UI where you can pick the real gender you want to associate with your account, and if you want to implement this feature, please reach out to us!

That's not all, there is also a small MR, that slightly improves the experience of translators when it comes to translating NPC messages, namely npc-speech-tell_site and npc-speech-tell_monster. It's the message that was combined from multiple different messages, and it was unclear which went where.

The answer is that these messages use npc-speech-dir* messages, npc-speech-dist-* messages and npc-speech-body-* variables from body.ftl component. We now explicitly guarantee that these messages are used ONLY for npc-speech-tell_site and npc-speech-tell_monster, which means that you should place all "helper words" like articles or any others on corresponding words, like that.

body-npc-speech-generic = some creature
body-npc-speech-biped_large-ogre-male = an ogre
body-npc-speech-biped_large-ogre-female = an ogre
body-npc-speech-biped_large-cyclops = a cyclops

and

npc-speech-dir_north = to the north
npc-speech-dir_north_east = to the north-east
npc-speech-dir_east = to the east
npc-speech-dir_south_east = to the south-east
npc-speech-dir_south = to the south
npc-speech-dir_south_west = to the south-west
npc-speech-dir_west = to the west
npc-speech-dir_north_west = to the north-west

Please reach out to us, if you still have problems with translating these strings or any other strings!

There's also some cool stuff in the review stage, unrelated to translations, but more on that later.

Autumn trees and cherry blossom by @kHannibal

🐊 Patiently waiting for lunch. See you next time!