Ants Board Game

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Ants Board Game

Post by Jagged »

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
ants-board.png
ants-board.png (411.15 KiB) Viewed 1271 times
[/url]

I should add that I don't intend to distribute my work as this board game is very much a current product.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Ants Board Game

Post by Jagged »

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:
  • 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.
I then know that all tokens with the "isConnected" status are part of a valid supply line for the current player.


User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Ants Board Game

Post by aliasmask »

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.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Ants Board Game

Post by Jagged »

aliasmask wrote:You should make an onClick event to toggle between peas-ants, serge-ant and nothing states for each positional token.
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.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Ants Board Game

Post by wolph42 »

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

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Ants Board Game

Post by Jagged »

I missed that. I searched the wiki for "onMouseClick" and found nothing :shock:

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Ants Board Game

Post by wolph42 »

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.

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Ants Board Game

Post by aliasmask »


User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Ants Board Game

Post by Jagged »

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 :)

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Ants Board Game

Post by Jagged »

aliasmask wrote:
Wed Apr 11, 2018 7:43 pm
Notepad++
Its been a while since I've done any macro writing and I am reminded how much harder it would be without your Notepad++ language definition. So thanks for that again :)

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Ants Board Game

Post by aliasmask »

Jagged wrote:
Mon Apr 23, 2018 4:16 am
aliasmask wrote:
Wed Apr 11, 2018 7:43 pm
Notepad++
Its been a while since I've done any macro writing and I am reminded how much harder it would be without your Notepad++ language definition. So thanks for that again :)
NP. It does need an update though. There are several new functions not included and the roll options.

Post Reply

Return to “User Creations”