emoose / OutRun2006Tweaks

Turning and spinning and spinning and turning, woah!
MIT License
308 stars 0 forks source link

Online services (status: server online!) #74

Open emoose opened 2 months ago

emoose commented 2 months ago

Aug 2024 update: online services are now restored in the latest OR2006Tweaks builds!

See the 0.5 release post for more info: https://github.com/emoose/OutRun2006Tweaks/releases/tag/v0.5

If you have any issues/questions/suggestions about the online feel free to post them here.

If you have login problems with the game please make a post here, some info about the process you used to setup your account and steps you tried to login to it would be useful.

Some notes about these services:

There's a chance settings like FramerateLimit and other framerate options could have some affect on the netcode, since networking appears to run outside of the games main 60Hz loop, running at whichever framerate you've set FramerateLimit to... if it comes to it we might be able to relocate this though.

The online services should work fine with the vanilla non-OR2006Tweaks game too, just setup your hosts file to point to our servers:

34.116.176.7 auth.outrun2.mmp.demonware.net
34.116.176.7 lsg.outrun2.mmp.demonware.net
34.116.176.7 outrun2.stun.us.demonware.net
34.116.176.7 outrun2.stun.eu.demonware.net
ArhumMK commented 2 months ago

Might not be very helpful for this topic but I found another game using Demonware having fan-run servers by the "Warehouse team" where you register your credentials via a bot in their discord to use to log in into their servers in-game. They seem to have experience running unofficial demonware servers so it could be worth contacting them for advice if ever needed. https://wiki.aiwarehouse.xyz/en/home

Tenome commented 2 months ago

I tried online LAN via Radmin with two people and neither of them had lobbies showed up, despite being in the same Radmin lobby with the correct settings. It feels like something in the game is blocking even simulated LAN. If anyone manages to get it working, that'd be great.

Also, sorta related since the console versions let you race other ghosts--can anyone drop this time trial ghost in your SaveGames folder and let me know if it shows up for you? It's a few levels of Time Trial single levels, first three or so. You might not need the "common" file but I included it just in case. If so, we could share time trials ghosts.

SaveGame.zip

emoose commented 2 months ago

Looks like that works: OR2006C2C_mc7KtITvRF I just copied the GHOST00.DAT for that, didn't show any rankings on the leaderboard though, think those might be in common. Also just noticed the ghost text at the top is misaligned there >.>

Tenome commented 2 months ago

So it loaded the car too? Nice! There are maybe 20 people still playing Outrun 2006, but maybe a sticky thread for sharing ghosts if there's enough interest. (or just post them in this thread).

The time attack text is most likely misaligned because it might use a monospace font. A good texture pack will fix it, I think one's being worked on bit by bit in the discord (the one you're using needs to be replaced anyway, it's a sloppy upscale).

envido32 commented 1 month ago

Is the LAN feature working? I tried it on 2 PC with Win10 and even thought one PC can see and join the other's lobby it intermediately drops out.

I looked at the Windows firewall configuration but found nothing and the LAN it's working fine... what other debugging could I try? maybe some networking package visor?

emoose commented 1 month ago

I've only really seen 1 video of someone playing MP using Tweaks: https://www.youtube.com/watch?v=PTW85JsRS2c Other than that I haven't really heard anyone else having success yet, too bad they didn't post any info about their setup there.

Tenome commented 1 month ago

Ohh, so it is possible. Hopefully that uploader replies.

emoose commented 1 month ago

The netcode does have some specific checks for 10.x.x.x / 192.168.x.x / 127.x.x.x IP addrs, maybe have to be using one of those for it to recognize other machines.

Also kinda seems it might be selecting the first network adapter which matches one of those addrs, if your local network is using that it might stop it from being able to use Radmin's adapter.

Think game also listens on 41455 / 41456 / 41457 ports, haven't seen those mentioned anywhere else yet.

Tenome commented 1 month ago

I'm on a 10.xxx IP. So it hits the 10.xxx first and doesn't see the Radmin adapter? I wonder how the Youtuber got it.

image

lance8765 commented 1 month ago

Are you guys telling me that this game is not yet properly supported by third-party programs after all these years?

Tenome commented 1 month ago

Evidently, it is. It's just a question of setup...

envido32 commented 1 month ago

BTW does anyone know if any footage of the online mode exists anywhere? I wonder if it was just an online version of the LAN support with people hosting servers & choosing them from a list, or if it actually had matchmaking?

image

OutRun_2006_Coast_2_Coast_Manual_Win_EN.pdf

According to the User Manual there was some kind of ranking system... so it should be a bit more complex than just "Lan over Inet" I guess...

Dekaid0011 commented 1 month ago

According to the User Manual there was some kind of ranking system... so it should be a bit more complex than just "Lan over Inet" I guess...

If it is the same as on the xbox version its very simple. The more you win the higher your number goes and after each race the global leaderboard gets updated. The ranking system didn't impact matchmaking.

EDIT: Also on xbox there was Quick Match and Opti-Match options. Quick Match just throws you into a lobby, the other gives you a lobby browser.

Tenome commented 1 month ago

I'm not sure why, but we were able to get a lobby going in Radmin now. I'm not sure what changed, but I did forward the port range (though that might not have been it). I wonder why the Radmin lobby didn't work last time, then.

emoose commented 1 month ago

Played around with this a bit over the weekend:

https://github.com/user-attachments/assets/64c8acda-71ed-4d56-8363-354a124fb792

https://github.com/shit-ware/T5-DemonWare/tree/master/DWServer was helpful for figuring out how they pack the network data, but seems OR's demonware does a lot of stuff different to what that DWServer code expects (probably using a much older version of DW), so ended up writing some new server code instead.

Don't really know how far I'll be able to go with this, never really written a server emu before, guess we'll see.

(really it'd probably be nicer to rip out the DW stuff and just use something like Steamworks instead, for that we probably need to see how the game actually interacts with DW first though)

Tenome commented 1 month ago

This probably won't work, but try emailing/reaching out to Demonware devs on Twitter/Linkedin/etc. and see if they'd be willing to offer any insight. If you dress up your plea as trying to breathe life back into an old game or something they might help lol.

lance8765 commented 1 month ago

How did we go from me asking to remove online features to emoose to actually RESTORE them? XD

emoose commented 1 month ago

Updated OP post with some notes about the service.

I'd heard some might have issues connecting to the google server from some countries, open to relocating it if that is an issue, if anyone knows any cloud Linux hosts that offer free credit that'd be ideal (though AWS isn't really an option for me)

Also does anyone know any good DNS hosts we could use? that 7.176.xxx URL isn't really that memorable lol, using some DNS to point to us should also help with any future relocating too.

emoose commented 1 month ago

Tweaks got noticed by C2C dev S0L 😸 https://www.rllmukforum.com/index.php?/topic/106773-outrun-2006-coast-2-coast/&do=findComment&comment=14336223

I'm happy it's getting a new lease of life. It's interesting how the tweaks are 'undoing' some of the changes we needed to do in terms of performance for PC's of the day, but things PC's now can handle easily. Some really smart choices like letterboxing the UI, but full-screening the game means you get nice presentation across the board. In theory they could lift some assets out of Online Arcade in terms of higher resolution textures etc.

I think they've lifted bits from previous upgrades (i.e. FXT) where I might have helped them out with some assets, like the overseas version of Clarissa... :)

Super impressed they've managed to resurrect the online. They could likely look at updating the data rate so it's more accurate, we had to try and pick numbers that worked with 56K modems - the internet is a LOT faster now so you could avoid some of the car intersections etc.

Might have to get it onto my Steam Deck, bet I can't manage the goal times I used to though!

Interesting bit about the data rate, will try seeing if I can find much about that, maybe it'll let us change tickrate of network updates to make things more accurate.

(like OP mentions I don't really have much visibility into the C2C netcode though sadly, since we only have debug symbols for Lindburgh which uses completely different code... really hoping some proto/dev version might show up that includes PDB symbols with it, would help make things 1000x easier on us)

Tenome commented 1 month ago

If that's a dev, he might be willing to help if you reach out to him in DMs.

lance8765 commented 1 month ago

Oh my god i haven't seen that S0L guy in ages... he was on GameFAQs back in 2006 lol.

emoose commented 1 month ago

Does anyone know how the ghost uploads worked in this? I've only seen code related to it but not really sure how it would have been accessed..

Might be cool if you could go through rankings, select one of the top times, then download ghost & play against it, somehow doubt that's how it worked though.

The manual doesn't really mention anything about ghosts being online, wonder if it was actually implemented or just half-finished.

emoose commented 1 month ago

👻 Ghost uploads/downloads are now available, if you play time attack while connected online & beat your best time you'll be offered to upload a ghost to the server.

Ghosts can be downloaded & played against by going to the time attack menu, heading to the goal/stage select part, highlight the goal/stage you want to play, then press Up to move to the scores table, and select any score which has a ghost icon next to it.

To upload ghosts:

emoose commented 1 month ago

Ah I think per-stage ghosts might only record runs that go through the Retry checkpoint, when you head to Exit that ghost gets ignored - I'm sure I did see game using the time from the Exit run though and then uploading the ghost from the first Retry run but maybe I was wrong about that.

If anyone notices any ghost uploads that don't match the time set for them let me know.

emoose commented 1 month ago

BTW right now the scoreboards are setup to create new entries for each time/score uploaded, instead of replacing any older times, so if you beat a score that you uploaded before the board will still show both your previous score & your new one.

Not sure if this is how the actual game worked though, plus in-game it mentions "number of players" for the number of scores on the board...

I could change it to replace existing scores instead, would make the board tidier I guess (and save disk space for ghosts by deleting old ones too), but maybe people would prefer being able to see their older scores/ghosts though?

Lets put it to a vote: https://strawpoll.com/NPgxeElMoZ2 (E: voting ended, replacing scores is pretty unanimous)

Tenome commented 1 month ago

If replace is chosen, would it be possible to accidentally replace your older better score if you hit the prompt? Or does it only prompt the upload if you beat it?

emoose commented 1 month ago

I've seen a few mentions of login issues now, if you've had any login problems please let me know here, some info about the process you used to setup the account would be useful too, eg. if you created the account, then deleted your savegame, then tried to login to the account you created. Also, did you try using a password longer than 6 chars?

The server should be able to handle logging into existing accounts fine really, not sure why some are getting issues with it.

If you have an account showing up in the login screen which doesn't work, the "delete account" menu can remove it for you, that'll only delete it from your local savegame, will still exist on the server, then you can try going through login screen again to re-add it.

If replace is chosen, would it be possible to accidentally replace your older better score if you hit the prompt? Or does it only prompt the upload if you beat it?

Looks like game checks with server first to get your current high score before submitting, should mean it won't overwrite with lower score hopefully. (also seems game handles deleting old ghosts from the server itself too, so I guess we'd have to make it replace scores really, else there'd be old scores on there without any ghost for them)

Updated the server last night to make it replace them instead, also went through each of the scoreboards and deleted dupes with lower scores (if anyone sees any duplicate players on the boards let me know)

Tenome commented 1 month ago

I noticed that since the leaderboard initialization, it no longer saves my username and password locally (I have to manually sign in every time). So it's safe to delete it locally and try logging in anew?

Tenome commented 4 weeks ago

S0L said he'll see about helping you improve the network stuff when he's back at the office.

https://www.rllmukforum.com/index.php?/topic/106773-outrun-2006-coast-2-coast/&do=findComment&comment=14341998

I do intend to see if we can help emoose out in some way, I was off last week but back in tomorrow. Might be we can provide some info to help improve the networking/server stuff.

emoose commented 3 weeks ago

S0L said he'll see about helping you improve the network stuff when he's back at the office.

Whoa that's big, any help with the P2P networking would be hugely appreciated, haven't really been able to map out much of that yet besides some funcs for sending/receiving.

Another thing I've been stuck on is the disabled bloom effect, probably one of the main reasons people are staying with other versions for now - pretty out of my element trying to understand the unfinished D3D code for that though.. seems it did get fixed for Online Arcade but haven't really been able to figure out what changes were needed yet.

emoose commented 3 weeks ago

Looking at string files it does mention the missing Slipstream option, as well as an option for Traffic (None/Low/High), and a Laps setting too? (3/5/10/15)

No idea how functional those are though, afaik the Slipstream option didn't really have any code to handle it, probably the same for these as well.

emoose commented 2 weeks ago

Seems we're PS2 compatible too 😸 pcsx2-qt_tbdiOKs1LE

Ghosts from PC also seem to work: pcsx2-qt_WaJXDgGqS4

See the post below for how to connect your own PS2/PSP!: https://github.com/emoose/OutRun2006Tweaks/issues/74#issuecomment-2322273032

Old info Tried checking with LyricalDonut whether this could connect to PC hosts too, but sadly didn't show their server for me :( (ED: seems PC and PS2 were made incompatible, more info in post below) Luckily the server didn't really need any changes for this to connect, just patched game to talk to our hostname instead of the orig server and it connected fine (after an hour or so getting PCSX2 to network properly anyway...) The original server it tried talking to was the exact same as PC too, ~~maybe could mean PS2 and PC always had cross play?~~ (ED: just the scoreboards/ghosts it seems, still kinda neat) If anyone wants to try it here's some pnach patches to point it to our host: ``` patch=0,EE,2012AE10,extended,248447E0 patch=0,EE,203C47E0,extended,72616C63 patch=0,EE,203C47E4,extended,61737369 patch=0,EE,203C47E8,extended,726F702E patch=0,EE,203C47EC,extended,6F2E3074 patch=0,EE,203C47F0,extended,00006772 patch=0,EE,203C49A8,extended,72616C63 patch=0,EE,203C49AC,extended,61737369 patch=0,EE,203C49B0,extended,726F702E patch=0,EE,203C49B4,extended,6F2E3074 patch=0,EE,203C49B8,extended,00006772 patch=0,EE,204056F8,extended,72616C63 patch=0,EE,204056FC,extended,61737369 patch=0,EE,20405700,extended,726F702E patch=0,EE,20405704,extended,6F2E3074 patch=0,EE,20405708,extended,00006772 patch=0,EE,20223A84,extended,24030001 ``` Or instead of patches it should be possible to do the same with DNS as well, if your router allows it you could try adding the following: ``` 34.116.176.7 auth.outrun2.mmp.demonware.net 34.116.176.7 lsg.outrun2.mmp.demonware.net 34.116.176.7 outrun2.stun.us.demonware.net 34.116.176.7 outrun2.stun.eu.demonware.net ```
emoose commented 2 weeks ago

Did some more testing with the discord, looks like PS2 was using port 3658 instead of PCs 41455. Patching the PS2 port number to match it does allow connections between them: pcsx2-qt_YzWGwZHjFi

But once in-game everyone seems to disconnect after the countdown, tried some things with PCSX2 overclock/fast-forward but didn't make a difference.

Too bad, would have been neat if OR2 turned out to be a crossplay game from 2006, could have made it one of the first 🫨

PCSX2 <-> PCSX2 did work fine, so likely not a connection / emu issue. PC was released a few months after PS2 so maybe they changed some of the networking (maybe could be related to the values S0L mentioned?)

PS2 players should be able to use the server to play among themselves at least, and share leaderboards/ghosts (wonder if there's anything we could do with PSP as well...)

emoose commented 2 weeks ago

PS2 / PSP online support

The server now supports PS2 and PSP clients, to use this you can setup the DNS kindly provided by https://ps2online.com/, which is set to point OutRun2 toward our server.

Just set your consoles DNS setting to the IP address shown on that page, for PSP that should be enough to let you connect, but for PS2 a game patch will be needed to disable DNAS first.

Note that to host a game you'll likely either need to port forward UDP 3658, or DNZ your console.

DNAS patch required for PS2 (click to view) On console you can use the following CHT file with OPL: ``` "OutRun 2006 (U) /ID SLUS_212.74" Mastercode 9021A8AC 0C086C64 20223A84 24030001 ``` With PCSX2 you can run the game, then head to Tools > Edit Patches, open the file with notepad, then enter the following pnach patch: ``` patch=0,EE,20223A84,extended,24030001 ``` The patches above are for the USA version of the game, if you're on a different version you can try using a DNAS patching tool such as DNAS_PATCHER to patch your copy of the game.

If you have issues with DNS you can also patch game to force it to use our server, using these OPL patches:

Patches to force game to use server (PS2) ``` "OutRun 2006 (U) /ID SLUS_212.74" Mastercode 9021A8AC 0C086C64 2012AE10 248447E0 203C47E0 312E3433 203C47E4 312E3631 203C47E8 372E3637 203C47EC 00000000 203C49A8 312E3433 203C49AC 312E3631 203C49B0 372E3637 203C49B4 00000000 204056F8 312E3433 204056FC 312E3631 20405700 372E3637 20405704 00000000 20223A84 24030001 ```

Some extra PS2 patches which might come in useful:

Change deadzone from 25% to ~5%:
patch=0,EE,201B4650,extended,3C013D4D

Skip intro logos:
patch=0,EE,203759F0,extended,00000000

(TODO: PSP deadzone is at 0x95114, but not sure how to make a patch for it yet)