Bay 12 Games Forum

Dwarf Fortress => DF Suggestions => Topic started by: NW_Kohaku on April 07, 2016, 01:27:13 am

Title: Graphics support for procedurally-generated races
Post by: NW_Kohaku on April 07, 2016, 01:27:13 am
This thread is in response to concerns in other threads (http://www.bay12forums.com/smf/index.php?topic=156871.msg6915837#msg6915837) that the upcoming myth generator's capacity to generate wholly new races will functionally break graphics sets, since currently, procedural creatures exist wholly outside the raws.  They exist inside uncompressed saves as less-than-clear names like TITAN_21 while in-game they appear as a Blue Night Hag or "Worrygears the Frenzy of Wildness" or something, making association of the two difficult.

Broadly speaking, how I envision this would be that modders produce some general-purpose graphics, and then when players come across a procedural creature, they have some method of associating it with one of their graphics tiles.  For example, if there is a creature that is shaped like a three-eyed skinless dimetrodon, modders might have made a dimetrodon-shaped graphic already to associate with it.

Basically, there should be some sort of method of adding a tag in the graphics section that will provide users the ability to make [CREATURE_GRAPHICS:MYTHIC_RACE_2] a set of graphics, especially if they will be playable instead of dwarves.  (That way, we can have indicators of different professions more specific than color-coding job groups.) To that end, there needs to be a way to see (possibly by legends mode or some mythic mode) a list of "known" races (to prevent spoilers) and their descriptions, plus what label to throw onto the graphics raws to associate with the graphics. 

From there, I expect some sort of third-party tool to arise to help automate some of that process of token updating, but that's not something that is necessary for being hardcoded.

...

Also, while I'm asking for graphics support, could you please get around to caste-level support for graphics?  Especially when mods make castes have significant differences, it can be really important.
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on April 07, 2016, 01:39:34 am
So. I'll re-iterate what I've said: As it stands, this is already a concern as graphics are ALREADY broken with respect to generated creatures. The impending update will magnify this problem and might draw attention to it, but if it hasn't been unfucked by now it's not any more likely to get unfucked soon.
Title: Re: Graphics support for procedurally-generated races
Post by: Dirst on April 07, 2016, 01:49:59 am
I can see this working with an interface not entirely unlike the one for picking a burrow's symbol.  You come across a creature with a vanilla tile, look at it, and one of the options is to re-assign its image.  You would only see the DEFAULT image in the selector, though if there is room a representative set of professions/variations might appear while a DEFAULT image is selected.

The challenge with this is the sheer number of images in a complete graphics set, not to mention the extras that might be hanging around specifically for this exercise.  IIRC, the graphics are all stitched together into a single texture with no tie back to the original filename... so that's out.  Something like menu categories might work, though.
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on April 07, 2016, 02:13:05 am
Though I suspect that a feature of such complexity might be low-priority even within the category of graphics support. If Toady works on more tileset support, I assume that expanding into giving plants, terrain, items etc the same foundation for tiles that creatures do would be higher up on the list. :V
Title: Re: Graphics support for procedurally-generated races
Post by: Max™ on April 07, 2016, 09:09:40 am
Wonder if we could smush mifki and Japa together, collect the goo that comes out, and bake that into the graphics code?
Title: Re: Graphics support for procedurally-generated races
Post by: NW_Kohaku on April 07, 2016, 10:06:20 am
Dirst's suggestion would be user-friendly but take work on Toady's part. My suggestion would be much less user-friendly, and probably have most people using a third-party tool to work, but would require rather little effort on Toady's part.

In fact, it's possible to use DF Hack to find out the raw name of a procedural creature and put it in one of the graphics raw files so that certain titans or werecritters had graphics. (There's a plugin that lets you check populations, and I know that lists the HFS and simply has "CLOWN"_11 innumerable, "CLOWN"_12 innumerable, etc.)

Phoebus made a set of [CREATURE_GRAPHICS:TITAN_1] through [CREATURE_GRAPHICS:TITAN_200] tokens in the graphics files, which means they all look the same, but there is, at least, an icon for them, so it's entirely possible to have graphic for a procedural creature. 

What I'm asking for is to make the raw name of particular creatures apparent without unusual third-party attempts to see the code.  Of course, I suppose you could make something DF Hack-based like this visualizer (http://www.bay12forums.com/smf/index.php?topic=141245.0) that can actually plunder the internal data for certain key traits (like, say, blob versus quadruped, body material, and special attack,) and choose from a selection of graphics to represent them.

... Actually, the more I think about this, the more I think I could probably do this straight through DF Hack now...
Title: Re: Graphics support for procedurally-generated races
Post by: Adrian on April 07, 2016, 10:53:28 am
Listening to Tarn's talk  (http://gdcvault.com/play/1023372/Practices-in-Procedural)(around 22min in) it seems the procedurally generated races are all based around template animals (Like Clowns are):
Quote
small contemplative lizards with exposed brains
Quote
tiny cackling serpents with mischievous smiles

Isn't it easiest to just have the generator copy whatever [CREATURE_TILE:] the template animal is referring to, and maybe give it a unique colour?
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on April 07, 2016, 10:58:37 am
Ahah. And now we see the weakest link in the generation: the template. That could be exploitable, yes. :V
Title: Re: Graphics support for procedurally-generated races
Post by: NW_Kohaku on April 07, 2016, 11:09:22 am
Listening to Tarn's talk  (http://gdcvault.com/play/1023372/Practices-in-Procedural)(around 22min in) it seems the procedurally generated races are all based around template animals (Like Clowns are):
Quote
small contemplative lizards with exposed brains
Quote
tiny cackling serpents with mischievous smiles

Isn't it easiest to just have the generator copy whatever [CREATURE_TILE:] the template animal is referring to, and maybe give it a unique colour?

Well, new graphics should be produced for a few reasons:

1. You want snake-like titans to look substantially different from a garden snake, just from a player-identification standpoint.  When I was making giant brown recluse spider graphics, I didn't just copy the GCS and recolor it because the difference would be too subtle for most.

2. There are some creatures rather different in type from generic creatures, I.E. dimetrodon clowns, which would need accounting for...

3. You'll probably want to add little features to signify special properties.  I.E. a flesh blob with fire breath might be a red blob with fire around it, while a flying metal blob with webs might have wings on a gray blob with a spiderweb on the edge.
Title: Re: Graphics support for procedurally-generated races
Post by: JesterHell696 on April 10, 2016, 01:51:58 am
I'm not sure how I feel about this suggestion, I'm generally against do it for the modders/mods type suggestions in any games forums but I really like the idea.... troublesome.
Title: Re: Graphics support for procedurally-generated races
Post by: Shonai_Dweller on April 10, 2016, 08:53:36 am
I'm not sure how I feel about this suggestion, I'm generally against do it for the modders/mods type suggestions in any games forums but I really like the idea.... troublesome.
Support for graphics and a large amount of customization is part of the plans. This is the best time possible to make this suggestion as it seems like we're about to enter a phase which could have a negative impact on current support (locking out one of the most interesting parts of the game in the worst case).
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on April 10, 2016, 10:18:33 am
I'm not sure how I feel about this suggestion, I'm generally against do it for the modders/mods type suggestions in any games forums but I really like the idea.... troublesome.

Which is again a good thing that the idea already is supported by Toady, just not high on the to-do list.

And giving modders more toys to play with is good. Eventually it leads to good ideas getting brought into the game earlier, in some cases. :V
Title: Re: Graphics support for procedurally-generated races
Post by: Glatux on April 12, 2016, 09:09:54 am
My idea would be to make a script/program with a folder that contain various sprites that look trough the procedurally-generated creature select a sprite depending on the template and then paste other sprites on top of it depending on the detail.
Ex : creature is humanoid so it pick humanoid_base(.png), it has blue scale so it apply texture_scale on it and color it blue(apply blue filter), then it apply details, the creature has 1 eye so it paste eye_1 on it, it has claws so it paste claws_2hands on it, etc...
And then you link the creature with the output of the script/program
Title: Re: Graphics support for procedurally-generated races
Post by: Dirst on April 12, 2016, 10:09:31 am
My idea would be to make a script/program with a folder that contain various sprites that look trough the procedurally-generated creature select a sprite depending on the template and then paste other sprites on top of it depending on the detail.
Ex : creature is humanoid so it pick humanoid_base(.png), it has blue scale so it apply texture_scale on it and color it blue(apply blue filter), then it apply details, the creature has 1 eye so it paste eye_1 on it, it has claws so it paste claws_2hands on it, etc...
And then you link the creature with the output of the script/program
This was my general understanding of how to do forgotten beasts and such, but remember that you get at most 32x32 to work with, and still have to add bits to distinguish professions.  The level of detail can't be too deep for playable races.
Title: Re: Graphics support for procedurally-generated races
Post by: Glatux on April 12, 2016, 10:13:16 am
My idea would be to make a script/program with a folder that contain various sprites that look trough the procedurally-generated creature select a sprite depending on the template and then paste other sprites on top of it depending on the detail.
Ex : creature is humanoid so it pick humanoid_base(.png), it has blue scale so it apply texture_scale on it and color it blue(apply blue filter), then it apply details, the creature has 1 eye so it paste eye_1 on it, it has claws so it paste claws_2hands on it, etc...
And then you link the creature with the output of the script/program
This was my general understanding of how to do forgotten beasts and such, but remember that you get at most 32x32 to work with, and still have to add bits to distinguish professions.  The level of detail can't be too deep for playable races.

I think professions would be differentiated pasting clothes on top of everything else
Title: Re: Graphics support for procedurally-generated races
Post by: NW_Kohaku on April 12, 2016, 12:16:35 pm
Generally, when making a playable race, I tend to keep about half the tile open so that the creature can hold up an item that indicates profession. 

For example, here's a sample of my naga race professions:
(http://i56.tinypic.com/140b31i.png)
The middle two rows are standard professions, and the 3, 2 (4, 3 when starting at 1) position is a cheesemaker, while a thresher wears the same clothes, but holds a sheaf of wheat, and the brewer is similarly clothed, but holds a glass of wine.

(The full list is:
Peasant, ghost, duke, broker,
miner, mechanic, woodcutter, chief medical naga,
weaponsmith, spinner, animal caretaker, cheesemaker,
reruit, spearnaga, master marksnaga, zombie.)
Title: Re: Graphics support for procedurally-generated races
Post by: Egan_BW on April 12, 2016, 12:34:30 pm
I like the idea that particularly dedicated players could make thier own sprites specifically for thier generated races.
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on April 12, 2016, 01:53:01 pm
Ooh. Noodly goodness. But still, this would be more involved than the current idea of spriting content for modded-in races.
Title: Re: Graphics support for procedurally-generated races
Post by: NW_Kohaku on April 12, 2016, 02:00:07 pm
Ooh. Noodly goodness. But still, this would be more involved than the current idea of spriting content for modded-in races.

Not really, you can already have custom sprites for titans, but the problem is that they are merely TITAN_12 in the raws, so graphics sets just make all titans have the same graphic.

With some sort of way of telling players or a third-party app which characters relate to which raw names, then the "heavy lifting" of connecting raw names to sprites can be done by modders, themselves. 

(In fact, with DF Hack, it may be possible to do all this now, provided someone sits down and creates a method of associating graphics on the fly through reading the raws (http://www.bay12forums.com/smf/index.php?topic=121451.msg6922565#msg6922565).)
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on April 12, 2016, 02:15:34 pm
True. But that falls into the issue of the fact that the easiest method will likely not work unless a specific ID is associated with a specific appearance. Otherwise the differing generated races will all look the same, just as with the titan issue.

EDIT: Though what I mainly meant was that generating a world and adding graphics that make SENSE for what results would be infinitely more hassle than adding sprites for specific modded-in races. That way you don't have to change out desired sprite assignments with each world.
Title: Re: Graphics support for procedurally-generated races
Post by: NW_Kohaku on April 12, 2016, 02:38:15 pm
A third-party system could make changing out sprites fairly easy.  Just look at Phoebus's interface.

Something that works on the fly would require DF Hack, but that's basically what Stonesense does already with its dwarves that wear clothing that directly represents their actual clothing, down to being the color of the dye applied to their robe.
Title: Re: Graphics support for procedurally-generated races
Post by: Rose on May 26, 2017, 12:53:07 am
Just want to mention that I made DFHack plugin that partially fixes this, allowing graphics according to the base creature that the generated creature is based off of.

http://www.bay12forums.com/smf/index.php?topic=162497.0
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on May 26, 2017, 01:28:00 am
Just want to mention that I made DFHack plugin that partially fixes this, allowing graphics according to the base creature that the generated creature is based off of.

http://www.bay12forums.com/smf/index.php?topic=162497.0

Not sure whether to make angry dragon noises due to massive necropost, or because I know someday a DFHack user will cause hilarious confusion during a bug report with this.

Or both. Rawr. I guess.
Title: Re: Graphics support for procedurally-generated races
Post by: Rose on May 26, 2017, 01:35:52 am
Just want to mention that I made DFHack plugin that partially fixes this, allowing graphics according to the base creature that the generated creature is based off of.

http://www.bay12forums.com/smf/index.php?topic=162497.0

Not sure whether to make angry dragon noises due to massive necropost, or because I know someday a DFHack user will cause hilarious confusion during a bug report with this.

Or both. Rawr. I guess.

The thread came up in a search, and I couldn't help myself.
Title: Re: Graphics support for procedurally-generated races
Post by: Shonai_Dweller on May 26, 2017, 03:53:24 am
Double sin there, a necro and a reply to a suggestion that 'mods can do that'. Off to the hammerer with you.

(Good info to know, of course, thanks!).
Title: Re: Graphics support for procedurally-generated races
Post by: Egan_BW on May 26, 2017, 05:11:58 pm
Wouldn't that be only a singlesin though, because suggestion necros are allowed and prefered to making a new thread?
Title: Re: Graphics support for procedurally-generated races
Post by: Random_Dragon on May 26, 2017, 05:16:48 pm
Double sin there, a necro and a reply to a suggestion that 'mods can do that'. Off to the hammerer with you.

(Good info to know, of course, thanks!).

"DFHack can do that" is what's heretical, if only because I've had DFHack users butt into a bug discussion only to be all "nah fam, this works oh wait you need DFHack" and such. :V

At least when I snark about being able to do something in my mods that you can't in vanilla, I'm up-front with it.