12 October, 2016

Character Strings

If you've been reading through the last few posts, you'll know that the strings I'm talking about here are not the same ones discussed in Monsterhearts, instead I'm refering to a string of digits that can be entered into a website as a password. Once entered, the string of digits passes through a filter subroutine in the website, producing a character that integrates with all of the various systems and subsystems in the online game. 

To describe my intentions here I will use an online game with a similar concept as my core model. 

A character for Dungeon Robber could be handled pretty easily, it follows the standard D&D six attributes, besides these, characters have:
  • A name
  • A number of experience points
  • Coins carried
  • A range of equipment in their inventory (spells are included here)

Pretty much everything else can be derived from these figures.

The attributes are even streamlined further, either you have a "high" attribute or you don't (where "high" attributes give you a bonus to certain in game effects). All characters have 2 "highs".

We could easily define this type of character with the following string (where brackets are included purely for the sake of breaking up the string, to make it easier to explain...they wouldn't be included in the live version of the string)...

(XXXXXX)(X)(XXXXXXXXXXXXXXXX)(XXXXX)(XXXXX)(XXXXX)(XXXXX)(X......)

...where the first six digits indicate the six attributes. Maybe giving them 1's if the attribute is "high" and 0's if the attribute isn't. 

The seventh through twelfth digits of the string would be the character's experience points. that gives you a potential of 999,999 XP to accumulate.

The thirteenth through twenty-eighth digits are the character's name (which can be up to 16 characters long). 

Digits thirty-nine through fifty-eight are broken into five digit chunks. Each of thesse defines the amount of a specific monetary unit possessed by the character. Copper Pieces, Silver Pieces, Gold Pieces, Platinum Pieces. A character can have up to 99,999 units of each...which is probably far more thaan they'd actually accumulate in game.

Any digits thereafter are pieces of equipment, including weapons, armour and other things picked up along the way. 

Anything else about the character is derived automatically from these values.

  • Character level: derived from XP
  • Hit points: derived from a combination of Character level and whether the character has a high constitution attribute.
  • Armour class: derived from characters dexterity attribute and any equipped armour/shield/etc. in their possession.
  • Damage: not really seen as a specific thing on the character sheet, but this is derived from the equipped weapon, and the character's strength attribute.
  • Etc... (a lot of things are derived from these attributes on the fly, such as bribing henchmen as a derivative of the charisma attribute, and you don't actually see them on a character sheet)

Given the simplicity of the game, you could probably compress this string further.

With two attributes high, and a total of six attributes, they could probably be defined by a single digit in the string. 

A =110000, B =101000, C =100100, D =100010, E =100001, F = 011000, G =010100, H =010010, I =010001, J =001100, K =001010, L =001001, M =000110, N =000101, O =000011

Everything converting that single digit into useful values is handled by a subroutine in the program. No human intervention required.

Next post, I'll look at the specific string I'm planning to use to define characters in this new game idea I'm working on. 
Post a Comment