Create account / Log in

Area Majority Game - How to evaluate most and second most?

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Area Majority Game - How to evaluate most and second most?

Postby Bridger » September 26th, 2020, 3:51 pm

I have an area majority game where X points are given to the side with the most forces in a region, and Y points are given to the side with second most units in a region, etc. If there is a tie, then both sides get the points.

Doing this in a 2-sided game is damn simple. But this game has 7 players. Is there any way short of super convoluted nested "If" statements to properly evaluate who has the 'most' in an area?

My plan was to use the 'on move' command to adjust a variable to denote the number of each side's forces in a given area (so 7 variables per area) and then fire a command to somehow update the display showing who has the 'most' and who has the 'second most'. I just can't figure out how to evaluate that to properly display the correct side.
Bridger
 
Posts: 26
Joined: March 19th, 2015, 10:27 pm

Re: Area Majority Game - How to evaluate most and second mos

Postby jrwatts » September 26th, 2020, 9:53 pm

Unfortunately, I can't think of any easy way to do that with VASSAL; even a simple Bubble sort is rather difficult to implement with a BeanShell expression. Hate to tell you this, but it would probably be best to write a bit of custom Java code to sort the scores.
jrwatts
 
Posts: 128
Joined: April 29th, 2020, 10:30 pm

Re: Area Majority Game - How to evaluate most and second mos

Postby Cattlesquat » October 4th, 2020, 11:26 pm

If you wanted to look at the All Bridges Burning module (the new COIN game), it handles many of these issues. You can look in particular for the "Countable" prototype (no custom code needed)

Brian
User avatar
Cattlesquat
 
Posts: 953
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA


Return to Module Design

Who is online

Users browsing this forum: No registered users and 4 guests