MisterTea / MAMEHub

Netplay-capable multi-machine emulator
http://www.mamehub.com
118 stars 29 forks source link

Rollback netcode impressions #339

Open antervud opened 9 years ago

antervud commented 9 years ago

i tried with Smube and we had like 70ms ping, we both had "rollback 1" in ume.ini and i was hosting

we both have above 3ghz cpus

we tried a cps1 game first: Street Fighter II': Champion Edition (World 920513) it was flawless, perfect online experience

then we tried a cps2 game: Super Street Fighter II X: Grand Master Challenge (Japan 940223) it was responsive but had very frequent choppiness, not really playable

then we tried another cps2 game: Street Fighter Alpha 3 (Euro 980904) it was responsive but had very frequent choppiness, not really playable too

next game was a neogeo game: The King of Fighters '98 - The Slugfest (NGM-2420) was pretty bad choppiness, unplayable, very bad

i also tried starting Street Fighter III 3rd Strike: Fight for the Future (Japan 990608, NO CD) but csume crashed multiple times

also, when youre using rollback is the frames delay still dynamic? what if we can put it a fixed value ourselves like on ggpo/fightcade? can it be better and/or uses less cpu?

can we have a switch on the interface for rollback/default netcode?

i'm not sure 100%, but looks like that if you start a game you played on rollback with the default netcode, csume freezes when someone joins unless you delete the correspondent nvram

MisterTea commented 9 years ago

@antervud right now the rollback has a frame delay of 0. Every time you press a button, it causes a rollback on the other side. If I support adding a frame delay to rollback, then as you increase the frame delay, there would be fewer rollbacks and things would be less choppy, but then you also would get input lag. I feel like the non-rollback code (which dynamically tunes the frame delay to ensure the best experience) is better than letting people guess at a good value for frame delay in rollback mode.

Regarding your question about a switch on the interface: We can't put a switch in mame, but someone should write an ini editor in the client where it would be easy to make changes to the ini file without having to open a text editor.

MisterTea commented 9 years ago

@antervud Also regarding your feedback on different machines: The rollback code has to make 10 state saves per second and keep them around for at least 2 seconds, so machines with a lot of RAM (Like sf alpha 3 NOCD) will blow up because they swap large amounts of content from ROM into RAM.

Did sf2 champion edition work flawlessly every time and king of fighters work terrible each time? Please send me the logs of the games which were bad.

antervud commented 9 years ago

@MisterTea maybe it works differently here under the hood but it's from 2007 that on ggpo people play with one frame of delay on rollback netcode by default and there you can change manually the delay from 0 to 10 frames delay. empirically on ggpo i could be able to play smoothly with one frame delay up to 150ms ping and i never go down to zero frames delay (because of course i experience so much rollback).

so i disagree and i invite you to try it yourself and see

as for logs let me see if i can find those in the mamehub folder

antervud commented 9 years ago

@MisterTea yeah cps1 (sf champion edition) is less powerful than cps2 (alpha 3) but neogeo should be less powerful than both (or maybe just cps2) and perform the worst

Prinygod commented 9 years ago

Ggpo uses an old version of mame that's been hacked like crazy and can only run a few arcade systems. Mamehub trys to support thousands of games and its impossible to optimize all of them. If it was so easy to get ggpo code running for all games don't you think some one would do so already?

MisterTea commented 9 years ago

@antervud When you compare ggpo with 1 frame of delay against mamehub without rollback, is there a noticable difference for the same game?

MisterTea commented 9 years ago

@antervud 1 frame of rollback in GGPO shouldn't make a difference if you have 150ms ping: 1 frame is 16ms so you will still have to roll back every time there's an input (no inputs will make it in 75ms)

antervud commented 9 years ago

@MisterTea this is street fighter 2 champion edition (cps1) http://pastebin.com/HvnbDDVP and was nearly flawless (i notice now that on ume.ini i had the basedelay sat on 17ms which is roughly a frame, maybe this had influence?)

this is alpha 3 (cps2) http://pastebin.com/9vK2uP2H frequently rollbacks here

this is neogeo (kof98) http://pastebin.com/N3YNmKZg the worst (i was messing with ume.ini and i sat basedelay at 0 just before i think)

this is the connect attempt for 3rd strike http://pastebin.com/dRdv107E

@Prinygod GGPO (now "FightCade") uses an outdated version of Final Burn Alpha, never used Mame. Also i don't wanna trigger anyone with this GGPO thing, but at the moment is probably the one that offers the best experience.

In the end, i just like be useful to MameHub.

MisterTea commented 9 years ago

@antervud I need both client and server logs.

Setting basedelay is ignored if you have rollback on at the moment.

Prinygod commented 9 years ago

i was under the impression that mame and final burn alpha were forks of each other, i might be wrong, but my point remains the same. trying to compare netcode that only works for a couple of systems to one that works for thousands is not a fair comparison.

antervud commented 9 years ago

@MisterTea i don't have both, sorry i will try another session maybe tomorrow

"When you compare ggpo with 1 frame of delay against mamehub without rollback, is there a noticable difference for the same game?"

definitely yes, feels more responsive and feels that the delay is always the same, in mamehub feels that on certain moment theres huge delay and on some others less, it comes and goes

"1 frame of rollback in GGPO shouldn't make a difference if you have 150ms ping: 1 frame is 16ms so you will still have to roll back every time there's an input (no inputs will make it in 75ms)"

math is no opinion for sure, i lack the knowledge to explain this, i don't know what else i can say besides "go on FightCade and feel it yourself", i just know that with these settings it's butter smooth, of course there's occasional rollbacks but they're rare and unobtrusive (there is a bug anyway where you should go windowed then fullscreen again to unlock a freezed game, maybe is a fullscreen bug only? but happens only playing with people that has bad connection)

@Prinygod GGPO can work on all games supported FBA i think, that's why people came up with custom savestates to load games not officially supported by the GGPO project itself. Again, i don't wanna be unfair.

antervud commented 9 years ago

@Prinygod i think that the rollback on MameHub is just as good as the GGPO one, the matches i had with Smube with SF Champion Edition felt great!

Prinygod commented 9 years ago

Well supposably ggpo uses input prediction. But its closed source so we only have the creators word. I'm glad I worked for you but I think we will find that many people won't be able to use rollback. Me and DG were not able to get a satisfactory game together. But that's why roll back is optional

antervud commented 9 years ago

To have both it's the better thing.

Just to know, what games was those?

Prinygod commented 9 years ago

Hyper sf2

MisterTea commented 9 years ago

I'm amazed that rollback works at all, because when I tried it, it looks like it was doing exactly what it was supposed to do, but it felt like shit. Maybe my internet connection was bad at the time.

MisterTea commented 9 years ago

@Prinygod I read some articles on GGPO, and their "input prediction" is really "we prediction people will do what they were doing before". MAMEHub's rollback already has the same prediction.

antervud commented 9 years ago

how many ms of latency from you two?

antervud commented 9 years ago

@MisterTea i tried today with another italian, unfortunately his connection wasn't as good as the german here you can download the logs for the matches of Street Fighter II': Champion Edition (World 920513) cps1 http://lowercase.soupwhale.com/roba/roba/sf2ce.zip matches ran kinda fine but not flawless like yesterday, with some major rollback (at a certain point, after a rollback, the audio stalled for me but the action continued normally)

here's the logs for a cps2 game Marvel Vs. Capcom: Clash of Super Heroes (Euro 980123) http://lowercase.soupwhale.com/roba/roba/mvsc.zip matches ran bad like alpha 3 (at some point there was a huuuuuge stall of the game and after some second continued) bad performance

i will try some neogeo next time

antervud commented 9 years ago

attempted with Smube a second time

we had a very nice connection like last time

sf2ce gameplay is good, at some point the sound get stuck but the game continue just fine http://lowercase.soupwhale.com/roba/roba/sf2ce_2nd_attempt.zip

kof98 was better this time at the very beginning, then became very choppy http://lowercase.soupwhale.com/roba/roba/kof98_2nd_attempt.zip

MisterTea commented 9 years ago

Cool. Maybe if I put a 2 frame delay in the rollback code it will be a lot smoother and only have a bit of input lag.

antervud commented 9 years ago

Please, let us choose the delay, lets say from a range of 0 to 10 frames, and: _both client and host can choose its own delay independently _an option where host can force same delay for both players

tnx

antervud commented 9 years ago

I think ggpo make 20 savestates per second but i'm not sure, i think i read that somewhere and i don't know for how much time keeps them in memory

maybe increase the number of saves per second and slightly decrease the time being stored could help for more smoothness without impacting too much on cpu/ram?