Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Other Apogee/3D Realms Games > Rise of the Triad (1995) Source Code
Blogs FAQ Members List Social Groups Calendar Mark Forums Read

Notices

 
 
Thread Tools
Old 05-13-2003, 10:30 AM   #1
DrLex
Some issues under OS X
I guess this is the first OSX-related post here... Most Mac gamers don't seem to know this game, which really is a shame because it's one of my all-time favourites!

The OS X binary which overcode released a while ago at http://www.overcode.net/~overcode/rott-osx-test.tar.gz didn't have music and all sounds were played in mono at the same volume. So I compiled the stuff myself and behold: music and stereo sound! However, all sounds which undergo a volume change (i.e. panning) are severely distorted, although they do are panned correctly. I am pretty sure it's due to little endian data being played as big endian or vice versa. Apparently overcode turned off panning in his initial build as a quick fix, but he doesn't seem to have worked on the port since then [img]images/icons/frown.gif[/img]

When looking into the ROTT sound code, it appears that the actual panning is done by SDL_mixer routines. Is this right? If so, would this be a bug in SDL_mixer, or passing incorrect data to the routine? I'm using SDL_mixer 1.2.5.

Also, the game crashes quite a lot, apparently mostly when switching songs. In another thread I read that upgrading to the latest SDL_mixer fixed this problem, but apparently this is only under Windows... I do see some suspicious malloc warnings in the terminal, so there may be memory leaks.

P.S.: I noticed that the "\EKG" effect is different than the one I'm used to. Now the guards explode into a thick fountain of blood, while when I played the game on my thrusty PC, the blood went much higher and it kept raining blood drops during about 8 seconds. Is there a way to choose between these two "flavors" of exploding villains? [img]images/icons/smile.gif[/img]
DrLex is offline  
Old 06-15-2003, 09:43 PM   #2
Guest
Guest
Re: Some issues under OS X
Hey, do you think you could provide some working binaries on the web somehow? I'm trying to get this to work on a friend's iMac (updated to OS X) and I have, so far, met with failure. Installation instructions would also be nice. I downloaded a binary earlier on that machine, but when I untarballed it, the resulting application wouldn't run. It did the usual animation when applications start up (expanding box) but nothing more. Do you know what might be wrong?
 
Old 06-16-2003, 03:18 PM   #3
DrLex
Re: Some issues under OS X
All right, I'll give you the stuff I've got, which works except for the problems mentioned above. You can download them here (StuffIt file).
It are only the binaries, so you need to add the game files yourself. Instructions are included.

Mind that you will also need to install the SDL libraries to make it work:
SDL Library
SDL_mixer


Regarding the distorted sound, it might be due to a bug in the SDL_mixer library itself, because I couldn't find anything suspicious in the ROTT source. After all, the sounds are 8-bit and the 16-bit conversion only happens when mixing. However, 8-bit sound is also distorted in some strange way... When I have some more time I'll do some experiments.
For the music, it may be a good idea to route the MIDI playback to QuickTime, which will not only avoid the buggy playback of SDL_mixer, but will also boost the quality substantially... This could be done by mapping e.g. the 'General Midi' device to QuickTime, so SDL can still be used if desired.


For those interested, I also tried to get the game rescaled to 640x400 resolution, by just 'blowing up' the picture, so it would look exactly like in the good ol' DOS times. However, this appears to involve changing hundreds of lines of code. If only SDL allowed to set a scale factor for the display, adding 2 bytes to the source code would do the trick [img]images/icons/frown.gif[/img]
DrLex is offline  
Old 06-18-2003, 05:23 PM   #4
DrLex
Re: Some issues under OS X
Gotcha! [img]images/icons/smile.gif[/img]

The sound problem was indeed caused by a simple misconfiguration: the sound mixer was set to little endian in the startup call. Why didn't I think earlier about beginning at the start? [img]images/icons/tongue.gif[/img]

It suffices to replace the following line from fx_man.c:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> audio_format = (samplebits == 8) ? AUDIO_U8 : AUDIO_S16 [/code]</blockquote><font size="2" face="Verdana, Arial">by
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> audio_format = (samplebits == 8) ? AUDIO_U8 : AUDIO_S16SYS [/code]</blockquote><font size="2" face="Verdana, Arial">This will automatically use the right endianness setting for the sound mixer on any system. 16 bit sound is perfect now! 8 bit still sounds weird (as if it's clipped), but there is no reason anymore to use it anyway...

I updated the OS X binaries, they can be downloaded here.
Remember to set NumBits back to 16 in your config.rot file(s) if you changed it.
DrLex is offline  
Old 06-19-2003, 08:33 AM   #5
kuran
Re: Some issues under OS X
Thanks in keeping this port alive on Mac, I hope it will one day reach version 1.0 and boast a lot of cool features. Especially proper 640x400 resolution support! [img]images/icons/smile.gif[/img]
kuran is offline  
Old 07-14-2003, 06:44 PM   #6
DrLex
Re: Some issues under OS X
All right, here is the newest release:
Download it!

This includes the R.I.P.-screen fix, and also a fix for the crashing music problem. Music can now be played immediately through QuickTime instead of SDL, which avoids the nasty crashes and also improves the quality! The only thing you need to do to activate this, is set MusicMode in sound.rot to 8 ("General Midi").
I even did the effort to include a routine which replaces the "Space" (aka Sci-Fi) MIDI instrument with something that sounds right, because some songs really sounded horrible due to the fact that in modern MIDI players this instrument is detuned on purpose.
And last but not least, I restored the \EKG effect to its original splendor. (For some reason a few lines of code which added randomness to the gibs were commented out.) [img]images/icons/smile.gif[/img]

As for source code, the QuickTime fix of course involved more than just adding a few lines of code. I had to create a dummy window with an NSMovieView to keep playback simple while allowing looping. This window is accompanied by a "SongController" class in Objective C, and another file with 'glue' routines had to be added to make this stuff available in the C code. In some of the fx_man routines I had to add tests for the "General Midi" setting.
If any of the icculus guys would like to add all this stuff to the CVS, just mail me (click the envelope icon at the right) and I'll try to put the stuff online somewhere together with a list of all the changes.
DrLex is offline  
Old 08-09-2003, 02:59 PM   #7
DrLex
Re: Some issues under OS X
I compiled a new OS X binary containing all the recent changes, of which the most important are:
-Precaching
-Full screen
-Some cosmetic fixes like the RSAC warning
-Application icon
The stuff can be downloaded here.
DrLex is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:16 PM.

Page generated in 0.13798690 seconds (100.00% PHP - 0% MySQL) with 16 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

Website is 1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.