[22] Character Creation And Customization
Antorum
10/29/2020, 07:27pm
17 views
Something I have been sitting on for a while is character creation and customization. This feature took a good bit of time, as it required changes to the database schema, login flow, and clientside player replication. I also had to make a bunch of 3d models for hair styles, beards, etc. Everything is still pretty rough, but at least now there is some variety in characters on the island.


Included in these changes are a slight rework to character stats, and the introduction of classes. In Antorum, players select a class by allocating class points into four areas: Artisan, Explorer, Warrior, and Ascetic. These points determine the name/title of the class and experience bonuses in the various skill categories, so you can tailor your character to be a bit better in the areas that suit your playstyle. I'll see how this all feels as work on the game continues.
Additionally, I finally got around to reworking the gross character window. The new one shows way more information about your character, and even has a little preview window. Nice.

Just like players, NPCs can now be customized, as well as have gear equipped. Just specify some options on an EquipmentComponent:
[equipment]
hair = [0, 255]
hair_color = [0, 6]
skin_color = [0, 36]
shirt_color = [2, 4]
pants_color = [5, 7]
[equipment.spawn_equipment_set]
main_hand = "iron-longsword"
off_hand = "wooden-board"
head = "rusty-helmet"
As seen above, customization options for stuff like hair can be specified as a range instead of just a single value. If you do this, the final value will be randomly selected from within the given range when the entity is spawned. I added this because it just makes it easier to have randomized NPCs that look different, without requiring a ton of separate entity definitions.
I'm pretty pleased with the network protocol changes for this feature. It's a set of 6 tidy packets:
Client - 0x30 - Character Creation Request
name: string (? bytes)
class_artisan: u8 (1 byte)
class_explorer: u8 (1 byte)
class_warrior: u8 (1 byte)
class_ascetic: u8 (1 byte)
stat_stamina: u8 (1 byte)
stat_strength: u8 (1 byte)
stat_smarts: u8 (1 byte)
stat_speed: u8 (1 byte)
hair: u8 (1 byte)
hair_color: u8 (1 byte)
facial_hair: u8 (1 byte)
facial_hair_color: u8 (1 byte)
skin_color: u8 (1 byte)
shirt_color: u8 (1 byte)
pants_color: u8 (1 byte)
Server - 0x31 - Character Creation Response
status: u8 (1 byte)
Client - 0x32 - Character Creation Class Info Request
class_artisan: u8 (1 byte)
class_explorer: u8 (1 byte)
class_warrior: u8 (1 byte)
class_ascetic: u8 (1 byte)
Server - 0x33 - Character Creation Class Info Response
class_title: string (? bytes)
class_bonuses: string (? bytes)
Client - 0x34 - Character Creation Stat Info Request
stat_stamina: u8 (1 byte)
stat_strength: u8 (1 byte)
stat_smarts: u8 (1 byte)
stat_speed: u8 (1 byte)
Server - 0x35 - Character Creation Stat Info Response
stat_bonuses: string (? bytes)
The next thing I plan to finish and write about is the herbology skill and foraging nodes.

- Declan (@dooskington)