Idea for adding custom race support

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Idea for adding custom race support

Post by XJDHDR »

I've been thinking for a bit about better ways for modders to add custom races to the game. Currently, every custom race mod for DF has involved replacing the textures and text for one of the existing races.

The idea I currently have is a button on the race selection window that can be used to select any installed custom races. My idea has the modder create a JSON or similar file that is populated with all of the information required to integrate the new race into the game. The modder also needs to supply a texture file containing the new body and additional textures for each head. All of this is placed in a special folder in the StreamingAssets folder. On launch, the game looks through this folder and populates a list with all of the custom races it found. The button will then open this list and let the player pick one of them. The button could even be coded to only appear if at least one custom race is installed. I've also attached a rough mockup of how the button could be added.

What are your thoughts on this idea?
Attachments
Custom race button idea.jpg
Custom race button idea.jpg (650.93 KiB) Viewed 2025 times

User avatar
joshcamas
Posts: 87
Joined: Mon Sep 21, 2020 7:01 am

Re: Idea for adding custom race support

Post by joshcamas »

This would definitely be awesome, although I'm not super sure how doable this is out of the box. I'd *hope* there is a way to have custom races, but it may all be hardcoded. Only way to find out is looking at the code :)

If it *is* hardcoded, it'd be good to transition DFU away from that. Would probably take a while though

Alth
Posts: 28
Joined: Wed Feb 20, 2019 9:59 pm
Location: New Zealand

Re: Idea for adding custom race support

Post by Alth »

Having a look at the engine and the races are held as enum values that map directly to native data. Just thinking that we could swap out enums for integers and just reserve the vanilla race integers. The hard part would be getting any custom races integrated into everything else.

User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: Idea for adding custom race support

Post by XJDHDR »

joshcamas wrote: Mon Dec 14, 2020 2:58 pm , but it may all be hardcoded. Only way to find out is looking at the code :)
Yeah, someone else will have to do that. While I have some experience with programming, C# has a different syntax to anything else I've worked with so far. As a result, I get lost whenever I try to read DFU's code.
Edit: Didn't see Alth's post before writing this.

User avatar
joshcamas
Posts: 87
Joined: Mon Sep 21, 2020 7:01 am

Re: Idea for adding custom race support

Post by joshcamas »

Yep, enum was my fear. DFU was designed to... well, be Daggerfall, so many features are designed specifically to replicate what exists - OOP wasn't used nearly as much as it could have been, instead hardcoding most features.

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: Idea for adding custom race support

Post by Interkarma »

While maybe not exactly what you want, it's possible to deliver custom races via the effect system's racial override system. See vampirism and and lycanthropy for examples. It's possible to override or augment most aspects of the base race, including paper doll and many behaviours.

I understand that's not quite the same thing as adding a custom race right from character creation and fully integrated across every system - but there's still a lot you can do if you're willing to work within Daggerfall (and DFU's) limitations. If you have a great idea for a custom race and have a story to tell, it doesn't need to be perfect to be good.

Post Reply