D2X-XL on Mac OS X

D2X-XL - Descent II update for modern systems with many new features and enhanced graphics. Home Page

Moderators: Grendel, Aus-RED-5

User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

D2X-XL on Mac OS X

Post by kaelan »

If anyone is interested, I have started to port D2X-XL to Mac OS X. I grabbed the 1.5.22 snapshot of the Linux port yesterday. After working through a good deal of the cruft in the bigendian support, I have a compiled version that works somewhat. There are still major bugs in it, but for less that a day's work, its going fairly well. The first level will even start up and let you fly around a little bit (before some Asserts kill it).
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Wow Wow Wow! Yeeeeehaaaaaaaaaaaw!

You da man! :D

There will be some extra work to be done in the multiplayer communications part, as I have added some new functions to support Entropy games and stuff like that; I will sift through that stuff and try to add it at least so that you only have to fix it, ok?

Please use the 1.5.24 version from my Descent site, as I have fixed a few issues and added full UDP/IP support today.

If you run into severe problems, tell me about the symptoms, maybe I have an idea (given my experience with D2X).
User avatar
TechPro
DBB Admiral
DBB Admiral
Posts: 1520
Joined: Thu May 20, 2004 11:51 pm

Post by TechPro »

Cool! 8) Will be watching this!
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

Diedel wrote:Please use the 1.5.24 version from my Descent site, as I have fixed a few issues and added full UDP/IP support today.
Updated to 1.5.24. :) Still many bugs to work out, but the game will load you can fly around a little bit before it dies.
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

It's Alive!

I've gotten the primary gameplay functional. There's still some testing to do with the networking code, but I think its ready for an alpha release. I'll be shipping a binary over to Diedel soon and we've been working on the unified source code base.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

An up to date D2X version for all three platforms had been my desire for months. Thanks for your help, kaelan. :)

Btw, thanks from OneOfThem from the Apple Corps forums to you for the D2X-XL Mac port. :)
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

For anyone desiring to check it out right now, I have a binary on my website. As this is my first stab at release an OS X binary, I'd love someone to check it out and let me know if it works. It currently has been compiled for 10.4. There shouldn't be anything that prevents earlier versions of OS X (10.3 at least), though I will need to install the cross-development SDKs.

http://programerror.com/packages/d2x-xl.dmg

There is also a copy of the SDL framework on my site as well, just in case its needed.

http://programerror.com/packages/SDL-1.2.9.dmg


The OS X version uses the same conventions as the linux build. So I put the data files in /usr/local/share/d2x-xl/ and made sure that it was writeable by my username.

My testing was done with the PC data files, so if anyone has mac data files that wants to test it out, it also would be helpful. (I was still using PC's exclusively when I bought all my copies of D1 thru D3... hence why I wanted to get the port working)
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

kaelan,

what is this dmg file? Is it an executable? 2.3 MB? Still containing debug info?
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

Its an OS X disk image file. In it theres the d2x-xl.app package. I'm wondering if its statically linking in the SDL framework (among possibly others). It should be stripping the debug symbols when it packages it.
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

Oops. Didn't have deployment processing turned on. Its now about 894kb for the compressed DMG file.

I've updated it on my site.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Is the deployment version not online yet, or does our darn company proxy not realize the file has changed?
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

Must be the proxy. :)

I just put up a d2x-xl.dmg.zip file. The different name should bypass the proxy, and it saves another 40k or so.
User avatar
Shadowfury333
DBB Ace
DBB Ace
Posts: 326
Joined: Mon Aug 09, 2004 8:36 pm

Post by Shadowfury333 »

I've tried downloading the .dmg.zip file, but the .zip is apparently missing some info for the .dmg:

Code: Select all

Archive:  d2x-xl-osx.zip
error [d2x-xl-osx.zip]:  missing 14 bytes in zipfile
  (attempting to process anyway)
error [d2x-xl-osx.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
  (attempting to re-compensate)
  inflating: d2x-xl-1.5.29.dmg       
  error:  invalid compressed data to inflate
file #2:  bad zipfile offset (local header sig):  1173754
  (attempting to re-compensate)
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

Perhaps an alternative download location may help:

http://programerror.com/packages/d2x-xl-1.5.29.zip
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

It looks like I accidentally ftp'd some zip files as ASCII instead of binary files, thus causing "linebreaks" inside of them to be converted.

I have just uploaded the file kaelan has offered above, making sure I marked it as binary.
MrGRiN
DBB Cadet
DBB Cadet
Posts: 3
Joined: Fri Dec 02, 2005 12:50 pm

Menus don't work

Post by MrGRiN »

Hi,

I tested version 1.5.29 on my mac os 10.4 and the game works but the menus don't. The menus only refresh when I minimize the app and open it up again.
So far so good. I think it is great that there is a mac port in the works and I say thanks to all who worked on d2x xl and the mac port.

MrGRiN
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

When is it that the menus do not refresh - when you simply move the highlight to another option, or when you overlay the game window with another app's window?

The further case would be a bug, the latter a 'feature'.
MrGRiN
DBB Cadet
DBB Cadet
Posts: 3
Joined: Fri Dec 02, 2005 12:50 pm

Post by MrGRiN »

The first. It even does not show menus when d2x xl is started. Only after a minimize and open up again operation the menu is shown. Then I can move in the menus but it is not shown. Then I minimize again and see what I have done.

MrGRiN
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Latest drivers installed? Any background apps? Please see my d2x page for known problems of D2X-XL when running with certain other software.
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

Another set of questions... are you using the retail or shareware data files? The shareware data files caused all kinds of rendering problems with the menus.

Perhaps more importantly, are you using the Mac data files. I think there may be a difference. The code should work with them, though I don't have them to test with. I bought all my copies of descent back when I used PCs exclusively. If you are using them, perhaps we could arrange for me to 'borrow' them to develop with.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

kaelan,

I have sent an e-mail from my other account to you regarding a crash.

One kind request: Could you test d2x-xl-osx with my level Glass House (see multiplayer level section of my D2 site)? I wonder whether my extensions get loaded properly (little/big endian stuff).

If not, I'd have to fix the level loading routines accordingly.

karx
MrGRiN
DBB Cadet
DBB Cadet
Posts: 3
Joined: Fri Dec 02, 2005 12:50 pm

Post by MrGRiN »

I'm using the retail PC data files. I also had no mac back then when I bought d2. I'll try another set of data files from a friend and report if this works. He told me he had to try several different sets of data files before it worked for him so I'm pretty sure when I get the right data files it will work.
Thanks for your help.
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

As far as the data files go, I have found a bug related to some filename problems. Basically the findfile functions were case sensitive, which can be problematic given the standard case-insenstive case-preserving HFS+ file system. This shouldn't affect the game data, but it will affect demos, player files, and third-party levels. I can post a binary that fixes these later today, though there are still a number of other bugs. I will be compiling the OS X binary with support for logging some debug information that can help figure out what's going wrong. More details to follow.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

kaelan,

I have just committed numerous software changes. Current version is 1.5.33. Please update your source code, and mind offering a new binary when you're done? :)

Diedel
User avatar
Kd527
DBB Ace
DBB Ace
Posts: 86
Joined: Mon Aug 09, 2004 11:11 am
Location: USA
Contact:

Post by Kd527 »

Well, for me, it still launches then crashes. At leas this time it brings up an error report thing, but still the app barely launches before crashing immediately.

This is version 1.5.40

screenshot

if you need comp specs here:
iBook G4
PowerPC 7447A (1.42 GHz)
1 GB DDR SDRAM
32 MB Radeon Mobility 9550 graphics
Mac OS X v10.4.3
Ibn
DBB Cadet
DBB Cadet
Posts: 2
Joined: Mon Dec 05, 2005 7:57 am
Location: Germany, Munich
Contact:

Post by Ibn »

@kd527:
you have to make sure that your d2 data files lie in /usr/local/share/d2x-xl.
or start d2x-xl with -hogdir parameter.

....

d2x used an ini-file for switches. is there any eqivalent in d2x-xl?

i ktrace/kdump-ed d2x-xl to see if any such files are accessed but at the first sight i didn't find any. but i have to admit that i haven't had the time to look thoroughly.

bye
ibn
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

The Mac version is looking for a d2x.ini in the game folder or the subfolder 'config' (e.g. '/Applications/Games/D2X-XL/config/d2x.ini').

The Mac version currently doesn't recognize the DESCENT2 environment variable and still cannot handle having the D2 data in some arbitrary folder and starting the game from there (blame kaelan :P).

I have just made some code changes to fix this, but I will have to wait for kaelan to create new binaries for the Mac (and he will have to wait for me to check the stuff into the SVN repository).

I will also have the next mac version put some diagnostic messages into a file named "d2x.log" - maybe that will help in pinning down the cause of that bug.
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

So a couple of things...

With version 1.5.40, it will look for the data files in /Applications/Games/D2X-XL first. If that directory doesn't exist, it will default to /usr/local/games/d2x-xl.

If it still has trouble, I have built the OS X binary with support for printing a debugging trace log that may help me figure out what's going wrong. To create it, open up a Terminal window. Go to wherever you have placed the d2x-xl.app. Once there do the following:

cd d2x-xl.app/Contents/MacOS
./d2x-xl -debug -printlog

This will open up d2x-xl, and if it is able to find the data directory, it will create a file d2x.log. Email this log file to me at d2x@programerror.com.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

kaelan,

there are some new (old) bugs in 1.5.40/41. I have uploaded the current source code to http://www.descent2.de/resources/d2x-xl-unified-src.zip, because I cannot check it into the SVN repos until in a few hours. So if you have time and like to, grab the source, check it in and build a new OS X version. You can enable the -debug-printlog switch for all OS's (or I'll do that tonight).
User avatar
Shadowfury333
DBB Ace
DBB Ace
Posts: 326
Joined: Mon Aug 09, 2004 8:36 pm

Post by Shadowfury333 »

Kaelan, why not set the search location to ./Data?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

Shadow,

that is what I have built into .42/.43.
Ibn
DBB Cadet
DBB Cadet
Posts: 2
Joined: Mon Dec 05, 2005 7:57 am
Location: Germany, Munich
Contact:

Post by Ibn »

something else now... i just wanted to thank you guys for doing this!
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

I need a 3D math expert.
User avatar
Shadowfury333
DBB Ace
DBB Ace
Posts: 326
Joined: Mon Aug 09, 2004 8:36 pm

Post by Shadowfury333 »

Diedel wrote:I need a 3D math expert.
Why?(not that I am) Isn't all of the 3D math taken care of?
inuwali
DBB Cadet
DBB Cadet
Posts: 19
Joined: Fri Dec 09, 2005 1:20 pm
Location: Atlanta, GA

Post by inuwali »

I have a couple things to accomplish in this post... Please tell me if there's a more appropriate place.

First, thanks for doing the work to port to OS X! I'm excited to see that D2X is alive and well, after such a long hiatus in development. I downloaded the binary (1.5.40) and only encountered a couple problems (which I'll get to below), but in general it is very stable and in good shape.

Second, if you need a 3D math expert, I'll help to the extent I can. I'm not really an expert in that area, but I did take a 3D computer graphics course in college and still have the textbook, and I have a basic understanding of the 4x4 arrays and 4x1 vectors used to do the computation.

Third, my bug reports... Please let me know if there's a better way to post these.

1: On occasion (actually the very first time I played) I get an error that crashes the program very soon after entering a level and starting to fly. A dialog appears that states something like "invalid geometry".

2: I am hoping to set up multiplayer gaming on my lab of eMacs. I have installed the program on several machines and have had trouble getting things working. None are running firewalls, and they're all plugged into the same switch. When I start a multicast game, I get a UDP error dialog box that tells me "querying my own hostname." This is both for setting up a game, and for joining. On the hosting machine, I get to the screen where I wait for others to sign on. But on the other machine, I can't see the hosted game. I've tried all three multiplayer options with the same result. Have you seen this before? Have you gotten a multiplayer game to work?
User avatar
kaelan
DBB Ace
DBB Ace
Posts: 42
Joined: Tue Nov 22, 2005 2:51 pm
Contact:

Post by kaelan »

So the short answer is yes, multiplayer functionality on OS X is a known bug.

I believe that there must be something wrong with how D2X-XL is attempting to setup network connection, and since it fails, everything that follows (creating, browsing, joining) doesn't work. Beyond knowing it's a problem, I haven't had much of a chance to diagnose it.


The geometry error, on the other hand, is an interesting one. If you can do a trace log (as described above) and send it to me, I'll try to see if I can reproduce it. I may need to pad out what is in the trace logs in future versions, depending on how well they work. I've basically just enabled the tracing that was in D2X.
inuwali
DBB Cadet
DBB Cadet
Posts: 19
Joined: Fri Dec 09, 2005 1:20 pm
Location: Atlanta, GA

Post by inuwali »

Thanks for the reply.

In the true nature of bugs, once I actually went to reproduce it the geometry error, it evaporated. It happened a couple times, each when I ran it for the first time on a given machine. I tried a couple more "virgin" machines but didn't get it to fail.

Let me know if I can do anything to help.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

#1 Multiplayer

Try direct UDP/IP.

#2 3D math

I need to know how to rotate a spatially arbitrarily oriented object around a certain object axis (that has also been displaced from the world axis).

Background: I am trying to implement rotating cameras which always should rotate around their vertical (Y) axis no matter how that axis is oriented relative to the word Y axis.

I have a position vector and a orientation matrix. I thought transforming the desired angle into a matrix and adding that to the orientation matrix would do the trick, but not so.

I also tried rotating the Y displacement vector with the orientation matrix, creating a 2nd matrix from the result and multiplying it with the orientation matrix, but that didn't work either.

I tried a lot of other things, but I cannot figure this. I am really upset about this darn 3D math crap. Cannot find something useful with Google either.

Edit:

I've got it. Was probably thinking too complicated.
inuwali
DBB Cadet
DBB Cadet
Posts: 19
Joined: Fri Dec 09, 2005 1:20 pm
Location: Atlanta, GA

Post by inuwali »

Glad you got the math figured out. Those transform matrices can be tricky since they're order-dependent.

As for the multiplayer, I did try straight UDP/IP, though admittedly not exhaustively. I set up one machine to host and then pointed the other towards its IP, but nothing showed up in the "available games" list. I'll need to do some more testing, though, to be convinced that it's not working. Do you have a list of variables that should be accounted for when I try to be more thorough?
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel »

It can well be that this doesn't work yet on OS X, as I never had the opportunity to go over that code or even test it. Donate ppl, and I will eventually get a Mac and see what I can do! ;)
Post Reply