User:Crush/Dynamic Dynamic Recoloring

From The Mana World

This article is about how the dynamic recoloring system can be used with maximum freedom on TMWServ

Objectives

  • Every piece of equipment should have an individual color
  • Players should be able to modify the colors of their equipment
  • This ability should go beyond predefined colors and allow customization to the limits of the dyeing systems
  • The whole process should be scriptable

Idea

  • every instanced piece of equipment has an individual color ramp
  • the dye ramps are part of the look information sent by the netcode
  • the individual color ramp of an item can be modified by game events. This is done by mixing it with another color ramp
  • the result of this mix is randomized slightly for additional variation

Necessary simplifications to ease implementation

  • The W-channel is reserved for use by DDRS (other dye channels can still be used in a static manner)
  • Standardized brightness levels for W-channels of item graphics so that the dye ramp for each item becomes 2 entries long (named high-color and low-color). Dye operations also have two-part ramps. Otherwise the mixing becomes too complex.

Dye modification

Every dye modification has three values:

  • high-color (RGB color value)
  • low-color (RGB color value)
  • intensity (floating point value)

Every RGB color channel is modified separately:

new-color = (old-color + mod-color * intensity) / (1 + intensity)

Item Dyeing Player Skill

Dyeing is a player crafting skill. The necessary reagents are the item which is dyed and a dye bottle. The challenge rating depends on the value of the item. The intensity of the dye operation depends on the success of the skill check. The high color and the low color of the operation depend on the dye bottle. Dye bottles exist in the following colors:

  • black
  • white
  • primary RGB colors with the lower color warm hue-shifted
  • primary RGB colors with the lower color cold hue-shifted

A botched skill check consumes the dye but results in no effect for the item. Players should not be punished with equipment damage for trying to make the game world more colorful.