This Week In Veloren 114

5 minute read05 April 2021

Authored by AngelOnFira

This week, we see lots of changes to trading systems. New sound effects are being worked on, and new visualizations for maps are being made as well.

- AngelOnFira, TWiV Editor

Contributor Work

Thanks to this week's contributors, @zesterer, @Sam, @xMAC94x, @theCow61, @Pfau, @aweinstock, @HunterTParks, @1b15, @Slipped, @DaforLynx, @tonyvu0605, @Sharp, @Christof, @Snowram, @nogajun, @VincentFoulon80, @Songtronix, @aljazerzen, and @James!

@Songtronix Squashed/fixed Airshipper bugs in preparation for its 0.5 release. There is still a lot to do, but the backend is mostly figured out. @Pfau worked on crafting window tabs with icons by @VincentFoulon80, with bug tracking and programming support by @aweinstock and @imbris.

Window tabs

@Gemu has been working on more gear set models, which will lead to animals being able to drop different crafting materials which can be used to craft the new gear. @DaforLynx has been working on more sound effects for combat. @LunarEclipse worked on improving the readability of Torvus. @Christof created an updated 0.9 economy tree.

The leather line-up of new gear

@James has been going through new variants of what the map could look like. @aweinstock worked on some changes to trading. @LunarEclipse made some big improvements to the readability of Torvus by making different message kinds from Veloren look different on Discord as well. You can check out the MR here.

Torvus readability changes. Left is old, right is new.

Sound effects by @DaforLynx

I implemented more sound effects for combat using the outcome system. A sound will emit from a struck entity when attacks connect, similar to what @zesterer did with arrows earlier this week. The new sounds were made by @Flashbang. Planned for the future are further diversifying the sounds based on things like weapon used, armor worn, etc.

How is the trading price calculated @Christof

It all starts with an economic simulation of the resources available to a town. Each chunk counts as terrain towards the closest town (site), with the different biomes providing different potential goods. Guards turn this into controlled territory. The most important good is food as it determines the maximum number of inhabitants of a town. As long as there is enough food, the population will grow (exponentially). Of course, the recursive raw materials needed to cook food and to produce equipment for guards create an interesting cycle. Merchants will travel to neighboring towns and trade extra goods for missing ones, a maximum transportation capacity per merchant considered.

The ratio between annual need and stockpile determines the local value for each Good. This number is typically between 0.1 and 4.0 and varies between towns (due to access to different resources).

To generate a price for a specific item, the rarity of the item (as derived from loot tables) is translated into an equivalent amount of good (a rare weapon translates into a large amount of tools). Here the individual weight of a loot table is tuneable (more dangerous encounters associated with a loot table should result in lower probability). The most common item per good is normalized to a given amount of this ware. Only towns with a high enough extra stock of that ware can offer rarer goods (as the equivalent can never exceed to local unclaimed stock, currently these limits are hardly perceived though).

And last but not least the merchant will sell items at a higher cost than they bought them for. As in real life, consumable goods (food, potions, ingredients) achieve a better buy-to-sell price ratio than investments (armor, weapons).

PS: For coin, there is no definitive need, so it uses the starting amount per town for an annual consumption to calculate local value. Some fortunate towns accumulate coin from their neighbors, some towns have nothing to offer and spend all their money on buying missing goods.

I finally created an updated 0.9 economy tree, see devblog 99 for the much simpler old one.

Maps by @James

Recently, I've worked on making the map more "map-like". I'm still going through lots of options and variants:

I've separated this map into three layers that are all stacked on top of each other. The first layer has hill shading, lake shores, rivers, and coastlines on a yellowish background. The second layer is terrain color with a reduced alpha channel. The final layer applies the contour lines and redraws the roads on top. I've also given the minimap layer support.

Trading fixes by @aweinstock

I made more changes to trading:

  • When trading with a merchant, ctrl-clicking an item will automatically insert/remove enough of that item to balance the trade with the current prices. Shift-clicking will add/remove items from a trade one at a time.
  • Merchants now spawn with stacks of stackable items.
  • The buy/sell prices when trading with an NPC are heuristically colored: if buy is green and sell is red, it's probably a better idea to buy that item then sell that item at that site.

A fight with the Mindflayer! See you next week!