Create account / Log in

Bot in module

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Bot in module

Postby Paulie » January 12th, 2012, 10:43 am

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!
Paulie
 
Posts: 1
Joined: January 12th, 2012, 10:07 am

Re: Bot in module

Postby irishwulf » January 12th, 2012, 10:58 am

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.
irishwulf
 
Posts: 243
Joined: December 17th, 2011, 4:29 am

Re: Bot in module

Postby Tim M » January 12th, 2012, 1:45 pm

irishwulf wrote: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
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Bot in module

Postby irishwulf » January 12th, 2012, 3:24 pm

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.
irishwulf
 
Posts: 243
Joined: December 17th, 2011, 4:29 am

Re: Bot in module

Postby Tim M » January 12th, 2012, 4:06 pm

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.
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1812
Joined: December 8th, 2007, 12:22 pm
Location: Earth


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests