Code Monkey home page Code Monkey logo

emu-coop's Introduction

emu-coop

This directory contains some Lua scripts that, when loaded by a compliant emulator such as snes9x-rr/snes9x-coop, can synchronize emulator state over the internet (allowing "cooperative" playthroughs of single-player games).

Each game you want to use this with requires a "mode" file in the modes/ directory. Currently included are modes for Link to the Past (JPv1.0) and the Link to the Past Randomizer.
The files you see here are very likely not compatible with other forks of emu-coop. It is recommended to always exchange the entire coop-folder for every release/fork.
WARNING: Modes are PROGRAMS, like a .exe file. Do not install a mode file unless it came from someone you know and trust.

You can reach me, FirenX, here at GitHub or at Discord as Feed4Fame#7342.

What is shared?

All modes share:

  • The complete Inventory (all Y-items, all ability items, swords, shields, mails)
  • Bottle Contents
  • Arrows, Bombs, Rupees
  • Heart Containers/Pieces
  • Half Magic Buff
  • Curent HP/Magic (optional)
  • Triforce Pieces (in Rando)

On top of that, Link to the Past and Link to the Past Randomizer - Identical Seeds share:

  • Pendants/Crystals
  • Compasses, Maps
  • Keys (Big and Small)
  • Overworld/Dungeon data (e.g. Doors/Chests/Item Locations are opened/taken for both players if one player does so)
  • Boss kills (including Aga1 and Aga2)
  • Reaching the Triforce Room

For the Overworld/Dungeon data to share correctly it is recommended to not be in the same overworld screen/dungeon superroom simultaneously.

For Link to the Past Randomizer - Different Seeds it is recommended to play on a higher difficulty setting or with customizer seeds since you will otherwise end up at 20 Hearts, Golden Sword, Red Mail, Mirrorshield, Quarter Magic relatively quickly.

How to Use

  • Open the ROM using the snes9x-coop
  • Have both players open the coop.lua using "File -> Lua Scripting -> New Lua Script Window..."
  • If asked what mode to use, pick the one you intend to use
  • Fill out the connection setting, pick your options and click "OK". Only use "Retro mode" if you are playing a Retro Variation seed of the Randomizer
  • Wait for the script to say "Connected to Partner"
  • You can now play the game

In case something terrible happens and you need to restart/reconnect:

  • Save&Quit
  • Close and restart the emulator
  • Open the ROM you were using
  • Open your save file starting the game
  • Start the coop.lua as described above. This time use different nicks and pick the option "Restarting after a Crash?"
  • The script will now take its time to sync both players again. Wait until it says "Syncing is done"
  • You can now keep on playing

Author / License

These files were originally written by Andi McClure and later edited by Alvytv, and then edited by me, FirenX.

Big thanks to:

  • The LTTP Randomizer team, esp. Mike Trethewey, Zarby89 and Karkat, for information
  • Alex Zandra and Maya Shinohara, and Andypro1 from github for help testing
  • Andi McClure and Alvytv for creating/updating these scripts
  • The various testers of each release

Unless otherwise noted, the license is:

Copyright (C) 2017 Andi McClure

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE 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.  IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

Included in this directory is Penlight. Here is its license:

Copyright (C) 2009-2016 Steve Donovan, David Manura.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE 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.  IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

Included in this directory is Luasocket. Here is its license:

LuaSocket 3.0 license
Copyright © 2004-2013 Diego Nehab

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE 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. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Included in this directory is IUP. Here is its license:

Copyright (c) 1994-2017 Tecgraf/PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE 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. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

emu-coop's People

Contributors

firenx avatar mcclure avatar miketrethewey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

emu-coop's Issues

Version Error

in the version.lua, the patch numbers must be all numbers, since the util.lua uses a tonumber on them to compare them. This means that it's causing something to turn up nil and crash the lua immediately.

Regarding fairies and sharing death/health (LTTP Randomizer)

Playing with some friends, I noticed some inconsistencies whenever we died: Sometimes one fairy would be used, sometimes two would be used, and sometimes one player would use one while the other is sent to the game over screen... Is there any way to keep this consistent, or is it because we're sharing death while sharing health that's causing this issue? Should we just keep the Death option off?

Item Limits arent shared

Item Limits (aka too many lamps) dont have their counts shared to make future lamp finds or whatever become shared. They are at the addresses 0x7EF39#, so sharing 0x7EF390 to 0x7EF39F on high should solve this issue. Tested and it seemed to work. Unsure if there is any unintended side effects yet but that should be all it takes.

Duplicate key issue

Ik this project hasn't been updated for some time, but I thought I should mention something I ran across. If both players happen to be the the same room, if both collect the same key, the counts are doubled. Obviously, it's impossible to despawn the key in the room, but you could possibly run a duplication check and decrement the local key count and prevent sending the duplicate key to the other player.

Dying through a door transition softlocks the game

I just had unfortunate timing with a friend: I ended up dying in the middle of a door transition, specifically in Thieves Town dungeon, in the top-right door of the room to the right of the big chest.

The game decided not to send me to the Game Over screen, I couldn't move, and I couldn't save+quit, either... Can anything be done to prevent/fix this?

Allow for multiple users playing the same seed

I'm looking at extending pipe.lua to support using IRC channel instead of private message to allow for multiple people playing the same seed. Looks to be fairly simple just from an IRC standpoint, but are there other obstacles in the code which would be problematic with more parties?

Odd resync issue

I don't know if this should be classified as internet, IRC, or the script as the issue. Last night (Feb 25) at around 11:45 pm the script lost connection to Mistress Saeko. She kept getting an error that the connection died, similar to this:
Error: Connection died: PRIVMSG lenoguy :#{value=48,addr=8319853}

We followed standard procedure to get restarted, and when we reconnected it would attempt to resync (restart after crash). This is the series of messages she would receive:
Playing Link to the Past Randomizer
Connecting to server...
Logging in to server...
script returned but is still running registered functions
Searching for partner...
Connecting to partner...
Connected to partner
Syncing...
Error: Connection died: PRIVMSG lenoguy :#{value=128,addr=8318997}
Error: Connection died: PRIVMSG lenoguy :#{value=31,addr=8318996}
Error: Connection died: PRIVMSG lenoguy :#{value=15,addr=8318980}
Error: Connection died: PRIVMSG lenoguy :#{value=3,addr=8319945}
Error: Connection died: PRIVMSG lenoguy :#{value=25,addr=8319863}
Error: Connection died: PRIVMSG lenoguy :#{value=4,addr=8319860}
Error: Connection died: PRIVMSG lenoguy :#{value=20,addr=8319857}
Error: Connection died: PRIVMSG lenoguy :#{value=25,addr=8319856}
Error: Connection died: PRIVMSG lenoguy :#{value=104,addr=8319852}
Error: Connection died: PRIVMSG lenoguy :#{value=242,addr=8319849}
Error: Connection died: PRIVMSG lenoguy :#{value=144,addr=8319848}
...
Syncing...done!

We tried both the default server you have put in, and SRL's IRC server. Both gave the same result. Both of our internet connections never had any kind of interruptions, and I didn't lose a single frame when I was streaming my end. She never lost connection to anything during the game, as well.

I guess the real issue here is why the game would not let us resync. I don't know if it's because of the new stuff added from the original script, or if the resyncing is just faulty in general.

As a side note, there was an issue with death syncing prior to the connection dropping. Saeko had died, and I forgot what to. I had 1/2 a heart left and it did not kill me. A couple of minutes later, I would die twice in succession so it seemed like it got synced back up. However, sometime after that it lost sync when she picked up the Master Sword, while I still had Fighter's Sword.

Silver Arrows NOT Syncing

I started playing ALttPR with one friend with the coop emu scripts, we actually play keysanity, but we're experimenting the problem that when someone gets the Silver arrows they don't sync to the partner.
I've seen also the bird & rescuing the old man not syncing as well.
What's the solution?

Support for the clean English version of LTTP?

I'd love to get more of my friends into LTTP Co-Op randomizer, but I think the clean English version is the best way for me to get some of my friends into it.

Everything seems to work except syncing keys. I'm not sure if other dungeon puzzles are saved because the key was the first puzzle we ran into and didn't test any farther.

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.