Bay 12 Games Forum

Please login or register.

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

Author Topic: Snake Fortress: A learning project  (Read 2796 times)

ViolinAnon

  • Bay Watcher
    • View Profile
Snake Fortress: A learning project
« on: July 29, 2014, 05:15:29 pm »

Hello!
I have been trying to get started in the wonderful world that is DF modding for a few days, and thought that doing a large project like this one would help me learn a bit of everything, while also possible contributing to this great community we have here.

The most basic goal of this little project will be to add a new playable civilization to the game, Snakemen. (Placeholder name)
The reason I created this thread is that... Well, I will most likely need a lot of help to create all of this, and rather than make a new thread (Or spam the modding questions thread) everytime I need help with something, I'll have it all over here in the same thread. It will also help me keep things organized and will let people who are interested in the mod (If there is any) follow its progress.


TO-DO LIST
Spoiler (click to show/hide)


I hope this is the right place to make the thread, and that it'll interest people enough so that they are willing to help me.
Speaking of help... How would one go about modding in a new body type with a lower body that consists on only a tail?
Logged

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: Snake Fortress: A learning project
« Reply #1 on: July 29, 2014, 05:54:35 pm »

Body parts aren't too hard. The important thing to remember is that the order that body parts are listed in are important, though the order depends on any reliance that body parts have. For example, hands are connected to lower arms and rely on them as anchors of sorts. If the hand is defined before the lower arm, then it will not be able to find the arm, and will be unable to connect the hand.

It helps to visit the wiki, so I'll drop a link to the body tokens here. I find that it also helps to look at pre-existing objects in the raws to compare the work-in-progress to.

A new body part can be started with the tag [BODY:ID], with the letters ID being whatever you want the ID of the body to be called. The ID can be anything you want, so long as the ID is unique, and not shared by any other object of its type.

The easiest possible way that I can think of to make the body you want would be to take the pre-existing HUMANOID_LEGLESS or HUMANOID_LEGLESS_NECK and create a copy of it that alters the lower body.

As an example, here is the default legless humanoid body:
Spoiler (click to show/hide)

And here is an altered variant where the lower body is a tail:
Spoiler (click to show/hide)

[BP:ID:singular name:plural name] is the tag used to start a part of a body. The changes I made were mainly to the tail. I changed the upper body's name to torso, and the lower body's to tail. The tail also has [STANCE], which means that it is used by the creature to stand, and [LIMB], which should allow the part to be used in wrestling, like arms can.
« Last Edit: July 29, 2014, 06:00:40 pm by BlackFlyme »
Logged

Nil Athelion

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #2 on: July 29, 2014, 07:14:37 pm »

This looks all quite doable... except for eggs, last I recall.  However, I think something egg-related happened in the latest update, so it might be best to look around or do science on this yourself.  It would be embarrassing for them to not be able to have children, also embarrassing if they had a habit of eating said eggs.

Also, find the tissue layers for reptiles and work from there.  Or maybe just reference them.  Custom tissue-layers for a gecko-like civ I was making was definitely the worse part of body-making.

I look forward to natural weapons of venomous biting and tail-whipping.
Logged

ViolinAnon

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #3 on: July 29, 2014, 07:29:02 pm »

And here is an altered variant where the lower body is a tail:
Spoiler (click to show/hide)

[BP:ID:singular name:plural name] is the tag used to start a part of a body. The changes I made were mainly to the tail. I changed the upper body's name to torso, and the lower body's to tail. The tail also has [STANCE], which means that it is used by the creature to stand, and [LIMB], which should allow the part to be used in wrestling, like arms can.

Thanks a lot for the tips and details, I'll most likely be using that, and change the size of the tail to make it bigger. (Around 1500, probably)

This looks all quite doable... except for eggs, last I recall.  However, I think something egg-related happened in the latest update, so it might be best to look around or do science on this yourself.  It would be embarrassing for them to not be able to have children, also embarrassing if they had a habit of eating said eggs.

Also, find the tissue layers for reptiles and work from there.  Or maybe just reference them.  Custom tissue-layers for a gecko-like civ I was making was definitely the worse part of body-making.

I look forward to natural weapons of venomous biting and tail-whipping.
Oh, right. Actually forgot about that. Well, I can just say they're ovoviviparous, which means eggs that hatch inside of the mother's body, and be done with it.
As for the tissue-layers, that's pretty much what I'd have went for. I'll look to see what cave crocs are made of and take it from there, or take similar.

I'm also really curious about how the game's AI will make them fight. Tail slams, and hopefully constriction would be really nice.
Logged

Nil Athelion

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #4 on: July 29, 2014, 07:38:06 pm »

I can't find any science saying you can't get them to lay eggs, so you should try to find out.

In the mean time, I've modded my dwarves by replacing [MULTIPLE_LITTER_RARE] with the egg-laying stuff with pythons.  Unfortunately, this seems like somethign that will take a while to test, since I actually have to sustain fortresses.

EDIT: Okay, so modded dwarves do lay eggs.

Currently I have a stack of 21 dwarf eggs and a stack of 11 dwarf eggs, both in a barrel.  I made a separate stockpile for them right next to a new kitchen, but they have not been cooked yet.  They also don't turn up on the kitchen cook/brew page.

I noticed that dwarves will take dwarf-eggs away from the nest box, so I staked out the egg box and did a bit of forbidding on the next stack of eggs laid there.  (By Inod Nokgollibash.)  So far, Inod has not stayed on the nest box, but instead keeps returning to it.  I don't know if the eggs are still viable.  I think a chicken lay eggs in the next while Inod was away, but I'm not sure - someone was definitely carrying eggs away from the nest box and Inod's eggs are still there, but no verification.  If Inod hatches 26 dwarf  babies, it will be very fun.
« Last Edit: July 29, 2014, 08:08:46 pm by Nil Athelion »
Logged

Tabithda

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #5 on: July 29, 2014, 08:08:29 pm »

Regarding egg laying for sentient creatures, Greiger's custom race that he plays with lay eggs and he has posted about his experiences with egg laying in this post and this post.

Futhermore NW_Kohaku made a "snakeman" like race a few years ago, which he posted in this thread(which included a tail slam attack).  Perhaps you could make some use of it in your endeavor?
Logged

Nil Athelion

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #6 on: July 29, 2014, 08:20:11 pm »

Looks like Greiger's findings match up with my experiences thus-far almost perfectly.  No way to tell whether Inod's eggs are duds or not (she does have a husband).

Looks like eggs are a go.

Also, it looks like most of Greiger's micromanaging isn't strictly necessary, just useful for his race acting the way he or she wants it to act.


Meanwhile, it looks like turning into a baby is now unnecessary: http://www.bay12forums.com/smf/index.php?topic=141206.0

That might be relevant to avoid the "mother drops task and crosses map to pick up newly-hatched young at the next box" occurrence.


Further science to be done:  Do mothers prefer roosting to idle-training in the militia?  Do they prefer it to grazing in a pasture?  What is the hierarchy of idlish tasks?
« Last Edit: July 29, 2014, 08:22:29 pm by Nil Athelion »
Logged

ViolinAnon

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #7 on: July 29, 2014, 08:58:59 pm »

Well, I'm putting the egg laying on the backburner for now. When everything is said and down, I'll mess around with it to see how viable it is. But for now, I'll focus on making the basic stuff down. I've copied the RAWs from the Dwarf entry and going line-by-line to see what I need to change and what I need to keep.
I'm now on this part:
Code: [Select]
[BODY:HUMANOID_NECK:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:TONGUE:FACIAL_FEATURES:TEETH:RIBCAGE]
And wondering exactly what I need to do.
I'm guessing it should look like this?
Code: [Select]
[BODY:HUMANOID_SNAKE:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:MOUTH:TONGUE:FACIAL_FEATURES:TEETH:RIBCAGE]Basically just removing the toes and changing the body to the one made earlier?
Although, I probably need to change the teeth to add fangs and make it easier for them to inject venom with bite attacks.

EDIT: Gonna be using FORKED_TONGUE and GENERIC_TEETH_WITH_FANGS instead of their counterparts in the above code.
« Last Edit: July 29, 2014, 09:40:15 pm by ViolinAnon »
Logged

Nil Athelion

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #8 on: July 30, 2014, 01:13:37 am »

I don't think that HUMANOID_SNAKE exists as a body part yet, so you'd have to make that instead.

Remember, all this does is call things from the body_default text.  Look through there, and find what things you want to have as part of the body.

My recommendation is to do as is done for the King Cobra Men/Women and the Python Men/Women and use HUMANOID_LEGLESS (which, unsurprisingly, is a human without legs) and... ...looking through the body_default text... this thing:

Spoiler (click to show/hide)
As you  can see, it connects to the lower body, you can stand on it, it has the category of tail, and has a size.   Be sure to read through body_default.txt for all the goodies in there.

My advice, to avoid the pitfalls that I had, is to use everything from the default files, and then modify from there within your creature's file.  So instead of making a body plan txt with [BODY:TAIL_GRASP_STANCE] because you want them to be able to pick up things with their tails, just build that inside of your creature.  One file makes things nice, you'll probably have more (civ! custom weapons!), but juggling a bunch was certainly a pain for me.


Also, I assume you read this, but:

Spoiler (click to show/hide)
So your snake people will need clothing for their lower body and clothing for their stance body part (assume tail).  Not sure if there's a clever way around that.  Hilarity ensues for multiculturalism.
« Last Edit: July 30, 2014, 01:25:06 am by Nil Athelion »
Logged

ViolinAnon

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #9 on: July 30, 2014, 01:52:47 am »

No worries there. HUMANOID_SNAKE was the first thing I made, by using HUMANOID_LEGLESS and changing a few things.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Snake Fortress: A learning project
« Reply #10 on: July 30, 2014, 02:25:45 am »

Also my Genesis Reborn mod has Serpentfolk (snakemen) race, you can see if you can get something useful from that. It also has tiles I've made which can be useful if you want to make a graphical version.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Snake Fortress: A learning project
« Reply #11 on: July 30, 2014, 01:24:25 pm »

Posting to watch this thread.  I'd like to help out as I can but want to make sure this thread shows up under new replies, so I don't forget after work. :)
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Snake Fortress: A learning project
« Reply #12 on: July 30, 2014, 02:02:02 pm »

This looks interesting :)

Feel free to lift anything you want/find useful from Rubble (see sig).
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

locustgate

  • Bay Watcher
    • View Profile
Re: Snake Fortress: A learning project
« Reply #13 on: July 30, 2014, 02:38:38 pm »

One of the problems with egg laying entities is they still require a nest box, at least last df2012
Logged

TomiTapio

  • Bay Watcher
  • OldGenesis since 2012
    • View Profile
    • My Flickr animal photos
Re: Snake Fortress: A learning project
« Reply #14 on: July 30, 2014, 05:26:29 pm »

A creature speed helper text file by me, with real-world animal speeds: helps you decide the walk swim crawl speeds for your lizardmanly race.
"DF_" names are vanilla DF speeds.
burst means short term top speed, and apparently Toady uses that one (human burst 39 kph, human sustained 8.8-18 kph)

Spoiler (click to show/hide)
Logged
==OldGenesis mod== by Deon & TomiTapio. Five wood classes, four leather classes. Nine enemy civs. So much fine-tuning.
47.05e release: http://dffd.bay12games.com/who.php?id=1538
OldGenesis screenshots: https://twitter.com/hashtag/OldGenesis?src=hashtag_click&f=image
My Finnish language file: http://dffd.bay12games.com/file.php?id=14884
Pages: [1] 2