Author Topic: Demo playback sound?  (Read 47273 times)

Cryfire

  • Lieutenant
  • ***
  • Posts: 56
Demo playback sound?
« on: December 28, 2012, 09:31:59 AM »
I was wondering if there was any way to get the sound to work again when playing demos? It's nice to play them and see what was but would be so much better if the sound worked again.

Hotaru

  • Lieutenant
  • ***
  • Posts: 77
  • Just a demo-loving fool in the Far East...
Re: Demo playback sound?
« Reply #1 on: December 28, 2012, 11:34:41 AM »
Sound works in demos played back with an earlier issue of the client--issue 17, possibly 18 (I'll have to pick up a Going Rogue disk to check that out, though). If you've got an earlier issue backed up to CD, that could give you your aural fix, though later parts/patterns/effects/maps might be missing from some demos.

Leandro

  • Elite Boss
  • *****
  • Posts: 310
Re: Demo playback sound?
« Reply #2 on: December 29, 2012, 10:43:49 AM »
It might be possible to patch the current client to re-enable sound in demos. I think Codewalker is looking into it.

Hotaru

  • Lieutenant
  • ***
  • Posts: 77
  • Just a demo-loving fool in the Far East...
Re: Demo playback sound?
« Reply #3 on: December 29, 2012, 11:34:46 AM »
That would be unspeakably awesome, Leandro.

therain93

  • Elite Boss
  • *****
  • Posts: 574
Re: Demo playback sound?
« Reply #4 on: December 29, 2012, 01:34:25 PM »
It might be possible to patch the current client to re-enable sound in demos. I think Codewalker is looking into it.
That would be a phenonemal accomplishment and one I look forward to, if it's in the pipeline!
@Texarkana - March 5, 2004 - December 1, 2012 -- Imageshack |-| Youtube
---------------------------------------------------------------------------------------

You don't know what it's like.... |-| Book One. Chapter one...

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Demo playback sound?
« Reply #5 on: December 29, 2012, 10:59:36 PM »
How to fix demo playback sound in the Issue 24 beta client:

You'll need 1 (one) hex editor program, 2 tablespoons of sugar, and a jackhammer.

Okay, just the hex editor.

  • MAKE A BACKUP COPY OF CITYOFHEROES.EXE

  • Check that you made a backup copy of Cityofheroes.exe

  • At offset 0043788A of Cityofheroes.exe, you'll see the following sequence of bytes:

    E8 F1 18 05 00 E8 BC 10 05 00

  • Change it to:

    83 05 30 13 67 01 01 90 90 90

  • Save the changes

  • Fire up your bug fixed copy and enjoy sound in demo playback!

Working on finding the correct locations in the Issue 23 client, will make a followup post shortly.

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Demo playback sound?
« Reply #6 on: December 29, 2012, 11:15:46 PM »
For the Issue 23 client:

  • MAKE A BACKUP COPY OF CITYOFHEROES.EXE

  • Check that you made a backup copy of Cityofheroes.exe

  • At offset 0043A43A of Cityofheroes.exe, you'll see the following sequence of bytes:

    E8 D1 15 05 00 E8 9C 0D 05 00

  • Change it to:

    83 05 D0 D4 66 01 01 90 90 90

  • Save the changes

  • Fire up your bug fixed copy and enjoy sound in demo playback!


Michiyo

  • Titan Staff
  • Lieutenant
  • ****
  • Posts: 54
    • SGSpaces
Re: Demo playback sound?
« Reply #7 on: December 30, 2012, 01:02:15 AM »
Made a patcher for those not wanting to play with hex editors.

Link for Live Client

Link for Beta Client

corvus1970

  • Elite Boss
  • *****
  • Posts: 758
  • A true ruler is as moral as a Hurricane.
Re: Demo playback sound?
« Reply #8 on: December 30, 2012, 01:13:29 AM »
Holy crap on toast!

Codewalker, NeoRavencroft, you guys are awesome! :D
... ^o^CORVUS^o^
"...if nothing we do matters, than all that matters is what we do."
http://corvus1970.deviantart.com/

The Fifth Horseman

  • Elite Boss
  • *****
  • Posts: 961
  • Outside known realities.
Re: Demo playback sound?
« Reply #9 on: December 30, 2012, 01:17:24 AM »
Tech awesome. (pardon the pun).
We were heroes. We were villains. At the end of the world we all fought as one. It's what we did that defines us.
The end occurred pretty much as we predicted: all servers redlining until midnight... and then no servers to go around.

Somewhere beyond time and space, if you look hard you might find a flash of silver trailing crimson: a lone lost Spartan on his way home.

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Demo playback sound?
« Reply #10 on: December 30, 2012, 01:37:11 AM »
The really funny part is that the bug is actually related to loading screens. Go figure.

Hotaru

  • Lieutenant
  • ***
  • Posts: 77
  • Just a demo-loving fool in the Far East...
Re: Demo playback sound?
« Reply #11 on: December 30, 2012, 01:40:08 AM »
Once again, I find myself celebrating Codewalker Xmas, which unlike plain ol' Xmas, seems to come ever few weeks. Outstanding!

NeoRavencroft, thank you so much for making it idiot simple. In the time it took me to read Codewalker's posts, hit Wikipedia for info on hex editors, and finally download one, you took care of everything. Nicely done!

Hotaru

  • Lieutenant
  • ***
  • Posts: 77
  • Just a demo-loving fool in the Far East...
Re: Demo playback sound?
« Reply #12 on: December 30, 2012, 01:43:44 AM »
The really funny part is that the bug is actually related to loading screens. Go figure.

About 2 weeks back, Floride mentioned here http://www.cohtitan.com/forum/index.php/topic,7275.0.html that it might've been turned off by the devs to stop annoying sound bugs during loading screens.

Thanks again for another awesome contribution!

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Demo playback sound?
« Reply #13 on: December 30, 2012, 02:44:44 AM »
It is related to the loading screen change that Floride mentioned, but in a somewhat unexpected way.

The game keeps an internal frame counter in memory, and the main loop increments that counter for every frame that's drawn. It's not used for much, but one of the few things it is used for is to fade the volume back in after it was muted for a loading screen.

The demoplay loop however doesn't increment that counter. So the sound code thinks that you're still at a loading screen the whole time a demo is playing because the frame count is 0. So it keeps the volume at 0.

The patches above modify the demo loop to simply increment the frame counter, and then everything works properly. Since with all magic nothing is free, in order to do that I had to replace some existing instructions. I picked the ones that call a function to detect changed files, since the number of times when people need to move files around during demo playback should be close to 0.

Michiyo

  • Titan Staff
  • Lieutenant
  • ****
  • Posts: 54
    • SGSpaces
Re: Demo playback sound?
« Reply #14 on: December 30, 2012, 02:52:17 AM »
So my Scene file replacements for a fog free Echo DA won't work anymore?  Darn!  Small trade off :D

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Demo playback sound?
« Reply #15 on: December 30, 2012, 02:56:42 AM »
So my Scene file replacements for a fog free Echo DA won't work anymore?  Darn!  Small trade off :D

No, those will still work. :)

The only check I removed was the one for files that are changed after the game is already started -- like if you were to drag a new replacement sound file or something in during playback. Even that only worked if the files were present on startup (you couldn't add new overrides once the game was running; just replace existing ones). So very little is lost.

And thanks for putting together that patcher so quick. Saved me the trouble of writing yet another launcher!

Michiyo

  • Titan Staff
  • Lieutenant
  • ****
  • Posts: 54
    • SGSpaces
Re: Demo playback sound?
« Reply #16 on: December 30, 2012, 03:27:14 AM »
Well my scene replacement required I rename and then rename back the skyfiles, I had a bat that did it for me.  They didn't work unless they were "New" and renaming worked.  But I'm REALLY not worried about that :p

Codewalker

  • Hero of the City
  • Titan Network Admin
  • Elite Boss
  • *****
  • Posts: 2,740
  • Moar Dots!
Re: Demo playback sound?
« Reply #17 on: December 30, 2012, 03:43:49 AM »
Oh, that's because scenes/ is one of the four excluded directories that normally is prohibited from being overridden by local files, along with ent_types/, geobin/, and object_library/.

It's pretty easy to hack that check out of the exe, I can PM you details if you want; just let me know which client version.

Hotaru

  • Lieutenant
  • ***
  • Posts: 77
  • Just a demo-loving fool in the Far East...
Re: Demo playback sound?
« Reply #18 on: December 30, 2012, 04:27:53 AM »
I'm thinking this info and the links to NeoRavencroft's executables should be given a new sticky on this board--some folks who didn't follow this past the initial exchange should be jazzed to know we now have sound luv in demos.

I'd be interested in getting some info on how to override ent_types and scenes with local files, since I have some ideas I'd like to try out (mainly with trying to get clickies to show up demo playback).

Edited to add: in i24.
« Last Edit: December 30, 2012, 10:39:07 AM by Hotaru »

Electric-Knight

  • Elite Boss
  • *****
  • Posts: 297
  • E-K and Malfaz taking a break, drinking tea
    • www.pauldamonthomas.com
Re: Demo playback sound?
« Reply #19 on: December 30, 2012, 06:05:29 AM »
FANTASTIC!!
Thank you SO MUCH, Codewalker!
And thanks for those patchers, NeoRavencroft!

Has anyone told Black Pebble about this fix? I just thought he'd appreciate it.
--
"Your reality, sir, is lies and balderdash and I'm delighted to say that I have no grasp of it whatsoever."
- Baron Munchausen

http://www.pauldamonthomas.com/