Handle "hardcoded" attributes nicely

The 2009 Mana project went dormant around 2014 and was revived in 2023; it currently develops a client implementation for TMW and potentially other games.


Post Reply
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Handle "hardcoded" attributes nicely

Post by Ablu »

The server currently expects some hardcoded ids for attributes (like HP for example). However the attribute itself is freely defineable on the xml side.

This could lead to bad setups, like the HP attribute in wrong scopes or maybe missing.

Another problem is that attributes like HP are only read by their base values and never by their modifiers (or at least supposed to be handeled this way). However you can define modifiers for them in the attributes.xml.

My proposal would be this:
  • add some info tag to the attributes which take a named string like "hp" or "maxhp".
  • make the server reading those tags and mapping the ids of those attributes to the internal ids (ATTR_HP)
  • write a function which checks the status of the attributes after loading. This would check for all required tags being available in their correct scopes for example.
Any comments on that? (please only take this as a rough sketch in my mind)

Regards,
Ablu
User avatar
Bjørn
Manasource
Manasource
Posts: 1483
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Re: Handle "hardcoded" attributes nicely

Post by Bjørn »

Tagging and checking the built-in attributes sounds sane to me.

How many of these "built-in" attributes do we currently have? Probably the list found in defines.h, right? If I trim that from stuff that are unused or will soon be unused I'm left with:
  • health
  • maximum health
  • health regeneration speed
  • movement speed
  • money
  • inventory capacity
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: Handle "hardcoded" attributes nicely

Post by Ablu »

Bjørn wrote:If I trim that from stuff that are unused or will soon be unused I'm left with:
  • health
  • maximum health
  • health regeneration speed
  • movement speed
  • money
  • inventory capacity
Yep, that list looks ok.
Post Reply