Giter Site home page Giter Site 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)

Valentin won 504 times
*noob* won 185 times
Izidor won 116 times
strax won 82 times
Angry Mamay won 68 times
KurSe won 34 times
Minion agent won 10 times
Dan Knox agent won 1 times

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

david k won 323 times
Rogue Leader won 235 times
flipback won 222 times
Eric the Kill Steal won 84 times
Dan Knox agent won 40 times
Minion agent won 28 times
A Tabby Cat won 19 times
Ian Terrell won 14 times
Cossack Mamay won 8 times
david k2 won 8 times
strax won 4 times
*No rest for the wicked* won 4 times
Izidor won 4 times
South Pole Steve won 3 times
Chuck Norris won 1 times
Raiko won 1 times
rots won 1 times
| Drowsy Leo | won 1 times

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

david k won 292 times
flipback won 250 times
Rogue Leader won 235 times
Eric the Kill Steal won 76 times
Dan Knox agent won 47 times
Minion agent won 36 times
A Tabby Cat won 20 times
Ian Terrell won 18 times
david k2 won 7 times
Cossack Mamay won 4 times
South Pole Steve won 4 times
strax won 3 times
*No rest for the wicked* won 3 times
Jayaram won 2 times
Raiko won 1 times
rots won 1 times
Izidor won 1 times

ruby-mmo's People

Contributors

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

Watchers

James Cloos avatar Kevin Jayanthan avatar

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.