Wargame Programming

A blog about converting wargames and maybe some board to computer programs for the Windows 7-10 platform.

1 , 2 , 3  Next »  

Recommend
4 
 Thumb up
 tip
 Hide

NAW: Computer AI

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
I have been playing way too much "Slay the Spire" while waiting for feedback on Texas Revolution (very little) and hence the lack of posting.

In the meantime I have been looking for a new project. I thought I might do Demonlord from Dwarfstar/ Reaper but when I contacted Reaper about permission they indicated that they we're considering digital publication themselves and then nothing. So I'll take that as a no which is probably just as well as the game has movement classes and would require characterizing each hex side for multiple terrain types. And combat is done using a battle line system, so a lot of work for small game.

When I did Napoleon at Waterloo for DG I took a shot at creating a computer AI based on considering every possible move or attack and scoring them. This worked well for combat but not too surprisingly failed utterly for movement considering there may be 20+ units with a choice of 90+ hexes each. I think I can do better for movement by grouping units so only 3-10 units need to be consider at a time. Units would receive a basic order to either;
1) move to attack
2) move towards an objective
3) move to plug holes.

Attacks would be optimized by scoring every combination of units and attack positions for a particular group than moving on to the next group and finally repeating in different group orders. Units with orders 2 and 3 would be done together after all attacks have assigned.

But first I need to update the code. Currently I am in the process of porting the old Blitzbasic code into Blitzmax. In the last week (with a time out for StS) I have gotten the map and chits working and I am close to being done with movement.
Twitter Facebook
2 Comments
Mon Sep 14, 2020 2:56 pm
Post Rolls
  • [+] Dice rolls
Recommend
 
 Thumb up
 tip
 Hide

Texas Revolution Beta

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
Everything is seems to be working properly, at least in my playthroughs. Although the programmer always has blind spots and assumptions that actual players may not share.

I did change the rules in some places;
- Stacking is based on stacking points and the highest ranked leader.
- Stacking is only checked during movement and only at the destination hex.
- Combat is from adjacent hexes
- Units are always halved attacking across rivers although the Die roll modification (DRMs) can be negated.
- DRMs are applied as column shifts to overrun attacks.
- You may not retreat through a hex adjacent to enemy unit involved in the combat unless there is not other choice.
- No Sieges (too complicated and Santa Anna would never allow one).
- Fully hidden and partially hidden units (optional rule)
- Optional rules for how recruitment and heavy artillery is implemented

I think there is enough help and tables included to make the game playable for any experience war gamer but I would be happy to include more based on player feedback.

I am considering adding more optional rules for interception, battle reinforcements, training (e.g. 3 companies combined into a battalion) and Mexican supply issues depending on interest.

PM me if would like to download the program and give it a try.
Twitter Facebook
1 Comment
Mon Jul 20, 2020 1:42 am
Post Rolls
  • [+] Dice rolls
Recommend
2 
 Thumb up
 tip
 Hide

Texas Revolution Update: Limited Intelligence

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
Except for sieges (which I am inclined not to include) I think all rules have been implemented now. The Rule set used is closer to the original rules with with some modifications and clarifications from the revised rules plus my own tweaks.

For limited intelligence infantry and cavalry can see enemy Calvary,leaders and other (blank) chits out to the limit of their movement allowance counting rivers as only +1MP and not tracing through enemy cavalry. Outside this range (which is very lightly highlighted) enemies are hidden. Infantry, Dragoons (mp=7) and light cavalry (mp=9) can see all units in stack out to 2,3,and 5 MPs away respectively. Cavalry can scout enemy stacks by moving next to them. Note units can be moved several times, pausing in different hexes to take control, scout, or over run as long as they having remaining MP's which is updated on their chits as they move.

I have also added a menu system and a help system. I need to do some more internal testing and maybe add a rule options and Texas Revolution should be ready for external testing.
Twitter Facebook
2 Comments
Fri Jul 10, 2020 6:23 pm
Post Rolls
  • [+] Dice rolls
Recommend
 
 Thumb up
 tip
 Hide

Texas Revolution Update

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
I believe Fort Combat is working correctly now along with combat in general. I have code in place for attacking across ferries but it has not been tested yet. Sea movement and reinforcements arriving by sea also appear to be working.

Chits are created as 200 by 200 pixel images and then generally scaled down in use. Rendering all the images at game startup or phase changes (to update remaining mps) takes a few seconds which is annoying and maybe consumes too much graphic memory This may be the source of the odd text area crashes I have been having. I may need to be more selective in the units that get updated and maybe shrink their size down. In the meantime I have enable graphic sharing which seems to be preventing the text area crashes.
Twitter Facebook
3 Comments
Tue Jun 30, 2020 3:44 pm
Post Rolls
  • [+] Dice rolls
Recommend
1 
 Thumb up
 tip
 Hide

Texas Revolution: Combat

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
The combat code with the exception of supply, forts, and across ferry attacks is now complete and appears to be working correctly. Retreating was the hardest part to get correct because of the need to track whether a river was crossed during the retreat which will cause loss of half of the retreating force.

I have been using Object types as pseudo modules as the Code Editor allows an Object type definition be to be collapse to a single line. Using type as modules also yields the advantage of having global variables, constants, and functions visible only at the 'module' level unless the type prefix is used with the variable or function name. I have now realize I can use the 'Extends' to create 'Sub Modules' of the base Module/Object. For example Reinforcement, Movement, and Force March types all extend the Game type. They can use game functions and data without the use of the "Game." prefix while staying organizationally separate. Oddly the Combat 'Type' which refers to game data at least 28 times is its own independent type. It should probably be an extension of the Game type but we shall see.
Twitter Facebook
2 Comments
Mon Jun 22, 2020 12:25 am
Post Rolls
  • [+] Dice rolls
Recommend
2 
 Thumb up
 tip
 Hide

Texas Revolution: Overruns

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
It has been a long week of going in circles. I wanted to be able to select units from a stack without using a separate window. The big mistake I made was using coordinates based on the map sheet origin rather than the screen origin. This would worked until I changed the map scale.
I would get everything working at 50% scale than have have to reworked the code for 100%, than 50% again etc etc. until I finally deleted the screen based code and went back to a separate window approach. Than I realized my mistake. Oh well maybe next game.

In the meantime loading and saving seems to be working flawlessly and the overrun code is complete except for cavalry retreats. The combat code will have a lot of overlap with the overrun code giving me a nice head start on what is typically the most involved part of wargame programming.

For now at least, I have made a change to the overrun rules in that die roll modifications are treated as column shifts. Otherwise defending at ford across a major river is no different from standing in open prairie. Looking at the CRT this is what DRM's essentially do for regular combat in any case.
Twitter Facebook
0 Comments
Wed Jun 17, 2020 3:55 am
Post Rolls
  • [+] Dice rolls
Recommend
2 
 Thumb up
 tip
 Hide

Texas Revolution Reinforcements 2:

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
The Reinforcement phase is mostly working as it should. The only issue remaining is when the Texan Player has reinforcements that have placement options on top of his regular militia and volunteer recruitment options. Rather than trying to manage two unit windows I am just going to add separate recruitment phase/step as regular reinforcements are limited to a few US Army units.

I also started work on the game save and load code. The game will be automatically saved between every phase including the current random seed value. I am found this to be an invaluable feature for debugging. The more self-contained modular approach I adopted recently has made this a breeze. Rather than searching several screens of global declarations for the critical state variables, I can call each module (actually type) in turn to save its critical values to a common file. The other trick I have learn through hard knocks is write out some empty variables and to use an end of data flag in case I want to make changes later without having to delete all the old files or go through some other gyrations.
Twitter Facebook
0 Comments
Tue Jun 9, 2020 4:32 pm
Post Rolls
  • [+] Dice rolls
Recommend
2 
 Thumb up
 tip
 Hide

Texas Revolution Reinforcements:

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
This section of code is proving to be very tedious to write. The Texan player has 9 militia units that can appear in any hex adjacent to a 9 different rivers (10-30 hexes each). Not being at all that familiar with Texas Geography I am assuming the named river ends at the first major fork. Rather than hand coding nine long list of hexes I wrote some quick and dirty code where I can just click on the map to highlight hexes and to add or delete them from a list that can outputted to the Editor's output screen for cutting pasting later.

Release of refugee units was done based on the second edition rules which releases them when certain rivers are crossed. I did this by hand coding through a variety of hex number checks and column checks (e.g. release if column Y=12 and row X<6). The check will be done at the start of the Texan turn (hence the need to define an area) rather than during Mexican movement to avoid path tracing although less data would have been involved.

Reinforcements will be placed on the map by selecting them from a separate window than clicking on a highlight map hex. Clicking on the unit on the map will return it to the window. Texan militia units assigned to a town and hence already displayed on the map in a dimmed state can toggle between active and inactive by clicking on their hex during the reinforcement phase. At least that's the plan.
Twitter Facebook
2 Comments
Wed Jun 3, 2020 5:51 pm
Post Rolls
  • [+] Dice rolls
Recommend
 
 Thumb up
 tip
 Hide

Texas Revolution: Stacking and Movement

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
The Movement and Force March phases have been implemented with the except of overruns and force march losses. The force march rules encourage the inclusion of 1 and 2 factor units into the stacks to pay for possible losses which is never more than 2 combat factors. The Texans I suspect will always have a plethora of militia units to pay for march losses while the Mexican player may be forced between losing a valuable but weak cavalry or horse artillery unit or a large infantry battalion towards the end the game. Seems like a very cleaver way to sneak strategic attrition into the game.
Twitter Facebook
2 Comments
Sun May 31, 2020 2:07 am
Post Rolls
  • [+] Dice rolls
Recommend
 
 Thumb up
 tip
 Hide

Texas Revolution Update 1

Thomas Stevenson
United States
Columbus
Ga
flag msg tools
badge
Avatar
Microbadge: WargamerMicrobadge: The Dice Tower fanMicrobadge: 5 Year Geek VeteranMicrobadge: Alien Frontiers fanMicrobadge: Chemist
I have created the basic skeleton of the Texas Revolution program from the Fustian code and it's capable of scrolling Gary's map and showing stack contents. The order of battle, chit images and map data have been imported from WarMaker. The biggest hurdle was switching form a East-West to a North-South hex grain map board.

Question; the Texas player has a lot of militia reinforcements that appear in fixed towns but the timing is by choice rather than by any fixed schedule. It would be nice to show them on the map but in some format that indicates they're not in play yet. I could;
Rotate them 90°
Draw them with some level of transparency
Make them smaller
Just draw the text and NATO symbol
Change the chit somehow

Any other suggestions or preferences?
Twitter Facebook
2 Comments
Sun May 24, 2020 3:39 am
Post Rolls
  • [+] Dice rolls

1 , 2 , 3  Next »  

Subscribe

Categories

Contributors