The Ultimate Tool for Mafia Theme Makers

Discussion in 'Theme Development' started by IceKirby, Sep 15, 2014.

  1. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Presenting here my a new tool that every theme maker will find useful: the Mafia Simulator (Beta version)!
    Link: http://icekirby.github.io/PO-stuff/simulator/

    What is this?
    The Mafia Simulator is a simple page where you can load a mafia theme and run a game to check if things are working as you intended.

    What the Mafia Simulator is not:
    -The Mafia Simulator is not a place to play mafia. Games that you start there can only be seen on your browser, no other player can connect to it.
    -The Simulator will not do any action by itself. It will only run the game, and you will be given the chance to change names and control the players you want. If you don't control them, they will not do anything on their own.
    -The Simulator is also not PO. Lots of commands and features you can use on PO are not available on the simulator (examples: /me and /rules, which are server commands, not mafia commands).

    What is this useful for?
    The Simulator is ideally aimed for people who need to test if a role's coding do what you want. It's also useful to see how the game messages are displayed.
    The Simulator is not intended to test game balance, as that is not possible in an environment where you know everyone's role.

    How to use?
    1. Copy your theme's code and paste it into the first box.
    2. Click Load Theme. If your theme has no errors, it will be loaded.
    3. With your theme loaded, choose the number of players you want in the game and then press Start Game.
    4. The game will then start. You can use the controls near the Send button to make the current phase stop indefinitely, to skip to the next phase or to change the current player you are in.

    Tips:
    -If you are using a decent web browser, you can resize both the Theme Code box and the Chat box by dragging the hook at the corner of those boxes.
    -You can use /start to start a theme as you do on the server, but it's advised that you use the Start Game button because 1) You can automatically push the number of players you need and 2) You can bypass the "Theme started 5 games ago" restriction.

    Known Issues:
    -There's currently a limit of 49 players you can push into a game. This is easy to fix, but it's unlikely someone will actually need that much.
    -"Watch" commands may throw an error/not work. Fixed (I think)

    Closing words:
    Remember that this is a beta version. If you find any error, please report them on this thread. Suggestions are also welcome.
    If you are reporting an error, remember to state which web browser you are using.
     
    Last edited: Sep 19, 2014
    Pangaea, Yttrium, MUMU and 5 others like this.
  2. Keima Katsuragi

    Keima Katsuragi New Member

    Joined:
    May 22, 2014
    Messages:
    9
    Likes Received:
    0
    This is great before i used my localhost with po, now is more easy thanks Icekirby and dont have errors for now
     
  3. Dreadpool

    Dreadpool Inb4 I die N1...

    Joined:
    Jun 21, 2014
    Messages:
    41
    Likes Received:
    4
    PO Trainer Name:
    Dreadpool
    Rice you have outdone yourself.
    Genuinely the most helpful thing for testing ever!
     
  4. Fiery Espeon

    Fiery Espeon The fire never bothered me anyway ~

    Joined:
    Jul 26, 2013
    Messages:
    540
    Likes Received:
    129
    PO Trainer Name:
    Fiery Espeon
    I have a suggestion ^_^ Instead of forcing the user to finish their theme to test, what if you remove that restriction? I know a lot of people want to test some type of mechanics before they finish the code.
     
  5. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    If the theme is valid according to the Mafia Checker, then you can test it. You could very easily leave some roles unfinished while you test others, as long as the theme as a whole is valid.
     
  6. VirajVora

    VirajVora VirajVora...

    Joined:
    Apr 29, 2014
    Messages:
    371
    Likes Received:
    75
    PO Trainer Name:
    Viraj / Virus
    This is an awesome theme...
    I found out whether all my commands are correct or not and also other few things...
    This thread must be made sticky...
     
  7. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Two new features added:
    -Auto-complete names with TAB is now possible. Practically the same as with PO, except it will only pick names from players still alive in the game.
    -Pressing Up and Down on the chat input field now allows you to browser previous messages sent, just like in PO.
     
  8. Dreams

    Dreams Active Member

    Joined:
    Dec 4, 2013
    Messages:
    166
    Likes Received:
    76
    omg thanks so much for this. Now I can finally get some fun stuff done when I'm free
     
  9. Natsu Dragniil

    Natsu Dragniil Member

    Joined:
    Apr 27, 2014
    Messages:
    67
    Likes Received:
    2
    Can you make it so each person is a specific character rather than randomly picked? When I test out bigger games, I often take a long time to find to role I want. I know there is a pause feature, but it would save a bit of time.
     
  10. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    What do you mean by a specific character? An example would help, if possible.
     
    Last edited: Oct 2, 2014
  11. VirajVora

    VirajVora VirajVora...

    Joined:
    Apr 29, 2014
    Messages:
    371
    Likes Received:
    75
    PO Trainer Name:
    Viraj / Virus
    I guess he wants to say as follows...
    In 40 player game of SI he dont want to start and end the game 100 times to become Laser Cannon but he wants he feature to choose the role Laser Cannon at the start itself...
     
  12. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    I think he wants something else. Because Kirby's simulator already permits the testers to change what player/role they control any time during the test.
    Probably what Natsu wants is to assign a precise role to a precise bot instead then randomly. Something like : the bot Aarion always get the first role of the spawn list and the bot Zorua the 45th role of the used spawn list, or something like this more or less.
     
    Last edited: Oct 4, 2014
  13. Natsu Dragniil

    Natsu Dragniil Member

    Joined:
    Apr 27, 2014
    Messages:
    67
    Likes Received:
    2
    Thats exactly what I mean Obey/Shazan
     
  14. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Unfortunately, that's not really possible. The Simulator shares the same script that the actual mafia channel uses, so not everything can be implemented easily on the simulator unless some changes are made to the mafia script.

    What I could try is something closer to VirajVora's suggestion: create a field where you can pick a role you want before the game starts, and then if that role spawns then you are automatically put on the player that got that role.

    If you have another idea to achieve the same goal, feel free to suggest.
     
  15. Natsu Dragniil

    Natsu Dragniil Member

    Joined:
    Apr 27, 2014
    Messages:
    67
    Likes Received:
    2
    Yep I think that is good, it achieves the same goal I wanted. Thanks :D
     
  16. Silone

    Silone Kanade <3

    Joined:
    Jul 31, 2013
    Messages:
    265
    Likes Received:
    3
    PO Trainer Name:
    Silone
    Thank you Kirby, my life is now complete. No more needing to ask for a test :D
     
  17. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    I made an interface update that greatly improves usability: The players list now appears as an actual list, which makes it quicker to change players (less clicks necessary) and easier to read the names/roles still in the game.

    Check it out, test it, bork it and report any bugs you can find.
     
  18. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    Is there a way to check if hax/broadcast messages work?
     
  19. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    No, there' none currently. I once thought about adding a 2nd "window" for those occasions, but never put a priority on that.
     
  20. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    Suggestion: when changing between players, why not return the role/the role proto instead of the player's name?

    This:
    (03:06:33) You are now Mew!

    Turns into:
    (03:06:33) You are now Samurai!

    Or this:
    (03:06:33) You are now Samurai (samurai)!

    It just makes sense since the role name/role proto has more relevance than the player name does.