Bot in module

Hi!

Is it possible to include a bot into module? The bot will play automaticly for one side (in 2-player abstract board game like chess).

Thanks for the answer!

Yes, you could do this relatively easily with custom classes, which are described in the programming tutorial. However, from what I gather it is generally contrary to the spirit of Vassal - modules are usually designed to be as close as possible to the social experience of playing board games in person with your friends, with interface tweaks as appropriate.

I would say it is a lot more difficult than you make it sound, or it would have been done already. As it is only a few modules even do some semblance of rules AI/ Automating rules and tasks which is a lot easier than building a bot AI which would require not only the code for the rules but also decision paths for the bot etc… It is also not contrary to anything, you can do what you want - if you want to put in a bot or rules you can, but Vassal may not be the best suited engine to do certain things or tasks in its current state as it is not built very efficiently

I maintain that if you have experience writing an AI, integrating it into VASSAL would be relatively easy. I think much of the reason it hasn’t been done is that most games are either really complex, and therefore hard to code an AI for, or they’re pretty common, e.g. Monopoly, in which case there are already many other AI implementations. Please forgive my naivete, but couldn’t this essentially just be (for chess):
1 hidden counter with a 64-property sheet to maintain game state
map triggers to update the game state on drag-and-drop (global property fromSquare, toSquare, GKC to the gamestate updater)
main map button to set the AI’s next move (fromSquare, toSquare) - almost directly ripped from Tension.java, but with nextMove() instead of newIncrement()
map triggers, if desired, to automatically call the AI’s next move after updating game state
Send To Locations, if desired, to automatically move the AI’s pieces

It seems to me that the hard part is coding the nextMove() function. So if you’re prepared to do that, I think tying it into VASSAL should be doable.

Oh it’s doable, but as Ive stated Vassal isn’t optimized properly for doing certain stuff - it can do it, sure no problem especially by adding custom classes, just it won’t be efficient as it could be because of the way the Vassal code is currently written. Check out some of the developer discussions about the state of the code Joel has found. This is after all, what you would have to be working with.