In development: ROBOMOD
-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
In development: ROBOMOD
Have you ever wanted to play a nice little game of mafia, but you only have 4 friends? With 5 people, thats 4 players and a mod. But what good setup uses only 4 players? 5 is where its at. If only there was a way to play so that there is no mod, and yet all night actions and win conditions are handled fairly. Well, now there is!
Sales pitch aside, I'm coding a computer program that will act as 'the mod' for a meatworld game with the setup Lyncher Mafia, with the additional variable of 50% chance that the lyncher is a jester (dosen't end the game) (I'm planning on adding more setups eventually)
Basically, the program will call in the players individually and tell them their roles. Then, during the day, it will wait patiently as the players come to a decision as to who to lynch. It will flip them, then call in the players one at a time to submit their night actions. If they dont have a night action, they will just type their own name. It will detect when a player has fulfuilled their win condition too!
I'm coding it in Eclipse, and a prototype should be ready within a few weeks.
Just wanted to share. Thoughts?THIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
Yeah, I saw that (I read every mini in trying to decide which setup to create) but I thought lyncher/jester would be more fun.
And I'm trying to decide whether to do that one or dethy next.THIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
Yeah, that was the idea. But for dethy especially, you need a mod. I don't see any way around it. That was the original inspiration (dethy) but I decided to test the concept with an easier setup first.
The way I distribute the roles seems inefficient to me. Because you can't have repeats, you can't just assign each player a random role.
Here's my code for the role assignments:
Spoiler:
Anyone have any suggestions on how to make it more efficient? Some sort of reverse bubble sort? I mean, the above works, it just has to do a lot of Random.nextInt.
(And before you suggest arrays, Im planning on making the players into arrays instead of individual variables eventually. This is just a proof of concept)
PS: in the code, villan = mafioso, executioner = lyncher, target = unaware lyncheeTHIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
Yeah, I've played the supersaint setup in RL, but it dosent really require a mod because there isn't any night actions. Ace of spades = mafia, jack of diamonds = vengeful, 2 of hearts = townie
The cop setup is interesting, though.
In post 11, Aeronaut wrote:This is how the matrix starts
I loledTHIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
See, that's where I'm stuck. I'm not sure how to use 'shuffle'. I looked it up and the answers were not helpful.
Pedit: @maguaTHIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
In post 23, Magua wrote:In post 19, vonflare wrote:See, that's where I'm stuck. I'm not sure how to use 'shuffle'. I looked it up and the answers were not helpful.
Pedit: @magua
Java's not my thing, but something like this:
Code: Select all
List<String> roles = Arrays.asList("VT", "VT", "Lynchee", "Mafia", "Lyncher"); Collections.shuffle(roles);
roles.get(0) will be the role of the first player, roles.get(1) will be the role of the second player, etc.
If you want the Mafia to be a possible Lynchee, get a random number 0-4 afterwards, rerolling while "Lyncher".equals(roles.get(yournumber))
Hey, this worked great! I had to modify the code a bit though, List apperently dosen't take parameters.
Code: Select all
import java.awt.List; import java.util.Arrays; import java.util.Collections; public class test { @SuppressWarnings("unchecked") public static void main (String [] args) { java.util.List<?> roles = (java.util.List<?>) Arrays.asList("VT", "VT", "Lynchee", "Mafia", "Lyncher"); Collections.shuffle(roles); System.out.println(((java.util.List<String>) roles).get(0)); System.out.println(((java.util.List<String>) roles).get(1)); System.out.println(((java.util.List<String>) roles).get(2)); System.out.println(((java.util.List<String>) roles).get(3)); System.out.println(((java.util.List<String>) roles).get(4)); } }
produces the correct results.
thanks again!THIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-
-
vonflare doot
- doot
- doot
- Posts: 3093
- Joined: January 1, 2014
- Location: Blue Gatorade Factory
In post 30, Magua wrote:Import java.util.list instead of java.awt.list and use string rather than ? gets rid of all the unnevessary casts
Ohey, you're right!
My mistake was I didnt import Java.*;, I just used the reccomended import, which was Java.awt.list;.
This works now:
Code: Select all
import java.util.*; public class test { static Random r = new Random(); static Scanner s = new Scanner(System.in); static int EorJ = r.nextInt(2); static String [] Name = new String[5]; static String [] Role = new String[5]; @SuppressWarnings("unchecked") public static void main (String [] args) { List<String> roles = Arrays.asList("Townie", "Townie", "Target", "Executioner", "Villan"); if (EorJ==1) {roles = Arrays.asList("Townie", "Townie", "Townie", "Jester", "Villan");} Collections.shuffle(roles); for (int i=0; i<5; i++) { Role[i]=roles.get(i); } } }
THIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Copyright © MafiaScum. All rights reserved.