In development: ROBOMOD

This forum is for discussion related to the game.
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

In development: ROBOMOD

Post Post #0 (ISO) » Thu Apr 09, 2015 10:32 am

Post by vonflare »

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.
User avatar
SleepyKrew
SleepyKrew
he/him
Snark Attack
User avatar
User avatar
SleepyKrew
he/him
Snark Attack
Snark Attack
Posts: 15746
Joined: April 27, 2011
Pronoun: he/him
Location: quack

Post Post #1 (ISO) » Thu Apr 09, 2015 11:01 am

Post by SleepyKrew »

To be clear: quack
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #2 (ISO) » Thu Apr 09, 2015 11:23 am

Post by vonflare »

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.
User avatar
SleepyKrew
SleepyKrew
he/him
Snark Attack
User avatar
User avatar
SleepyKrew
he/him
Snark Attack
Snark Attack
Posts: 15746
Joined: April 27, 2011
Pronoun: he/him
Location: quack

Post Post #3 (ISO) » Thu Apr 09, 2015 11:24 am

Post by SleepyKrew »

Definitely don't do a setup that doesn't need a mod (such as the one I linked).
To be clear: quack
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #4 (ISO) » Thu Apr 09, 2015 11:37 am

Post by vonflare »

Hmm true.

I'll probably do 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.
User avatar
Magua
Magua
Jack of All Trades
User avatar
User avatar
Magua
Jack of All Trades
Jack of All Trades
Posts: 6109
Joined: January 18, 2009

Post Post #5 (ISO) » Thu Apr 09, 2015 2:41 pm

Post by Magua »

If the setup is well known and understood amongst those playing, and does not have any N0 actions, typically the pattern is:

- Pick player somehow (random, whatever)
- Pass out cards
- Everyone goes to sleep
- Picked player tells mafia to wake up and identify eachother
- Picked player tells mafia to go to sleep
- Picked player tells everyone to wake up
- Day proceeds as normal
- Whoever is lynched becomes the mod
User avatar
N
N
Jack of All Trades
User avatar
User avatar
N
Jack of All Trades
Jack of All Trades
Posts: 8539
Joined: August 2, 2012

Post Post #6 (ISO) » Thu Apr 09, 2015 2:45 pm

Post by N »

In post 5, Magua wrote:If the setup is well known and understood amongst those playing, and does not have any N0 actions, typically the pattern is:

- Pick player somehow (random, whatever)
- Pass out cards
- Everyone goes to sleep
- Picked player tells mafia to wake up and identify eachother
- Picked player tells mafia to go to sleep
- Picked player tells everyone to wake up
- Day proceeds as normal
- Whoever is lynched becomes the mod

never lynch cheery dog day 1
GTKAS

Share And Enjoy
(go stick your head in a pig)
User avatar
ZZZX
ZZZX
Survivor
User avatar
User avatar
ZZZX
Survivor
Survivor
Posts: 10778
Joined: July 7, 2013

Post Post #7 (ISO) » Thu Apr 09, 2015 9:07 pm

Post by ZZZX »

I had an idea in mind for a mafia bot that can legitly play mafia. But uaing vb.net

I guess I cab assist you somewhat if you qre doing some kind of auto mafia mod?
Implosion: I see ZZZX was
redacted
. For shame, people. For shame.
The Bulge: ZZZX is ZZZX
Get to know a ZZZX: http://forum.mafiascum.net/viewtopic.php?f=61&t=58733
User avatar
BBmolla
BBmolla
Open Book
User avatar
User avatar
BBmolla
Open Book
Open Book
Posts: 24301
Joined: May 29, 2011

Post Post #8 (ISO) » Thu Apr 09, 2015 9:12 pm

Post by BBmolla »

Uh

play Vengeful

Is normally what I do with five players

http://wiki.mafiascum.net/index.php?tit ... eful_Mafia
Come see me in the Great American Melodrama in Oceano
User avatar
BBmolla
BBmolla
Open Book
User avatar
User avatar
BBmolla
Open Book
Open Book
Posts: 24301
Joined: May 29, 2011

Post Post #9 (ISO) » Thu Apr 09, 2015 9:14 pm

Post by BBmolla »

In post 5, Magua wrote:If the setup is well known and understood amongst those playing, and does not have any N0 actions, typically the pattern is:

- Pick player somehow (random, whatever)
- Pass out cards
- Everyone goes to sleep
- Picked player tells mafia to wake up and identify eachother
- Picked player tells mafia to go to sleep
- Picked player tells everyone to wake up
- Day proceeds as normal
- Whoever is lynched becomes the mod

But yeah this is normally how face to face works

A robot that automatically inputs actions and automatically resolves everything would be sweet though, would actually allow for role madness

Like, a bot who you text your night actions and it runs everything would be amazing.
Come see me in the Great American Melodrama in Oceano
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #10 (ISO) » Fri Apr 10, 2015 12:56 am

Post by vonflare »

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:
import java.util.*;


public class ExeModless {

static String p1R = "";
static String p2R = "";
static String p3R = "";
static String p4R = "";
static String p5R = "";

public static void main (String [] args) {
///////////////////////////////////////////////////////////////////////////////////
Random r = new Random();
Scanner s = new Scanner(System.in);
int p1RP = r.nextInt(5)+1;
int p2RP = r.nextInt(5)+1;
int p3RP = r.nextInt(5)+1;
int p4RP = r.nextInt(5)+1;
int p5RP = r.nextInt(5)+1;

int EorJ = r.nextInt(2);

boolean repeat = true;

while (repeat)
{
if (p1RP == p2RP || p1RP == p3RP || p1RP == p4RP || p1RP == p5RP) {p1RP=r.nextInt(5)+1;}
else if (p2RP == p3RP || p2RP == p4RP || p2RP == p5RP) {p2RP=r.nextInt(5)+1;}
else if (p3RP == p4RP || p3RP == p5RP) {p3RP=r.nextInt(5)+1;}
else if (p4RP == p5RP) {p4RP=r.nextInt(5)+1;}
else {repeat=false;}
}

if (p1RP==1) {p1R="villan";}
else if (p1RP==2) {if (EorJ==0) {p1R="executioner";}else if (EorJ==1){p1R="jester";}}
else if (p1RP==3) {if (EorJ==0) {p1R="target";}else if (EorJ==1){p1R="townie";}}
else {p1R="townie";}

if (p2RP==1) {p2R="villan";}
else if (p2RP==2) {if (EorJ==0) {p2R="executioner";}else if (EorJ==1){p2R="jester";}}
else if (p2RP==3) {if (EorJ==0) {p2R="target";}else if (EorJ==1){p2R="townie";}}
else {p2R="townie";}

if (p3RP==1) {p3R="villan";}
else if (p3RP==2) {if (EorJ==0) {p3R="executioner";}else if (EorJ==1){p3R="jester";}}
else if (p3RP==3) {if (EorJ==0) {p3R="target";}else if (EorJ==1){p3R="townie";}}
else {p3R="townie";}

if (p4RP==1) {p4R="villan";}
else if (p4RP==2) {if (EorJ==0) {p4R="executioner";}else if (EorJ==1){p4R="jester";}}
else if (p4RP==3) {if (EorJ==0) {p4R="target";}else if (EorJ==1){p4R="townie";}}
else {p4R="townie";}

if (p5RP==1) {p5R="villan";}
else if (p5RP==2) {if (EorJ==0) {p5R="executioner";}else if (EorJ==1){p5R="jester";}}
else if (p5RP==3) {if (EorJ==0) {p5R="target";}else if (EorJ==1){p5R="townie";}}
else {p5R="townie";}


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 lynchee
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.
User avatar
Aeronaut
Aeronaut
He/Him
Jack of All Trades
User avatar
User avatar
Aeronaut
He/Him
Jack of All Trades
Jack of All Trades
Posts: 7236
Joined: September 8, 2013
Pronoun: He/Him
Location: Boston, MA

Post Post #11 (ISO) » Fri Apr 10, 2015 1:14 am

Post by Aeronaut »

This is how the matrix starts
2023 W/L | 1-0
User avatar
Kublai Khan
Kublai Khan
Khan Man
User avatar
User avatar
Kublai Khan
Khan Man
Khan Man
Posts: 5278
Joined: August 5, 2008
Location: Sarasota, FL

Post Post #12 (ISO) » Fri Apr 10, 2015 1:17 am

Post by Kublai Khan »

Occasionally intellectually honest

Black Lives Matter
Get vaccinated
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #13 (ISO) » Fri Apr 10, 2015 1:27 am

Post by vonflare »



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 loled
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.
User avatar
Kublai Khan
Kublai Khan
Khan Man
User avatar
User avatar
Kublai Khan
Khan Man
Khan Man
Posts: 5278
Joined: August 5, 2008
Location: Sarasota, FL

Post Post #14 (ISO) » Fri Apr 10, 2015 2:21 am

Post by Kublai Khan »

In post 13, vonflare wrote:


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.

Eh. I think it might be less interesting actually. Once the initial "I'm a cop!" "COUNTER-CLAIM!" gimmick is over, it's just 2 townies v 1 mafia. Super-saint setup gives mafia more of a challenge to manipulate the townies to not just mislynch, but to do it in the right order.

Conversely, in the super-saint setup, the saint player usually makes themselves pretty obvious (often unintentionally) so it breaks down to 1 v 1.

Either way, ultimately more players are needed to make mafia more interesting.
Occasionally intellectually honest

Black Lives Matter
Get vaccinated
User avatar
Kublai Khan
Kublai Khan
Khan Man
User avatar
User avatar
Kublai Khan
Khan Man
Khan Man
Posts: 5278
Joined: August 5, 2008
Location: Sarasota, FL

Post Post #15 (ISO) » Fri Apr 10, 2015 2:22 am

Post by Kublai Khan »

Also: XYLBOT.
Occasionally intellectually honest

Black Lives Matter
Get vaccinated
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #16 (ISO) » Fri Apr 10, 2015 2:25 am

Post by vonflare »

XYLBOT?
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.
User avatar
Magua
Magua
Jack of All Trades
User avatar
User avatar
Magua
Jack of All Trades
Jack of All Trades
Posts: 6109
Joined: January 18, 2009

Post Post #17 (ISO) » Fri Apr 10, 2015 3:00 am

Post by Magua »

Use arrays. also use the java equivalent of shuffle on an array/list of roles and you eliminate 80% of the code.
User avatar
Kublai Khan
Kublai Khan
Khan Man
User avatar
User avatar
Kublai Khan
Khan Man
Khan Man
Posts: 5278
Joined: August 5, 2008
Location: Sarasota, FL

Post Post #18 (ISO) » Fri Apr 10, 2015 3:03 am

Post by Kublai Khan »

In post 16, vonflare wrote:XYLBOT?

It's an IRC Bot that moderates IRC mafia games. In depth article -> XylBot
Occasionally intellectually honest

Black Lives Matter
Get vaccinated
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #19 (ISO) » Fri Apr 10, 2015 3:04 am

Post by vonflare »

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
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.
User avatar
Kublai Khan
Kublai Khan
Khan Man
User avatar
User avatar
Kublai Khan
Khan Man
Khan Man
Posts: 5278
Joined: August 5, 2008
Location: Sarasota, FL

Post Post #20 (ISO) » Fri Apr 10, 2015 3:19 am

Post by Kublai Khan »

Damn, it would be great if Xyl was still here. His bot basically gave weighted figures to each role based on how many times it ended up on the winning side, then balanced future setups with those weighted numbers.

So a townie might be 0.45 and a cop would be 1.55 so cops would appears much less often than townies.
Occasionally intellectually honest

Black Lives Matter
Get vaccinated
User avatar
vonflare
vonflare
doot
User avatar
User avatar
vonflare
doot
doot
Posts: 3093
Joined: January 1, 2014
Location: Blue Gatorade Factory

Post Post #21 (ISO) » Fri Apr 10, 2015 3:20 am

Post by vonflare »

I looked XYLBOT up. How do I join a game of that?
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.
User avatar
Kublai Khan
Kublai Khan
Khan Man
User avatar
User avatar
Kublai Khan
Khan Man
Khan Man
Posts: 5278
Joined: August 5, 2008
Location: Sarasota, FL

Post Post #22 (ISO) » Fri Apr 10, 2015 3:22 am

Post by Kublai Khan »

Go to http://webchat.globalgamers.net/ and put #mafia as the channel you want to join.
Occasionally intellectually honest

Black Lives Matter
Get vaccinated
User avatar
Magua
Magua
Jack of All Trades
User avatar
User avatar
Magua
Jack of All Trades
Jack of All Trades
Posts: 6109
Joined: January 18, 2009

Post Post #23 (ISO) » Fri Apr 10, 2015 3:59 am

Post by Magua »

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))
User avatar
ZZZX
ZZZX
Survivor
User avatar
User avatar
ZZZX
Survivor
Survivor
Posts: 10778
Joined: July 7, 2013

Post Post #24 (ISO) » Fri Apr 10, 2015 5:48 am

Post by ZZZX »

I can give you how the basic code will look but its.. quite differant from java. (I hate java never got used to it) is that fine with you?
Implosion: I see ZZZX was
redacted
. For shame, people. For shame.
The Bulge: ZZZX is ZZZX
Get to know a ZZZX: http://forum.mafiascum.net/viewtopic.php?f=61&t=58733
Post Reply

Return to “Mafia Discussion”