Showing posts with label Emulation by VBA. Show all posts
Showing posts with label Emulation by VBA. Show all posts

08 February 2021

Tracks, Turrets, & Tokamaks: Virtual Playtest and Filecards

I have not abandoned my goal to get Super Mission Force (2nd Edition) to the table.  In fact, I've made progress in that regard by completing one of the six figures needing paint.  I plan to post the full complement of six when I get them all done.

Life is getting very full recently so I've found it efficient to combine hobby time.  My bi-weekly AD&D (1st Edition) game was yesterday and since it was via Discord, I got five hours of miniature painting in, getting base coats on two more minis!  Shhhh...don't tell my DM.

Macro uses one of two templates
On to the topic of this post.  I've run a few virtual playtests of my future tank game, Tracks, Turrets, & Tokamaks (TTT) in order to find all the bugs.  Since the rules are solidified enough for a rough draft, I'm confident enough to put a some effort into actual play materials and do a full (virtual) playtest.  

During TV time with the Missus I was able to knock out a filecard maker on MS Excel using Visual Basic.  Now I can just fill in the information on the spreadsheet, tell the program how many sheets I want and for which force, press "Go" and watch it spit out entire platoons.

I've photographed one example each of my "table-legal" (i.e. painted) tank types in both planform and profile views, placing the pics on the card template.  Then using the "Selection Pane" feature of MS Office, I can simply cycle through the pics to assign the correct miniature to the filecard. 

The sheets are 5.5 inch by 4.25 inch, designed to be printed four to a sheet on standard piece of US Letter sized paper and cut twice.

I have no terrain built (and super-heroes are supposed to be the next game) but I just had to start this playtest.

The first game will be a 6v6 brawl with no special objectives other than smash the enemy force.  The blue force has two three tank platoons of the same medium tank type.  Opposing them is the red force, with two different medium tank designs, three per platoon.  

Virtual Playtest: Start of Turn 1
Support elements make up a big part of TTT; most of the 30 different 
available options are simple die rolls impacting the opposing force, therefore reducing the number of extra required miniatures.  

Too Fat Lardies' game Chain of Command inspired the (presumably) heavy influence of support elements in TTT.  Although I've not played CoC myself, I've watched heaps of actual play videos on the Tabletop CP YouTube channel.  I like how although CoC is an infantry game, and ultimately the game is won or lost on infantry tactics and performance, the support elements are often game changers.

So, for this first game of TTT I've drawn the support element cards (cards and dice are used in my game), indicating quite the support element advantage for the red force.  Red team has five support effects: a Full Mission Rehearsal, 2x Orbital Bombardments (!), an Artillery Strike, and Jamming Support.  Poor blue team ended up with only Heavy Jamming and Reinforcements (1-4 Light Tanks).  The red force puts one of the Orbital Bombardments On Call, while the blue force opts for On Call Heavy Jamming.  We'll see if the liberal use of support elements "over-flavors" the game.

The tank types:

25 February 2018

Solitaire Dead CCG: Middle-Earth The Wizards

I started my first game of Middle-Earth: The Wizards (METW) tonight and already I'm hooked.  As I've said before, the best CCGs are ones that play well solo even if ostensibly designed for multiplayer games.  The METW CCG is definitely one of those, playing extremely well solo using a set of solitaire rules included in the basic rulebook.

Like Mythos and Quest for the Grail, two other questing-type games, a "normal" multiplayer game of METW is built around the general concept that each player represents the good guys on his or her respective turn, while throwing obstacles in the opponents' paths during their turns.  This dichotomy works well in the solo-player's favor, as the game cards are already designed to be split into discrete "us" and "them" decks.  Play then progresses fairly normally, with certain triggers then resulting in hazard deck draws.  I find one of the most satisfying aspects of these games is finding the most devious way to apply hazard cards against my own hero cards; it really makes any eventual win that much more worth it.

What sets METW apart from many other CCGs is the exceptional starter deck.  The publisher put considerable effort in ensuring the game played well straight from the starter.  The inaugural game shown used the contents of only one starter and five booster packs.


The first screenshot shows the second turn.  Trying to get to the Wind Throne, my company of heroes has to endure attacks from Wargs and an Abductor before being driven back to their starting point by a snowstorm!

  
The second shot shows a few turns later, after recruiting Rangers at Henneth Annun and picking up a mail hauberk at Sarn Goriwing.  The company is trying for the Wind Throne again, seeking the Dreams of Lore.  Unfortunately, poor Merry was wounded by Orcs; hopefully he'll survive the trip to the Wind Throne and back to Lorien.

The METW CCG really evokes a strong narrative, like the two previously mentioned CCGs, which is the final and probably most important ingredient in a good solo game.

05 November 2015

Create Your Own CCG

My explorations into using Visual Basic for Applications (VBA) for gaming has given me more ideas.  Specifically, I realized that VBA can be used to very quickly create a complete deck of virtual cards for a homemade collectible (or as I prefer, customizable) card game (CCG).  Heck, it could be used to create ready-to-print sheets for actual hands-on play.

So to create your own CCG you need a great idea for a game and a solid set of rules.  I can't help you there.  The great thing about this technique however is that if your rules need adjustment, you can recreate an entirely new virtual deck with a single click.

Assuming you have your game and rules, now you need some artwork.  Nope, can't help you there either.

Alright, now that you have your rules and art, we can talk about how to make your own virtual (or real) CCG.

Enter all of the card information in an Excel Spreadsheet.  Ensure that one column of information designates the card-type of each individual card.  Here's an example of a post-apocalyptic Gamma World-type game I'm working on.

Cards can be changed at whim

The next thing to do is create card templates using Shapes.  You can do this directly in the Excel workbook.  Use Shapes instead of Text Boxes to position the writing on the cards.  Ensure that you name each individual Shape.  For example, in the picture below the template on the far left is named "Ruin Template" as it corresponds to the "Ruin" card type.  The top silver shape on that card template has its own name "Ruin Field 1", and the text area on the bottom of the card is named "Ruin Field 2".  All the shapes for one card template are grouped under the template name.

Example templates; a real game would have 8+


After one template is made (and all parts named appropriately) for each card type, then a macro is written to make the deck.  I won't bore anyone with the code here but I'll explain the general procedure.

The macro starts at the top of the card list and uses the card type written there to select the "Field" Shapes on the respective template.  The text in the shape is then overwritten with the data from the spreadsheet.  The process is repeated for each text field.  If there is artwork, the macro can get the art from a file, position it on the card template and adjust the order of the template's layers so that the art sits over the background but beneath the text (not shown here).  Next the macro copies the template, with all the current card's information filled in, and pastes it in a different area of the sheet as a picture (.jpg).  The macro names the picture with the name of the card, then pastes a second copy below, shrinks it, and names that pic as "card-name thumbnail".  The macro then loops to the next card on the spreadsheet list and does it all over again.  The template is still a collection of shapes, each of which retains the appropriate name so the same process can be used for the next card.   

It would take hours to type these out…a macro made them in 30 seconds


Once the cards are created any changes required after playtesting can be made right on the spreadsheet. Then, with the click of a button all the cards, with changes, are redrawn.  

Speaking of playtesting, once you have a virtual deck of all your cards, you can write other macros to emulate the actual game environment such as shuffling and dealing.  I've done this already for commercially produced CCGs; see my previous post and downloads page for an example.

08 September 2015

CCG Emulation: On the Edge

I just finished a Play-by-Forum contest of Atlas Games' old On the Edge (OtE) card game over on BoardGameGeek (BGG).  The game got me inspired to continue working on CCG emulation using VBA for Excel.

The file I discuss here is available on my downloads page.  Of course, you'll still need access to OtE cards to get the details of individual cards and play but the file allows quick building of a card deck and a handy way to visualize where the cards are on the board.

OK, so when the file is opened, go to the "Table" sheet and you'll see it indeed looks like a game table. The buttons in the bottom-left corner are active.



At this point you have to option to do an OMNI League (i.e. sealed starter) "purchase.  Click the button that says "OMNI Starter".  Pushing this button starts a macro that gives you 60 cards with the rarity distribution based on an actual OtE Starter Pack.  The macro lets you know when it is done (next pic); it takes about a minute for it to sort through the "cut-sheet" and select the cards.



If you want to thin down your OMNI deck, go to the sheet labeled "Cards".  This sheet was adapted from one which was originally designed for collection management.  You can sort by all manner of traits and other characteristics.  You'll notice that the previous macro populated the "Quantity" column for you.  Filter out the blanks in the quantities column to eliminate cards that are not available (next pic).  Then change the quantities of those that are available to reflect the OMNI deck you want to play.



You can skip the "OMNI Starter" button and go right to the "Cards" sheet in order to build a custom killer deck.  In order to build a deck, you simply type in the third column the number of copies of a particular card that will go into your deck.  So if you want four Resounding Bells in your deck, type "4" in column C next to Resounding Bell.  Note that cards from all expansions are available.

Regardless if you choose to play a sealed starter or make a killer deck, when you are ready to play (quantities filled out) go back to the "Table" sheet.  Press the "Shuffle and Draw 10" button and the program will do just that, drawing rounded rectangle shapes individually labeled with your card names. You move these around the table however you please.  If you need to draw a card, press the "Draw One" button to do so.  When you are out of cards, the program tells you.





When you are done playing, simply hit "reset" and everything is set back to start.  Don't erase any of the card shapes on your own: it will screw up the macros.

That's where the program stands for now.  I will work on it sometime in the future and add "Booster Buys" so you can limit your cards to maybe one Starter and a few boosters from the different expansions.

My ultimate goal is to create a "card summary" area on the table where it will show the Power, Pull, Cost, Special Abilities, Etc. of the selected card.  The macro is super simple to write; the pain is just getting all the Power, Pull, and Cost numbers for each card into the "Card" reference sheet.

21 August 2015

Virtual Gaming with Microsoft Excel

Originally posted over on the Two Hour Wargames Forums:

I have a handful of THW products but except for Friday Night Fights I've never had a chance to play; just too many things going on in life to spare the time to paint figures and make/set-up terrain.

I really wanted to try RRTK however so I started setting up a virtual tabletop on Powerpoint. That stalled when I bought FNG and decided to use Excel instead.

Why use Excel? With a rudimentary knowledge of VBA coding (which is my level...) one can set up macros to help run the game environment. The picture below will help me explain.

Each of the green round tokens and the red PEF triangles represent units and are actually Microsoft Office Shapes. They're easily moved all around the "board". When you click on one and then click the shiny "Select" button it runs a macro. The select macro cross-references the Shape's name to a roster table (on another sheet). This referencing then fills in the unit info, so you have all the figure's stats right in front of you.

Since a figure's status will change, you can click the "Status" button to bring up a list of conditions. Then simply pick from this list and select the new condition (from Carry On to Out of the Fight for example). The status macro will then overwrite the old condition with the new one for the figure on the roster. Since it's captured on the roster, the info is available on future turns.

The dice rolling buttons are self-explanatory. My favorite macro is the ruler function. The player just grabs the black arrow pointer and places it wherever it is needed, adjusting the length appropriately. Then when the "Range" button is pressed, it displays the correct range. The playing area is scaled to represent a 36x48 inch table.

This will never replace actual miniatures for me but it does give a convenient way to explore the rules and play the games. I played five FNG missions in just two hours! Which, by the way, is a great game. 





20 June 2015

CCG Emulation using Excel VBA

I'm stuck in a hotel room for three weeks on a business trip.  During the week the pace is so busy there's barely any time to think but on the weekend there's nothing to do.  My two options are either killing my brain with TV or trying to learn something.  I chose the latter and decided to teach myself Microsoft Visual Basic for Applications (VBA), as employed by Microsoft Excel.

Excel and collectable card games (CCGs) go together like peanut-butter and jelly.  CCGs typically contain hundreds of cards each featuring a relatively large amount of information, making the sorting and filtering capabilities of a good spreadsheet program perfect for collection management and deck-building.   I've just started to tackle macro-writing and exploring the rest of VBA for unrelated work efforts; I'm quickly realizing how powerful VBA is.  And what better way to harness the power of Excel VBA than to try to create a CCG Emulator.

The Quest for the Grail CCG from 1995 is one of my favorites, especially since solitaire play is very clean with little changes to the multi-player rules.  QftG therefore seemed like a perfect choice for my experiment.

The project is still a long way from finished but I've made pretty good progress.  So far I've written code that allows the user to do a virtual "buy" of up to a box of 10 Starter packs and up to a box of 36 booster packs.

From there the program sorts the cards into the eight different general types (Combat Tactics, Companions, Domains, Events, Experience, Rewards, Spells, Warriors) that the player builds a deck from.

Once the cards for the deck are selected, the program shuffles not only those cards but all of the available Quest cards.  In Quest for the Grail the Quest cards represent obstacles to be overcome and reside in a separate deck.  The program creates this separate deck for the player.

That's as far as I've got.  Next will be to code the actual turn-by-turn play, which should be fairly easy.  Basically I'll write a new Userform that will pop up and give access to the appropriate number of cards and keep the rest hidden.

Here's a few pictures with explanations of what happens behind the scenes:


The starting page just has one button.  I'll throw some art from the game in the background once I get everything else coded.  When the button is pressed it brings up the next user data-entry form.


This form allows the player to do a virtual buy of Starter and Booster packs.  The cards are randomly generated from the lists on the "Common" "Uncommon" and "Rare" worksheets, with the frequency of the rarity of the cards based on the actual distribution of the real starters and boosters.  The program enters these values in a single column, then assigns the appropriate card type based on a lookup function.  It then sorts the cards and displays them on the next form.



This form has a lot going on.  First the multi-page box on the left features a page for each of the player card-types; each page includes two list boxes.  When the form initializes the right list box on each page is empty.  The left box shows all the available cards of a respective type; once the player chooses a card to add to the deck the chosen cards are moved to the right list.  When the right list of each card type is populated, the player clicks the "Build Your Deck and Shuffle" button and the program does just that.  The other thing this form does is allow a card preview.  If the player selects one (and only one) card in the left list box on the active page and then clicks the "Preview Card" button, the text boxes in the middle and on bottom of the page are populated with the card information.  I plan on scanning my entire card collection and then coding it so that when previewing a card the actual picture will appear in the gray box on the right.

I've a lot more work to do on this, but it's been fun.  Is it more trouble then it's worth?  Yes probably.  It is way easier to just shuffle some real cards and play.  There are a few advantages to VBA emulation however.

CCG emulation through VBA allows a player to virtually "purchase" far more cards than he could ever afford.  Also, it allows the player access to every card in the game.  No more desperately searching for an Ultra-Rare.

The final advantage, which I am most excited about, is that one could use card game emulation through VBA to do play testing of home-brew games before spending a significant amount of time on the playing pieces.  Instead of spending hours and hours laying out the graphics for self-published cards only to find that the game doesn't work, one could use VBA with just the minimal information needed for the game and check the rules.