[SCENARIO] Dungeon Adventure - the 133rd K.R.A.G.

Lutefisk Mafia

Inscrutable Enforcer
Joined
Jun 15, 2007
Messages
544
Location
Minnesota
*** UPDATE ***

RELEASE 5 (TC01 Update) NOW UPLOADED!

NOTE: You must have Fall from Heaven II 0.41 with patch "j" installed to use this scenario!

NOTE: You must have the revised CvGameCore.DLL installed to use this scenario!

NOTE: This update was made possible by TC01, who kindly merged the mod into patch "j" and came up with a DLL fix for a new error!

Release 5 (TC01 update) uploaded on January 4, 2010.

*************


*** SPECIAL NOTE ***

Huge thanks to Kael for making favorable mention of this scenario in the last few minutes of Modcast #32! (which can be found here: http://polycast.apolyton.net/modcast/)

Your kind words are what motivated me to drag my head out of other projects and get this scenario merged into FfH2 0.41!

Moreover, huge thanks to TC01 for putting in the work to patch this mod up to FfH2 version 0.41j! It is his updates that are being released as Release 5.

******************


Welcome to Dungeon Adventure - the 133rd K.R.A.G.

This scenario was created for the FfH2 scenario design contest, and I was very honored to win! Release 5 (TC01 Update) has been merged with Fall from Heaven II 0.41j. (Release 1 was merged with patch "t" of 0.40, Release 2 was merged with patch "x" of 0.40, Release 3 was merged with patch "y" of FfH2 version .40, and Release 4 was merged with Fall from Heaven II 0.41)

Please note that this release ONLY merges DA-133rd KRAG to the most recent 0.41j FfH2 patched distributable. Nothing else has been changed in terms of coding or gameplay since version 3. I haven't had time to do that yet, but wanted to get this merge out so that people can play with it again!

The basic premise of the scenario is the story of a lowly Khazad guard, who fails catastrophicly in his duties. Instead of being exiled from the Clan, however, Lord Kandros Fir gives him a chance to redeem himself by drafting him into the service of the 133rd K.R.A.G. (Khazad Resource Acquisition Group).

The story takes place in the early days of the Khazad exodus (exile?) to the the Surface. At this time, the Khazad still have some holdings in the Underhome, and just starting to explore and colonize the Surface World.

Much of the material for this scenario has been invented from whole cloth, so conflicts with established lore are likely. This is one area in which feedback could be helpful!

Much of the material from my abandoned Dungeon Adventure modmod has been worked into this scenario. It has been a bit of a challenge to get some of it to work within the confines set by the scenario contest -- but I gave it a shot.

In any case, the files for the scenario are contained at the end of this entry, in a zip file.

The zip file is a zip of the "Assets" folder in the FfH2 mod. It is called "Assets-DA5" to make it easier to differentiate from other file collections you may have.

This stuff goes into the ffH2 "Assets" folder. Unzip accordingly, but BEFORE YOU DO ANYTHING be sure to back up your original files. Seriously. Just do it!

The safest thing to do would be to make a backup of the entire Assets folder, even though that takes up a lot of harddrive space. If you want to be specific about the files, though, the files altered by this scenario are:

ScenarioFunctions.py
CvRandomEventInterface.py
CvEspionageAdvisor.py
CIV4EventTriggerInfos.XML
CIV4EventInfos.XML

it also adds:

CIV4GameText_Z_DA.XML in the the Assets\XML\Text folder
Dungeon Adventure.CivBeyondSwordWBSave in the Assets\XML\Scenarios folder

I hope you enjoy it!

Zip files below:

Assets-DA5.zip is the scenario, plus integration into the scenario picker screen.

The CvGameCoreDLL.zip file contains TC01's fix for the DLL error. Just replace your DLL file with his revised one (after backing up your original of course!) The revised DLL file should not affect gameplay in regular FfH2 games -- it just fixes a special odd situation in the DA modmod.
 
A polite request:

This was my entry for the scenario design contest. I am think that some of the creative ideas I came up with helped my entry shine. Perhaps partly because of this, I have had a number of requests from people to use coding ideas that I created for DA in their own mods.

I am totally fine with that! I only ask that if you use a particular mechanic or code block that I developed, please credit me in your readme.

Dungeon Adventure - the 133rd K.R.A.G. Features:

The Scenario Sifter -- a way of using the scenario counter to keep track of multiple map designations and mission states. Did you complete that last mission or did you completely botch it? The Scenario Sifter knows!

Dynamic in-game map switching -- this scenario allows dynamic switching from local maps to a global "overmap." This is NOT accomplished by sequestering a section of the global map for the "indoor" map. The entire map actually switches out! The is made possible by some custom coding, handshaking with the Scenario Sifter, and using a 20x20 base map.

Random Multi-level Explorable Dungeons -- The armageddon counter now serves as a "you are on level x of the dungeon" counter. The dungeons are not yet tied into the missions of this scenario, but one of the dungeons is accessable. I have worked out a pretty good script for generating random dungeons, and am looking forward to adding features to them as I continue work on the scenario. So far, the dungeons have maze-like corridors punctuated with a few rooms; Staircases to the Surface and ones that will take you Deeper; Tresure chests (as a stand in for 'features of interest'); auto-closing doors; and secret doors. I will also add traps and few other goodies.

Limited view -- the map that isn't immediately visible automatically "re-hides" itself, which adds to the adventure feel.

Story telling style character generation -- the first map includes encounters with other characters that give you choices about how to construct your character. These choices will affect gameplay as the scenario unfolds.

Indoor vs Outdoor default abilities -- anytime you travel "indoors," units automatically get the starting settler promotion to adjust the scale, so to speak. Travelling back out to the overmap removes that promotion.

A few screenies below:



Gorym the new draftee leaves his prison cell at the begining of the game.
Spoiler :



Gorym approaches the Ancient Fort
Spoiler :



WB view of a sample dungeon level
Spoiler :
 
Reserved for versioning and bug list info:

A few quick notes about Release 5:

There are no meaningful changes in terms of gameplay or coding from version 3. Release 5 is just a merge into the FfH2 0.41 distributable patched to version "j" so that people can more easily play this scenario again. It also includes a seperate download with a replacement CvGameCore.DLL file to fix a mod specific error.

As with release 3, the pre-game character generation map (Shaft X) and first mission on the main world map are included in this release. Mission two is still included, and takes place in a dungeon map accessable from the far NE corner of the world map. The player may freely travel between Shaft X and the dungeon as needed. Special events and opportunities that track the player's progress on Mission two are also available in Shaft X!

Once Mission 2 is complete, you may continue to run around the dungeon, and may also re-enter Shaft X. For the time being, you may think of the "Success!" pop up at the entry point to Shaft X as the "Yay, you won!" pop up.

Some day in the probably distant future, I hope to have the following missions:

1. Redemption - Salvage the camp of the ill-fated recon party and rescue any survivors. IMPLEMENTED.
2. Rescue - Rescue Thane Torek, Captain Bambuk, and Engineer Manu from the clutches of the Horde Bandits holed up in the Ancient Fort. IMPLEMENTED
3. Retribution - Destroy the Horde stronghold in the Southern Pass, and defeat the Warlord
4. Exploration - Explore and map out the caverns beneath the Ancient Fort to see if there is an exploitable connection back to the Underhome
5. Extermination - Remove an infestation of the Green Death that has cut off access between Shaft X and the Underhome, using an adaptation of Doviello technology called the "Khazamboni!"
6. Exploitation - Assist a work party in linking key subterranean resources to "Extraction Central." Defend the work party from the predators of the Underdark.
7. Allies - Pursue optional missions to acquire key allies and add them to your adventuring party.
8. Arena - Khazad operations have shifted to the site of the Ancient Fort. The old Shaft X site has been leased to a group of Belseraph. What are they up to, anyway? Go find out!
9. Akh Danon - Visit the Lich King's tower in search of information. Akh Danon does not like visitors, however...
10. Dread Citadel - Storm the Dread Citadel to obtain the Really Important Artifact.
11. Final Act - Destroy the Really Important Artifact and seal the Potentially Cataclysmic Volcano by throwing the former into the latter.

STUFF ADDED TO RELEASE 5:

Spoiler :
Nothing! Release 5 just merges the scenario into the most current version of FfH2 (0.41j).


STUFF ADDED TO RELEASE 4:

Spoiler :
Nothing! Release 4 just merges the scenario into the most current version of FfH2 (0.41).


STUFF ADDED TO RELEASE 3:

Spoiler :
New code for Treasure chests to decrease their view area once ownership is switched to player.-- this will be adjusted back after ffH2 patch z.
Regeneration, Medic promos, courage, diseased, withered, plagued, and poisoned now have healing effects in dungeons!
Edge issues with secret doors fixed.
Plot counter no longer disabled in gameoptions -- this was causing the weird behavior with the sanctify spell.
Potions of invisibility removed from game -- causing odd errors and graphical glitches when used.
Teleportation traps added -- yikes!
Raw mana nodes get a new warning post after turn end -- since dispel magic destroys improvements!
Some placement of stairs and rooms adjusted to reduce palimpset errors.
Adepts can no longer use specialized weapons -- preserves this advantage for fighters and scouts!
Purchasing new specialized ewapons will remove the "rusted" promotion.
Purchasing/switching kit will remove the "rusted" promotion.
Rust traps added.
Water features added.
Bone piles and slime patches added.
Fire pits added.
Slightly different treasure chest reveal code used to reduce level transition errors -- if a player started a new level being able to see a chest, errors would occur.


STUFF ADDED IN RELEASE 2:

Spoiler :
Better spaced doors (at the suggestion of Kenken244).
"Indoor" promotion changed to staring_settler bonus, instead of a mix of mobility and sentry.
Now possible to re-enter Shaft X after first mission.
Prospecting/mining in Dungeons
Bortas the Outfitter will now sell and buy things.
NPCs in shaft X will temporarily stop moving once you get within 1 plot.
Nag prompts added for rats mission.
In dungeons, nooks along the west and south edges will now get goodies just like elsewhere.
Traps and secret doors given new helper units that are more visible in WB.
Dungeon goodies diversified into gold, mana crystals, and chests.
Trap placement improved.
Rescue missions in the Ancient Fort are now in.
Tweaked dungeon generation code for prisoner placement.
New magic system -- collect crystals to learn spells! Customize and reorganize your adept!
Now a small chance that a given dungeon level will host a KRAG merchantile franchisee. :)
Akenor now tells interesting stories.
Imdelos will now provide services.
Rescued prisoners Torek and Bambuk now offer benefits when you meet up with them again at Shaft X.
Bambuk can be recaptured.
Goal tags added for mission two.
New code to account for the fact that Treasure Chests can no longer be non-invisible. (Arghh!)


BUGS:

Spoiler :
Release 5:
I need to switch the treasure chest reveal mechanism back to the original, since the invisibilty issue was fixes several FfH2 patches ago. It works fine, it is just a little clunky, code-wise.
Slave units can cause multiple triggerings of mana and exit events. Need to add an "if not slave" condition on the trigger. Good catch, Gaga1111 and TC01!

Release 3:
Getting the bless buff from Imdelos probably should not also heal the player, just for balance reasons. -- will be fixed in next release.


Release 2:
Treasure chests are deleted when they lose invisibility -- FfH2 issue, set to be fixed in patch z.
When an adept uses an invisibility potion, the unit graphics are changed from dwarven adept to regular adept. It doesn't change back after the hidden promo is removed, either. -- Invisibility potions removed from game, as this is an FfH2 ISSUE.
When a secret door is found on edge of map, a door does not appear to replace the walls. -- FIXED in release 3(good catch Psychic_Llamas!)
Sanctify spell is changing plots to marsh and messing up global counter -- FIXED in release 3(thanks again, Psychic_Llamas)

Release 1:
Ancient Fort on world map is auto-upgrading to a castle -- leaving as is for now -- (thanks Kenken244!)
Possible missing GAMEOPTION enums -- FIXED (no_techs and no_buildings were removed in patch "t")
WB game file did not have proper mod path set -- FIXED (Thanks MagisterCultuum!)
"==" versus "=" errors in Scenario Sifter -- FIXED
Multiple typos in TXT files -- FIXED (thanks for finding them, cIV_khanh93!)
 
I'm going to have to try it to see if I read that right, but I never did think about making a dynamic map possible by storing a couple of large maps in a seperate python framework and only having a small square centered on your current activity ever actually visible at a time. Would feel very old-Nintendo-Quality RPG-esque :)
 
I'm going to have to try it to see if I read that right, but I never did think about making a dynamic map possible by storing a couple of large maps in a seperate python framework and only having a small square centered on your current activity ever actually visible at a time. Would feel very old-Nintendo-Quality RPG-esque :)

Exactly! As someone who cut his teeth on Temple of Apshai, and then moved on to Phantasy and then Nintendo adventure games, this format seemed the most appropriate for an RPG feel.
 
But in a more direct answer to your implied question:

The DA-133rd KRAG system works like this:

1. All of the individual maps are 20x20 size, the same as a "Duel" map.
2. At the end of each turn, any plots not curently visible get re-hidden.
3. At certain points on the "world map" and "local maps" it is possible to trigger an event that switches the adventuring party to a different map. These are set up to behave naturally, e.g., upon approaching an ancient fort or walking out a passageway, or moving onto a staircase.
4. When the maps switch, a custom python code block is executed that wipes all previous map information from the board and then writes in the new stuff. The "world map" is a static map that stays mostly the same, with only a few features being altered according to the information provided by the Scenario Sifter. Dungeon maps are random. The Shaft X map (sort of the home base) has a basic structure but will change significantly as directed by the Scenario Sifter.

There are many additional possibilities suggested by this method. One of them would be to use the top row of plots on the map to hold scriptdata that defines an entire sub-map. Since in my maps the top row is never accessable to the player (it is always either walls or mountains), these tiles could be used as data dumps without compromising the integrity of the game.

I actually did work out read/write method for an array system that could store maps in scriptdata, but could never get the pickling to work. If I could get over that hurdle, then the scenario could have up to 20 sub-maps that were mutable, but re-callable! That is, for example, instead of being static, the world map could be changed. Then after coming back to the Surface from a dungeon, those changes would still be reflected on the map. If you chop down a bunch of forest plots, those forests would stay chopped!

I know that the FfH2 team shies away from such heavy use of scriptdata, since it can be a performance killer. My view, however, is that on such a small map (20x20), and with so few units in play at any one time (usually less than 20), the read/write on scriptdata will not slow things down too much.

Anyway, we will see how the scenario develops!

@xienwolf again: I think you are thinking of having a big array stored in a python file for a map, and then having something like a 10x10 grid out to the "map" every turn, centered on the player character. I did try that at first, but it became untenable for several reasons. Foremost, anytime you had a unit that had a high movement score, it could move to the "edges" during a given turn and destroy the illusion of the "huge map." Also, I wanted it to be possible to have your party spread out a bit, instead of all clustered on one tile. Anyway, this will all make much more sense once you have had a chance to play around with the DA - 133rd KRAG scenario. I look forward to your feedback!
 
Yah, that is actually what I originally set out to do, but it ended up being unworkable without making heavy use of the "onUnitMove" function. Since that function is off-limits for the scenario contest, I just let it go!

Depending on the response to/popularity of the DA-133rd KRAG concept, though, I may rework the whole thing after the contest as a stand alone modmod. Lord knows it would be easier to code things cleanly with "onUnitMove" than having to rely on some bastardized "onTurn" thing or make such heavy use of Warning Posts.
 
I found the goblins in the beginning somewhat difficult as you only have 2 strength. The dungeon was upgraded from a fort to a castle. I also saw some doors in consecutive spaces, and walls with a diagonal path though. Since gyorm can't attack, I was unable to capture the treasure chests. I did manage to capture one since one was spawned on the tile I spawned on when I went deeper in the dungeon.
 
I found the goblins in the beginning somewhat difficult as you only have 2 strength. The dungeon was upgraded from a fort to a castle. I also saw some doors in consecutive spaces, and walls with a diagonal path though. Since gyorm can't attack, I was unable to capture the treasure chests. I did manage to capture one since one was spawned on the tile I spawned on when I went deeper in the dungeon.

Some strategy on the first mission discussed below:

Spoiler :
Some of the beginning choices will help with fighting or avoiding the goblins, such as heavy kit or elven blood. Mostly, this mission involves being sneaky and avoiding the goblins. It is not necessary to fight them -- you need only return the survivor to Shaft X.

As a dwarf, you have double movement in hills terrain -- you can use this to your advantage to avoid and run around the two goblin units. Having Elven blood gives double movement in forests instead of hills, but can be used to a similar advantage.

Heavy kit increases strength, and makes a defensive stand on forested hills a pretty safe bet. And if you chose "cannibal" as your secret shame, you get the health boost after combat.

Anyway, the mission isn't supposed to be easy, but once you catch on to the strategies above, it can be consistently won.


About the fort upgrading to castle: Yes, depending on how long you spend on the main map, it might upgrade. I forgot that they tend to do that! I can switch some of this to a "doTurn" code to reset the improvement. Good catch, thanks!

About the dungeon: Very much a work in progress. Back to back doors may be fixed -- it would just be an additional check in the placement code. Diagonal paths through walls are not frequent, but will be retained -- those are cracks that you can barely squeeze through! :)

And about Gorym attacking:

Spoiler :
Yes, Gorym cannot attack, since he is an Adventurer unit. But as more gets added to the scenario, he will enter Shaft X right after the recon party rescue mission and have the ability to train/upgrade to a warrior, scout, thane, or adept. That way, by the time he gets to the dungeon he will be able to attack. Also, one additional member will be added to the party for the first dungeon mission.

Also, those treasure chests are just temporary stand ins. There will still be some chests, but they will have a custom "contents" code. So, no getting priceless artifacts in every chest! :) More commonly, the places where chests appear will have gold or other sources of wealth, magic resources, or useful equipment items.
 
It got upset when I loaded it (see attached screenshots.) Appears to be working at the moment though. :p
 

Attachments

  • Civ4ScreenShot0223.JPG
    Civ4ScreenShot0223.JPG
    72.7 KB · Views: 954
  • Civ4ScreenShot0224.JPG
    Civ4ScreenShot0224.JPG
    70.3 KB · Views: 739
It got upset when I loaded it (see attached screenshots.) Appears to be working at the moment though. :p

That is weird. Those gameoptions are standard gameoptions for the FfH2 mod. Indeed, a few of the official scenarios make use of them. I'm not sure why the Engine would report missing enums, unless you have conflicting mods installed or aren't patched up to FfH2 patch "t"?

Any FfH2 experts able to chime in? Is anyone else experienceing this problem?
 
That is weird. Those gameoptions are standard gameoptions for the FfH2 mod. Indeed, a few of the official scenarios make use of them. I'm not sure why the Engine would report missing enums, unless you have conflicting mods installed or aren't patched up to FfH2 patch "t"?

Any FfH2 experts able to chime in? Is anyone else experienceing this problem?

It's not your fault. :p

After doing some investigation into it, it appears patch T has unintentionally deleted those lines from the gameoptions file, which is why your scenario can't read them.
 
I just changed the name of the version I'd modded a little, reinstalled the original mod, installed patch t, and copied the contents of assets.zip into the mod. When I tried loading the mod (directly, by opening Dungeon Adventure.CivBeyondSwordWBSave in the Assets\XML\Scenarios) the game loaded with the Warlords screen and crashed when I tried to start playing. What did I do wrong?

Edit: I think the reason it didn't work is because you hadn't set ModPath=Mods\Fall from Heaven 2
 
Top Bottom