Sonic and Sega Retro Message Board: Sonic Adventure 2: Battle Network - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 4 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

Sonic Adventure 2: Battle Network Online Multiplayer for Sonic Adventure 2 PC! (v3.2, 04/30/2016)

#1 User is offline Morph 

Posted 18 August 2013 - 04:23 PM

  • AKA SonicFreak94.
  • Posts: 723
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA1/2 hax
  • Wiki edits:11
Posted Image

Sonic Adventure 2: Battle Network is a netplay mod for Sonic Adventure 2 PC which is still very much in early development, and not a Sonic/Mega Man Battle Network crossover, unfortunately.
Originally a stand-alone program, SA2:BN now utilizes the SA2 Mod Loader to check for changed player and input values and synchronizes them with another instance of SA2 over the internet. It also now uses an oh so very slightly modified version of the SFML networking library (to allow seeking in sf::Packet).

Media:

These are old screenshots.
Local testing
Splitscreen toggle

Requirements:


Download:


See known issues and report bugs here

Installation:
  • Extract the SA2 Mod Loader to your SA2 folder, launch the Mod Manager, and click "Install loader"
  • Extract the SA2 Battle Network archive to the "mods" folder.
  • Re-open the Mod Manager if you closed it, or just click refresh if it was still open.
  • Find "SA2 Battle Network" and enable it (by ticking the checkbox to the left)
  • If you have MainMemory's Character Select mod, disable it if you want spawn points in multiplayer to function correctly.


Usage:
    If you know how to run a program with command-line arguments, just scroll down to see them.
  • In Steam, right click on Sonic Adventure 2, and click "Properties", click the "Local Files" tab, and click "Browse Local Files..."
  • Create a shortcut to sonic2app.exe and place it wherever you like
  • Right click the shortcut and click Properties.
  • In the "Target" box, at the end of the text, add a space followed by the arguments you want (e.g: "sonic2app.exe" -h 27015). Details below.


You must use that shortcut to launch the game in order for it to work. But I know what you're thinking. "Steam has launch options! Can't I just use that?" - but the answer is no. SA2 on Steam will always start the launcher first, so the command line arguments will go to the launcher and not the game.

Note: If you're trying to host and you don't use something like Evolve or Hamachi, you must forward ports on your router for both UDP and TCP protocols (for now). I won't go into detail on how to do this as there are many online resources that give detailed instructions already.

Command line arguments:
  • --host (or -h) [port] - Hosts a server on the specified port. When in doubt, use 27015
  • --connect (or -c) [address:port] - Connects to the specified address on the specified port. NOTE: As of version 3.2, the format has changed from the original [address] [port] to [address:port]. Be sure to update your shortcuts and stuff.
  • --timeout (or -t) [timeout] - The connection timeout in milliseconds. Default is 15000, minimum is 1000. Currently non-functional.
  • --no-specials - Disables special abilities in 2P mode entirely. It doesn't synchronize yet, so both players must use it.
  • --keep-active - Keeps the game window active. In other words, it doesn't pause when you click on another program while in window mode. Also available in mod form.
  • --cheats - Enables teleportation.
  • --netstat - Enables network statistic logging. Saves as netstat.recv.csv and netstat.sent.csv


Example: --connect 127.0.0.1 27015 --no-specials

Features:
  • Toggle-able splitscreen ingame (Press L+R) (DO NOT use if splitscreen was not already on or the game may crash.)
  • Input handler (this makes all the difference in the world)
  • Synced upgrades if you want to cheat yourself a bounce bracelet and the like =P


Planned:
  • Configurable 2player specials (ring count requirements, blacklist, etc; e.g speed up only, 50 ring requirement)
  • Something everyone has wanted forever
    :ssh:


Thanks:
I owe a huge thanks to MainMemory for helping me out with a lot of things (such as enabling me to run multiple instances of SA2).

On the same token, let me be clear here. MainMemory did all of the reverse engineering. Without his work, this would not have been possible simply because I wouldn't even know where to start with a disassembly and the like. Not to mention the executable had encrypted data which would make it crash if you tried to attach Cheat Engine's debugger... which MainMemory also cracked. The closest thing I got to reverse engineering was finding the input structure of which MainMemory has already documented for SADX (it's pretty much the same).

And with that, I also have to thank everyone who worked on the cheat table, Sonickidnextgen who wrote the (original) socket library and helped me be less derp at programming (It's still a mess. I'LL CLEAN IT UP LATER I SWEAR!), and everyone who helped me test it. Couldn't have done it without you guys!
This post has been edited by Morph: 30 April 2016 - 03:21 PM

#2 User is offline Morph 

Posted 18 August 2013 - 07:21 PM

  • AKA SonicFreak94.
  • Posts: 723
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA1/2 hax
  • Wiki edits:11
Alright, I've updated it. Here are the changes:
  • Input handler is a little more accurate and at the same time a little less accurate. This should also help in low-performance circumstances as it ensures one frame has passed which also pretty much ensures the buffer has been read, thus simulating the button press.
  • Fixed character action bug. One line of code needed to be moved up one line. Wish I noticed before the contest deadline :v:
  • "Fixed" the animation bug (e.g covered it up. If it works it works!)
  • Probably some other stuff I forgot about.


Specials don't work very well anymore (doesn't notice you pressed the button) due to the input changes, but I'll be working on this.
This update should make it a little nicer to play if you ignore the specials (which you can disable by running the program with -nospecials, or by using sa2 pro =P).

#3 User is offline Aquaslash 

Posted 20 August 2013 - 09:21 PM

  • Emerald Dragoon
  • Posts: 2808
  • Joined: 17-November 04
  • Gender:Male
  • Location:Hampton, VA
  • Project:The S Factor: Sonia and Silver
  • Wiki edits:1,144

View PostMorph, on 18 August 2013 - 04:23 PM, said:



Planned:
  • Something everyone has wanted forever



If this is what I think it is, I might be tempted to marry you XD

This is an awesome thing though, might give ti a try this weekend when my nephews come over

#4 User is offline Retroman 

Posted 20 August 2013 - 09:35 PM

  • Unlike Sonic I chuckle
  • Posts: 609
  • Joined: 18-September 09
  • Gender:Male

View PostAquaslash, on 20 August 2013 - 09:21 PM, said:

View PostMorph, on 18 August 2013 - 04:23 PM, said:



Planned:
  • Something everyone has wanted forever



If this is what I think it is, I might be tempted to marry you XD

This is an awesome thing though, might give ti a try this weekend when my nephews come over

What is what you think it is, because I'm curious
This post has been edited by Retroman: 20 August 2013 - 09:35 PM

#5 User is online Neo 

Posted 20 August 2013 - 11:54 PM

  • Clackerjack
  • Posts: 1236
  • Joined: 10-December 04
  • Gender:Male
  • Location:Portugal
  • Project:Sonic 3 Unlocked
  • Wiki edits:1

View PostMorph, on 18 August 2013 - 04:23 PM, said:

Maybe if I say "netplay" people will notice!

It's more that people just don't seem to care much about this game, and even less people actually own the Steam version.

But no, this is an amazing thing you've done here and you should very much be proud of yourself! I haven't tried it myself (again, lack of people to test it with) but if it's playable at least 50% of the time (which it very much seems to be) then that's 50% better than what SEGA (or anyone else) has done.

I know it's not much feedback if I haven't even been able to try it, but I think you at least deserve the acknowledgement. Good job!

#6 User is offline Caverns 4 

Posted 21 August 2013 - 11:40 AM

  • Posts: 324
  • Joined: 07-December 12
  • Gender:Male
  • Project:Sanik Quest: Journey To The Right
I haven't had the chance yet to try this myself, but believe me when I say I'm really looking forward to it. This is going to be awesome to play SA2 online, even if it's a little buggy.

#7 User is offline ICEknight 

Posted 21 August 2013 - 12:50 PM

  • Posts: 10351
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18

Quote

Sonic Adventure 2: Battle Network
Maybe if I say "netplay" people will notice!

I saw this and thought it was a Megaman hack with Sonic Advance sprites, now with netplay (or whatever that would mean in the GBA game).


Online support for Sonic Adventure 2 PC. That would do.
This post has been edited by ICEknight: 21 August 2013 - 12:51 PM

#8 User is offline Morph 

Posted 21 August 2013 - 03:37 PM

  • AKA SonicFreak94.
  • Posts: 723
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA1/2 hax
  • Wiki edits:11

View PostNeo, on 20 August 2013 - 11:54 PM, said:

It's more that people just don't seem to care much about this game, and even less people actually own the Steam version.


I totally get that. I feel like I won the contest without anyone even testing it out though. I've been hard pressed to find anyone who has so much as run the program even if they voted on it. I definitely appreciate the support, though!

Edit: Oh, on that note, I do plan to back-port this to SADX PC, not that there's much to do in the way of multiplayer. Maybe a certain hack of MainMemory's that he should totally finish would go well with it though. WINK WINK NUDGE NUDGE

View PostICEknight, on 21 August 2013 - 12:50 PM, said:

I saw this and thought it was a Megaman hack with Sonic Advance sprites, now with netplay (or whatever that would mean in the GBA game).


Online support for Sonic Adventure 2 PC. That would do.


... Heheh, good point. I'll change that. :v:
This post has been edited by Morph: 21 August 2013 - 03:40 PM

#9 User is offline Dude 

Posted 21 August 2013 - 05:25 PM

  • Posts: 3108
  • Joined: 11-September 04
  • Gender:Male
  • Location:Southbridge, MA
  • Project:Random VR/AR trash
  • Wiki edits:43
Well if you really want to test it more you can play with me. I'd love to play against people in sa2. I'm just too busy to go out looking for somebody to play with.

#10 User is offline Blivsey 

Posted 21 August 2013 - 06:46 PM

  • Charismatic Sonicaholic
  • Posts: 703
  • Joined: 20-September 11
  • Gender:Male
  • Location:Ioway
  • Project:Throwing my support behind others' projects (aka none)
I'd be down to try this with someone! Granted, my connection has a bandwidth cap, but I'd still like to try.

#11 User is offline sonicblur 

Posted 21 August 2013 - 07:47 PM

  • Posts: 1070
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6

View PostNeo, on 20 August 2013 - 11:54 PM, said:

But no, this is an amazing thing you've done here and you should very much be proud of yourself! I haven't tried it myself (again, lack of people to test it with) but if it's playable at least 50% of the time (which it very much seems to be) then that's 50% better than what SEGA (or anyone else) has done.

:-(

The Gamecube hack was playable more than 50% of the time. (Unless you're counting the BBA and Homebrew launcher requirement)

#12 User is offline Morph 

Posted 21 August 2013 - 08:47 PM

  • AKA SonicFreak94.
  • Posts: 723
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA1/2 hax
  • Wiki edits:11
That Gamecube hack was honestly what got me to start working on this already. Well, that and the SADX PC netplay that showed up on YouTube, but that never really got anywhere. I had the idea for the longest time but never really had the motivation (nor the skill) to make something of it (and plus, SA2 wasn't on PC yet =P). When I saw that, I thought to myself that I have no more excuses if it's already been done to an extent on a Gamecube.

#13 User is offline Shade Vortex 

Posted 25 August 2013 - 05:34 PM

  • The Black Vortex
  • Posts: 451
  • Joined: 11-September 10
  • Gender:Male
  • Location:USA, WA.
  • Project:Twitch Streams
So I was trying this with a friend earlier. Worked pretty well, for the most part. It wasn't perfectly synched up though, my friend was always ahead of me at the start. I used the recommended 16 ms interval. I was using Hamachi to host because even though I forwarded the port from my computer, my network IP wasn't wanting to work for my friend, for some reason.

Also, the game seemed to crash, or severely desync at times, like we'd end up in different stages. We mostly did Action, but we also tried Shooting. The Time Stop seemed to sometimes not work, but other times it would.

If it's of much importance, my friend is from the UK and I'm in the US, so that might have something to do with things a bit.

#14 User is offline Morph 

Posted 25 August 2013 - 06:18 PM

  • AKA SonicFreak94.
  • Posts: 723
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA1/2 hax
  • Wiki edits:11
The level desync is probably due to the menu in addition to missed button presses. On that note, I don't recommend doing more than one battle at a time, as that could do it too (make sure battle number isn't 3 in the battle options). Same with selecting an entire set of levels (to the very left of each level tier). Continuing the same level after completion works fine though.

The time stop thing not working also applies to all other special attacks at the moment, and that's also an input issue. My button press code is more precise but not accurate enough for it to work all the time, although I've been working to fix that. Unfortunately this also breaks the pause menu a bit, but you should still be able to restart and/or exit the level even if the pause menu doesn't sync, as the game state is synced. I recommend restarting if there's a noticeable head start for one of the players... unless it's due to latency. In which case, don't be surprised if you both "win" :specialed:

Also, it should work OK with latency up to, oh I dunno, 300-500ms? Past that point will be stretching it quite a bit though. Prepare for lots of "resending reliable message" console messages =P

#15 User is offline Lanzer 

Posted 26 August 2013 - 01:02 AM

  • The saber calls for its master...
  • Posts: 6629
  • Joined: 27-February 09
  • Gender:Male
  • Location:Glendale, AZ
  • Project:Doing Stuff.
  • Wiki edits:1
So I got a friend with a problem with this mod:

Codes in Trance, on 22 August 2013 - 11:32 PM, said:

I input one of the two commands "server" or "client" and the command line just keeps spitting out gibberish and nothing happens with the game itself.


Codes in Trance, on 23 August 2013 - 12:44 AM, said:


Posted Image
I load up multi-player mode and I activate the Battle Network executable.

Posted Image
I type in "client" or "-client-".

Posted Image
Then the command line freaks out. I know it has to be me doing something wrong rather than just the executable itself not working right.


So, have any idea what the problem is Morph?

  • 4 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users