Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
So here is my first initial release of a Python script which attempts to replicate the French AI Bot for this game.

Approx 1100 lines of code and easily 30+ hours to get things to where they are.

Please note this is described as an Alpha build.

*Yet to be implemented*
Only scenario 2 is available. 1 & 3 to follow.
Modifiers due to Leaders are not taken into account
Battles are pretty much a manual affair - i hope to tackle these next.
Error handling, there is some, but it may fall over.
Patriot AI is in the works ! That should allow you to focus on British & Indians as a human player.
Brilliant strokes / winter cards - although you can manually update the AI using the 'map' command.


PLEASE BE AWARE - this current build does not contain much error handling, if it crashes mid-game there is no easy way to launch back to where you were (For my testing I have been noting down the ‘values’ I have entered into the script as I go).... apologies for this. However right now I am looking for general feedback via testing.

If you do get an error please post what it shows + an explanation of what you were doing at the time, something like this :

“Failed to execute script LoD
Traceback (most recent call last):
File "LoD.py", line 1088, in <module>
File "LoD.py", line 1085, in main
File "cmd.py", line 142, in cmdloop
File "cmd.py", line 221, in onecmd
File "LoD.py", line 491, in do_french_flow
File "LoD.py", line 1036, in french_battle
TypeError: do_map() takes exactly 2 arguments (1 given)”

To download / Copy the entire LoD folder from:
https://www.dropbox.com/sh/x9uu786vrndnt8g/AABxKB6_c1IqIUHYn...

In the folder run LoD .... any problems let me know your O/S, setup etc.

GitHub Link:
https://github.com/autonm/LoD

Instructions:
After entering 2 for the scenario, the map is setup in the background. You can then use the following commands

map
This is how you keep the AI aware of the state of each location.

Entering the command ‘map’ gives you a list of abbreviated locations. Enter the abbreviation and it will walk you through a set of questions. Just enter the number, True, False where appropriate. Repeat whenever you move pieces around.

map command should be used if an Event requires to move pieces for ANY side, not just the french. So you need to use this if you make moves for Patriot, British, Indian regardless if it is an Event of Command.

A Control Check then automatically takes place. The result will show if you need to change who controls the city.

status
This will list all the locations and the pieces that should be with each city

status <location abbreviation>
example status NYC
This will list the specifics for this location. This is a good way of checking things have worked as expected.

toa
This will allow you to change the status if ToA has been played. Just enter True or False

fni
Change the FNI value

french
Change the French resource count

patriot
Change the Patriot resource count

indian
Change the Indian resource count

british
Change the British resource count

crc
Change the Cumulative Rebellion Casualties

cbc
Change the Cumulative British Casualties

total_support
Change the Total Support count

total_opp
Change the Total Opposition count

french_prep
Change the French Prep count

french_flow
This is the power option
If the French bot flowchart is UNABLE to play an event then use this command. The entry point on the flow chart is at the decision branch of “French Resources > 0?” .. it checks this an then moves through the flow chart. i.e. it is the French bot turn, and the card is a ‘No Event’ then use this option.

Note: if you move pieces due to an event you must use map command to update !!

During the flowchart - the decision branches, commands or special activities are shown in CAPITALS to help you refer to the flowchart if needed.

If the AI displays “ACTION’ then it is requiring you to move a piece on the board, generally the counts with the AI are updated for you automatically.


Final Notes:
You are my testers !!!
I of course will continue to test and release improved versions myself. Apologies if this AI crashes half way through - I am doing my best to prevent this by improving the logic and input captured.

Any questions please ask.
Any feedback, keep it constructive, but this AI can only improve with your feedback.
Let me know if - the instructions, general text etc should be more or less verbose. What works, what makes sense, what does'nt?


Let me know if the above instructions on how to use this, need explaining more - or even a You Tube video ?


Enjoy - and any questions just drop a reply on this thread.

*Also I'm interested to see how many people download and try it - will let me know how much more effort to put into this.... I also have COIN: Falling Sky, which I may try to AI the Bots too.

Thanks !!

Release Notes:

4th August -
*Added the ability to set the FNI level
*Fixed 3 setup values for scenario 2
*Improved the readability of the available commands, which are displayed after a scenario is selected.
*Fixed a situation where 'Preparer la Guerre (before TOA)' was called twice.
*French Regulars can now be updated, when the 'map' command is used.
*Fixed bug in 'French Agent Mobilization'. INTegers are now forced, STRings were creeping into the calcs.


31st July -
*Refactored French Skirmish code, more input via the user, however the logic was to convoluted.... simplified.
*Minor bugs fixed
*Published to GitHub https://github.com/autonm/LoD

29th July -
*Initial Release
14 
 Thumb up
9.00
 tip
 Hide
  • [+] Dice rolls
Juan Valdez
msg tools
Thanks for your effort!

Any reason not to post the code to github?

I'd definitely consider cloning it to take a poke, possibly even submit pull requests, issues, etc.

Just curious is all.
5 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
mtngrown wrote:
Thanks for your effort!

Any reason not to post the code to github?

I'd definitely consider cloning it to take a poke, possibly even submit pull requests, issues, etc.

Just curious is all.


No reason. Just more a case of just getting round to it. Also i have been working 100% offline for the past several days. I'll get it uploaded and post a link over next few days.
4 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Yiannis Hadjikyriakou
United Kingdom
Brighton
East Sussex
flag msg tools
Avatar
mbmbmbmbmb

Great to see someone doing this. GMT should pay you to do it - 2016 and they are putting out AI on cardboard still!

(I'd tip you some gold if I had any spare!)
3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Volko Ruhnke
United States
Virginia
flag msg tools
designer
Avatar
mbmbmbmbmb
Yiannis, I tipped on your behalf. And look, some of us still like cardboard! :)

Michael, thanks so much for the hard labor. You are pushing the COIN envelope outward!

Best, Volko
7 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Gabriel Conroy
msg tools
mbmbmbmbmb
mtngrown wrote:
Thanks for your effort!

Any reason not to post the code to github?

I'd definitely consider cloning it to take a poke, possibly even submit pull requests, issues, etc.


Ditto here.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
GitHub link:

https://github.com/autonm/LoD

Look forward to pull requests & issues being recorded in there.

Thanks !
5 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Mike Szarka
Canada
Waterloo
Ontario
flag msg tools
badge
When it is your turn to send a VASSAL move, the wait is excruciating. When it's my turn, well, I've been busy.
Avatar
mbmbmbmbmb
Constans wrote:

Great to see someone doing this. GMT should pay you to do it - 2016 and they are putting out AI on cardboard still!


Approx 1100 lines of code and easily 30+ hours to get things to where they are.

I think that's a pretty clear explanation of why!
4 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Harold Buchanan
United States
RSF
California
flag msg tools
designer
badge
Avatar
mbmbmbmbmb
autonm wrote:
So here is my first initial release of a Python script which attempts to replicate the French AI Bot for this game.


Hey Michael

This is very cool and a big step! I am crazy busy now with real life but I am looking forward to digging in once I can. I can't wait.

Harold
5 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
hankhankhank wrote:
autonm wrote:
So here is my first initial release of a Python script which attempts to replicate the French AI Bot for this game.


Hey Michael

This is very cool and a big step! I am crazy busy now with real life but I am looking forward to digging in once I can. I can't wait.

Harold


Hi Harold - great to hear from the man himself... I continue to tweak and expand on this as I play more of LoD myself - it's a great incentive to keep playing the game - as I get to tweak the app each gameplay.

In general the more feedback I have from everyone the more likely I am to continue on with this with the Patriot Forces. That way the solo game should play more quickly (I am a 100% solo gamer myself).


Thanks
Michael.

1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
mcszarka wrote:
Constans wrote:

Great to see someone doing this. GMT should pay you to do it - 2016 and they are putting out AI on cardboard still!


Approx 1100 lines of code and easily 30+ hours to get things to where they are.

I think that's a pretty clear explanation of why!


you make a good point.

If I was to write this from scratch again I would probably shave of 10-15 hours. To give a bit of background I spent the first few iterations trying to decide how best to keep track of each individual location across the map, and ways in which to allow the user to update this.

I also started going down the route of the app also playing the event cards for you - but that was way way to complicated, and entering all the cards and their eventualities was to overwhelming for just myself / 1 person... so I dropped that.

I hope that once I have the French AI polished off and confirmed by a few people, the Patriot AI should be quicker, as the base code is already there for the map / resources etc.

Now it's just a case of writing out the IF / WHILE statements for each decision tree.

Also I would like to try and tackle the Battles - again that would make the game play quicker.

If anyone has any general questions about implementation, feel free to ask.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
Latest release up (available from dropbox & Github), see release notes in this threads first post.

Per usual with software, please always use the latest release

Thanks
Michael
4 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
I am working on the French Battle command - and have a few questions, which I have posted in here:

https://boardgamegeek.com/article/23382350

In the spirit of helping me with the AI, I would be greatful if anyone subscribing to this thread could help on the Battle questions.

Thanks
Michael
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Goirish 374
msg tools
mb
i know this might seem silly in 2016, but would it be possible to post a bit more in the way of instructions for how to get started?

say, assuming someone had never written in or run prompts for python in windows before?

let's say from the point of downloading the .zip from github and having extracted the "src" folder?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Michael Auton
United Kingdom
flag msg tools
mbmbmbmbmb
ok - so if your not familair with Python you need to download the link I gave for dropbox:

https://www.dropbox.com/sh/x9uu786vrndnt8g/AABxKB6_c1IqIUHYn...

Download that entire folder, then run/double-click the LoD file in there.

Just a heads up for visibility, work on this particular AI/bot has paused - due to a partnership I have struck up with another developer under Falling Sky. Unfortunately I was gaining more feedback for my work under that game than Liberty of Death.

https://boardgamegeek.com/article/23693607#23693607

I hope to pick up LoD though again in the future, with a lot of lessons learnt from my time on Falling Sky.

Remember what you are downloading is an Alpha ... maybe not even that, as your the first person that I know of who has actually tried it - outside of myself !

Thanks

3 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.