NOTE: If you're
looking for a TTopRPG 2.0 download, go here
instead! This page is a very old diary I typed up during my development of an
This is a small
developer diary describing my attempts at making a Visual Basic program designed
to duplicate the activities of the tabletop for purposes of playing an authentic
Dungeons and Dragons game online. This was sparked by playing World of Warcraft,
when a guild member talked about missing playing the game. I've been playing
lately myself, taking someone through Return to the Temple of Elemental Evil
and him taking me through City of the Spider Queen.
I first wanted
to see if there were any tools available that would allow me to play. So I downloaded
klOoge. It had some interesting functions, but when I connected with my laptop,
some of the functions didn't work, and when I moved some icons around in the
primary list, they disappeared from the main screen, and I couldn't get them
back. It wasn't very intuitive.
I also took a
look at screenshots from OpenRPG, but didn't try to run it.
had a primary grid screen with the capacity to display a map underneath, and
a primary chat area.
I figure if I
develop my own, it will need the following things:
- Grid area with
ability to display multiple jpg maps, one at a time, and allow scrolling and
zooming, with the ability to hide or shade areas of the map (DM only)
- Primary chat
area with ability for player-player private chat and party only chat (assuming
only one DM - if there are multiple DMs, they should get a private chat too)
- Dice rolling
dialog with quick way to select dice and roll them, similar to picking them
up at the table and rolling them yourself. The DM should have the ability
to roll dice and either show or hide them. More often, he hides them.
- Ability to
move icons around, remove some, add some new ones, and add indicators where
necessary (where to place a fireball, where are you searching, etc.). Players
can move their own icons, or possibly any other, when the DM allows them to
- Ability to
keep notes, some visible, some not (intiative order (DM), remaining hps of
characters, spell effects up and rounds remaining, etc)
- Support delaying
in combat and reminder to ask if still delaying
Other things to
keep in mind:
- A single player
should be able to control multiple characters. The DM sets this up
- A session should
be savable, including how maps are hidden
- klOoge had
an interesting way of revealing maps - a box drag system, which I'm developing
for myself now
What I've accomplished:
- I have a main
form developed that supports resizing.
- I have main
chat and private chat ability
- I can display
a single map (hardcoded), which took some work getting lined up in Corel.
It was also difficult to determine the right size for the 5' squares so that
they coincided with the squares on the original map.
What I have yet
to do, immediate plans:
- DONE 6/7: Base
the grid on scrolling instead of always starting at 0,0
- Done 6/7: Try
a scanned image instead of one taken with a digital camera - distortion may
throw the grid lines off in the picture. I may need to support adjusting the
grid in different parts of the map, too.
- DONE 6/7: Verify
that a 10' square is 22.4 pixels across instead of 22.746 the way Corel suggests
- after getting a scanner today, I found it is MUCH more accurate, although
I still cannot determine the size of a 10' square on a map without some trial
and error. After I set up a map resource editor, this shouldn't be much of
- DONE 6/8: Group
only chat (everyone can see it, I'll leave it up to the DMs to make use of
the Honor System)
- DONE 6/8: Zooming
on the center of the map image instead of basing it on 0,0 (Got this working,
but I'm finding it might be more intuitive at times to be able to zoom by
pointing on a surface on the map instead of using the scroll bars and zoom
buttons. I'll see what I can do, but this will probably be a future enchancement.
Another nice feature might be to click on apoint on the map and have it move
that point to the center)
- DONE 6/12:
Figure out why I need a conversion factor of 22.456 when calculating the size
of a loaded image (I won't bother trying to figure this out for now. Hopefully
the conversion factor is exe determined and won't change on different machines)
- actually I found the answer on p.129 of Programming VB 6.0 - I used the
.ScaleX method with vbHimetric and vbPixels to get an actual pixel dimension.
I replaced all the conversion code and it works identically. Glad that loose
end is cleaned up. I actually found this while trying to look up how to display
text in a picture box.
- DONE 6/8:Safeguards
against trying to send chat text when a session isn't open
- DONE 6/9: Safeguards
for resizing the forms too small
- DONE 6/9: Limit
popup options to players (they see the option to Kick and Ban players when
they right click on a name)
- DONE 6/9: Fix
a bug with a chat line getting focus when a chat form is activated, causing
the application to freeze from 100% CPU activity as the main and private forms
fight for focus when the private form is minimized. I would like chatting
forms to set focus to their chat lines when activated for convenience. (I
got it to work by setting Tabstop to False on all controls except the input
line, and setting the focus to the input line if the chat area is clicked.
It accomplishes the same purpose without the infinite loop problem of setting
the focus on the Activate message).
- DONE 6/9: Hide
private chat boxes instead of closing them, to preserve text
- DONE 6/9: Make
the scrolling change more intuitive based on zoom and map size instead of
always being 40 large/10 small (I set small change to 4 always, 20 to large
always, and even allow the map to be centered on any point, all the way to
its edges. This still might need some more work. I can see where a minimap
will be needed where you can click it to jump to any location on the map)
- Integrate the
box routines into hiding the map
- Rename controls
and forms to final versions, reorganize code (functions and subs at the end,
form functions at the top, and scroll, text line and button routines grouped
together), get rid of test routines. Or do I want functions associated with
specific controls grouped near those control functions (like the specialized
Picturebox paint routine close to the Picturebox routines so I can find it
quickly by double clicking the picturebox on the design form? Sigh, I dunno)
- Started 6/10:
Dice dialog, and toggle to reveal in main chat (DM only, players are always
revealed, for now) - I don't ahve a toggle, but all player rolls are public,
DM rolls are hidden, and the DM knows if the roll is authentic
- Display icons
for characters and cycle through in order of initiative. DM will have a larger
display showing all creatures involved in combat (each will need an Init modifier
and ability to modify as the DM), and ability to add new creature to combat
as the need arises
- Send hiding
data to all machines as changes are made, and provide updates to new players
when they join (map packs, hide data, etc)
- Allow browsing
of old maps (another dialog), and force loading of new active map
- Map resource
editor, with ability to set square size and offset, and view the results before
making them part of a map pack
- Perhaps upgrade
the DirectX version from 7. I think Visual Basic 6.0 only supports up to DirectX
8 - DirectX 9 I believe requires .NET. I discovered a limitation where my
laptop could not communicate with a remote user with my main workstation as
the host. A second machine on his network also could not communicate. It might
be a limitation in DirectX, perhaps all games have that problem. I imagine
games that are hosted remotely from all machines don't have this problem.
For now, other than that limitation, it does what I need.
- Started 6/13:
Drag icons around on the map screen - I wrote a small program to demonstrate
this and have integrate markers into the app, but not icons yet
I don't think
the online program has to keep track of absolutely everything, just what it
takes to get through a tabletop session. Much information only needs to be known
at the player level. Sometimes the DM needs to look at player sheets to see
if they have an ability, though.
- Made a map
list dialog supporting multiple map files, one loaded at a time on the main
form - later this will need to support saving and loading the hide and icon
- Added a few
more short term changes above
Most of the items
form 6/7 are done. Here's a new immediate changes list:
- Design how
the final form will look, with a map minimap, character icon list and initiative
order block. I figure anything else can be just another dialog (dice rolling,
character info, map browsing, etc.)
- Started 6/10:
Set up dice rolling dialog allowing you to quickly select 1 or multiple dice
and roll them all - will we need a seeder to make sure it starts random? I'll
test. I also need to think about automatically applying modifers for things
like attack rolls, dispel checks, concentration for defensive casting, spell
- Started 6/10:
Move session join and host buttons into the top menu to make room for more
immediate functions in the frame next to the map display. The menu selections
should disable after a connection. A user should also be able to willingly
disconnect without ending the program. (I still have to arrange for a disconnect
without ending the program. And disabling menu options is frighteningly easy.)
- Add markers
and hiding to the map, and save the information and reload it. This will eventually
require arranging files into base map packs, and another folder specifically
for adventures in progress (any two or more of which could easily involve
the same map pack but different characters).
- Done 6/9: Make
zooming and scrolling on the map less klunky (I enabled drawing the map on
scroll instead of just letting the control go. It stutters a bit but it's
easier). Now the map can be centered anywhere. I'll leave it the way it is
- Done 6/14:
Experiment with adding markers to the map with information ("Fireballing
here", for example), and sending them across to other machines and removing
them. This should equate to what you're doing at the table. If you put something
there or take it off, everyone should see it happen. Possibly, some private
markers, especially for the DM, may be available. - DM can delete any marker,
only clients can move and modify their own
I just realized
I could add something to the dice rolls to allow players to set up their own
buttons with modifiers and send that across. For instance, Concentration checks,
Attack 1, 2 and 3 for the primary attacks, Concealment roll, Reflex save, etc.
So it would have a description blank, a modifier blank, and a button. Click
it, and it rolls the dice, adds the modifer, and sends the result and the description.
This would have to be set up on a per character basis, and sinze a single player
could control multiple characters, they will need to be able to select which
character they are rolling for (which will probably be enforced by whose turn
it is in combat, but could easily need to support rolling out of turn, such
as a Reflex save against a fireball).
I just added five
description and modifier blanks to the dice screen to test out special rolls.
They report the description and modifier to all the machines, now, too. But
I forgot to show the actual dice rolls. That would be important for detecting
possible crits. The program could probably be set up to automatically report
a crit roll, too.
I've also started
making a toolbar that will allow a user to place, remove or move icons (on a
player's turn only, although the DM can do it anytime), do the same with markers
(anyone, anytime), and hide/reveal the map (DM only). At first, icons can be
dragged anywhere, but in times of combat, I want to enforce movement rate and
let the program count down squares remaining based on movement rate (supporting
single moves, double moves, and modifiers due to spells).
I took a break
for a day because I was a bit burned out from programming, and I had a killer
headache (not enough carrots in my diet).
Anyway, I got
text working and can even calculate its size for centering. What I figure I'll
do is detect the pointer moving over an icon, and if the icon it's on is different
from the last one it was on, it will repaint the screen with the info of the
icon (name, hp (DM) or status (player - they can see their own hp though)),
or allow seeing all statuses and names for all icons always.
I wrote a little
stub app to test placing icons, highlighting them and chaing their information.
I'm realizing I may need a list of all icons to look up their information instead
of highlighting each, much like I keep notes of creature's hit points on a scrap
piece of paper while the fight is taking place.
to make the program intuitive to how a game is conducted at the table.
The program now
allows me to make markers, and drag both the markers and icons around.
I need to set
it up for zooming and using map coordinates instead of PictureBox coordinates.
I also assume
I'll need a Quick Marker function so when I ask where a fireball is getting
cast, the player can just right click and select "Quick Marker" instead
of having to type anything.
I'm also thinking
about how the program will need to save these things, and send them across to
people that are joining in the middle of a session.
I don't know yet
what challenged there will be for people that get disconnected and have to rejoin.
Perhaps they can just do a reload. If the master disconns, though, that pretty
much messes everyone up, unless the master saves its information often. Perhaps
it can save it in chunks (markers as they are placed or moved, icons as they
are placed or moved, etc.)
Also, the master
will be the one responsible for telling all machines what the id's are for created
icons and markers. The client will tell the master it is placing the icon, then
the master will choose an id for it and send it to all clients, including the
one sending the request. That way, no id's will overlap.
I sent off the
latest Alpha and am hoping to test it with two clients soon. I still haven't
solved the problem of two machines on the same LAN communicating to a machine
across the internet (the second machine on the LAN freezes and doesn't always
receive system messages).
In order for the
program to be usable next week, I need:
- Character list
- enterable by the client, savable and reloadable, with a selection for a
user controlling multiple characters. Should the master save them and send
them down or should the user be responsible for loading them?
- Implement the
hiding algorithm, and don't render monster icons in nonvisible areas
- Send data down
to clients that join in the middle of a session (characters, hiding data,
- Implement icons
and the ability for DM to move all, and to establish which character(s) a
single user can move on their turn
The final version
- A screen that
organizes all creatures and characters involved in battle by initiative roll
(as a creature is added to the list, it can roll initiative automatically,
assuming its Init modifier is set up. Characters can roll initiative explicitly
and have a special message sent across)
- A screen for
clients to load and look at previously explored maps
- Notes, public
- Treasure, CR,
magic items notes
portraits for character icons, graphics for creature icons
- Enforce positioning
in grids during combat
Other things I've
- If a character
turns invisible, should there be a way to hide its location? Perhaps the DM
flips an invisible flag so that only that character can see himself?
6/15/2005 - #2
I just did an
alpha test. The other user said he couldn't see the button used to resize the
upper half of the form. I checked my code and found I that I was basing the
new position of the button on the size of the map window, but I was repositioning
the button before I resized the window. This caused the button to be a little
off sometimes. So, I moved the button adjustment to occur after the map window
adjustment, and it looks stable. Hopefully that bug won't happen again.
Also, the application
errors out when you minimize the main form, becuase it attempts to perform a
Here's a link
to the VB install package. Unzip this into its own folder and run setup. Choose
an installation directory and click the computer icon. After it's installed,
navigate to the installation directory and run Project1.exe. NOTE: This program
will not work without the \map and \sounds directories.
I realized it
might be nice in my box drag routines (which I have another app successfully
implementing) to be able to set an enter group of visible squares to be visited,
without replacing them. The only splitting would be where boxes are cut by the
edge of the box. Perhaps it might be easier to flip a switch and just make all
boxes visited, then the DM can set to visible whatever he likes.
I also have an
icon displayer going, but the shrunk images don't come out very well. I'm sure
if I upgraded to Direct3D, they would look much better. The way I have it will
do for now, for testing.
Another nice function
on the main map form would be to adjust the damage taken by an icon, instead
of having to set its damage taken so far directly.
I would also like
to display the app's version number on the main form, since it auto increments
each time I build an exe from it.
I'm at the point
where I'm ready to think about getting monster and character icons onto the
map. It's presenting some challenges though, and I need to think about how I'm
going tog et it to work. Displaying the icons and tracking their information
is the easy part. The hard parts are:
- Setting it
up so that a player that logs on can submit a character or choose a previously
submitted character to control. Being able to select one prevents having to
re-enter the information every time they log on, and allows other players
to control the icon if the other player is absent. This character is only
part of the current adventure for now, but will likely be stored on the player's
machine for future submissions for other adventures.
the player icons on the main form (only the ones selected to be controlled
by players) with a clear indicator of whose turn it is to move - I figure
this will be a vertical list able to show at most 6 icons with the ability
to scroll up and down. I may need to order the icons by initiative as well.
- Locking the
icons so that players can only move the icons that the DM sets for them to
- Multiple icon
information display options
all or display on mouseover
- SHIFT select
- Integrate icon
selection with the initiative screen from the DM side, through rolling initiative,
selection for whose turn it is, adding more to the battle, and auto-advancing
Of course, it's
probably just best if I work on one thing at a time:
- Get icons and
graphics displaying with information
- Set up information
I also realized
that the best way to design the initiative screen is to allow the DM to auto-advance
down the list with the click of a button (which then notifies everyone whose
turn it is and activates/locks the appropriate icons), rearrange the order manually,
and set it to be the turn of anyone the DM wishes. At first I was just going
to allow auto-advancing the turns, but I realized that was too restrictive.
This way, the design is a little more open.
Well, after a
long break I decided to come back to it. Over the past couple weeks, I've added
- A functional
combat screen that supports advancing turns, decreasing spell durations, find
combatants on the battle grid, and altering orders in the list by changing
the init value, just like I would on my scratch paper at a table
- Icons with
the ability to change their data (PC's can only change the name and portrait)
and move them around. The program doesn't lock the PC icons to particular
players or even turns in combat. I didn't see any reason to lock their positions,
because that doesn't happen at the table, either. Only the host can place
- Host will communicate
map data to new connections and when a new map is loaded. There is no previous
map browser functionality at this time. For now, everyone has the same map
up as dictated by the host.
- The dice roll
screen allows players to input various d20 rolls. No character data is communicated
across the connections, except for the results and descriptions of dice rolls
for characters. Characters and export and import characters to their local
- Host can create,
load and save campaigns. Unfortunately, right now there is no way to preset
a map for multiple campaigns. You have to prepare each campaign separately
(or copy over the mapdata files to other campaign folders after setting them
- Host can flag
box areas as visible, visited or unexplored
I did run into
one problem, however: for some reason, sending the fog box data in a map down
to a client across the internet occasionally causes a 80004005 error when the
program attempted to do a Msg.Readstring on the packet. I haven't tested my
attempted fix for it yet.
I decided not
to lock and control things so much for simplicity, and the fact that if you're
going to play a game like this with people, it should be with people you can
trust and enjoy playing with, not just someone who sees your game and decides
to hop into it.