Ants Board Game
Moderators: dorpond, trevor, Azhrei, Gamerdude
Ants Board Game
I have started work on Maptooling the board game Ants and thought I would document some of the process here.
If you are not familiar with the game I would highly recommend it. A nice simple strategy game, were you build highly dynamic supply lines to grab food and fight other ant nests.
I decided from the outset that the Maptool version of the game would NOT use lots of player controlled tokens. The game itself involves positioning lots of pieces and my players at least, seem to have lots of problems when it comes to "delicately" moving tokens. Therefore the only player controlled/owned tokens will be their Queen Tyr-ants and once the game starts all token movement will be locked.
First task: Build the board
[/url]
I should add that I don't intend to distribute my work as this board game is very much a current product.
If you are not familiar with the game I would highly recommend it. A nice simple strategy game, were you build highly dynamic supply lines to grab food and fight other ant nests.
I decided from the outset that the Maptool version of the game would NOT use lots of player controlled tokens. The game itself involves positioning lots of pieces and my players at least, seem to have lots of problems when it comes to "delicately" moving tokens. Therefore the only player controlled/owned tokens will be their Queen Tyr-ants and once the game starts all token movement will be locked.
First task: Build the board
[/url]
I should add that I don't intend to distribute my work as this board game is very much a current product.
Re: Ants Board Game
Targeting Hexes
Several important parts of the game involve targeting specific named hexes and sometimes their neighbours.
I did consider trying to come up with a mathematical solution to convert board hexes to Maptool coordinates but soon rejected that idea, since I would need to come up with a naming convention for the hexes that surround the nests (numbered 1 to 7 in the image above).
My alternative strategy is to place all the board coordinates as appropriately named images on the Object layer. So the "A1" image is called "A1", the fountain in the centre is called "F7" etc. If I need the X&Y coordinates of a hex, I can just use findToken("F7") followed by getTokenXand getTokenY. In the end I decided I could control the entire game through token states rather than by placing tokens, but the principle still applies.
States instead of Tokens
Rather than use lots of tokens I intend to use the coordinate images (the "A1", "A2" etc) on the Object layer, combined with different statuses to build and display the boards.
I use a number of different statuses in the game, which get applied and removed from the hexes. Those statuses are "Food" to repesent the presence of food on the hex, the player's colour (i.e. "Black", "Blue", "Red" etc to represent the presence of an ant of that colour), "isConnected" (used to indicate the hex is part of a valid supply line), "hasPeasant" and "hasSargeant" (to represent an ant's type).
The statuses are then ordered to that the food images is at the bottom, then the player colours, followed by the ant types. The "isConnected" is currently a circle that displays around the images. Though I'd like to come us with something better.
Building a Supply Line
The other important part of the game is building your supply line of Peas-ants from your Queen Tyr-ant to your target, whether thats food or opponents. Moving across the board costs one 1 move per hex, except when you are moving along your own supply line, which is free.
To calculate the valid supply line I use the following pseudo-code:
Several important parts of the game involve targeting specific named hexes and sometimes their neighbours.
I did consider trying to come up with a mathematical solution to convert board hexes to Maptool coordinates but soon rejected that idea, since I would need to come up with a naming convention for the hexes that surround the nests (numbered 1 to 7 in the image above).
My alternative strategy is to place all the board coordinates as appropriately named images on the Object layer. So the "A1" image is called "A1", the fountain in the centre is called "F7" etc. If I need the X&Y coordinates of a hex, I can just use findToken("F7") followed by getTokenXand getTokenY. In the end I decided I could control the entire game through token states rather than by placing tokens, but the principle still applies.
States instead of Tokens
Rather than use lots of tokens I intend to use the coordinate images (the "A1", "A2" etc) on the Object layer, combined with different statuses to build and display the boards.
I use a number of different statuses in the game, which get applied and removed from the hexes. Those statuses are "Food" to repesent the presence of food on the hex, the player's colour (i.e. "Black", "Blue", "Red" etc to represent the presence of an ant of that colour), "isConnected" (used to indicate the hex is part of a valid supply line), "hasPeasant" and "hasSargeant" (to represent an ant's type).
The statuses are then ordered to that the food images is at the bottom, then the player colours, followed by the ant types. The "isConnected" is currently a circle that displays around the images. Though I'd like to come us with something better.
Building a Supply Line
The other important part of the game is building your supply line of Peas-ants from your Queen Tyr-ant to your target, whether thats food or opponents. Moving across the board costs one 1 move per hex, except when you are moving along your own supply line, which is free.
To calculate the valid supply line I use the following pseudo-code:
- Clear all tokens of the "isConnected" state
- Set the current player's Queen to the status of "isConnected"
- Use the getWithState function to find all tokens with the state "isConnected"
- For each "isConnected" token use the getTokens function combined with the "range" and "setStates" options to select the surrounding hexes that contain a peasant of the appropriate colour (i.e. has the states "Black" and "hasPeasant").
- Use setState to set all the found hexes to the state "isConnected".
- Repeat the previous 3 steps until no new hexes are added.
Re: Ants Board Game
looks great dad!
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Ants Board Game
I just watched a YT video on game. You should make an onClick event to toggle between peas-ants, serge-ant and nothing states for each positional token. It would be based on each player's color since you can move your supply lines very easily and it seems more intuitive that way.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Ants Board Game
That's a good idea. I assume that's using the fake onMouseOverEvent trick?aliasmask wrote:You should make an onClick event to toggle between peas-ants, serge-ant and nothing states for each positional token.
I had not realised that when the token was on the object layer that it would behave like an onClick.
I shall try it once I have the basics working.
Re: Ants Board Game
nope its not. There are two events you can use onMouseOver and onMouseClick. The former is really tricky to use and can get MT to crash when used improperly. The other can be used when form is open where that event is active. If you're familiar with my Bag of Tricks you might have noticed and orange button among my macros that activates such an onMouseClick event e.g. for using door switches.That's a good idea. I assume that's using the fake onMouseOverEvent trick?
I had not realised that when the token was on the object layer that it would behave like an onClick.
I shall try it once I have the basics working.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Ants Board Game
I missed that. I searched the wiki for "onMouseClick" and found nothing
Re: Ants Board Game
its been a while, there's a reference in the forms tutorial:
<link rel='onChangeSelection' type='macro' href='[r:link]'>
thats the one you're looking for.
<link rel='onChangeSelection' type='macro' href='[r:link]'>
thats the one you're looking for.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Ants Board Game
I have a recent post on it here: http://forums.rptools.net/viewtopic.php ... ck#p256272
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Ants Board Game
I have the basic game finished. Huzzah!
Haven't used any fancy forms or anything, its all done through basic buttons.
Still need to rationalise the various macro calls to reduce repeated code etc.
Will test play the game a few times before adding in nice forms
Haven't used any fancy forms or anything, its all done through basic buttons.
Still need to rationalise the various macro calls to reduce repeated code etc.
Will test play the game a few times before adding in nice forms
Re: Ants Board Game
NP. It does need an update though. There are several new functions not included and the roll options.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools