Giter Site home page Giter Site logo

multimon's Introduction

Multimon: A Gameboy emulator for multiplayer first generation pokemon gameplay

This is a simple combination of the PyBoy emulator with the PodSixNet networking library that allows for netplay of Pokemon Red/Blue (Red only tested). It consists of a custom emulator made with PyBoy (client.py) that tracks memory values in order to pass them to a seperate server program (server.py) that then sends state to connected players. The network code is naive in that the server does not attempt to sync state, but instead relies on both clients to be good faith actors. Current features include the ability to display both players on the map, total event and item lockout, caught pokemon lockout, and win conditions based on gym victories. The overall idea is to create a synchronous platform on which races of a randomized first-gen runs can be played.

Requirements

Client Side:

  • Python 3.7
  • PyBoy
  • PodSixNet
  • SDL2 DLL (in same directory as client)

Server side:

  • Python 3.7
  • PodSixNet

Usage

Using this emulator requires a server clients can connect to. server.py requires two positional arguments, the first being the hostname of the server and the second the port clients will connect with. It also accepts a number of positional arguments:

  • -items: Total item and event lockout. Will certainly break the game if both players start from Pallet. Binary, default false.
  • -wilds: Locks out wild pokemon -- should a player catch a pokemon it will become unavailable to other players. Binary, default false.
  • -position: Displays the position of other players on each player's screen. Binary, default false.
  • -badge_win: Default none. Accepts badge names (In the form BoulderBadge, CascadeBadge, etc.). Should a player obtain the given badge the game will end for all players.
  • -max_connections: Default 2. Max numbers of players able to connect to the server. Tested only with 2.
  • -password: default none

A sample invocation looks like: "xxx.xxx.x.xx 8080 -wilds -position -badge_win CascadeBadge"

When testing locally use localhost instead of an IP address. If you wish to run a server on a VPS cloud provider (tested with DigitalOcean) the IP address will be the external IP of the server.

client.py also has a number of arguments. It requires positionally:

  • Path to the first generation pokemon ROM to use.
  • A nickname
  • Hostname of the server to connect to
  • Port to use when connecting

and optionally:

  • -savestate: the location of a savestate to use
  • -password: a server password, if required

Issues, etc.

This was a first go for me at working with both (virtualized) gameboy hardware and netcode, as such treat it gingerly. Desyncs are absolutely possible, and there are unresolved issues with the gamestate:

  • Locking out items also locks out events (such as obtaining the starter pokemon) and is thus likely to break the game.
  • Wild pokemon lockout works...mostly. Due to the oddities of the first generation catch algorithm it is absolutely bypassable by the Master ball. Still, it does work: catch lockout
  • Numerous graphical glitches (phasing over menus etc.) with the other player on screen

Overall it "just works," and I have been able to complete CascadeBadge races against an opponent. Have fun!

multimon's People

Contributors

messner1 avatar

Stargazers

 avatar

Watchers

 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.