This Week In Veloren 110

4 minute read08 March 2021

Authored by AngelOnFira

This week, final changes are merged as code freeze approaches. There are updates to the sceptre, fireworks, and economics.

- AngelOnFira, TWiV Editor

Contributor Work

Thanks to this week's contributors, @xMAC94x, @Frinksy, @zesterer, @ccgauche, @Synis, @Pfau, @Sarra_Kitty, @aweinstock, @Sam, @imbris, @Snowram, @VincentFoulon, @Sharp, @Quibble, @James, @Slipped, @Tadabito, @XVar, and @heyzoos!

@ccgauche and @xMAC94x have been updating the plugin ECS access to enable more parallelisation in systems and increase general game scalability. @Sarra_Kitty and @aweinstock made improvements to the fireworks code. @Christof has been continuing work on economic trade, with NPCs deciding value of their trades. @Sam has been working on (another) sceptre overhaul.

Fireworks with @Sarra_Kitty and @aweinstock

Shader code by @Sarra_Kitty

I did a minor tweak on the shader code for fireworks, which gave them a proper colorful explosion, as the particles before, did not actually have the right colors for each firework. I also added a white-colored firework into the mix. @aweinstock did some more substantial work on the fireworks, they now explode into multiple bursts of color, recursively.

Recursive Fireworks @aweinstock

I extended fireworks to shoot copies of themselves recursively, to give them the effect of staged payloads.

Both before and after, throwing a firework launches an entity with high initial velocity that is subject to gravity. It triggers an effect when its vertical velocity goes below 0 (i.e. it slows down due to gravity, and detonates at the peak).

Previously, the trigger used ServerEvent::Destroy to destroy the projectile, and ServerEvent::Explosion to make an explosion (which uses the same machinery as the staff explosions; apparently, fireworks do 5 damage per explosion, so they're a reasonable anti-air weapon if you have enough of them).

I added a ServerEvent::Shoot event to shoot additional fireworks when the vertical velocity trigger is met. The Shoot event had to be extended with a comp::object::Object field, since it was previously only used for projectiles, which only have triggers when they hit an entity or block, (as opposed to fireworks, which have the vertical velocity trigger, and bombs, which trigger when they land on a surface). Relatedly, inventory-launched fireworks don't currently go through Shoot, so they don't have a Projectile component, which means they don't trigger when they hit a wall or entity. This can be seen at the 14 minute mark of @SavvyNik's recent stream.

To avoid runaway exponential growth with self-replicating fireworks, a firework has a 25% chance to shoot 2 additional fireworks, and a 45% chance to shoot 1 additional firework. This gives a 70% chance for each firework to replicate at least once (so you'll get a decent show from most usages of the item), and an average replication rate of 95% (which is less than 100%, so the show will almost certainly stop eventually).

Economic decisions @Christof

I was finally able to combine item rarity, economy's prices, and both inventories inside the agent code and decide whether to accept the trade or more value is needed. Sadly the agent doesn't yet know how to give the second confirmation and the item rarity table needs more balancing.

First acceptance. Of course, all towns always need more food - if they had more the population would grow.

Scepter overhaul @Sam

I've overhauled the sceptre (again), it should merge in the next few days. The projectile heal is removed and the beam is split. There is also now a skill bar ability.

  • New M1: A beam that damages enemies with a bit of life steal
  • New M2: A beam that heals allies, at the cost of stamina and combo
  • New skill bar ability: An aura that provides damage reduction to you and group members in range for a short duration

The skill tree for the sceptre has also been redone to account for the new skills. You'll have all the points that you've invested reset (meaning if you earned 34 points, and spent any number of them, you'll now have all 34 of those points available to spend again).

Fog over a village in the morning. See you next week!