Welcome! Log In Create A New Profile

Advanced

Online playing on homebrew emulators?

Posted by TheManuel 
Online playing on homebrew emulators?
December 05, 2008 11:17PM
Is there any general interest or have there been discussions about enabling online play on emulated systems, kaillera style?
It seems the potential is there and it would be really cool to face off against a friend on, say, the original Super Mario Kart.
Re: Online playing on homebrew emulators?
December 06, 2008 04:17AM
I'm very interested! I hope we can achieve that soon.
Re: Online playing on homebrew emulators?
December 06, 2008 06:04AM
Quote

kaillera style?

How does it work?
Are only the input data sent via the network or is there more to it?



Edited 1 time(s). Last edit at 12/06/2008 06:04AM by daniel_c_w.
Re: Online playing on homebrew emulators?
December 06, 2008 09:46AM
Kaillera is good in theory (yes, it only sends controls across the network). However, I was playing MAME Killer Instinct on a LAN with my friend, and it still dropped packets, so I ended up playing one game, and he was waiting for me to enter my name. lol

There are two ways I can think this could be done reliably, keeping the games in sync.

1. On consoles with "link" ports (ala Gameboy), these ports are emulated.
2. Emulators know when the console's "memory" is altered, it could send all alterations across the network (Address|Length|Data...)

Option 1 would definately be good for consoles that have them. I'm not too sure about the practicalities of option 2.



Edited 1 time(s). Last edit at 12/06/2008 09:49AM by whodares.
Re: Online playing on homebrew emulators?
December 06, 2008 10:34AM
Quote
whodares
2. Emulators know when the console's "memory" is altered, it could send all alterations across the network (Address|Length|Data...)

In theory, sending the input data is enough, right?
Every alteration of memory is a definite result of user input. And sending every Memory alteration would use to much bandwidth.

I am more concerned about latency. How to keep two games in sinc?


Has this approach been tried:
2 emulators:
Both run the same game, connect and sync time
Measure the average single trip time between them.
Add a safety to the time.
Both emulators emulate the game twice - a Now and a Then, that is the [time] behind the now.
The Now is presented on screen.
Every user input is buffered and sent to the other client immediately with a timestamp.
Every user input is executed when [time] has passed. - Inputlag!
Both emulators keep their timing in sync.
If any user input took longer than [time] to travel (detectable via timestamp),
- a signal will be sent back
- execution will be paused
- a new Now is created from the Then, the buffered input data and the received input data
- both emulators sync again
- continue execution
Re: Online playing on homebrew emulators?
December 06, 2008 01:30PM
the biggest problem is indeed latency
emulating a second player through network is easy, you just need to read controller data from network instead of reading your usual controller input

there is 2 problems:
1/ make sure that the emulation starts in sync
2/ make sure that both emulators don't go out of sync

I don't think it's a good idea to pause emulation when a input signal takes too much time to arrive

a solution I had in mind some time ago, quite similar to yours I believe:

-->on both side, emulators send game_id then wait until receiving same game_id from other network side

emulator 1 (player 1) starts, and send starting time to emulator 2 = start_1
emulator 2 (player 2) starts and send starting time to emulator 1 = start_2

emulation loops:

emulator 1 (main task) read player 1 inputs (local) and send it to emulator 2 with timestamps = update_1
emulator 2 (main task) read player 2 inputs (local) and send it to emulator 1 with timestamps = update_2

emulator 1 (specific task) wait for messages from emulator 2 and store player 2 input data + time stamp (update_2) in a FIFO (tbd)
emulator 2 (specific task) wait for messages from emulator 1 and store player 1 input data + time stamp (update_1) in a FIFO (tbd)

emulator 1 (main task) read FIFO and if (start_1 + time() ) >= (start2 + timestamp), updates player 2 data on its side
emulator 2 (main task) read FIFO and if (start_2 + time() ) >= (start1 + timestamp), updates player 1 data on its side

--> "network" player data is only updated if it supposed to have been updated

you will endup in some kind of latency during gameplay but should be acceptable as emulation does not slowdown



Edited 2 time(s). Last edit at 12/06/2008 03:27PM by ekeeke.
Re: Online playing on homebrew emulators?
December 06, 2008 03:52PM
Quote
ekeeke
I don't think it's a good idea to pause emulation when a input signal takes too much time to arrive

The pause is needed, because otherwise both emus will loose sync.
The problem with this approach:
Quote

emulator 1 (main task) read FIFO and if (start_1 + time() ) >= (start2 + timestamp), updates player 2 data on its side
emulator 2 (main task) read FIFO and if (start_2 + time() ) >= (start1 + timestamp), updates player 1 data on its side
...is that on the one side a lot of time may have passed , before the other side even recieved anything.
Or am I missing something?
Re: Online playing on homebrew emulators?
December 06, 2008 04:03PM
on emulators, inputs are generally updated on each frame (60 times per second)
if you didn't get any new messages, i think it's better to just keep input state in old state rather than pausing emulation and losing some frames
Re: Online playing on homebrew emulators?
December 06, 2008 04:15PM
Quote
ekeeke
if you didn't get any new messages, i think it's better to just keep input state in old state rather than pausing emulation and losing some frames

exactly. The pause is only needed the resinc both emulators. When the sync is lost you have no other choice.
In a lan environment that is no problem, because the lantency and ping is good enough to execute any remote input on either the same or the next frame. But in todays internet neither ping nor latency are good enough.
As we both agree it won't work without an input latency. Unfortuantely that latency is not guaranteed to stay constant.
Re: Online playing on homebrew emulators?
December 06, 2008 04:18PM
Well, it's worth to ask ourselves how PC games or even Wii games do it nowadays to see it that approach can be used.
Re: Online playing on homebrew emulators?
December 06, 2008 05:02PM
Quote
TheManuel
Well, it's worth to ask ourselves how PC games or even Wii games do it nowadays to see it that approach can be used.

Not really, because that games are tailored for online play, as opposed to SNES games, which are tailored for local play.

The network data, are generated by the games, not by their environments (emulators).
In general every genre has it's own approach. For example competitve shooters often use a client-server-modell, with the server deciding everything. If the client is laggy from his point of view he may be hitting an enemy, but the server will tell him "no you are missing", because the shoot command take too long to reach the server.

The networking requiremnets of fighting games are propably close to our problem...
Re: Online playing on homebrew emulators?
December 06, 2008 10:06PM
Quote
daniel_c_w
Quote
ekeeke
if you didn't get any new messages, i think it's better to just keep input state in old state rather than pausing emulation and losing some frames

exactly. The pause is only needed the resinc both emulators. When the sync is lost you have no other choice.
In a lan environment that is no problem, because the lantency and ping is good enough to execute any remote input on either the same or the next frame. But in todays internet neither ping nor latency are good enough.
As we both agree it won't work without an input latency. Unfortuantely that latency is not guaranteed to stay constant.

This is evident in Brawl's online play.
Re: Online playing on homebrew emulators?
December 06, 2008 11:45PM
do the VC games from Nintendo have any sort of 2 player mode through online?

also, wouldn't some sort of server need to be set up in order for the emulators to be able to connect to each other?
The last issue would be game "compatability" both users would have to use the EXACT SAME rom in order for it to work. And as all emulator players know, there are multiple versions of roms: (E) (U) (bi) (b2) (b3) (!) ect...

of course, the simple solutions would be to send the rom file to the other Wii emulator for second player. I don't think it would be piracy since if your friend comes over to your house to play as a second player, he doesn't have to bring his own game.
Re: Online playing on homebrew emulators?
December 07, 2008 12:18AM
The VC games do not have online.
Re: Online playing on homebrew emulators?
December 07, 2008 03:00AM
Quote
strongfan
This is evident in Brawl's online play.

I did not really analyze Brawl's network behavior, but my from a few sessions I came to the following guess.
The game uses a client/server model. The best internet connection becomes the server (so far so good Nintendo :D)
For the player on the server-Wii the game is Lag-free! For everyone else the game is as laggy as his connection.

(personal note: to me it was clear before I bought the game, that my internet connection is not fast enough, because it adds at least 55ms to every roundtrip. A complex fightitng game like brawl could not be lag free on my connection.)
Re: Online playing on homebrew emulators?
December 07, 2008 03:12AM
Quote
DrLucky
also, wouldn't some sort of server need to be set up in order for the emulators to be able to connect to each other?

...snip...

The last issue would be game "compatability" both users would have to use the EXACT SAME rom in order for it to work.

...snip....

I don't think it would be piracy since if your friend comes over to your house to play as a second player, he doesn't have to bring his own game.

A remote server is not needed! But of course at least one player needs to know the connection details of the other one (IP address, port).

Compatibility is in deed needed (both approaches (ekeeke's and my one) deal with it)

Sending over the game is a nice idea, but depending on your local laws it may indeed be piracy. I'm a sure it is not piracy under German law (as long as the other person is really a friend of yours and not some person you met on the internet)

It may be piracy under some other countrie's laws, because you are still creating a copy of copyrighted material
(though the copy is not persistent)
Re: Online playing on homebrew emulators?
December 07, 2008 04:40AM
Quote
daniel_c_w

Sending over the game is a nice idea, but depending on your local laws it may indeed be piracy. I'm a sure it is not piracy under German law (as long as the other person is really a friend of yours and not some person you met on the internet)

It may be piracy under some other countrie's laws, because you are still creating a copy of copyrighted material
(though the copy is not persistent)

if you picked up a random guy on the street and brought him to your house to play in a 2 player game, it would still be legal...
as long as it were a temporary "copy" rom sent over the connection with no way of saving the whole rom... it would sit in the ram perhaps...old system roms are around 2 megs, gba is around 8 megs, and a 64 rom is 16 or 32 megs.. they could also be zipped...
Re: Online playing on homebrew emulators?
December 08, 2008 02:47AM
Quote
DrLucky
if you picked up a random guy on the street and brought him to your house to play in a 2 player game, it would still be legal...
You are comparing apples to oranges.

That are 2 very different situations.
If you pick up a random guy, inivte him to your home, you do not have to create a copy.
Re: Online playing on homebrew emulators?
December 08, 2008 02:54AM
Yeah, that's how a lot of people got AIDS in the 80's...
Re: Online playing on homebrew emulators?
December 08, 2008 03:00AM
Well I think if you follow that definition of piracy than running ROMs in an emulator is piracy. Even if you physically own the game, I think you have to dump it yourself for it to not be piracy. I don't think legal issues are the real problem with online enabled emulators...
Sorry, only registered users may post in this forum.

Click here to login