Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Hi-ho, hi-ho, it's off to mod I go....  (Read 3002 times)

orius

  • Bay Watcher
    • View Profile
Hi-ho, hi-ho, it's off to mod I go....
« on: July 27, 2012, 02:24:21 am »

After several failed starts, I think I'm about ready to do some serious DF modding.

The modifiable nature of DF has always been interesting to me.  People often say DF has a high learning curve, but I've never found it to be the case; rather I think the modding is the serious learning curve.  Or if DF has a steep learning curve, then DF modding is a sheer cliff a thousand feet high.  In any case, I've been having some trouble wrapping my head around the basics, but I think I understand them enough to start playing with things now.

The first mod I played with was the Dig Deeper mod in late 31.25.  There was some interesting stuff in there and it gave me my first ideas of what could possibly be done with modding.  I was running a big vanilla fort though, and I didn't want to simply abandon it.  So I waited until 34.02 came out (waiting for stuffs like Therapist and DFHack) and then tried to use the mod to make a new fort, but it wasn't compatible and the game crashed when the humans came to trade.

So I thought about trying to mod myself instead of just adding new material.  The first thing that came to my mind concerned custom workshop reactions, I thought it should be possible to have the dorfs make bread in the kitchen.  I checked the wiki for info on custom reactions, but I wasn't sure how to tell the game to make a bread item.  Checking here, I noticed at least both Genesis and Masterwork had a bake bread reaction, very similar to what I thought was the right way of doing it.  The one thing that had me confused was the output, both mods used the same code (I'm guessing from a common source somewhere), but told the game that the bread was a type of cheese (the more I see dwarf cooking, the less I want to experience it for myself :P).  I assumed from that that modding can't create an item type from scratch, but it has to be related to something in the game already.  So I simply copied the code into a new file, genned a new world to test it...and nothing happened.  I tried several times, and confirmed it worked in MW with a quick test, but I couldn't figure out what I was doing wrong, so I ditched it.

So about two weeks ago, I was playing around a bit with adventure mode, and read on the forums here that I could give non-human sites human-like cities by adjusting a few lines in the code.  I did that, but I noticed the entity file had a whole bunch of lines that read [PERMITTED_REACTION:...].  My jaw dropped; apparently this is what I was doing wrong, I need to tell the game that dorf civs can bake bread.  So I put in the new line of code...and nothing happened again.  I took another look through the raws, and found that I needed to adjust all the plants that make flour so that game knows the flour can be used to make bread.  Did that and tested it again, this time the kitchen did allow for bread baking, but it was all coming out as cave wheat plant, whip vine plant, etc.  I haven't fixed this problem yet, but I think I'm supposed to add a material template for the bread too.  In the meantime, I ran a Masterwork fort to get some more practical experience in seeing what I can do with mods, and it gave me some ideas of what I can do with modding.

So, I haven't gotten around to getting bread off the ground yet, but I've already added some custom content.  I'm starting off with the Black Powder Firearms mod, and I'm going to add stuff from the Flora and Fauna mod.  I don't want to use everything from Flora and Fauna though.   I'm mostly satified with the vanilla selection of normal animals, though I did add various extinct stuff like mammoths, smilodons, terror birds, etc. for some interesting additions to savage areas.  I'd really like to add some dinosaurs as well (I'd prefer this stuff over the hordes of useless animal people for savage areas, to give them a kind of lost world feel), but the only ones I've seen are the sauropods and raptors in Masterwork, and that mod has an altered body plan, so I'm fairly certain I can't just copy that stuff into my raw folder and get it to work properly.  I checked a while back, but it didn't seem like there were a lot of serious attempts to add dinos in the 31.x days.

The plants are good, but I want to check them carefully to see what their uses are, and eliminate stuff that's very similar or which has limited use (i.e. food only).  Also, I want to make my own underground plants.  There doesn't seem to be anything wrong in particular with the Flora and Fauna underground stuff, but there's a certain logic I want to go with for new underground plants.  Vanilla underground plants are pretty simple and work like this:
  • Plump helmets, the basic dorf staple, grows year-round and can be used for food and drinks.
  • Sweet pods grow in the spring and summer and can be used for drinks and cooking ingredients.
  • Cave wheat grows in the summer and autumn and can be used for drinks and cooking ingredients.
  • Pig tails also grow in the summer and autumn and can be used for drinks and thread.
  • Quarry bushes grow in every season except winter and can be processed into cooking ingredients.
  • Dimple cups grow year round but are only used for dye.

So what I want to to is add new underground crops that can be grown in different seasons or even year round to cover certain gaps.  I want to have new crops fron the second layer that grow in different seasons to facilitate crop rotation (I've already replaced summer with winter on cave wheat for this), and have stuff in the third layer that either grows year-round or has seasons but is more valuable.  I don't want to simply copy and tweak the stuff in Flora and Fauna though, because it has a few new plants for cavern 1, and I don't want to just take someone else's work and rewrite it.  Similarly, in Masterwork each cavern layer has different types of grass, so I've added some different grass types for each layer so they look different, layer one is now greens and browns, layer two is bluish, and layer three is reds and purples.

I've seen how some modders have altered the item_food raw to add new types of meals, but I don't want to take this approach.  I got my first look at it back under Dig Deeper, but it really didn't add anything to the game, it just gave new names to biscuits, stews, and roasts but the stuff was just 2, 3 and 4-food meals.  I think instead I'll borrow stuff like boiled eggs and sausages from Masterwork, and have the dwarves use raw materials like this to make more elaborate types of food.  After seeing how the bread reaction worked, I wondered if it was possible to have the dorfs bake pies by using flour and either meat or fruit.  And not stop there either if I can, maybe have them make all sorts of things like pastries, cakes, cookies, and so on (even if they end up thinking everything is cheese :) ).  Let them churn butter from milk for another type of ingredient.  A reaction to make blood pudding to give a use to all those blood barrels the merchants like so much.  Maybe even have them make haggis, which seems kind of dwarfy to me.  Then after that, have them combine the stuff into prepared meals.  I might change the meal names to things like dinner or feast or something, to better reflect what I'm doing with it.

Another thing from Masterwork that got my attention is reduced item types to improve FPS.  I've already tweaked the inorganic_stone_gem raw, combining a lot of the similar gem types into a single generic type, so all the stuff like opals, agates, garnets, and zircons have been reduced.  I then reorganized the raw and alphabetized them under each value group to make the stockpile lists easier to use.  The end result was few gem types to plow through, but enough for some variety.  Then I added amazonite to the raw, it's gem-quality microcline, and since just about every single map I do seems to have a fuckton of microcline I figured why not?  I just took the code for sunstone, changed the colors and names and told it to spawn only in microcline clusters and it seems to work.  I still need to work on the tourmalines, they have a lot of different colors and I'm not sure which to go with for a generic tourmaline.  I want to adjust sapphires and rubies too, right now they only appear in bauxite which I don't run into a lot, and this seems to make them a bit too rare for my taste.  I'm thinking of adding corundum mineral veins for them to spawn in, much like how diamonds appear in kimberlite veins, but I need to figure out the mineral raw so it works properly.

Other items I want to reduce like this are leather and wood.  I don't really need all the different types of leather clogging the game like they do right now.  I'm thinking of doing it like this, a basic leather type for hides from common domestics and the like that functions like leather does now.  Then an exotic leather category for the higher value stuff that comes from predators and the like which is the same as normal leather but more valuable.  Finally a thick leather category for stuff from animals like elephants, rhinos, dralthas and the like which are big and have thick tough hides, this stuff will have better stats than normal leather.  I don't want leathers that are as good as or nearly as good as metals though.  As for wood, the rough wood from Masterwork helps simplify a lot of things, though I think I'd like to go with two categories of generic wood, hardwood and softwood.  Softwood should be easier to work with, but hardwood should be better for making charcoal, but I'm not sure how to do this or if it can be done.  Also, I want to keep woods with special properties like featherwood or nether-caps in place.

I don't want to go too overboard with civilizations but there's a few things I want to add.  For another friendly trading race, I want to add in some hobbits.  I'm going to put them somewhere inbetween elves and humans with their goods, so it'll be something like no metals, but they'll have meat and leather.  I'll just have them use human-like villages and towns for their sites. 

For enemies there's a couple of things I want too.  I don't want to add orcs, they really don't feel like they'd be different enough from the standard goblins.  I want lizardmen, and I think LFR has them.  I also want minotaurs and some kind of giants that will attack in small groups, and it looks like Fortress Defense's minotaurossi and jotunar might be along the lines of what I'm looking for.  They're also supposed to be some of the hardest monsters in the mod, so I'm worried they might be a bit too hardcore as is.  Though with the giants, it would be cool if there'd be stuff like fire giants and frost giants occasionally mixed in (maybe depending on seasons and biomes).  Drow might be good as enemies, but underground civs right now are kind of a big meh.  I've got a map that has some fish men just standing around doing nothing interesting.  I might have them show up occasionally in small raiding parties (spawning like regular creatures) or maybe have them send ambushes, I need to see how entites and creatures work before I do this.

Anyway, that covers some the stuff I'd like to experiment with.  I think I should be able to do most of it on my own without too much trouble.
Logged
Quote from: ThatAussieGuy
That is an insane and dangerous plan.  I approve wholeheartedly. 


Fortressdeath

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #1 on: July 27, 2012, 04:23:52 am »

As far as I've seen, this is the easiest game to mod I've ever seen. I've modded Warcraft III, Unreal Tournament, and Fallout 3, and this is by far the easiest of all. Just because it's text doesn't mean it's hard. Food stuff is undoubtedly the hardest part, weirdly enough.
« Last Edit: July 27, 2012, 04:25:36 am by Putnam »
Logged

Replica

  • Bay Watcher
  • Temp. leave of absence
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #2 on: July 27, 2012, 08:16:34 am »

I am 99.99% sure that you haven't modded another game extensively before prior to Dwarf Fortress.

Saying that DF raw modding has a step learning curve compared to most other games is utter insanity to my eyes.
Logged
Quote from: tahujdt
I don't know about unicorns, but back in .95, one of my PA soldiers was diagnosed with power armor. I drew a fairly good picture about it, but my science project (a bunny) pissed all over it.
Fallout: Equestria - Index of Stable Reports x Fallout: Equestria - Orange

orius

  • Bay Watcher
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #3 on: July 30, 2012, 02:34:54 am »

No, I haven't done a lot of modding; most of my gaming tends to be limited to consoles which are more accessible to me.  Most of what I've done is mostly play around with things like level/map editors and the like which isn't really hardcore modding anyway.  That sort of thing probably needs things like new models to be built for game graphics and the like, and I don't have the artistic skill for that.  By comparison DF is easier, but there's still all the various tokens to keep track of, which was my big stumbling block.

So food is one of the hardest things to mod, huh?  Naturally I take my usual approach and dive headfirst into it at the start.

Anyway, I made the hobbit creature I wanted, and it looked like it worked alright in the arena, and I think I managed to make a working civilization for them, they started popping up in Legends mode and doing stuff (one killed a forest titan), and they appear on the embark screen in dwarf mode.  Now I'm going to make a language for them with DFLang using typical hobbit names, just hope the program doesn't think that dildo is a perfectly cromulent hobbit word.   :P
Logged
Quote from: ThatAussieGuy
That is an insane and dangerous plan.  I approve wholeheartedly. 


Fortressdeath

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #4 on: July 30, 2012, 07:59:28 pm »

Let me say that, in my eyes, you just volunteered to make the hobbits for the middle-earth mod >:D

PrimusRibbus

  • Bay Watcher
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #5 on: July 31, 2012, 12:33:55 am »

People often say DF has a high learning curve, but I've never found it to be the case

Glad I'm not the only one that feels this way. I'm of the opinion that DF has poor documentation, not a steep learning curve. I used the Wiki to learn the game and it was very accessible.

/offtopic
Logged
grammar is for essays and letters and second FREEDOM TO POST except obscene material
THE ONLY THING THAT'S GONNA GRIND IN THIS GAME IS YOUR ASS ON THE PAVEMENT

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #6 on: July 31, 2012, 12:35:20 am »

Poor documentation and a UI made by a programmer.

mastahcheese

  • Bay Watcher
  • Now with 20% less sanity and trans fat!
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #7 on: September 01, 2012, 12:57:45 am »

I've found this to be the easiest game by far to mod, I still can't mod Warcraft 3 worth anything, I know I've tried, and I just learned it all from Toady's handy notes in various files and the many mountains of wiki pages, along with ample time and a never ending patience at watching freshly modded dwarves bleed "dwarf alchohol" for a while.

When in doubt, !!Experiment!!, that's the best way I've ever figured out how to mod in DF.
Logged
Oh look, I have a steam account.
Might as well chalk it up to Pathos.
As this point we might as well invoke interpretive dance and call it a day.
The Derail Thread

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #8 on: September 01, 2012, 04:26:41 am »

The difference with DF is that you don't have to learn to code, you just tweak values and the game magically reads them. One of the best in-built parsers I'd say.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Joben

  • Bay Watcher
  • Elder Thing
    • View Profile
    • Lazy Lizard Gear
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #9 on: September 01, 2012, 11:43:49 am »

I am 99.99% sure that you haven't modded another game extensively before prior to Dwarf Fortress.

Saying that DF raw modding has a step learning curve compared to most other games is utter insanity to my eyes.

I've modded a few other games. I wouldn't say DF is the hardest, but I've seen easier to get into.

For example i've written fairly long scripts for Oblivion and found it almost intuitive.
But DF's thousands of tags, arcane strings of arguments and missing chunks of documentation give me a headache.

LOCAL_CREATURE_TEMPLATE:10:15:BODY_SIZE:USE_PYTHAGORIAN_THEORUM:42:CREATURE_MAT:FLAG_SECRETION:YARD_PENALTY:DELAY_OF_GAME:5

 :-\

True fact, that's the incantation for making a creature icon brown. ;)
Logged
Broken Arrow - A small stats tweak to fix unrealistically overpowered arrows and bolts.

My RTD games: Roll To Raptor (On hold), Dino Arena

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #10 on: September 01, 2012, 01:15:45 pm »

Or you could just use "CREATURE_COLOR:6:0:0" :P

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #11 on: September 01, 2012, 02:10:19 pm »

Quote
LOCAL_CREATURE_TEMPLATE:10:15:BODY_SIZE:USE_PYTHAGORIAN_THEORUM:42:CREATURE_MAT:FLAG_SECRETION:YARD_PENALTY:DELAY_OF_GAME:5
Actually not a single token is as complex is this.

People like to believe it's complex, so they see it complex. It's not.

Quote from: 'Sirio Forel'
You must see with your eyes
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #12 on: September 01, 2012, 02:13:44 pm »

But DF's thousands of tags, arcane strings of arguments and missing chunks of documentation give me a headache.
What missing documentation? The Wiki's Modding Category has literally something about 99.99% of the tokens that you will use. In fact if we are missing something it's usually because the thing in question doesn't have an effect, instead being a placeholder for future content. The resources are there, you just have to look for them. :P

And I've got to agree with Deon here, most of it's not complex at all, it just looks scary right at the beginning. And for the parts that are complex you can usually just cut and paste them from creature to creature (tissues and material tokens are virtually identical for most fleshy creatures, for example), with the only real complex thing coming into play when you are trying to create extremely unique things.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Joben

  • Bay Watcher
  • Elder Thing
    • View Profile
    • Lazy Lizard Gear
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #13 on: September 01, 2012, 04:20:22 pm »

A couple people apparently are unfamiliar with hyperbole.

This is a kinda silly discussion for the most part now that I think about it. People telling each other what they do or should find challenging is pointless at best.

But just for the sake of clarification I have a couple concrete examples I was thinking about when I wrote the above.

Maybe it's there, but I haven't found it. Nothing on the wiki seems to explain anything about BY_CATEGORY, BY_TYPE, BY_TOKEN. ...Which seem to be basic functions for defining what happens where on a creature.
Logged
Broken Arrow - A small stats tweak to fix unrealistically overpowered arrows and bolts.

My RTD games: Roll To Raptor (On hold), Dino Arena

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Hi-ho, hi-ho, it's off to mod I go....
« Reply #14 on: September 01, 2012, 04:26:13 pm »

It's explained right here.

To give an example:

Code: [Select]
[BP:UB:upper body:upper bodies][UPPERBODY][CATEGORY:BODY_UPPER]
[DEFAULT_RELSIZE:1000]

Here, UB is the token used in BY_TOKEN, UPPERBODY is the type used in BY_TYPE, and BODY_UPPER is the category used in BY_CATEGORY.
Pages: [1] 2