Yesterday, I wrote the general outline of how to make a quest.
Today, we’ll get into the nitty gritty:
My QuestPackage has these objects in it:
Items 4 and 5 are generated by the tile editor in the workshop, I just pasted them in.
The Quest Definition
I. Quest Definition
a. Display Name
b. Repeatable (will it be spawned multiple times? 1 yes, 0 no)
c. TriggerChance (% odds that it will be triggered when the trigger condition is met)
d. Image (PNG of the image)
e. QuestClass (Minor or Major. Completing a Major quest ends the game)
f. TriggerType (What causes this quest to occur, we support the Location as well as other triggers such as population, turns, etc. This can be used to create random events which we’ll talk about in the future)
g. TriggerOrigin (where does the event occur?)
h. SpawnRating (how advances is the quest on a scale from 1 to 10)
i. Description
j. ShortTextAccept
k. ShortTextDeny
l. RewardText (dialog title for your reward)
m. RewardImage (picture of what you’re getting)
n. SuccessText (text that comes up when the quest is complete)
o. GameModifier (message the game to do something)
i. ModType (with the corresponding Attribute options)
1. GiveItem (attribute is name of item)
2. Unit (StrVal provides the key and if necessary <Value> provides the amount)
a. TransferUnitStat
b. StealUnitStat
c. Lifesteal
d. IncreaseDecreaseUnitStats
e. AdjustUnitStat
f. AdjustCasterUnitStat
g. UnlockUnitAbility
h. CharmTarget
i. CurHealth
j. CurMana
k. ManaBurn
l. GiveExperience
m. UnitJoinArmy
n. TargetMovesBack
o. SummonUnit (UnitClass provides class name, StrVal provides title)
3. Player
a. Treasury
b. SpellPointBonus
c. AbilityBonus
d. EssenceBonusForAllChampions
e. UnlockResource
f. UnlockImprovement
g. UnlockTech
h. UnlockUnitAction
i. UnlockCityAction
j. UnlockSpellbook
k. UnlockDiplomacyWndAbility
l. RaiseResourceCap
m. UpgradeCityWalls
n. ExposeCity
o. ExposeSovereign
p. ExposeGoodieHut
q. SpawnQuestLocations
r. UpdateSpawnRating
i. NPC
ii. CREATURE
iii. QUEST
iv. GOODIEHUT
v. CRYSTAL
vi. FOOD
vii. METAL
viii. SHARD
ix. GOLD
s. UpdateRecruitables
i. SPIDERS
ii. SHRILLS
iii. DRATH
iv. DARKLINGS
v. UMBERDROTHS
vi. DROTA
vii. DRAGONS
viii. DEMONS
t. MarriageProposal
4. Map
a. TransportUnit
b. PlaceEnvironment
c. PlaceTerrain
d. GreaterRaiseLand
e. RaiseLand
f. LowerLand
g. SetEnvironment
h. ReviveLand
i. DestroyObjects
j. RandomTerraform
k. SummonUnit
l. CreateGoodieHut
m. CreateResourceHoard
n. CreateWorldProp
o. Reveal
p. BlockTile
5. City
a. SummonRandomGuardian
b. PlaceEnvironmentOnCity
p. QuestObjectiveDef
i. ObjectiveID (defining its numerical ID)
ii. NextObjectiveID (telling it where to go next or -1 if this ends the quest)
iii. Description
iv. GameModifier
v. QuestConditionDef (what determines whether this quest is complete?)
1. Class (Success of Failure)
2. Type (what type of condition is it)
a. ClearGoodieHut (TextData then used to say which goodiehut)
b. KillMonster (TextData used to identify which monster)
c. UnitKilled
d. BuildImprovement
e. ReturnItemToCapital
f. ReturnItemToQuestLocation
g. CheckForItem
h. ReturnItemToOriginCity
i. UnitLevelUp
j. UnitEntersOriginCity
3. Faction (if applicable)
4. Flag (AllConditionsMet forces all conditions to be met for it to be a successful quest, RevealTarget is useful for showing the player where the target is)
QuestLocationType
This is used to define the tile that will be used as the quest location. You can (and probably should) use existing quest location types.
GoodieHutType
This is used if you want your quest to spawn a goodie hut to send the player to. You could always just do the “bring me 5 wolf pelts back to me and I’ll give you gold” type quest instead and make sure you are spawning wolves that have the item WolfPelt as their treasure.
Download
To download the full quest here it is:
http://dl.dropbox.com/u/8051911/Quest_UrgentMessage.zip
You will need to unzip the XML file into your elemental\data\english\core quests directory
(in the future, I have put in the request that a packaged quest can just go into the user’s quest directory)
Other Notes
The hardest thing about making quests right now is the difficulty in testing them. One typo in a quest can make it just not work. This is why I’m lobbying internally (or externally) to get a quest editor made that eases this but will require more documentation. As you can see from above, the quest system is powerful but we’ve only scratched the surface so far.
This is what I'm talkin' about. Excellent information! Thank you!
I hope you're able to get that implemented. Would it be a compressed file that gets stored or would it be a sub folder that gets copied? I'm hoping for the latter. With .NET you can set an option to scan all subfolders vs. the top directory. I don't know what it takes in C/C++.
That is tremendously helpful!
I don't think StealUnitStat or IncreaseDecreaseUnitStat works
Great reference post. Need more of these!
Normally you would end up with several different files (the quest def, the goodie hut, the quest location, and the various tiles). I took them all and put them into a single XML file that you can drop into a folder. But I have to drop them into a particular folder in the game directory rather than the user directory which is what I'd prefer.
Could we please eventually get a corresponding Lock GameModifier to all these unlocks up there? Sometimes it could be useful to take away, or temporary hide particular things (spellbooks etc.), especially when writing trial-type quests or negative events.
in the immortal words of Wayne... ssschwinggg!
thanks brad...
A few questions, in no particular (logical) order:
1. How do I structure GameModifiers to add 2 rewards. Say GiveItem and Unit:GiveExperience. Is that just 2 GameModifier elements?
2. What is the correct enumerated values for TriggerType? TriggerOrigin?
3. What is the Token_BestFriend? Where is that defined? Can I define my own item under the QuestDef element?
4. How do I define a monster/unit that needs to be killed?
5. How can I put a time/turn limit between multiple QuestObjectiveDef elements?
6. When sending player to multiple locations, each location is defined as by GoodieHutType. Only the QuestLocationType defines the where teh quest starts?
7. Explain PrefQuestLoc.
8. How can I give quest without player coming to a location?
9. Do you have an XSD?
10. Where do the images need to be at? Filesystem wise.
I imagine I will have more as I work through a few quests that I have in mind.
11. Can we tie the Accept/Deny to QuestObjectiveDef elements? Will you help me, IF Answer=Yes, Yippee spawn GoodieHut, ELSE Spawn mad quest giver?
I think it would be more helpful if the quest editor was implemented in-game (and interconnected with the rest of the editors).
Excellent information. Thanks.
Great Brad,
why your here and slightly unrelated can you list the damage types for units, I've been modding weapons also could I use the unit lifesteal there and how exactly does it work.
......
1. Class (Success of Failure) 2. Type (what type of condition is it) a. ClearGoodieHut (TextData then used to say which goodiehut) b. KillMonster (TextData used to identify which monster) c. UnitKilled d. BuildImprovement e. ReturnItemToCapital f. ReturnItemToQuestLocation g. CheckForItem h. ReturnItemToOriginCity i. UnitLevelUp j. UnitEntersOriginCity
As for the quest in 1.07 (for killing rats), I get my champion there and trigger the quest, then my champion to the location of the quest and did the quest (killed the rats), but i do not get a reward when my champion return to the hut. I tried a few times until i get my sovereign to take the rat corpse in her inventory and go to the hut to receive the reward.
does g. CheckForItem only check the sovereign inventory and location to trigger?
Is there a way to spawn an encounter that is relatively equal to the party's strength that started the quest?
I notice the levelhi levello tags in some of the other core quests, but they don't seem to be used (or I don't understand what they are for)
Hmmm... am I the only one thinking we're going to need some kind mod manager in order to keep track of which one we want to activate? Just shoving it into a Mod folder and a Quest folder isn't going to cut it. Remembering which xml file does which isn't exactly the most ideal solution when the number of mods start growing.
Try transferring the dead rat to whoever triggered the quest, then re-enter the inn.
If mods could stored in their own folder, it would be easier to manage.
Otherwise the challenge is for a mod manager application being able to identify which files are associated with each other. You could parse a quest file and find all the dependencies (outside of the core game folders) and remove them. However what if you built a quest using tiles that you downloaded for another quest, mod, campaign, etc. Unless when you build a quest, all the elements of that quest get copied and identified as related/dependent on that quest.
Another option would be to initially store the mod files outside of the user folders in separate folders for each mod. Then use the mod manager to select which mods to "install" (basically copy to the user folders) and record what was installed and where. If you wanted to uninstall a mod, then it could look up what files were installed and remove them.
A major problem with having a mod manager outside of the game is that if you load a saved game, I don't think the game currently checks to make sure all the mods it's dependent on are loaded. So if someone built a mod manager and people didn't understand how it worked, I think there would be a risk that they'd inadvertently remove mod files, break their save game, and then get mad at both Stardock and the person who wrote the mod manager.
CAUTION: CODE AHEAD.
Let me see if I can get this .NET C# code snippet to work.
To Create the existing Quest using XmlSerialization
Base Serialization Class Structure based on Quest provided.
Now, to read in existing
Or just to recreate sample using c#
Now, on to creating the UI for the wizard.
may i be the first to say... i love you man... no, i mean it... i love you!
oh, and for you my good man...
@Frogboy
Me, Kenata, and Gnilbert have been noticing some... irregularities in the [calculate] function, most noticeably when you attempt to decrease an enemy stat using AdjustUnitStat after dealing damage, or just generally applying negative modifiers to statistics. If you want to look into this, I can PM you some examples, but I think it might be most productive if you had someone on the team actually write some script to do this and take note of the results.
I haven't voted for which one you should focus on first because I personally don't think you can focus on just one at a time. Not if you want a great result anyway.
I think what is needed is a global design which fits all the major gameplay elements of the game together into a framework were all key strategies are viable and balanced against each other. The design then needs to drill down lower and lower into each level of the game making sure that each level is both balanced and has interesting choices / noticeable trade offs. Finally the lowest level data needs to be refined so that items/spells/units are balanced and interesting.
Examples off the top of my head - you might disagree with some of the examples but hopefully not the theory:
Top Level : Arcane vs Tech, Champions vs Regular Units, Conquest vs Spell vs Quest victory conditions, aggression vs building / turtling gamestyles.
Mid Level : Warfare vs Adventure vs Civilisation techs, few large cities (eg level 5) vs more small cities (eg level 2), imbuing many spellcaster champions vs building up a few very powerful spellcasters, ranged vs melee vs spellcasters (both for champions and regular units).
Low Level : Fireball vs Frost Blast, Sword vs Axe, Combat Attack vs Defence vs Combat Speed, Strength vs Dexterity vs Charisma etc.
In all cases the various options the player is choosing between need to be moderately balanced (ie several choices are viable) but also interestingly different (ie it makes a difference which one you pick), otherwise there is either only one choice or the choice doesn't matter (both of which are equally bad).
IMO tinkering with one part in isolation will probably just lead to slightly more polish in that area while leaving the overal balance of the game in disarray.
Are you able to release an XSD file so we at least can validate the structure, if not the actual values? Relative work should be significantly less for a pretty sizable initial benefit.
Wow.
I hate to ask but I'm going to anyways... how long did it take you to come up with that code?
If the file is not compressed and you just want to find, for example, all XML files, it only takes about 10 lines of code.
There are many great features available to you once you register, including:
Sign in or Create Account