Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: IndigoFenix on May 07, 2014, 05:38:42 pm

Title: Pantheon Script (alpha released)
Post by: IndigoFenix on May 07, 2014, 05:38:42 pm
This mod adds a new dimension to the game: making the gods get up off their lazy bums and do something.

You build an altar in fortress mode, consecrate it to a god worshiped by your civilization, and then pray or sacrifice items to improve your merit and increase the belief level of your citizens.  When your merit and belief is high enough, the god may intervene on your behalf.  Every sphere will have a different effect on gameplay, so choose your idols with care.  A god of metals may increase your smelting efficiency, while a god of agriculture may increase crop yields, a god of chaos may cause your enemies to fight among themselves, and a volcano god is likely to be a lot of !!fun!!

It's still pretty experimental right now.  Not all gods have a logical effect, but many do.

To install it, place the building_pantheon and reaction_pantheon files into the raw folder, copy and paste entity_pantheon_clip into your entity file, and place pantheon.lua into the dfhack scripts folder.  The script must be running in order to work.

0.1 alpha: The altar building, consecration, prayer, and sacrifice reactions are active.  Some spheres are active.  If nothing else, all deities can smite enemies by slamming them into the ground.

Download Link (http://dffd.wimbli.com/file.php?id=8684)

Spoiler: Existing effects (click to show/hide)
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Putnam on May 07, 2014, 05:42:35 pm
df.sphere_type[num] is what you want for finding sphere strings based on numbers. For example, df.sphere_type[2] is ART.

Information found here (https://github.com/DFHack/df-structures/blob/master/df.history.xml) by ctrl+f "sphere", with this line:

Code: [Select]
<enum base-type='int16_t' type-name='sphere_type'/>
meaning that there's an enum of sphere types which can be accessed with df.sphere_type. df.sphere_type['ART'] will come up with 2 as well.
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: IndigoFenix on May 07, 2014, 05:44:52 pm
Excellent.
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Meph on May 07, 2014, 05:57:39 pm
If you want people to make suggestions about different spheres, I would suggest posting a list of all spheres first. :)
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Putnam on May 07, 2014, 05:58:56 pm
https://dwarffortresswiki.org/index.php/DF2012:Sphere
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Meph on May 07, 2014, 06:09:40 pm
That list is longer than I remembered. How many effects per sphere are you planning to do?


I would single out the ones used in the dwarven entity file first, as a testrun. No need to work on spheres not used by civs that the player will never play.

You can also rename spheres with the string dump patcher from insolor. In case there are some you really dont want or really do want to add.
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Putnam on May 07, 2014, 06:10:16 pm
Dwarves use other spheres, they just prefer those ones.

EDIT: Also, I would not rename spheres. That'd be like changing [MEGABEAST] to [NASTY_THING]. No real point to it, breaks compatibility with other things.
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Maul_Junior on May 07, 2014, 07:15:39 pm
.....after glancing through the list I am very interested to see what you do with the Lust sphere.

heh.
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Warmist on May 07, 2014, 11:16:03 pm
Long ago i started an idea like this. Unfortunately laziness happened, so salvage what you want: my ideas (https://docs.google.com/spreadsheet/ccc?key=0Ah3wIUIV9xPrdHlCSFFWY3l0VmdnV284S0ZrSDRKM0E&usp=sharing)
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: IndigoFenix on May 08, 2014, 12:48:39 am
Long ago i started an idea like this. Unfortunately laziness happened, so salvage what you want: my ideas (https://docs.google.com/spreadsheet/ccc?key=0Ah3wIUIV9xPrdHlCSFFWY3l0VmdnV284S0ZrSDRKM0E&usp=sharing)

Using statues and figurines for something could be interesting.  Everything works through abstract persistent variables though, so no need to affect the actual god's historical figure.  There is a sliding scale for a god's "realness" based on how many believers there are in a fort and how often they are worshiped.  Belief for a given unit is an integer value between 1 and 100, raising this by one every time they do a service could allow you to increase overall belief in a particular deity.  Creating new, 'fake' gods is possible, but for now you'll need at least one citizen believing in a god already before it can be worshiped (this also means that the effects of prayer will be greatly affected by your civ's associated religion spheres).

That list is longer than I remembered. How many effects per sphere are you planning to do?

Several - there should be at least one 'good' effect and one 'bad' effect, and some effects based on specific situations such as invasions.  But, there will be a lot of overlapping.  Spheres with 'friend' relationships will be very similar for the most part.

.....after glancing through the list I am very interested to see what you do with the Lust sphere.

Interestingly, LUST is only associated with DEPRAVITY, which itself is only notable as being one of the spheres opposed to LAWS (the others being CHAOS, MURDER and THEFT), suggesting that in DF at least, LUST is basically a sphere related to illegal activities.  Now what effects could come from that...?  No idea!
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Warmist on May 08, 2014, 02:05:56 am
Not sure if you noticed the second page in the doc. It's a start to sphere effect brainstorming...
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: IndigoFenix on May 08, 2014, 04:01:07 am
Not sure if you noticed the second page in the doc. It's a start to sphere effect brainstorming...

I saw it.  It's a good start.
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Meph on May 24, 2014, 03:28:04 pm
How is it going?
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: IndigoFenix on May 24, 2014, 04:23:27 pm
Oh, I nearly forgot about this one!  Too many projects going on - I haven't done anything on this for a while.  I have the framework but none of the actual effects.  So, uh, hiatus until further notice?
Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: Meph on May 24, 2014, 04:42:44 pm
Oh, I nearly forgot about this one!  Too many projects going on - I haven't done anything on this for a while.  I have the framework but none of the actual effects.  So, uh, hiatus until further notice?
I had a hunch, which was the reason to slightly prod this thread with a stick. "Its not moving, maybe its dead..." *touch

Title: Re: Putting the Pantheon to Work (collecting ideas)
Post by: IndigoFenix on May 25, 2014, 02:30:07 am
It'll be revived.  I'm just busy at the moment.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on June 20, 2014, 09:01:58 am
Revived!

An alpha version has been released.
Title: Re: Pantheon Script (alpha released)
Post by: palu on June 20, 2014, 12:16:29 pm
I get this error when I run the script:
Code: [Select]
...ents\Downloads\df_34_11_win_r5\hack\scripts/pantheon.lua:6: module 'fov' not
found:
        no field package.preload['fov']
        no file 'C:\Documents and Settings\Paul\My Documents\Downloads\df_34_11_
win_r5\hack\lua\fov.lua'
        no file 'C:\Documents and Settings\Paul\My Documents\Downloads\df_34_11_
win_r5\hack\lua\fov\init.lua'
        no file '.\fov.lua'
        no file 'C:\Documents and Settings\Paul\My Documents\Downloads\df_34_11_
win_r5\fov.dll'
        no file '.\fov.dll'
stack traceback:
        [C]: in function 'require'
        ...ents\Downloads\df_34_11_win_r5\hack\scripts/pantheon.lua:6: in main c
hunk
        (...tail calls...)
DFhack r5, Windows
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on June 21, 2014, 01:10:27 pm
I get this error when I run the script:
Code: [Select]
...ents\Downloads\df_34_11_win_r5\hack\scripts/pantheon.lua:6: module 'fov' not
found:
        no field package.preload['fov']
        no file 'C:\Documents and Settings\Paul\My Documents\Downloads\df_34_11_
win_r5\hack\lua\fov.lua'
        no file 'C:\Documents and Settings\Paul\My Documents\Downloads\df_34_11_
win_r5\hack\lua\fov\init.lua'
        no file '.\fov.lua'
        no file 'C:\Documents and Settings\Paul\My Documents\Downloads\df_34_11_
win_r5\fov.dll'
        no file '.\fov.dll'
stack traceback:
        [C]: in function 'require'
        ...ents\Downloads\df_34_11_win_r5\hack\scripts/pantheon.lua:6: in main c
hunk
        (...tail calls...)
DFhack r5, Windows

Odd.  I don't get that error.  But it shouldn't make any difference, since fov isn't actually used.
Title: Re: Pantheon Script (alpha released)
Post by: palu on June 21, 2014, 01:42:09 pm
What DFHack version are you using?
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on June 21, 2014, 02:08:10 pm
Whichever one comes with Masterwork.
Title: Re: Pantheon Script (alpha released)
Post by: palu on June 21, 2014, 02:13:13 pm
That's r4. I'm using the new r5. You might want to test it in that.
Title: Re: Pantheon Script (alpha released)
Post by: Endovior on June 29, 2014, 11:29:58 am
Since Meph pointed this out in the masterwork updates thread, and in particular pointed out that you were looking for sphere suggestions, I've gone and made a bunch of suggestions.  All spheres from A-I now have something suggested for them.  Asterisks indicate my suggestions, as opposed to your (already implemented?) ideas.

Spoiler (click to show/hide)
Title: Re: Pantheon Script (alpha released)
Post by: Snaaty on June 29, 2014, 03:07:44 pm
I'm just here to say that this is a really awesome idea. And thank you IndigoPhoenix for working on it. I will try to contribute something as soon as I am not busy with work anymore.
Title: Re: Pantheon Script (alpha released)
Post by: lightstar on June 30, 2014, 02:14:19 am
This mod adds a new dimension to the game: making the gods get up off their lazy bums and do something.

You build an altar in fortress mode, consecrate it to a god worshiped by your civilization, and then pray or sacrifice items to improve your merit and increase the belief level of your citizens.  When your merit and belief is high enough, the god may intervene on your behalf.  Every sphere will have a different effect on gameplay, so choose your idols with care.  A god of metals may increase your smelting efficiency, while a god of agriculture may increase crop yields, a god of chaos may cause your enemies to fight among themselves, and a volcano god is likely to be a lot of !!fun!!

It's still pretty experimental right now.  Not all gods have a logical effect, but many do.

To install it, place the building_pantheon and reaction_pantheon files into the raw folder, copy and paste entity_pantheon_clip into your entity file, and place pantheon.lua into the dfhack scripts folder.  The script must be running in order to work.

0.1 alpha: The altar building, consecration, prayer, and sacrifice reactions are active.  Some spheres are active.  If nothing else, all deities can smite enemies by slamming them into the ground.

Download Link (http://dffd.wimbli.com/file.php?id=8684)

Spoiler: Existing effects (click to show/hide)

I really love this idea. Reminds me of the way Gods work in Emperor: Rise of the Middle Kingdom and ADOM.

What do you think of introducing some negative effects as well?
1. Always turned on: You have to build an altar and make some offerings - otherwise the God will be angry with you.
Starting value could be set to Happy to provide some help in case a new fort needs it

2. Is there some way in which the user / fort can ASK for direct intervention (ADOM-style). this could be useful in a pinch for attacks / seiges and also provide a economy-oriented method of defense by requiring the user to sacrifice substantial amounts of goods, etc.

You could also have settings so that negative effects from the Masterwork GUI (I understand that it is included there):
1. Only occur if the altar is built.
2. Never occur

This will keep everybody happy.

Otherwise, great idea and implementation.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on June 30, 2014, 04:44:35 am
I do plan on adding negative effects.  Basically, each god will have two stats: a power level (determining what they can do) and a happiness level (determining how much they want to help you).  Worship raises both; if you don't build an altar in the first place all gods will have a power level of 0 so they won't do anything, good or bad.  If you stop praying, they will get upset and harm you, but if you outlast the negative effects their power level will gradually wither away to nothing.

Of course getting the numbers balanced out will be tricky, but this is the plan.
Title: Re: Pantheon Script (alpha released)
Post by: Meph on July 01, 2014, 12:04:21 pm
I havent seen many effects ingame, but I wanted to ask if it is in any way harmful if I add extra products to the reactions.

The current ones you posted dont give any XP, so people pray and pray, and never get better at it. A few boiling rocks on it would help, but I dont know if that affects the reaction in any way. With spatter_add it would crash the game, while extra products on buildingupgrade run the script twice, so I wanted to make sure.

I would just add 100:1:BOULDER:NONE:INORGANIC:KNOWLDEGE_STONE, a harmless boiling rock I usually use for XP generation.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on July 02, 2014, 04:35:37 pm
I havent seen many effects ingame, but I wanted to ask if it is in any way harmful if I add extra products to the reactions.

The current ones you posted dont give any XP, so people pray and pray, and never get better at it. A few boiling rocks on it would help, but I dont know if that affects the reaction in any way. With spatter_add it would crash the game, while extra products on buildingupgrade run the script twice, so I wanted to make sure.

I would just add 100:1:BOULDER:NONE:INORGANIC:KNOWLDEGE_STONE, a harmless boiling rock I usually use for XP generation.

No, I don't think it would matter.  The only effect the product has is that if the first product is INORGANIC:NONE, the reaction will generate smoke when used.
Title: Re: Pantheon Script (alpha released)
Post by: Meph on July 02, 2014, 05:48:21 pm
Alright, I'll add some knowledge stones on it. :)

All spheres seems difficult to do btw, the wiki states that if I specifically add one sphere, the opposite spheres are automatically disabled. FIRE vs WATER for example, or LIGHT vs DARK. I just made no references to spheres at all in the entity file, just adding RELIGION:PANTHEON. Hopefully that makes humans worship all gods potentially.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on July 03, 2014, 02:50:16 am
If I understand correctly, those preclude relationships refer to the gods themselves, that is, you will never have a single deity associated with both fire and water, but a civ can worship both.  Giving no specifications should work too though.
Title: Re: Pantheon Script (alpha released)
Post by: Meph on July 03, 2014, 03:06:37 am
Quote
Choosing a religious sphere will automatically make its opposing sphere not possible for the species to have: adding WATER, for example, means the species will never get FIRE as a religious sphere
Title: Re: Pantheon Script (alpha released)
Post by: Meph on July 04, 2014, 05:53:21 am
I did ran 4 altars to 4 different gods, raised the merit high by using fastdwarf, so lots of praying gets done... after a while, I get these:

Code: [Select]
...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:463: attempt to inde
x global 'unit' (a nil value)
stack traceback:
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:463: in function 'getRandomUnit'
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1604: in function 'dailyEffect'
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1639: in function 'update'
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1652: in function <...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1652>
[DFHack]#
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on July 04, 2014, 07:56:27 am
I did ran 4 altars to 4 different gods, raised the merit high by using fastdwarf, so lots of praying gets done... after a while, I get these:

Code: [Select]
...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:463: attempt to inde
x global 'unit' (a nil value)
stack traceback:
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:463: in function 'getRandomUnit'
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1604: in function 'dailyEffect'
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1639: in function 'update'
        ...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1652: in function <...erworkDF V.5.10\Dwarf Fortress\hack\scripts/pantheon.lua:1652>
[DFHack]#

My mistake.

Just change the 'unit' in line 463 to 'u'.
Also in line 477.
Title: Re: Pantheon Script (alpha released)
Post by: Snaaty on July 04, 2014, 06:29:45 pm
I have been looking at my most recent Legends-World, and I noticed something. Many of the most well-knows monsters are associated with incredibly many spheres of influence. Now I am not sure if this also goes for deities, but if a deity actually had >30 Spheres, it could get kind of distracting, don't you think?
So, do deities also get that many Spheres?
If yes, do you plan to counterbalance the amount of effects somehow? (I think you already let many similar spheres give the same effect, so that's that.)
Title: Re: Pantheon Script (alpha released)
Post by: Meph on July 05, 2014, 03:44:54 am
I have been looking at my most recent Legends-World, and I noticed something. Many of the most well-knows monsters are associated with incredibly many spheres of influence. Now I am not sure if this also goes for deities, but if a deity actually had >30 Spheres, it could get kind of distracting, don't you think?
So, do deities also get that many Spheres?
If yes, do you plan to counterbalance the amount of effects somehow? (I think you already let many similar spheres give the same effect, so that's that.)
If you are talking about MDF, thats intended. I gave all megabeasts all spheres, so that they can appear as allies for all civs. It happens so rarely, I had to help them along a bit.

It doesnt affect gods, they have only a few spheres, I cant influence that anyway.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on July 05, 2014, 12:49:52 pm
I have been looking at my most recent Legends-World, and I noticed something. Many of the most well-knows monsters are associated with incredibly many spheres of influence. Now I am not sure if this also goes for deities, but if a deity actually had >30 Spheres, it could get kind of distracting, don't you think?
So, do deities also get that many Spheres?
If yes, do you plan to counterbalance the amount of effects somehow? (I think you already let many similar spheres give the same effect, so that's that.)

Deities won't get that many spheres.  If a deity has multiple spheres, it will randomly select one before performing an action.
Title: Re: Pantheon Script (alpha released)
Post by: Dunmeris on July 11, 2014, 09:57:11 am
You should continue work on this and add more spheres.

I would, but I'm way too intimidated by scripting.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on July 11, 2014, 10:07:02 am
You should continue work on this and add more spheres.

I would, but I'm way too intimidated by scripting.

I intend to do so, but probably not until DFHack is updated to 2014.  The most logical effects for many spheres would be to modify social behaviors, which is completely reworked for the new version, so why bother writing what will just break later?
Title: Re: Pantheon Script (alpha released)
Post by: arbarbonif on September 22, 2014, 06:33:51 pm
I ran into a problem where I seem to have a god with no spheres, which resulted in a massive number of nil errors.  I added
Code: [Select]
if spheres == null then spheres = {} end on line 58, which seems to have fixed it. (This is in the version in Masterwork)
Title: Re: Pantheon Script (alpha released)
Post by: Putnam on September 23, 2014, 12:47:16 am
"null" isn't really a thing in Lua. Conveniently enough, however, undeclared variables are equal to nil, so that works anyway, heh.

The canonical (if there is such a thing) way to do this AFAIK is
Code: [Select]
spheres = spheres or {}
Title: Re: Pantheon Script (alpha released)
Post by: chaosfiend on March 25, 2015, 05:56:32 am
Hey there Indigo, I love this mod, and especially its use in Meph's Masterwork mod. Is this still in development at all? Or is it on  hiatus for the time being? I do hope its not become a dropped idea.
Title: Re: Pantheon Script (alpha released)
Post by: IndigoFenix on March 25, 2015, 01:37:41 pm
Once Toady announced his intention of adding temples to the next version, I decided to put this on hold at least until then.