Would you like to make this site your homepage? It's fast and easy...
Yes, Please make this my home page!
GUB Plugins
Developer's Note: As long as GUB is in Beta it's plugin API is subject to drastic
changes. Please do not consider any of this information final. As of GUB version 0.8.0, the plugin API appears
to be pretty stable, but no guarantees as given. |
GUB offers the ability for people to write Java components that can be hot-plugged (and unplugged) in to GUB
at any time, immediately expanding what GUB can do. Anyone who can program in Java can use an interface (11 fairly
trivial methods in version 0.8.7, but it isn't final) or subclass GUB's basic plugin
to easily add functionality to GUB. Once a plugin is plugged in, it can register itself to receive any number of
message types that GUB sends out to all of it's listeners. The API for writing plugins will be released sometime
around the 1.0 release of GUB. If you are interested in seeing it before then, please email
me.
Current Plugins: These have already been completed, or at least have a partially-working
version.
NOTE: Some of these have not been updated to 0.8.x format and therefor don't work
right now.
- Die Roller. Select the type of die, the number of dice you want to roll, and click a button. It will
broadcast the die roll result to all connected players. GUB currently has a die roller, but I'm going to write
a more advanced one that will include things like "averaging dice" and FUDGE
dice.
- Plugin Launcher. Allows you to launch any of the "official" plugins by clicking on a list,
or any launch plugin by typing in the name and tapping ENTER. It also allows you to unplug all plug ins.
- Active Pieces. Gives a list of pieces that are currently on the board. When a piece name is double-clicked,
it will try to scroll to that piece (okay, that's currently broken. It appears to scroll to some near-random location).
- Game Piece Selection. Allows the selection of GUB game piece files and savegames. Will also handle the
savings of games, once I settle on a savegame format.
- Ogre Records. An unnoficial accessory for Ogre players,
this plugin comes in two flavors: a single Ogre record sheet that sits on the right side of the game board, or
a larger model that sits in the middle and allows you to have any number of record forms, each with it's own name.
When components are checked off of a record form, it automatically notifies all connected players.
- VEMU: the V_MAP Emulator.
For those people who already use V_Map as their PBEM gameboard interface, this plugin makes switching between GUB
and V_MAP painless. This plugin can currently load V_Map save games and will support saving sometime in the near
future.
- Piece Editor. This allows you to click on a piece and edit almost any of it's attributes, then apply
those changes. It also allows removing a piece from the game. This was needed because the pre1 release of the JDK 1.2 for Linux doesn't correctly deal with right mouse clicks (which are
needed to edit game pieces). It's easier to make lots of changes to a piece using this than it is using a bunch
of right mouse clicks to pop up the popup menu.
- Planned Plugins: Things I'd like to write, once GUB is closer to 1.0 and the plugin
API stops changing so much.
- GUB Game Piece List editor. For creating or editing game piece lists. (For now, a text editor works
fine.)
- Calculator. Self explanitory. I would also like to create "victory point" calculators that
work based off of point values of pieces (for wargaming).
- Turn Phase Marker. For games where it's important to keep track of which part of a player's current
turn he is playing, this will allow the player to click, immediately telling all players something like, "Guordo
changed phases from movement phase to attack phase."
- Targetting Computer. For declaring attacks between units in a wargame environment. This will save some
typing when playing against other players, as the plugin would handle that, writing something like "Player
Billybob is declaring an attack: Heavy Tank (id 134) is attacking Little Man (id 112)." An advanced targetting
computer could even calculate the attack and defense values. The game piece definition format has room for user-defined
tags which can hold the various values needed to calculate this.
- Game recorder. So you can step through your oponent's moves one step at a time when they email you their
savegame.
- Implement game board selection control as a plugin.
- Victory Point Calculator. Specifically, I'd like to write one for Ogre/GEV. This will allow players
to click buttons to add points as they attain victory conditions ("Scratch one more LGEV. That's 6 points
for me." Click.)
What Can Plugins Do?
- Almost anything that you normally see GUB do can be controlled by a plugin. Plugins send messages to GUB and
GUB sends the work to whichever component should deal with it (this is only done to keep them in sync, not because
it's efficient or anything). The components normally send messages back. Plugins can register themselves to be
interested in certain message types. If they are registered for a type of message, GUB will pass those on to the
plugin.
- The power of plugins offers the opportunity for malicious people to write malicious plugins. And these plugins
are applications, not applets, so they have the same ability to read and write to your hard drive as any other
application. Just like GUB could do if I was malicious. Before you think this sounds so scary, though, think about
how many applications you've downloaded and run before. My suggested solution against playing with people who use
custom plugins to cheat is to stop playing with those people. At some point in the future, I may come up with a
way to verify that everyone is using the same thing (like getting the file info for all of the GUB classes and
plugins for all players, and comparing those to each other). That's not likely to happen soon, though.
What Can Plugins Not Do?
- Plugins cannot tell GUB to do anything harmful, like erase files, save files, etc. GUB has a limited set of
instructions, and none of them are in the realm of "go delete this file" or "email the list of files
in this directory to this address." Plugins have to do that kind of thing themselves. They can do things like
tell GUB "make this file the game board graphic."
- Plugins cannot "hide" GUB messages. When GUB sends out a message, it notifies all interested plugins
(i.e., the ones that register themselves as being interested in that message type), then it sends the message out
to the standard GUB console. This prevents someone from writing a plugin that hides things (like game piece moves)
from the other players. Now it is possible to programmatically change a game piece without echoing the change
to all players, but I'm hoping that people won't do that.
Programming Plugins:
Sometime in the future I'll post complete instructions for writing your own plugins using the supplied basic plugin
and plugin API.
Back to the GUB page...