don't click here

Sonic Adventure 2: Battle Network

Discussion in 'Engineering & Reverse Engineering' started by SF94, Aug 18, 2013.

  1. E-122-Psi

    E-122-Psi

    Member
    2,292
    455
    63
    + - Two player mode in SADX??? Make it happen! :D  
     
  2. Vertrex

    Vertrex

    Layin' the wax and spinnin' the sound Member
    Tested chao world with nethax, although it's indefinitely unstable.

    http://www.youtube.com/watch?v=FKYUHYQBXQk
     
  3. SF94

    SF94

    Tech Member
    It's been a loooong time. How have you been?

    Version 3.1 has been released, and it's open source! Latest release and code here. From now on you'll be able to find archived releases on the GitHub repo. The latest version will always be hosted on my website here.

    Note: This version requires a newer C++ redist than before. It's linked in the main post. And make sure you update your mod loader! It's using new events that have just recently been implemented.

    Changes from 3.0:
    • Camera independent input.
    • Input rewrite now in place using OnInput and OnControl events. No frame latency!
    • Partial Emerald Hunting support (see #12 and #10).
    • Shooting is now much more playable, but not perfect. See #11.
    • Synchronized player damage, HP and ring counts via function call hooks; never desync again!
    • Teleportation only allowed with new flag from host, --cheats.
    • Network statistic logging now available with --netstat (logs to CSV in game directory).
    • Stage load lag compensation. The player who loaded first will wait for the player who is behind.
    • Stage change synchronization. Even if the menu desyncs, you'll still go to the same stage.
    • Random seed synchronization (although it's 0xDEAD0CAB 99% of the time anyway).
    • Console window now optional, but still recommended.
    • Overall accuracy and stability improvements (as well as some newly introduced instabilities! Fun!).
    • And of course, open source =P
    can't be bothered to make those issue numbers clickable; just go to the github release page for that

    You can report bugs and see known issues here!

    I'm probably forgetting some things given that it's been over a year since the last release. I can't believe I've been sitting on so many improvements for so long (which isn't to say all of the improvements listed above are old, it's just that some of them are, like the new input handler).

    For this version I wrote my own trampoline implementation which allows me to override functions but still call the originals, and that has been immensely useful for things like synchronizing HP, ring count, damage, etc etc. My implementation can also be found in the SADX Mod Loader right now, and I plan to expose it to mod developers in both mod loaders sometime soon. If anybody needs it in the meantime, just copy the source files =P

    And emerald hunting now works!... with a catch. It will only work the first time you enter a specific stage. If you try to replay that stage without first exiting to the main menu, they will no longer be synchronized. If you play best 2 of 3 however, the stage will usually change after a round, so it works out. I got this working entirely accidentally though. As it turns out, upon first stage load, the emerald manager will run through a for loop calling rand() because... reasons? It's relative to the frame count, though. Specifically, FrameCount & 0x3FF, which is anything < 1024. I decided to synchronize the frame count there for kicks, and to my surprise, it just worked. There's another catch though. There appears to be a crashing issue upon stage load in emerald hunting, but I can't consistently reproduce the issue. I highly recommend looking through the known issues linked above.

    For the next version, I hope to start working on a master server to make it easier to find people to play with.

    Have fun!
     
  4. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,825
    709
    93
    Long-term happiness
    Thanks for your efforts, and for making it open source too! Won't be downloading personally as I don't have the PC version of SA2:B but I'm sure lots will put this to use.
     
  5. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    This got updated?! whoa awesome!! :D

    Thanks for your efforts Morph.
     
  6. Turbohog

    Turbohog

    Member
    859
    92
    28
    I'm happy to see you're still working on this (and fulfilling childhood dreams). Glad to see it open sourced too! I'll be excited when I get the chance to try this out.
     
  7. SF94

    SF94

    Tech Member
    Just a heads up:

    If anybody is experiencing timeouts after about 20 minutes of play, this hotfix (v3.1.1) should fix it. It's compatible with the last release since it's just a hotfix.
     
  8. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Cool thanks man I was wondering why that was happening.
     
  9. SF94

    SF94

    Tech Member
    New version (v3.2)! Download here.

    • Code changes required for networking are now only applied on connect, and reverted on disconnect.
    • Local settings are now restored after disconnecting from a server with different settings.
    • Disabled built in cheats (Yep! Leftover debug stuff) by default.
    • Removed --keep-active as this is now built into the mod loader using a more efficient method.
    • Implemented configuration file support. Will detail this soon.
    • Command-line parser now only accepts addresses in the format 127.0.0.1:27015 instead of 127.0.0.1 27015
    • Servers can now be password protected by using the --password parameter or with the Password field in the configuration file.
    • Next stage synchronization implemented. Any time in a best 2 of 3 race where you ended up in the same level when it changed was just a coincidence until now. I'm baffled.
    • Improved netstat by including estimated overhead.
    • Implemented preventative measures for spawn time desynchronization on round start.
    • Fixed a bug where music would fail to start, or start and then stop, at the beginning of a round (see #23)
    • Fixed a bug which would cause upgrades to go missing on the receiving end. (fixes #25)
    • Fixed an oversight which would send HP changes for non-mech characters
    • Implemented character ID synchronization - Random Battle now works correctly. (fixes #13)
    • Implemented synchronization for level groups which can affect certain aspects of the game.
    • Improved analog accuracy a bit. (see #19)
    • Fixed emerald spawn location desynchronization for good by simply setting and synchronizing a custom seed and disabling their stupid rand() in a for loop. (fixes issues #10 and #12)
    • Implemented proper powerup synchronization (shields etc) (fixes #29)
    • Implemented sanity check for splitscreen toggle (see #28)
    • Re-worked the way damage is handled. (see #33 and 455e8ed36909dc94da153aaae7a57d96857c8276)

    For clickable issue numbers, see the release page on GitHub linked above.

    Edit: Oh yeah, important detail. The command line parser has changed a little bit when it comes to connection addresses. Instead of [ip] [port] you can (and must) now do it with the more natural format, [ip:port].
     
  10. Turbohog

    Turbohog

    Member
    859
    92
    28
    I really don't have much to say, but all of those improvements sound sweet! I need to check this out more.
     
  11. Lanzer

    Lanzer

    The saber calls for its master... Member
    6,845
    3
    18
    Glendale, AZ
    Living life.
    Thank you for dealing with that, got annoying at times.
     
  12. ELS

    ELS

    Member
    Can you make it so two players can choose the same character?
     
  13. SF94

    SF94

    Tech Member
    Probably :v:
     
  14. Fred

    Fred

    Taking a break Oldbie
    1,563
    116
    43
    Portugal
    Sonic 3 Unlocked
    You need to be careful with the alternate costumes; due to the way their resources are handled, if you try pitting a character versus their alt costume, everything catches on fire pretty quickly.
     
  15. urlogic

    urlogic

    Member
    75
    0
    6
    Is there any way I can make this load single player stages or the chao garden?
     
  16. Vertrex

    Vertrex

    Layin' the wax and spinnin' the sound Member
    Yes, this is possible through Cheat Engine. However, I don't recommend it.