Difference between revisions of "War of Wizards: Plan"

From RogueBasin
Jump to navigation Jump to search
(first draft)
 
(second draft)
Line 6: Line 6:


A better name would be most appreciated!
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 ==
== Concept ==


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


== Language ==
== Language ==
Line 24: Line 27:


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


Then they either cast one of three randomly given spells for that
* Cast one of three randomly given spells for that turn
turn, use an item, pick up an item or press the 'end turn' key. There
* Drink a potion from their inventory
are no weapons or hand-to-hand combat.
* Pick up a potion
* Nothing (Press the 'end turn' key)


Then the opponent does their move.
There are no weapons or hand-to-hand fighting.


== Controller ==
== Controller ==


The computer connected to is designated as the controller. That
The computer connected to is designated as the controller. That
computer is responsible for generating stuff and setting game options.
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.
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 ==
== Data Sending ==
Line 45: Line 69:


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


Line 53: Line 78:
After each turn, the following things are sent:
After each turn, the following things are sent:


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


Line 76: Line 101:
=== Dungeon Layout ===
=== Dungeon Layout ===


Assume dungeon layout is 25 by 25 squares. This means 625 characters
Dungeon layout will be a max of 25x25. This means 625 characters
of uncompressed data.
of uncompressed data.


Line 109: Line 134:


To send a location, convert the X coords to letters (0=a,1=b, etc),
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 item/spell/effect
keep the Y coord as a number, then add the ID of the potion, spell or
(letters). Example:
effect (letters). Example:


  ab13f
  ab13f
Line 116: Line 141:
ab = X coord (26+2 = 28)
ab = X coord (26+2 = 28)
13 = Y coord (13)
13 = Y coord (13)
f  = ID of Item/Spell/Effect ('f' could be fire spell effect, for
f  = ID of potion, spell or effect ('f' could be fire spell effect,
example)
for example)


Multiple locations are combined using a non-number non-alpha
Multiple locations are combined using a non-number non-alpha
Line 123: Line 148:


Letters are always lowercase, for locations.
Letters are always lowercase, for locations.
== After Turn ==
# All data is sent to the other player
# Previous dungeon layout is drawn
# Previous item locations are drawn
# New player positions are drawn
# New magical effects are drawn
# This stays for 250ms
# New dungeon layout is drawn
# New item locations are drawn
# New player positions are drawn
# 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 ==
== Dungeon layout ==


* Generate random perfect maze to fill the dungeon.
* Generate 25x25 square random perfect maze to fill the dungeon
** Wall squares are 0
** Wall squares are 0
** Empty squares are 1
** Empty squares are 1
* Overlay at least 1 room. Rooms are never connected to each other.
* Overlay rooms. Rooms are never connected to each other
** Room squares are 2
** Room squares are 2
* Remove all dead ends.
* Remove all dead ends
 
* Place potions in random locations. Each square can contain one
Number of potions = free squares / (something)
potion maximum.
 
* Create starting square for controller and opponent. Each player
Number of traps = free squares / (something)
starts in a different room.
 
* Place traps in random locations.
* Place potions in random locations.
 
Each square can only contain one item maximum.


* Create starting square for controller and opponent
Room sides are 3, 5 or 7 squares. 2, 3, 4, 5 or 6 rooms are generated.


Starting squares must not be walls and must not contain items or the
Number of potions = Free squares / Something
opponent.


== Interface ==
== Interface ==
Line 152: Line 190:
my screen, for testing. The interface needs to contain:
my screen, for testing. The interface needs to contain:


* A space big enough to show all of the dungeon
* A space big enough to show the entire dungeon
* Game messages
* Game messages
* Chat messages
* Chat messages
Line 159: Line 197:
* Who's move it is
* Who's move it is
* Inventory
* Inventory
* Available actions (moves, inv, spells)
* Available actions


The dungeon will be displayed in text format, there will be no
Dungeon is displayed as text on a black background:
graphical output.
 
. (white)  - Room
# (white)  - Corridor
@ (white)  - Player
@ (red)    - Opponent
! (various) - Potion
* (various) - Effect
 
No characters are used to display room walls.


== Keys ==
== Keys ==


All done via numberpad, except for chatting.
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


* /        - Cast spell 1
== FoV ==
* *        - Cast spell 2
* -        - Cast spell 3
* 12346789 - Move
* 0        - Pick up item
* +        - Inventory
* Enter    - Bring up chat prompt / Send chat message
* ./del    - End turn / Close chat prompt


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


== Dungeons ==
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.


Dungeons will be small, to avoid lots of wandering around aimlessly.
Can see:  @.....@
There will only be one dungeon per game. Dungeons will be randomly
generated.


The dungeon is initially unknown to both players. FoV will be used.
Can't see: @......@
Items are only shown if they appear in the FoV.


Players always start far away from each other.
Can't see: @.#.@


== Creatures ==
== Creatures ==


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


== Spells ==
== Spells ==
Line 199: Line 247:
Only good and neutral spells are randomly given. Bad spells can be
Only good and neutral spells are randomly given. Bad spells can be
done via the random spell or potions.
done via the random spell or potions.
Many spells have visual effects, which will be displayed for 250ms.
However, this delay is always added to avoid metagaming. (so the
opponent can't work out if a spell was cast, or not)


=== Positive ===
=== Positive ===
Line 294: Line 338:
opponent: "You hear lightning in the distance."
opponent: "You hear lightning in the distance."


== Items ==
== Potions ==


Each square can contain a potion or a safe trap. Additionally, each
The player can have up to 9 potions in their inventory. Pressing +
square can contain a set trap.
then the potion number (1, 2, etc) will drink the potion.


The player can have up to 9 items in their inventory. Pressing + then
Potions have random appearances. Five different potion types will be used in each game. These will be: yellow, blue, red, green and orange.
the item number (1, 2, etc) will either drink the item (if potion) or
set the item (if trap).


=== Traps ===
Once a potion has been used, all other potions of that type will be
 
identified to the player.
Traps can be found around the dungeon and then set somewhere in the
dungeon. They will be triggered only by the opponent. When a trap is
triggered, the person who put the trap down gets a message "You hear a
trap going off in the distance."


''Boulder'' -
The dungeon and initial player inventories will contain a random small
Does d2 damage.
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.


''Forget -
Players start with 2 different identified potions, so those appearance
Forgets the dungeon layout.
types are automatically identified.
 
''Destruction'' -
Destroys walls nearby.
 
''Sonic'' -
Potions held by nearby people might be destroyed.
 
=== Potions ===
 
Random appearances. Players start with 2 potions. More can be found
around the dungeon.
 
There is one potion appearance for each magic spell.
 
Once a potion has been used, all other potions of that type will be
identified to the player.


== Winning ==
== Winning ==

Revision as of 12:50, 8 February 2007

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.