Giter VIP home page Giter VIP logo

ruby-mmo's Introduction

Ruby MMO

Ruby MMO is a programming challenge in which players compete to gain the highest level in an MMO simulation.

How to play

Fork this repo and commit a module inside the /players directory. The module is then used to extend a player object with a couple of methods:

  1. The move method returns an array with two elements: the method to be called (can be one of :attack or :rest), and the method arguments. In the case of :attack the argument should be an instance of an opponent Player (see below for how to get this). In the case of :rest no argument is required. See the examples in the /players directory.

  2. to_s (optional) returns the name of the player.

Order of Play

The player order is shuffled each round. If multiple players attack the same opponent, the attacks are grouped so that the largest group attacks first and then remaining attackers are random (thanks to @iyonius).

Levelling Up

For each conquered opponent, the attacker gains the amount of experience equal to the opponent's max health. Group attackers split the experience equally. If a player's experience crosses the threshold for levelling up, that player's max health, strength, and defence will all be increased (according to the schedule in engine/player.rb).

Exploring

The player modules have access to the Game.world hash. This hash contains all the players and monsters in the world and their current stats. For example, to get the stats of a random player you could do:

player_count = Game.world[:players].count
opponent = Game.world[:players].select{|p|p != self}[rand(player_count - 1)]
opponent.stats

The select is to ensure the player is not fighting itself.

There is also a method alive that returns false if the player is dead.

Rules

  1. No cheating by overriding classes, methods, or instance variables.
  2. Cheating players will be moved to the cheaters/ directory.

@DanKnox came up with a dominating technique that involves dynamically creating multiple player modules. In order to mitigate the strength of this technique, a third rule seems necessary:

  1. No more than 3 player instances per Github account.

Running the simulation

./engine.rb -r 100 where -r sets the number of rounds (default is 10).

Winning

The player with the highest level and experience wins.

Winners

Sprint (./multi_run.rb -r 1000 -o 10)

Jbttn won 388 times
Valentin won 251 times
*noob* won 100 times
strax won 73 times
Angry Mamay won 64 times
Izidor won 37 times
Lachesis won 26 times
Clotho won 18 times
Atropos won 18 times
Jax won 16 times
__pwned_clone_left won 4 times
Van Diagram won 3 times
Z Cloud Strife won 1 times
limekin won 1 times

Race (./multi_run.rb -r 1000 -o 100)

Chuck Norris won 181 times
__pwned won 90 times
flipback won 82 times
Eric the Kill Steal won 76 times
Atropos won 66 times
__pwned_clone_right won 65 times
Z Cloud Strife won 61 times
Jax won 47 times
Clotho won 47 times
__pwned_clone_left won 42 times
Emmanuel, the new guy won 42 times
Lachesis won 39 times
Van Diagram won 37 times
Izidor won 37 times
strax won 13 times
| Drowsy Leo | won 12 times
Rogue Leader won 12 times
limekin won 11 times
Michael won 7 times
*noob* won 5 times
rots won 5 times
*No rest for the wicked* won 4 times
Angry Mamay won 4 times
Ian Terrell won 3 times
Cossack Mamay won 3 times
Jayaram won 2 times
Teeler won 2 times
Jack won 2 times
South Pole Steve won 1 times
A Tabby Cat won 1 times
Sir Samsonite won 1 times

Endurance (./multi_run.rb -r 1000 -o 1000)

Chuck Norris won 158 times
Eric the Kill Steal won 123 times
Z Cloud Strife won 118 times
Lachesis won 69 times
Atropos won 66 times
flipback won 66 times
__pwned won 53 times
__pwned_clone_right won 47 times
Clotho won 39 times
Emmanuel, the new guy won 39 times
__pwned_clone_left won 32 times
Van Diagram won 32 times
Izidor won 29 times
Jax won 22 times
Michael won 18 times
| Drowsy Leo | won 15 times
limekin won 15 times
Ian Terrell won 10 times
Rogue Leader won 10 times
*No rest for the wicked* won 8 times
Angry Mamay won 5 times
strax won 4 times
rots won 4 times
*noob* won 4 times
Sir Samsonite won 3 times
Teeler won 3 times
Jack won 2 times
Dan Knox won 1 times
Crazy Carl won 1 times
Jayaram won 1 times
Cossack Mamay won 1 times
South Pole Steve won 1 times
A Tabby Cat won 1 times

ruby-mmo's People

Contributors

abevoelker avatar benmanns avatar danknox avatar ekosz avatar gaustin avatar havenwood avatar ianterrell avatar izidormatusov avatar jberlinsky avatar jbttn avatar jkanche avatar joshvc avatar jrforrest avatar mechamanny avatar mtfoley avatar nathanlapp avatar omnipresent avatar petejohanson avatar pjurczynski avatar reedlaw avatar rfunduk avatar ryw avatar siannopollo avatar smerritt avatar snuderl avatar southpolesteve avatar stjohncj avatar valentinzberea avatar vitaly-pushkar avatar wmtylerdavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby-mmo's Issues

Monster spawning system

Monsters should spawn regularly and with similar stats to the surviving players.

Please comment with suggestions.

Inform players about moves of others

Give a message to every player about moves of other players: a player can then join the raid on a single player or know that somebody attacks him and he should defend himself..

Vote on 2.0

I'd like to know whether a sandboxed-version that still runs in the console, or a remote API calling version would be more fun?

Because of the ease of cheating in its current state there needs to be some separation between the players and the engine. It could be done in separate process, using a gem like shikashi, or just put it on a server and let players communicate by sending and receiving json objects.

multirun.rb only executes 10-round games

Blood is still flowing freely from the rat carcasses at round 10.

Maybe make multirun do less games, with longer rounds?

I'd vote for 200 50-round matches if you don't want to lengthen run-time.


And I love the game - I've just invested 2-hrs into it :)

Strength & defence

Instead of having these as constants, it'd be better to increase strength by a small amount with each attack and, naturally, lower defence after taking damage. Defence could also recover when resting, but with a slower pace than health.

Require no more than 2 logical players per github user

@DanKnox has a pending patch that creates 10 users and turns them into a bot net. I recommend disallowing such collusion by limiting the maximum number of agents per user to two modules. This will allow some room for developing alliance based agents and prevent the game from deteriorating into lynch mob style play.

Each round has slowed to a crawl

It may just be my computer but after updating my repository it seems as though each round of the game now takes a few seconds to complete. I have narrowed down the cause to the two modules submitted by @Davidk01 but haven't had time to look through them.

For anyone that is interested in speeding their game back up during testing, remove davidk.rb and davidk2.rb from the players directory or comment out the contents.

Not trying to single you out @Davidk01 just thought this might save someone else some time.

-ve points

Points are calculated using the players strength and the opponent defense.

What if the players strength is very less compared to the opponent defense, so that the calculated points is negative. This adds health points to the opponent. was it designed to be in that way ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.