War of Wizards: Plan

From RogueBasin
Revision as of 14:50, 8 February 2007 by Icey (Talk | contribs)

Jump to: navigation, search

Contents

Introduction

This page has the draft details for how my entry in the 2007 7DRL Challenge will work. Changes and suggestions are very welcome. Feel free to just edit them in and I'll keep anything I like.

A better name would be most appreciated!

The following is an ideal version of the game. It is unlikely that there will be time to write everything here.

Concept

Duelling Wizards is a turn-based text-output two-player roguelike game. Each player controls a wizard in a small random dungeon. The wizards cast spells and use potions until one of them is killed.

Language

The game will be written in Visual Basic 6, so it'll be Windows only. It'll be open source.

Play

Each wizard starts with 5 hit points. A random player takes the first move.

Each turn a player can move their wizard 0 to 5 squares in any direction. Then they do one of the following:

  • Cast one of three randomly given spells for that turn
  • Drink a potion from their inventory
  • Pick up a potion
  • Nothing (Press the 'end turn' key)

There are no weapons or hand-to-hand fighting.

Controller

The computer connected to is designated as the controller. That computer is responsible for generating stuff and the player using that computer can change game options, if they want.

The controller can release control between games.

Options

The controller can change the game options if they want to. Configurable options are:

FoV - Default to on. If off, the whole level can be seen.

Level Size - Default to be 25x25. This can only be odd numbers. If this is smaller, the number of rooms randomly generated needs to be modified.

Potions - Default to on. If off, no potions spawn in the dungeon or player inventories.

Changes to options can only be done while no game is in progress. Changes to options are not saved between sessions.

Data Sending

At the start of the game, the following things are generated on the controller computer:

  • Random dungeon layout
  • Random potion appearances
  • Random potion locations
  • Random potions in player inventories
  • Random starting positions

This data is then sent to the other player.

After each turn, the following things are sent:

  • Messages (via an id number)
  • Dungeon layout (only if it changes)
  • Magic effects locations (only if necessary)
  • Player positions
  • Potion locations
  • Lost/Win flag (only if necessary)

Chat messages are sent immediately.

Before sending, data needs to be compressed. A lot.

Data Compression

No Compression Needed

Messages are sent as very short id numbers.

Chat mesages are sent seperately.

Lost/win flag is just one character.

Dungeon Layout

Dungeon layout will be a max of 25x25. This means 625 characters of uncompressed data.

How could this be quickly compressed?

Convert 0's (walls)

  • [...]
  • 000 to c
  • 00 to b
  • 0 to a

Convert 2's (rooms)

  • [...]
  • 111 to C
  • 11 to B
  • 1 to A

1's are for corridors, so not much point compressing those.

After this, see what patterns are regularly left and convert those to other characters.

This will significantly reduce the data size.

Compressing Locations

Some spells (ray of cold, etc) can be worked out on the opponents computer from just the starting location. This method should be used if available.

To send a location, convert the X coords to letters (0=a,1=b, etc), keep the Y coord as a number, then add the ID of the potion, spell or effect (letters). Example:

ab13f

ab = X coord (26+2 = 28) 13 = Y coord (13) f = ID of potion, spell or effect ('f' could be fire spell effect, for example)

Multiple locations are combined using a non-number non-alpha character.

Letters are always lowercase, for locations.

After Turn

  1. All data is sent to the other player
  2. Previous dungeon layout is drawn
  3. Previous item locations are drawn
  4. New player positions are drawn
  5. New magical effects are drawn
  6. This stays for 250ms
  7. New dungeon layout is drawn
  8. New item locations are drawn
  9. New player positions are drawn
  10. New messages are written to the log

Message Log

Only show messages for the current turn. Needs wrapping. Needs ID's for all messages. Needs to incorporate chat messages, without removing game messages from view.

Dungeon layout

  • Generate 25x25 square random perfect maze to fill the dungeon
    • Wall squares are 0
    • Empty squares are 1
  • Overlay rooms. Rooms are never connected to each other
    • Room squares are 2
  • Remove all dead ends
  • Place potions in random locations. Each square can contain one

potion maximum.

  • Create starting square for controller and opponent. Each player

starts in a different room.

Room sides are 3, 5 or 7 squares. 2, 3, 4, 5 or 6 rooms are generated.

Number of potions = Free squares / Something

Interface

The whole window needs to be small enough that I can fit two of it on my screen, for testing. The interface needs to contain:

  • A space big enough to show the entire dungeon
  • Game messages
  • Chat messages
  • Actions that can be done
  • The players hit points (not opponents)
  • Who's move it is
  • Inventory
  • Available actions

Dungeon is displayed as text on a black background:

. (white)   - Room
# (white)   - Corridor
@ (white)   - Player
@ (red)     - Opponent
! (various) - Potion
* (various) - Effect

No characters are used to display room walls.

Keys

All done via number pad, except for chatting.

/        - Cast spell 1
*        - Cast spell 2
-        - Cast spell 3
12346789 - Move
0        - Pick up potion
+        - Inventory, then 123456789 to drink potion
Enter    - Bring up chat prompt / Send chat message
./del    - End turn / Close chat prompt

FoV

The dungeon layout is initially unknown to both players. FoV will be used. Potions are only shown if they appear in the FoV.

Players can see up to six squares in every direction. The FoV is a square. This is six squares so that a player could use all their five moves to get next to the other player.

Can see: @.....@

Can't see: @......@

Can't see: @.#.@

Creatures

There are no other creatures in the game. This is simply a 2-player, player-versus-player game.

Spells

Only good and neutral spells are randomly given. Bad spells can be done via the random spell or potions.

Positive

Ray of Cold - Goes through walls (but doesn't destroy them) until it reaches the edge of the dungeon. No chance of avoiding. The caster is told if they hit their opponent. No messages for the opponent, but they might see the ray. (d2 damage)

Fire Storm - Fire floods forward from the caster, up to a random distance between 5 and 10 squares. No chance of avoiding. The caster is told if they hit their opponent. No message for opponent, but they might see the fire.(d2 damage)

Magic Mapping - Reveals the layout for a random section of the dungeon. No message for opponent.

Collapse - Parts of the dungeon walls inside rooms are weakened, which makes boulders randomly fall down and crush people. Message for both players: "Parts of the dungeon ceiling collapse!" (d3 damage)

Alter Dungeon - The dungeon layout is completely changed. The new layout is known to the caster, but unknown to the opponent. Opponent gets a message: "You sense your surroundings are different."

Identify - Identifies potions in the inventory. No message for opponent.

Item Detection - Shows the locations of some items in the dungeon. No message for opponent.

Life Detection - Shows the location of the opponent. Message for opponent: "You feel like you're being watched."

Trap Detection - Reveals the locations of traps in the nearby area. No message for opponent.

Health Detection - Shows the hit points of the opponent. Message for opponent: "You feel like someone is looking through your medical records!"

Restoration - Heals one hit point. No message for opponent.

Take Life - Steals one hit point from the opponent, if they can be seen. Message for opponent: "You feel like your soul is being taken away."

Steal - Takes d2 items from the opponent, if they are in a square adjacent or diagonal to the opponent. Message for opponent: "Your pack feels lighter!"

Neutral

Random - A random spell is cast.

Demolition - Randomly destroys walls around the caster. Message for opponent: "You hear walls being destroyed."

Create Potion - A random potion appears in a random square of the dungeon. No message for opponent.

Blink - Moves the caster to a new unoccupied random position in the dungeon. No message for opponent.

Blink All - Moves everyone to new unoccupied positions. Message for opponent: "You are teleported!"

Negative

Forgetfullness - Parts of the dungeon are forgotten for the caster. No message for opponent.

Strike - Lightning strikes down and hurts the caster. (d2 damage). Message for opponent: "You hear lightning in the distance."

Potions

The player can have up to 9 potions in their inventory. Pressing + then the potion number (1, 2, etc) will drink the potion.

Potions have random appearances. Five different potion types will be used in each game. These will be: yellow, blue, red, green and orange.

Once a potion has been used, all other potions of that type will be identified to the player.

The dungeon and initial player inventories will contain a random small selection of variations of potions from the entire selection, to increase the chance of the same potion appearing multiple times. This is to give players a bigger chance of knowing potions that they find.

Players start with 2 different identified potions, so those appearance types are automatically identified.

Winning

When one player has their hit points reduced to 0 or below, they are dead. The other player wins.

Personal tools