This is a "Press Your Luck"-style game. Players play as
raiders exploring dungeons. The further
in you go, the more loot you'll find, but the higher the risk
you'll lose everything you've collected.

"Dungeon Raiders 2" is played over 5 dungeons. You'll move from room to room, splitting any gems you find with everybody in the dungeon. Typically you'll be asked if you want to stay or leave.

If you stay, you continue to the next room; but if you find the Spider's Lair, you'll run out and have all of your gems taken from you.

Occasionally you'll encounter a purple Adventure Room. Look at your options for more information on getting through the adventure.

Adventureers press their luck in a dungeon.

Computer Players
1-9
players
10-20
minutes
#### Requirements

- Windows 7+
- Mouse input, or
- Multi-touch input: Windows 7/8 multi-touch
- CPU: Any 64-bit processor
- GPU: Any DX9-compatible video card
- RAM: 256MB
- HD Space: 100MB

Android - Google Play Store Best on a 7-inch or larger device.

Windows v1.13 Standalone

**NOTE:** Windows may tell you that this is an unknown program. You will have to select "More Info" to run the game the first time.

Linux v1.12 Standalone

The standalone versions are a zip'd directory that can be extracted and run anywhere. No installation needed!

The game easily handles a single player with a mouse. I think the game is best with 4 to 6 total competitors, so add 3 to 5 A.I. players around the screen and enjoy! I recommend that you add yourself somewhere along the bottom of the screen so that your controls are right-side up.

The game is intended to be played on a flat touch table (see the following paragraph for play on a regular computer). The player controls are arranged on the outside of the screen and players control the game by touching the stay or leave buttons. The game will play best if the touch surface can handle multi-touch.

## Instructions (v 1.13 - 28 Jul 2017)

Each of the game's concept are described below in a very arbitrary order. Feel free to skip to the areas that interest you the most. Each concept hopefully can be understood on its own.

I am trying to describe every detail of the game. This is both to improve your play and to improve my game. If you find yourself reading how a formula or rule works and think you might have an idea that works better, please let me know (find my email at the bottom of this page). I welcome all comments and will consider your idea for a future patch.

## Game Flow

### High-Level Game Flow

- All players enter the dungeon.
- All players in the dungeon move to the next room.
- Typically gems will be found and shared as evenly as possible between the players.
- Each player still in the dungeon decides to stay in the dungeon or leave .
- Each player who decided to leave safe-keeps everything they've found and seen.
- Repeat these steps until everybody leaves or you find the spider's lair and are forced out.

- You'll play 5 dungeons this way. The player who has the most money at the end wins.

### Initialize A Game

- Set the "Number of Undiscovered Gold Bars" to 3.
- Pick 5 adventures that haven't been used much recently.

- I keep track of how many times each adventure has been used.
- Adventures that have been seen the least are added to the list first, ties are broken randomly.
- This list of 5 items is then shuffled and the first is used in Dungeon 1, ..., and the last for Dungeon 5.
- When Building a Dungeon, if an adventure room appears before the Spider's Lair, I add 1 to it's number of uses. When the first adventure room appears after the Spider's Lair, it does not count as being used and makes it more likely to appear in the next game. This makes sure that all of the adventures are seen as often as possible without spoiling the randomness of the room order.
- When all adventures have been used at least once, I subtract 1 from every adventure's number of uses. This allows me to introduce new adventures that will likely show up on the next play then blend into the regular mix of adventures.

### Building a Dungeon

- Add 1 to the "Number of Undiscovered Gold Bars"
- Create a set of rooms.
- 15 Gem Rooms with a value called "Level" set from 0 through 14.
- A number of Loot Rooms equal to the "Number of Undiscovered Gold Bars".
- A number of Warning Rooms with different warning types depending upon the dungeon:
Dungeon # | Warning Type 1 | Warning Type 2 | Warning Type 3 | Warning Type 4 | Warning Type 5 |

1 | x 3 | x 3 | x 3 | x 3 | |

2 | x 2 | x 3 | x 3 | x 3 | x 3 |

3 | x 2 | x 2 | x 3 | x 3 | |

4 | x 2 | x 2 | x 2 | x 3 | x 3 |

5 | x 2 | x 2 | x 2 | x 2 | |

- 3 Adventure Rooms (see "Initialize A Game" above).
- All three are of the same type: the first adventure in the first dungeon, the second adventure in the second dungeon, and so on.
- The first room encounter is internally titled "Part 1", the second "Part 2", and the third "Part 3". A few adventures change for different parts.
- In the case of the Mushroom Adventure, 6 rooms are added.

- Randomly order the set of rooms into a randomly ordered list.
- Repeat the following step 3 times on every room in randomly ordered list starting with the second room: if the room is an adventure (and not the Banker Adventure), then move it up one position in the list. This makes adventures a little more likely to appear.
- Scanning the rooms in their new "adventuresome" order, find the first Warning Room with the same warning type as an earlier Warning Room. Convert this into the Spider's Lair.
- If there are "unused" poisons previous to this Spider's Lair, mark the spider as dead and treat this room as an empty room. A poison is considered "unused" if it wasn't previously used to kill a spider in an earlier lair.
- If there are adventure rooms before the Spider's Lair, add 1 to the number of times they have been used. The players may not encounter the adventure because they all leave before seeing it, but the adventure will be revealed to the players before moving onto the next dungeon.

### Enter Dungeon Room

- If the room contains any gems , each player collects into their hand an equal share of those gems. Any remainder that can't be split evenly is left on the floor.
- If a room had 10 gems and there were 5 players, each player would take 2 gems into their hand.
- If a room had 10 gems and there were 6 players, each player would take 1 gem into their hand and 4 gems would be left on the floor.

- If a room contains any Sphinx Coins , each player in that room collects an equal share of coins. These coins are worth $1 each and immediately move into the player's chest for safe-keeping.
- If you see a 3 Card Monte Adventure , three cards are shown. Keep your eye on the left-most card as it is the most valuable (it will have green circles around it). To stay, you must choose one of the cards and win the prize shown on the card.
- If you've entered the Spider's Lair (which always contains a gem-stealing spider), you will run back to the entrace of the dungeon, grabbing nothing on the way out. The spider will be stealing the gems from your hand the entire time you are running out.

### Leaving the Dungeon

- Everybody that leaves takes equal shares of the following items left on the floor:
- gems , and
- gold bars .

- If there were Sphinx Coins left behind, each player only has to share those with other players who also visited that same room and are leaving at the same time.
- Each gem is sold for $1, the gold bars sell for their printed value ($1 - $18), and Sphinx Coins sell for $1. This money is kept safe in your chest .
- Gold bars you collected are shown next to your chest. Their value is already included in your score, but they act as the tie breaker at the end of the game.

### If nobody is left in this dungeon, build and enter the next dungeon.

- If this was because everybody voluntarily left, the remainder of the dungeon will be revealed for a few seconds before entering the next dungeon.

### Else, enter the next room in the dungeon.

## Winning the Game

- The player with the most money in their treasure chest wins the game.
- Ties are broken by the player who took the most gold bars.
- If there is still a tie, all of these players win.
- If you win the game and have a score equal to or higher than the best score ever, you earn the "Highest Score" Achievement .
- If you explore a dungeon as far or further than anybody else ever, you earn the "Deepest Explorer" Achievement .
- If you lost the most gems to The Spider and The Banker (or tied for this distintion), you earn the "Most Gems Lost" Achievement. .
- If you were scared out by The Spider 4 or more times, you earn the "Bold" Achievement .If you were never scared out by The Spider, you earn the "Timid" Achievement .
- If you leave a dungeon immediately before the spider's lair 2 or more times, you earn the "Psychic" Achievement .
- If a computer-controlled player wins the game, it earns the "Skynet" Achievement .

## Chest / Treasure Chest

- When you leave the dungeon, you convert your gems into cash: 1 gem equals $1
- When you leave the dungeon and collect a gold bar, the cash
value is added to your chest. The bar is shown next to your chest as it
is also a tie-breaker.

## Bravery

- When players enter a new dungeon the Bravery is set to a value equal to the number of players
- Bravery drops by 1 whenever
- 1 player leaves, or
- 2 players leave in a 7, 8, or 9 player game.

- Bravery remains unchanged whenever
- Nobody leaves,
- 3 or more players leave, or
- 2 or more players leave in a 3, 4, 5, or 6 player game.

## Odds The Next Room Contains The Spider's Lair

- There is a list of potential rooms that may come next from the pre-defined list (see Building a Dungeon).
- First count the number of Warning Rooms in this list that have warning types that are the same as a Warning Room already seen.
- Divide this number by the number of potential rooms. This is the odds that the next room is the Spider's Lair.
- If the room the players are moving into is the Spider's Lair, then this value is 100%.
- Each Warning Room has an type associated with it. You don't see these in the game since they are arbitrary.
- When building the dungeon, a warning with the same type as an earlier room is the room that gets converted into the Spider's Lair, thus ending the dungeon.
- From this you know that all of the Warning Rooms you see have different types.
- Note that the Poison Adventure will modify this. If you have any unused poisons, the odds that the next room is the Spider's Lair is 0%. See the "Poison Adventure" room below for more information.

## Rumored Gems In The Next Room

- There is a list of potential rooms that may come next from the pre-defined list (see Building a Dungeon).
- Each room type has a calculated value that are summed together:
- Gems rooms are assumed to have the current bravery and their gem value is used.
- Gold Bars are assumed to have the current value of a gold bar.
- The Lava Lake Ferryman Adventure is assumed to a value equal to 4, 3, or 2 times the number of players (cheaper the further in). While you pay this to cross the lava, you can leave after collecting the gems.
- The Sun & Moon Adventure is assumed to have a value equal to 0. This simulates an average of the two payouts (+N gems and -N gems).
- Three card monte is assumed to have a value equal to the average of the three cards shown times the number of players. That average is 1 in the first rooms, 1/3 in the second room, and -1/3 in the third room.
- Every other room is assumed to have a value of 0.

- That sum is then divided by the number of potential rooms. This is the rumored number of gems in the next room.

## Expected Value

- Secret Tip! If you tap the "Hand" icon and number will appear
near the cuff. This is an approximate guess of how many gems you are
expected to earn in the next room. When it greater than 0, you are
expected to earn something in the next room. When it is less than 0,
you are risking losing your gems to the spider.

## Rooms

### Gem Room

- A Gem Room has a value from 0 to 14 which we will call its Level.
- We use the current Bravery, but never a value less than 2.
- We set the number of gems in this room to
- 1 + round(Bravery * (0.29 - 0.012 * Bravery) * (Level + 1))
- but to no less than 1 and no more than 25

- Each player gets an equal share of gems. Any remainders are left on the floor. This can be modified by players who've eaten mushrooms (see Rooms/Adventures/Mushroom for more details).
- Options: Leave , Stay

### Gold Bar Room

- A Gold Bar Room has a gold bar in it in one of three sizes: small, medium, or large
- The size is related to the number of gold bars in player's chests:
- Fewer than 3 gold bars collected: a small bar appears
- 3, 4, or 5 gold bars collected: a medium bar appears
- 6 or more gold bars collected: a large bar appears

- The value of a gold bar is related to its size and the number of players
- A small bar has a 1-times multiplier, a medium bar has a 2-times multiplier, and a large bar has a 3-times multiplier
- Multiply the bar size by the number of players, but by no greater than 6.
- A large bar (3-times) in a 7 player game (but to no more than 6) is worth $18 (3x6).
- A medium bar (2-times) in a 4 player game is worth $8 (2x4).

- Options: Leave , Stay

### Warning Room

- A warning room increases the chance that the next room will contain the spider's lair.
- There can be 4 or 5 types of warnings (see "Building the Dungeon").
- A dungeon will always have 1 warning room before the spider can appear and can have up to 5.
- The first type of warning comes out as "Beware! A gem-stealing spider lies ahead."
- The second type of warnings comes out as "It's giant!"
- The third type of warnings comes out as "It's venomous!"
- The fourth type of warnings comes out as "It eats humans!"
- The last warning comes out as "Abandon hope all who continue ahead!"
- Options: Leave , Stay

### The Spider's Lair

- If you are still in the dungeon and then enter the spider's lair, you'll leave the dungeon and lose all of the gems in your hand .
- As from "Building the Dungeon", the Spider's Lair is the second warning of the same type.
- Options: Poison . If you have any unused poisons, the spider in this lair will already be dead.

### Adventure Rooms

#### Gems for Cash Banker

- In addition to the normal "Stay" and "Leave" options, you can "Stay, turning Gems into Cash".
- You can convert 4 gems into $3, 8 gems into $6, or 12 gems
into $9. The gems immediate go to the banker and the cash immediately
goes into your chest.
- Options: Leave , Stay , Turn 4 Gems into $3 and Stay , Turn 8 Gems into $6 and Stay , Turn 12 Gems into $9 and Stay

#### Sun & Moon

- To stay in the dungeon, a player much either stand on The Sun or The Moon by selecting the appropriate icon.
- In the first adventure, one position earns 2 gems while the other takes 2 gems (but no more than the player has). The second adventure pays/takes 4 gems, and the third pays/takes 6 gems.
- The Sun is always resolved first.
- Options: Leave , Stand on The Sun and Stay , Stand on The Moon and Stay

#### Gems & Lava Lake Ferryman

- Conveniently, this room first gives you the gems necessary to pay the toll.
- A ferryman sits here to help you cross the Lava Lake, the room that comes next.
- To stay in the dungeon, a player must pay the ferryman 4 gems for the first crossing, 3 for the second crossing, and 2 for the third crossing.
- Options: Leave , Pay the Ferryman 4/3/2 Gems and Stay //

#### Lava Lake

- You make no decisions here as you've already paid the gems to cross the lava.
- Options: None, simply cross.

#### Three Card Monte

- Three cards are presented to the players. Two are always
the same: "Win 2 Gems", and "Win 1 Gem". The first time this game is played,
the third card says "Push 0" (where players win nothing). The next room
has "Lose 2 Gems" and the last room has "Lose 4 Gems".
- The cards are flipped upside down and shuffled in front of your eyes.
- To stay, you must pick one of those cards. The cards are flipped back up and you win your prize.
- Note: If you don't have enough money to pay the dealer, you'll simply lose as much as you can.
- Options: Leave , Pick Card #1 and Stay , Pick Card #2 and Stay , Pick Card #3 and Stay

#### Sphinx

- From here, the dungeon path splits into 2 different rooms before coming back together.
- To stay, you'll pick which direction you want to travel.
- Options: Leave , 2 options to Stay each pointing in a different direction

#### Sphinx Coin Room

- There are two Coin Rooms in a Sphinx Adventure. One will
have N Sphinx Coins and the other 2N Sphinx Coins (where N is the
number of players but no greater than 6).
- Players earn $1 for each coin collected.
- Any remainders are left on the floor like gems.
- Only players who came through this room can return by it, so only they can pick up the remaining coins.
- Options: Leave , Stay

#### Spider Scout

- Each scout tells you an approximate location of the spider and its lair.
- The first scout knows the position within 8 spaces.
- The second scout knows the position with 5 spaces.
- The third scout knows the position with 2 spaces.
- Options: Leave , Stay
- The game finds a random space within X spaces of the spider (X is defined by the scout), which we will call space R. It then reports that the spider is at space R, plus or minus X spaces. It's rephrased to be simple, but that is the content of the message.
- The result of this algorithm is that if there is no minimum in the report, then the odds that the spider is in the next room jumps considerably.

#### Mushroom

- There are 6 Mushroom Adventure Rooms (instead of the 3 Rooms in other Adventures).
- Each player may choose to eat a bit of mushroom before continuing on in the dungeon.
- All players who ate the mushroom will either grow or shrink together.
- Players are regular-sized to start, each getting an equal share of the gems in a room, leaving any remainders.
- As you shrink, your share of the gems in the rest of the dungeon halves. As you grow, your share of the gems in the rest of the dungeon doubles.
- You can shrink down to one-fourth of a share and grow up to 4 shares.
- If a "4 share" player grows again, anybody who did not eat a mushroom will shirnk.
- Players with "1/4 share" will never shrink any smaller.
- Options: Leave , Stay , Eat a Portion of Mushroom and Stay
- The Mushroom Adventure alters the next Gem Room the players encounter.
- Players will either be double-grown, large, regular-sized, small, or double-shrunk.
Double-grown get 16 shares of gems, large players get 8 shares of gems, regular-sized get 4 shares,
small players get 2 shares, and double-shrunk get 1 share.
- Here are 3 examples:
- 16 Gems, 2 large players, 2 regular-sized players, 4
small player. There are 32 total shares (8 + 8 + 4 + 4 + 2 + 2 + 2 +
2). The large players earn 4 Gems, the regular-sized players earn 2
Gems, and the small players earn 1 Gem.
- 10 Gems, 1 regular-sized player, 2 small players. There
are 8 total shares (4 + 2 + 2). The regular-sized player earns 5 Gems
because 10 Gems * 4 Shares / 8 Shares = 5 Gems. The small players earn
2 Gems because 10 Gems * 2 Share / 8 Shares = 2.5 Gems. The two half
gems leave a remainder of 1 gem on the floor.
- 25 Gems, 2 double-grown players, 1 regular-sized player, 2 small players, 1 double-shrunk player. There are 41 total shares (16 + 16 + 4 + 2 + 2 + 1). The double-grown players earn 9 Gems because 25 Gems * 16 Shares / 41 Shares = 9.75. In the same manner the regular-sized player earns 2 Gems, the small players earn 1 Gem, and the double-shurnk players earn nothing.

#### Used Poison Bottle

- When the group comes along a Poison Bottle, the group knows that somebody has come through and poisoned The Spider in its lair.
- For each poison bottle passed, one Spider's Lair is converted into a blank room and the players may continue. See "Building the Dungeon" above for more information.
- Options: Leave , Stay
- This drops the probability that the spider will be in the next room to 0% until you find the dead spider.

## Bats

- The bats are disturbed every 5 rooms. Note that the Sphinx and
Lava Lake Adventures are counted as 1 room despite spanning multiple
tiles.

## A.I.

### Personality Variables

- Post Warning Delay (integer 0 through 3)
- Chance To Leave Extra (real 0% to 16%)
- Hard Expected Value Cutoff (real -1.5 to -0.1)
- Good Take (integer N to 4N+1, where N is the number of players)
- Attention (real 45% to 95%)

### Stay/Leave Logic

#### Preprocessing

- RumorLeave = Max Distance Away - 3 * {8,5,2} / 2, but no less than the previous RumorLeave
- Calculate my distance past the first warning room (this is equal to 0 when we are standing on the first warning room)
- Calculate my odds to leave as 0.5 * Odds of Lair in Next Room + Change To Leave Extra

#### If we are in the last dungeon

- Shrink my odds of leaving by 98%
- Modify my idea of a "good take" to be 4 times higher (4N to 16N+4)

- If I only have one option, select that option.
- If my expected value is less than or equal to my Hard Expected Value Cutoff, leave.
- If my take (see "Take") is greater than or equal to my concept of a good take, leave.
- If we are in the final dungeon and my current score plus my
gems in hand plus my estimated take is greater than the best current
score plus the number of players still inside minus 1, leave.
- (InHand + InChest + Take) > (BestInChest + Players Inside - 1)
- I'm going to assuming that I could leave and get my current
score plus some of the gems on the path. I'm going to also assume the
the winner will at least have their current score and will probably
take a number of gems equal to the number of players left inside. This
calculation could be refined quite a bit (and probably will be), but
it's a good first estimate.

- If we are at or past the RumorLeave point, leave.
- If our distance past the first warning is greater than or
equal to our Post Warning Delay, and we have at least 1 gem, and a
random real number from 0 to 1 is less than my odds to leave, leave.
- If my odds to leave are 0, our random number will never be less than this and we will stay.
- If my odds to leave are 1, our random number will always be less than this and we will leave (assuming the other conditions are true).

- Except in some adventures (see below), we will then remove the Leave option and randomly select from the remaining options.

#### Three Card Monte Logic

- If a random real from 0 to 1 is less than our attention, the A.I. will identify the card with the "Win 2 Gems" on it.
- Otherwise, the A.I. will pick a random card.

## Take

- This is an internal calculation that the A.I.s use to determine
how many gems on the path they will take if they leave. It is only an
estimate.
- It starts by adding all of the gems and gold bars left behind.
It then divides this sum by the square root of the number of players
still inside. This is the take.
- For example, if there are 4 Players inside, and there is a gold
bar worth $10 and 2 gems on the path, it will calculate the take as
($12 / sqrt(4)) = $6.

## Statistics

- Statistics are tracked only for the device this game is running on; these are not global or sharable statistics.
- From the main menu, you'll see a "?" button. It contains a summary of every stat tracked.
- At the end of a game, you'll see a summary of what happened during that game.
- Games Played: The total number of games played.
- Number of Players: The total number of players in all of the games played. A.I.s are counted.
- Gems Looted: The total number of gems that were taken from dungeons.
- Gold Bars Looted, sold for: The total number of gold bars that were taken from dungeons and the total amount they sold for.
- Sphinx Coins Looted: The total number of sphinx coins that were taken from dungeons.
- Lone Leavers: The total number of times that a single person left.
- Banker's Profit: The total amount of money the banker profited from players who exchanged gems for cash.
- Losses to 3 Card Monte: The total amount of gems that the carnie managed to take from players.
- People Who Stood on the Sun: The total amount of people who stood on The Sun.
- People Who Stood on the Moon: The total amount of people who stood on The Moon.
- Lava Lakes Crossed: The total amount of people who paid 2 gems to cross a lava lake.
- Spider Lair Reports Received: The total amount of reports received, sir.
- Mushrooms Eaten: The total amount of players who ate a piece of mushroom.
- Spiders Killed: The total amount of dead spiders seen.
- Min Depth Explored: The shortest distance the players traveled before they either all left or were scared out.
- Furthest Depth Explored: The deepest distance that players traveled before they either all left or were scared out.
- Spider Lairs Discovered: The total number of spider lairs that were encountered which scared out the remaining players.
- Gems Stolen by the Spider: The total number of gems that were stolen by the spider from the players' hands.
- Psychics: The total number of people who earned the Psychic Achievement.
- Games with AIs: This is the total number of games which ended with at least one A.I. player.
- Games won by AIs: This is the total number of games won by an A.I. player.
- Highest Winning Score: This is the highest score ever scored.
- Average Winning Score: This is the average of all of the winning scores.
- Lowest Winning Score: This is the lowest score that ever won a game.

## Interface Elements

- On the main menu, this is the button you press to start playing the game.
- If a player is joining the game, the play button turns grey.
- Select this to join the game.
- Select this to leave the game.
- Select this to have a computer play at this position. A human player can take over by making a choice from that position's option menu. If a human player must leave, you can select this option during the game to have the computer take over for that position.
- This player has not yet selected an option.
- This player is currently selecting an option.
- This player has selected an option. Once everybody has selected an option, you still have a second to change your mind.
- From the main menu this quits the program. From the game, it exits you back to the main menu.