Announcement: Be excellent to each other.

Caravel Forum : DROD RPG Boards : RPG Architecture : DAA Architectural Handbook (A(nother) guide to creating RPG holds)
Page 2 of 2
New Topic New Poll Post Reply
Poster Message
Level: Smitemaster
Rank Points: 3707
Registered: 02-20-2007
IP: Logged
icon Re: DAA Architectural Handbook (+6)  
Well, for a long time I avoided adding another post here, because I knew this would go onto a new page. But now that I've had a long break from DROD, and I've learned a bit more about architecture through finishing Nameless Fortress, a new page seems appropriate.

6. The Butterfly Effect, and how to counteract it

There are two related butterfly effects in DROD:RPG, but I want to talk about the one PigmyWubba recently brought up: the fact that small optimising decisions early in a hold have an effect that grows larger throughout the hold. For example, suppose you have a shield gem behind a heavy-hitting enemy. A medium-level player might try taking the gem, then find themselves too low on HP to continue. But a good player might find a way to continue after taking the gem. Then the gem serves as a reward for playing well -- always a good thing to have in a hold. The problem is that, from then on, every hit they take is reduced by 1, which adds up and allows them to get more good stuff that medium players won't. In a large hold, this means that by the last level, good players are liable to be killing everything in sight for zero damage, making it trivial.

(The other butterfly effect is that, when editing a large hold, small changes to early levels will have a large effect on possible stats on later levels. There's not much advice I can give about this, except the obvious -- build up a hold in stages and test (and get other people to test) each stage thoroughly before moving on so that you aren't going back and making changes to the early stages late in development!)

So, what to do about this? One approach is to tailor the hold to the best players, so that medium players simply won't progress at all. Nothing wrong with that if you want to make a difficult hold. But let's say you want to make your hold accessible to medium players -- you just don't want to make it so easy that better players no longer find it enjoyable. Here are some suggestions, which can be used individually or combined:

A - Prevent or delay the best players from reaching zero damage.

A1 - The default monster stats have a nasty flaw from the architect's point of view: at the 68 and 330 ATK thresholds, several monsters are reduced to zero damage simultaneously. Using custom monsters can greatly reduce this problem. Remember that the ATK threshold to kill a monster in one shot is the sum of its HP and DEF -- unless it has the "Attack first" property, in which case it will get at least one hit on the player regardless.

A2 - Give custom monsters (especially bosses) high HP and ATK, and low DEF. High HP means they can't be killed in one shot with high player ATK; high ATK means they can't be reduced to zero damage with high player DEF. Low DEF means they can still be fought by players with lower stats, though you need to make sure sufficient HP is available.

If you follow this method, you can still have some monsters and bosses that are exceptions. For instance, in Nameless Fortress, Kekkaijin has low ATK so that he can be reduced to zero damage; this is taken into account with a unique cut scene to reward the player who manages it.

A3 - Use "attack in front" and similar behaviours so that players always have to make choices about taking damage to reach power-ups. For example, a Mad Eye guarding a square the player must pass over to reach a gem. If the player might have sufficient ATK to kill the Mad Eye in one shot, you can prevent this by placing a briar that will destroy the gem.

B - Encourage players not to take power-ups.

B1 - The Elixir, a custom accessory that increases HP by a function of player ATK and DEF. For example, the Elixir in Nameless Fortress increases HP by (5 x ATK + 3 x DEF), which you may recognise as the formula for how much ATK and DEF contribute to your score. If one of these is available, the player is encouraged not to use it until the endgame, when it will provide the maximum benefit.

12th Archivist's post, now on the previous page, is relevant here:
Currently, _ATK and _DEF reference the player's base ATK and DEF only, without regard to stats from equipment. If an architect wishes to do anything with the player's effective ATK or DEF (the combined base and equipment bonus), they can do so by adding _ATK to _WeaponATK or _DEF to _ArmorDEF.
...and let's not forget _WeaponDEF, _ArmorATK, _AccessoryATK and _AccessoryDEF if you have any custom equipment with those stats (such as the Attack and Defence Emblems in Nameless Fortress).

Similarly, you could provide a boost to ATK or DEF that depends on current stats. An example is the character in Tendry's Tale who increases your stats by 3%, so you are better off taking this boost as late as possible.

B2 - You could make the multiplier increase each time a boss is killed. (Some tips on how to script this are on the previous page.) Then, the player is encouraged to leave as much as possible behind so that it will be worth more later on. It might seem that this method breaks down at the last boss, but there are ways around that. You could make the last score checkpoint activate, not on the boss's defeat, but on reaching an area beyond him (though be careful about other ways to reach this area -- see TFMurphy's post on accessory abuse). Or you could have a optional bonus boss beyond the last "main" boss.

B3 - A type of choice I mentioned before: have a small power-up that, if taken, blocks a larger power-up, but have the larger power-up guarded by a strong monster. The idea is that medium players will take the small power-up anyway; better players will leave it until they can get both, but in the meantime, they will have to get by with lesser stats. The trouble with this method is pretty obvious: when the player does get the power-up, they will receive a large boost, exacerbating the original problem. However, this can be a very effective method if combined with other methods.

C - Provide bonus content to reward optimal play.

C1 - Perhaps the most obvious type is a bonus boss who can only be killed if you have higher than usual stats, as in Tendry's Tale and Nameless Fortress. Defeating the optional boss might unlock the hold's "true ending".

C2 - Instead of (or as well as) requiring high stats to unlock bonus content, you can include some of the one-use accessories in your hold (Warp Token, Wall Walking, Pickaxe, Portable Orb, Invisibility Potion, Speed Potion). Medium players can then use these to get past a point where they are stuck, while you can use scripting or puzzles to ensure that bonus content can only be reached if some or all of these accessories are left unused. This is the route taken by Hold Anonymous. For Nameless Fortress, I decided to be more lenient and require only some of the accessories to reach the bonus boss, so that there would still be interesting choices about where to use the others. (Again, refer to TFMurphy's post for ways these accessories might be abused, if you include them in your hold.)

Hope that helps a little :)

50th Skywatcher
12-15-2013 at 02:56 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Level: Smitemaster
Rank Points: 3707
Registered: 02-20-2007
IP: Logged
icon Re: DAA Architectural Handbook (+10)  
7. Altars

Altars are another way to counteract the butterfly effect, but complex enough that they deserve their own post.

In this post, I will use "altars" as a catch-all term for scripting that offers the player the choice between ATK, DEF and HP for an increasing cost each time. Depending on the hold, these may be referred to as Machines, power squares, etc. In a large hold, there is usually one altar per level, and the later ones give larger boosts, but boosting your stats at any altar increases the cost of all of them.

This counteracts the butterfly effect in two ways. Firstly, a less able player may get stuck and have to buy HP from the altar, which allows them to continue, but at the cost of a possible ATK or DEF increase that would have benefitted them more in the long run. Secondly and more importantly, players are encouraged to save up altar usage for the final altar in a hold, and so better players will make do with less than optimum stats until the final altar becomes available, while less able players have an opportunity to catch up, again at the cost of knowingly cutting themselves off from having the best stats at the end.

Using altars also counteracts another frequent problem: in many holds, after the first level or so the player never runs low on money, so choices involving giving up money for something good are never really choices.

7a. Scripting altars

In the first room of the hold, include a set-up character whose script includes "Set var AltarCost = 1000", or whatever you want the cost of the first use to be. Then, for each altar in the hold, place a character and use this script as a template:

Label start
  Wait for entity Player x,y,x,y
  If ... 
        Wait until var "_GR" < AltarCost
     Speech "Current Cost: $AltarCost$ Greckles.",Normal,Self,0,.
     Wait 0
     Go to start
  If End
  Answer option "[amount] Attack",attack
  Answer option "[amount] Defence",defence
  Answer option "[amount] Health",health
  Question Current Cost: $AltarCost$ Greckles. What is your order?
Label attack
  Set var "_ATK" + [amount]
  Go to end
Label defence
  Set var "_DEF" + [amount]
  Go to end
Label health
  Set var "_HP" + [amount]
Label end
  Set var "_GR" - AltarCost
  [increase cost]
  Wait 0
  Go to start

What this does: First, the script compares _GR (the player's current greckles) with the current cost. If the player can't afford a boost, they are told how much they need. "Wait 0" followed by "Go to start" ensures the script will loop, but only on the next turn. Then, each "Answer option" sets up one of the options the player will be given next time a "Question" command occurs (so remember that a "Question" must always come after the "Answer option"s that relate to it).

"Label" designates the location in the script the player is taken to after selecting an option. In this case, each label is followed by the appropriate adjustment of ATK, DEF or HP, then "Go to end" to skip the following lines so they do not end up receiving all three!

7b. Increasing the cost

The most commonly used formulas for altar cost are the simplest: linear, quadratic or exponential growth.

Linear: For the line "[increase cost]" in the script above, substitute "Set var AltarCost + 1000" or some other amount. The cost will increase by this amount with each use.

Linear altars are rare, because the later default monsters give a lot more GR than earlier monsters, so the player will be able to afford a large number of boosts (and with this option, architects are especially liable to underestimate the number of boosts the best players will obtain). However, this certainly doesn't mean linear altars can't be used! The initial cost and increment can be adjusted to cut down the number of uses, and the hold can provide other places to spend money. You can use custom monsters with different amounts of GR. Another approach, which I experimented with in Nobard's Hold 2, is to increase _ItemGRMult or decrease _MonsterGRMult (make greckle gates cost more throughout the hold, or make monsters give less).

Quadratic: For "[increase cost]", substitute the following two lines:

Set var "AltarCost" + AltarIncrement + 1000
Set var "AltarIncrement" + 100

(As always, 1000 and 100 can be replaced by other values. Note that you do not need to set AltarIncrement to 0 in the first room of the hold; variables always have the value 0 if they are called on before they have been set.)

Tower of the Sorcerer / Tendry's Tale uses a quadratic altar, so one advantage is that the default monsters were created with this approach in mind. Quadratic altars are rare in usermade holds so far, perhaps because the formula is more complex, though as you can see it is only slightly so. When adjusting the parameters, remember that the first one (1000 in the example above) is the first increment, between the costs of the first and second uses of the altar; the second parameter (100 in the example above) is how much the increment increases each time.

Exponential: For "[increase cost]", substitute "Set var AltarCost * 2". If you want a lower exponent, multiply by one number and divide by another; for example, the altars in Nameless Fortress multiply the cost by 3, then divide by 2. (This is equivalent to multiplying by 1.5, but DROD:RPG doesn't allow you to enter non-integers.)

Exponential altars have the opposite disadvantage to linear ones. Their cost increases faster than the default monsters were designed for, so the player will be able to afford fewer uses. It's common for the player to end up with a large amount of money that can't be spent because the next use of the altar is still a long way away. However, there are many ways to offset this. You could use default monsters that give more GR, or increase _MonsterGRMult, either at the start of the hold or in response to an event. Nameless Fortress sets _MonsterGRMult to 400 (remember, all multipliers are percentages) when the player enters the last level. Any monsters left alive in previous levels can be killed for four times their usual GR (eight times, if you have the Lucky Blade). I feel this has ended up well-balanced.

7c. Balancing altars

In holds I've seen so far, architects have not been concerned with making all three choices well-balanced. The HP option is seen as a last resort for players who have made suboptimal choices, so that they can continue playing but will be unable to get the best possible stats (and sometimes will be cut off from bonus content). There's nothing wrong with this approach; though it would be interesting to see architects trying to make HP-buying a viable choice for optimisers as well.

Most architects do try to balance the ATK and DEF choices against each other, so that the player has three viable strategies for proceeding through a hold (building up ATK, DEF, or some of each) and each strategy is viable and leads to interesting play. Here are some things to bear in mind:

* Usually, all altars throughout a hold offer the same ratio of ATK to DEF (e.g. if one altar offers 6 ATK or 12 DEF, another might offer 8 ATK or 16 DEF). It's not compulsory to do this; but violating it might make it more confusing for the player to calculate their choices, and might make it harder for the architect to find the right balance.

* Tower of the Sorcerer / Tendry's Tale offers twice as much DEF as ATK, so the default monsters were created with this in mind. This does not mean that 1:2 is the "correct" ratio, or that a ratio such as 1:1 necessarily favours the ATK route. It all goes back to what I said in my first post about monsters' stats. In general, low-HP monsters favour the ATK route and high-HP monsters favour the DEF route. If you have many custom monsters, or even if you use the default monsters in different proportions, then the ratio that best serves the balance of your hold may be 1:1 or 1:3 or some other value.

* From my experience, in all holds where altars offer either ATK or DEF (which, so far, is all holds with altars), either an "ATK route" or a "DEF route" ends up being superior to a mixed route, except that on a DEF route, you may need to get some ATK to defeat high-DEF enemies such as the Rock Golem. If you want a mixed route to be an equally interesting option, you might consider altars that offer ATK, DEF or a mixture with each purchase -- and the mixture should be such that buying it twice gives more than one purchase of ATK and one of DEF.

Finally, a word about levelling systems. This is where, instead of spending GR to boost stats, on reaching certain levels of REP the player is offered a stat boost. Typically, this works in the same manner as altars: the player can choose whether to boost ATK, DEF or HP. Other than using REP instead of GR -- and therefore being independent of other means to spend money in a hold -- everything I've said about altars should work similarly for levelling systems as well.

50th Skywatcher
12-15-2013 at 06:55 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Level: Smitemaster
Rank Points: 3707
Registered: 02-20-2007
IP: Logged
icon Re: DAA Architectural Handbook (+8)  
8. Balancing ATK and DEF routes

12th Archivist recently asked an interesting question in the Rambunctious Romp topic: how do you balance a boss so as to make it equally hard for ATK and DEF routes?

In general terms, my first post on monsters' stats contains a useful hint. High-HP monsters favour a DEF route, while low-HP monsters favour an ATK route. Therefore, if the current balance is too far in favour of the DEF route, you should decrease the boss's HP and increase its ATK, and vice versa. But if you're not sure how much to change the stats and want a mathematical formula, read on!

(1) Playtest both the ATK and DEF routes, or get others to playtest, to see what stats you can get. The following calculation requires just one set of stats from each route -- if you have several testers, you can of course use the best stats you get if you want to make the boss especially hard, or you can use stats somewhere in the middle, or just use round numbers that are in the right area.

I will use H1, A1, D1 to mean the HP, ATK and DEF gained on the ATK route, and H2, A2, D2 to mean the stats gained on the DEF route. I will use bH, bA, bD to mean the boss's HP, ATK and DEF.

(2) Decide on the boss's DEF first. This determines the minimum ATK required to damage it at all, so it should be fairly low if you want to balance the two routes. It doesn't have to be zero, though: depending on the design of the hold, there may be power gems available without sacrificing shield gems, and most holds contain sword upgrades, so even a pure-DEF-route player will gain some ATK.

(3) A1 - bD = d1 (player 1's damage per hit) and A2 - bD = d2

(4) Decide how much total damage you want the boss fight to do (using H1, H2 as guidelines). Call this T1, T2. Usually, to make the boss equally difficult on both routes, T1 = T2, but this need not be the case, if testing shows that it's much easier to gain HP on one route than the other, for whatever reason.

(5) Suppose bH is known. Then bH/d1 = n1 (player 1's number of hits) and bH/d2 = n2

(6) T1 = n1 x (bA - D1) and T2 = n2 x (bA - D2). Since all the other values are known, this can now be solved for bA:

bA = T1/n1 + D1 = T2/n2 + D2

(7) Since these are not necessarily equal, we have to set bH so as to make them equal. In other words:

(T1 x d1)/bH + D1 = (T2 x d2)/bH + D2

bH = (T1d1 - T2d2) / (D2 - D1)

And now that you have bH, repeat steps (5) and (6) to find bA :)


Taking mine and Someone Else's stats from Rambunctious Romp, suppose that 12th Archivist wants the boss to do 12000 damage to me and 9000 to Someone Else, and suppose he has decided that the boss will have 0 DEF. Thus:

T1 = 12000, d1 = A1 = 1264, D1 = 245
T2 = 9000, d2 = A2 = 833, D2 = 861

bH = (12000 x 1264 - 9000 x 833) / (861 - 245)

Rounding some numbers off to make the calculation easier:

bH ≈ (12000 x 1200 - 9000 x 900) / 600 ≈ 10000

n1 ≈ 10000/1200 ≈ 8 and n2 ≈ 10000/900 ≈ 11

bA ≈ 12000/8 + 245 = 1745 and bA ≈ 9000/11 + 861 = 1679

The two values for bA have drifted a little apart because I used round figures, but a boss with 10000 HP and 1700 ATK would be approximately equally difficult for both of us.

50th Skywatcher
01-04-2014 at 07:56 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Level: Smitemaster
Rank Points: 1210
Registered: 08-04-2006
IP: Logged
icon Re: DAA Architectural Handbook (+2)  
Nuntar wrote:
8. Balancing ATK and DEF routes

I'd like to chip in and say that I really liked what suwacko did in The Forgotten Castle; having multiple areas accessible at the same time. In the tarstuff areas I found you were generally rewarded more for getting def upgrades, with high hp enemies, while other areas often favored atk. This meant that people going for the different routes (atk/def) would probably clear the areas in different order, but as the rewards gained were similar no route was obviously favored.

Voligner is my very own DROD-like game. Please check it out!
01-06-2014 at 09:57 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
12th Archivist
Level: Smitemaster
Rank Points: 790
Registered: 12-07-2008
IP: Logged
icon Re: DAA Architectural Handbook (+5)  
(If Nuntar doesn't like me adding on to his work-in-progress, I'll change this post's format to a more standalone design.)

9. Personal variables and designing interactive custom items

So you're thinking about making a hold, but you're not feeling up for a "typical" resource management hold? Maybe you want to make a custom item and all sorts of weird puzzles revolving around it? Enter the _MyScript variables, which takes DRODly scripting truly above and beyond. These variables are set to -9999 by default and so don't do anything, but setting them to a proper value -- or to another variable -- is the key to utilizing them to their fullest.

skell created a comprehensive list of _MyScript usage here, so I'm instead going to focus on a particular section today: the coordinate system, and how you can manipulate it.

Let's go with a simple custom item, like a shovel, to start with. When activated, it will turn the floor in front of the player into pit. There's quite a few clever tricks you could implement with a shovel, but let's focus on the scripting first.

9a. Scripting the shovel

Let's assume we've read the previous topics here, so we know how to activate the shovel:
Click here to view the secret text
When the accessory is activated, it will do <stuff>. Otherwise, it resets the _MyScript variables to their default so they don't interfere with anything.

Now to fill in the <stuff>. Since we want the shovel to make a pit /in front of the player/, it first must get the coordinate of the tile /in front of the player/. We'll use the _MyScript variables to store and use this information. _MyScriptX will get the X coordinate in front of the player, and _MyScriptY will get the Y coordinate. This is the best way to do it:
Click here to view the secret text
Now, when Build Pit at... is selected, it will build a tile of pit at the X and Y coordinates stored in the _MyScript variables! Best of all, the _MyScript variables will update whenever you move or turn, meaning the Build command (or any other) will dynamically change to build right in front of you. Cool, huh!

9b. Considerations

We have a basic script there, and it'll work all right, but it has a few problems. First, it will build a pit under /anything/, doors, walls, monsters, you name it. Unless you want the player to drop the whole continent into the Beneath, let's add a few conditions. Let's say the player can't dig through walls, doors, or monsters. How can we script that?

DROD RPG has blessed us with (among others) a very useful query: Wait for Item at... . Given a location and an element, this command will return true or false whether the element is within that room location or not. So before building the pit but after setting the _MyScript variables, let's put our checks in:
Click here to view the secret text
If there is a wall or closed door in front of the player, the Shovel won't build a pit. Also:
Click here to view the secret text
If there is a monster or NPC in front of the player, then don't built a pit there. You can customize your conditions all you want; this is just what I'd probably do.

Second, and something much more serious, is the room boundaries. RPG rooms are 16x16 tiles in size, so the X and Y coordinates can go from (0,0) to (15,15). Anything out of range is invalid, but some commands with an invalid coordinate component will lead to assertion errors or even crashing, so there's one more check we need to do before building that pit:
Click here to view the secret text
If the player is facing a tile that would be outside the room, don't attempt to build a pit there.

9c. Going above and beyond

One quirk I'll mention is that you can Build explosions at a coordinate, which deal damage, destroy walls, and activate items from afar. It's been more thoroughly elaborated upon elsewhere, but it's a really useful feature and the key to making ranged weapons. More on that later.

The shovel example was merely a preview of what _MyScript can do. Building pits or checking tiles isn't the end of the story. Generate Entity is another great command, since the characters your item creates have their /own/ default scripts. You could script an item that, when activated, creates a robot to charge forward and then explode, or a raygun that destroys everything in front of you, or a roach egg behind you to slow down attackers. The possibilities are endless.

The _MyScript variables really allow an architect's creativity to shine through. With some clever trickery of the scripting engine, you can design entirely new game elements, equipment, and creatures.

It was going well until it exploded.
~Scott Manley

Check out the DROD Wikia project here!

[Last edited by 12th Archivist at 02-01-2014 04:22 AM]
01-26-2014 at 07:08 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Page 2 of 2
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Architecture : DAA Architectural Handbook (A(nother) guide to creating RPG holds)
Surf To:

Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us |

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.