Page 2 of 5

Posted: Fri Dec 09, 2005 6:27 pm
by Shadowfury333
I've had the same problem myself, although mine is two-fold, 1. it can't load/find HOARD.HAM (and thus doesn't work) 2. I can't see custom missions. #2 is a problem stemming from the original Mac D2 and D2X.

Posted: Fri Dec 09, 2005 6:30 pm
by Diedel
You can't see custom missions? Do you own the full D2 version, or the demo?

Posted: Fri Dec 09, 2005 6:36 pm
by Shadowfury333
Sorry, I just checked with D2X in /App*/Games/D2X-XL/ and custom missions can be seen. I have the Full MacPlay version. It still can't open HOARD.HAM, however.

Posted: Fri Dec 09, 2005 8:26 pm
by Peter
Awesome job guys! Few notes: I have the full Mac game and everything (which means Mac data files). I have the cut scenes .mvl files. I am having trouble uploading the .sitx file to my iDisk so if one of you has AIM, I can send it to you guys. If you guys need any help, Xcode 2.2 or otherwise, let me know (AIM is "halprinp").

For a bug report:
The mouse looking is a tad bit out of whack. What I mean is that I think that once the cursor has reached the end of the screen, you can no longer turn in that direction. This done while in fullscreen. You get a similar problem while in window mode. Once you move your cursor outside of the window, you can no longer turn in that direction. Technically this is the same problem I am thinking.

Posted: Fri Dec 09, 2005 8:35 pm
by Aus-RED-5
I don't know anything about MACs but if there is a d2x.ini files in the D2 folder. Open it up and have a look and make sure that you have the following line in it:
;keep mouse focus in game window
-grabmouse

If nothing. Then add it. If you have a ;-grabmouse. Remove the ; from the -grabmouse. Try that and see if this fixes the prob. Other then that. I have no idea. :roll:

Posted: Fri Dec 09, 2005 8:45 pm
by Peter
I think I used to but I no longer have one. Can you possibly direct me to an example d2x.ini file that I may start from? I tried making just a blank file with that in it and it did not work. I also tried placing it in the /Applications/Games/d2x-xl/ and in the same directory as D2X-XL.

Posted: Fri Dec 09, 2005 9:12 pm
by Kd527
I have all my files in /usr/local/share/d2x-xl but it still doesnt work. also one problem with that directory is it's hidden so to get there you have to put that link in Safari which will then hand it off to Finder. But just future advice, don't require files to be there cuz its a horrible location. Anyway I put all my game files in there and I installed the SDL by copying the folder to /Library/Frameworks/ but the app crashes after I launch it.

Posted: Fri Dec 09, 2005 9:20 pm
by kaelan
With 1.5.40 you should be able to use /Applications/Games/D2X-XL

Also, to get to /usr/local/... in finder (or nearly any file dialog for that matter), hit Shift-Cmd-G to bring up the Go To Folder dialog. In there type in the path you want to go to.

Posted: Fri Dec 09, 2005 9:48 pm
by kaelan
I have built the latest source code (1.5.44). Hopefully this will address some of the path problems that have been occuring. To grab it right away:

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

Posted: Fri Dec 09, 2005 9:55 pm
by Kd527
wow i Just got it working. I just needed to put the game data in /Applications/Games/D2X-XL/ instead of the other place. cool, thanx guys.

Posted: Sat Dec 10, 2005 12:38 am
by Shadowfury333
Great job. this nicely fixes the weapon selection bugs I mentioned.

Posted: Sat Dec 10, 2005 1:14 am
by Peter
So with 1.5.44, it should read from a Data folder that is right in the same folder as the d2x-xl.app is and with no data in the other 2 locations?

I tried that and it isn't working...

Posted: Sat Dec 10, 2005 2:42 am
by Diedel
call d2-xl -debug-printlog and post the contents of d2x.log from the app dir here.
_______________

Peter,

folder priority:
  • if /Applications/Games/D2X-XL/data exists (whether empty or not), D2X-XL will expect its game data in that folder.
  • Otherwise, if if /Applications/Games/D2X-XL exists, D2X-XL will look for its data there.
  • Otherwise if a subfolder 'data' of the current folder at the time of launching D2X-XL exists, D2X-XL will expect its data there.
  • Otherwise it will look for its data in the current folder at program start.
I wrote current folder because I don't want to exclude the possibility that it's different from the folder D2X-XL resides in when you launch it.

Find a sample d2x.ini file at the end of the D2X-XL switches documentation. I have also included one in the d2x-xl-osx.zip file on my Descent site.
_______________

kaelan,

Peter posted here above that mouse control goes lost when the cursor reaches the end of the screen - in fullscreen mode (like it does when the cursor leaves the game window in windowed mode).

Could you check this and the influence of the -grabmouse parameter from the d2x-xl ini file on this behaviour?

Posted: Sat Dec 10, 2005 10:21 am
by Shadowfury333
I just checked, and the folder priority sems to still stop at /Applications/Games/D2X-XL. Arbitrary folders are still impossible.

Also, why is the Mac version missing the d2xtracker.pl file? It seems necessary

Lastly, d2x.ini isn't being read. I've put it in /Applications/Games/D2X-XL and in /Applications/Games/D2X-XL/Config, and neither work.

Posted: Sat Dec 10, 2005 10:42 am
by Diedel
RTFM, Shadow.

And make sure to use exactly the same letter case for all folders as I did in the manual(if filenames are case sensitive on the Mac).

d2tracker.pl is the tracker code you need to run a tracker. Not really needed.

Posted: Sat Dec 10, 2005 11:33 am
by kaelan
Filenames should be case-insensitve now. There was a bug in the way filefind was regex matching custom missions on OS X (was case sensitive), but that has been fixed by at least >= 1.5.40.

Posted: Sat Dec 10, 2005 11:43 am
by inuwali
kaelan, is there a link or a place where I can download the latest code as an XCode project? I tried the link on page 1 of this thread but was not able to get the .pbxproj file to open; I double-clicked on it and XCode started but no windows appeared.

I've been poking around the code and am having trouble getting oriented. I was hoping to at least check out the network code regarding game setup. The network.c file in the main directory seems to have to do with transmitting information about a game already in progress.

Posted: Sat Dec 10, 2005 2:06 pm
by kaelan
To open the project, you should click on d2x-xl.xcodeproj (which sould be a bundle), rather than the enclosed project.pbxproj file. You will need Xcode 2.1 or greater, though. Prior to 2.1 the files were called *.xcode.

I am specifically using Xcode 2.2, though it should work find under 2.1.

Posted: Sat Dec 10, 2005 4:50 pm
by Diedel
kaelan,

could you please check D2X-XL operation on all possible data locations, i.e.
  • /Applications/Games/D2X-XL/data
  • /Applications/Games/D2X-XL
  • <current folder>/data
  • <current folder>
Question: Does Mac OS X distinguish between the current folder and the folder an application is started when launching it, or is the application's current folder always the application folder right when it has been launched?

Posted: Sat Dec 10, 2005 5:09 pm
by kaelan
Current Folder will probably not work reliably. I will need to write some code to actually find what the "current folder" is. For command line tools, OS X works just as unix does. However, when launching apps from the GUI (Finder, Dock, etc.), it will probably be set to something like '/'.

Posted: Sat Dec 10, 2005 5:44 pm
by Diedel
kaelan,

I have received a crash log from a Mac user stating that d2x-xl does not find the SDL library. Did you statically link it to d2x-xl, or should be included in the d2x-xl-osx zip file, or what?

The crash log also stated v1.5.29. Is the version number stored somewhere in your project and added to the file info by the compiler, or how does OS X know the file version?

On windows, the project resource file has a 'version' section I have to manage (additionally to the version string being printed by d2x-xl). That version is put into the file info by my compiler, so the OS has a version number to report.

Is your project's file version sync'd with the program version?

Posted: Sat Dec 10, 2005 6:16 pm
by kaelan
Diedel wrote: I have received a crash log from a Mac user stating that d2x-xl does not find the SDL library. Did you statically link it to d2x-xl, or should be included in the d2x-xl-osx zip file, or what?
I have packaged the SDL framework inside the Disk Image. They will need to make sure that it is installed in order for it to work.
Diedel wrote: The crash log also stated v1.5.29. Is the version number stored somewhere in your project and added to the file info by the compiler, or how does OS X know the file version?

On windows, the project resource file has a 'version' section I have to manage (additionally to the version string being printed by d2x-xl). That version is put into the file info by my compiler, so the OS has a version number to report.
OS X has a similar resource file that stores version information for the application bundle. Additionally, I have the OS X conf.h file define the various version numbers and strings. Starting with 1.5.40, the d2x.log file should print this information, as well as the compiler and build date. That way I can diagnose things even if they are built by someone else.
Diedel wrote:Is your project's file version sync'd with the program version?
Yes, each time I have built a binary, I have updated all of the respective version numbers. So this error log must indeed be coming from 1.5.29.

Posted: Sat Dec 10, 2005 6:23 pm
by kaelan
So I dug into the crash log a little. The most recent crash was with 1.5.44, and it crashed on closedir. I have found that the directory finding stuff seems to crash when things aren't exactly right. I think that it must be looking for /Applications/Games/D2X-XL, and when it doesn't exist, it crashes on closing the null DIR*. (the log states that the app is in /usr/local/share/d2x-xl/)

Posted: Sun Dec 11, 2005 3:50 am
by Diedel
Yeah, the guy wrote he had the data in /usr/local/share/d2x-xl, and that he had been meticulously following installation instructions - which cannot be quite true, because if he had, he would have had his stuff in /Applications/Games/D2X-XL.

Posted: Sun Dec 11, 2005 9:48 am
by inuwali
kaelan wrote:To open the project, you should click on d2x-xl.xcodeproj (which sould be a bundle), rather than the enclosed project.pbxproj file. You will need Xcode 2.1 or greater, though. Prior to 2.1 the files were called *.xcode.

I am specifically using Xcode 2.2, though it should work find under 2.1.
Thanks... That would definitely explain it. Unfortunately I can't upgrade to XCode 2.2 without putting me out of sync with my eMac lab. (I'm assuming that the install replaces the existing version, and even if I were to move it aside before doing so, I have the feeling that it wouldn't work afterwards.) I went searching for a makefile for Linux but didn't see one; I was hoping that I might be able to set up an XCode 2.0 project from that. I may just see what I can do from scratch. I finally found the SDLMain.m file, so that's a start at least.

Posted: Sun Dec 11, 2005 11:26 am
by kaelan
inuwali,

To get a start, grab the the development framework from the SDL website. It installs some project templates into Xcode. They actually are Project Builder templates, I believe. At the barest minimum, I know Xcode upgraded the project file when it was created, so it should be compatible with 2.0. I started with the basic SDL application template and started adding in the source files that were used by the automake scripts. All of the platform specific files should be in 'arch/macosx'. I have a conf.h (a facility used by the automake build) that defines the OS X platform definitions. In the project settings just make sure to add HAVE_CONFIG_H to the preprocessor definitions.

Also, you will have to make sure that Xcode doesn't use Zero Link. It just doesn't work with the vast number of globals that are used in D2X-XL.

Posted: Sun Dec 11, 2005 11:28 am
by kaelan
inuwali,

Another thing... if you open up that project.pbxproj file in a text editor, you can see all of the files that are used by the project. From that it should be possible to build up the 2.0 project.

Posted: Sun Dec 11, 2005 2:00 pm
by Diedel
kaelan,

could you please check whether d2x-xl reads d2x.ini, and where d2x.ini has to be located?

Also, using /Applications/Games/D2X-XL/data for the D2 data doesn't seem to work.

Can you check that too, please?

Posted: Sun Dec 11, 2005 3:50 pm
by Shadowfury333
Diedel wrote:Also, using /Applications/Games/D2X-XL/data for the D2 data doesn't seem to work.
It works for me, at least with 'Data' capitalized

Posted: Sun Dec 11, 2005 4:36 pm
by Diedel
I thought D2X-XL crashes for you?

Re your log file post:

I have the impression that PC/Linux path and file handling code is not sync'd with the OS X version.

D2X-XL has two ways of storing data files:
  1. Directly in the data folder
  2. I an archive stored in the data folder (descent2.hog is such an archive containing a lot of D2 data files).
When D2(X(-XL)) is looking for a data file (e.g. 'descent.tex') it first checks whether there is a file with that name in the data folder. If not, it checks all archives (lib files) it knows whether one of them contains the file it is looking for.

The log file tells me the following:

The folder used for the direct file lookup (' /usr/local/share/games/d2x-xl') is different from the one used for lib file searches ('/Applications/Games/D2X-XL/data'). The latter seems to be the proper data path. I have no clue why the OS X version uses a different path for direct lookups, and nothing in my local code (which is hopefully sync'd with the SVN repository code) tells me how this could happen.

I can only guess that the source code kaelan works with is not sync'd with mine, but ofc I cannot really tell - only kaelan can.

Posted: Sun Dec 11, 2005 6:00 pm
by kaelan
The code I built that with is sync'd with the repository. I noticed that for some reason the AlternateHogDir stuff was being used when it wasn't before. It should not be problematic, as it won't typically find files there, and will just continue on to the data directory.

The default for the AltHogDir is something like /usr/local/share/d2x-xl

Posted: Sun Dec 11, 2005 6:03 pm
by Diedel
Ok. Afaik AltHogDir gets initialized with the -hogfile command line/ini file parameter. That's something I can check with the Windows version, too.

Edit:

On OS X and Linux, AltHogDir gets set to SHAREPATH automatically.

Posted: Sun Dec 11, 2005 6:05 pm
by Shadowfury333
Diedel wrote:I thought D2X-XL crashes for you?
Nope, it just doesn't play movies, multiplayer, singleplayer twice in one session or see .ini files.

Posted: Sun Dec 11, 2005 6:28 pm
by Diedel
SHAREPATH is defined in config.h has become redundant with d2x-xl. While it made sense for Linux, it's useless for OS X and has lead to folder confusion.

I am currently changing the folder handling and detection code to a) use only the proper folders and b) make sure they contain the D2 data (i.e. if you have '/Applications/Games/D2X-XL/data', but your D2 data is stored in '/Applications/Games/D2X-XL', d2x-xl will detect this with the next release).

Edit:

Changes done and checked into the SVN repository.

Posted: Sun Dec 11, 2005 10:09 pm
by inuwali
Some questions and comments:

How do I get to the SVN source? Is there any way I can get checkout privileges without checkin privileges?

I am close to getting my XCode 2.0 project to compile, but I have two problems. First, I am getting an undefined symbol "PrintLog" when I compile inferno.c. I fixed that by adding it to error.h. I'm assuming I just have out-of-date source.

Second, I am unable to link, because all the OpenGL symbols (e.g. _glBegin, _glBlendFunc, etc.) are showing up undefined for some reason. I have the OpenGL framework in my XCode project, but is there something tricky I have to do to be sure that I'm linking against it?

Posted: Mon Dec 12, 2005 2:31 am
by Diedel
The SVN link is on my D2 page, http://www.descent2.de/d2x-install.html.

You need to include arch/main/config.h in your compilation, but I cannot tell how the Mac project is setup. Only kaelan can really help you here.

inuwali,

to get the (Linux) automake files for d2x-xl, download d2x-xl-src.tgz from my D2 site (that's the source code link there).

Edit:

I have made some more changes to folder handling to make sure d2x-xl will find its stuff if its in any of the possible locations. Will check sourcecode into SVN repos in a few hours.

Posted: Mon Dec 12, 2005 11:45 am
by Kd527
OK, here's a weird problem I sometimes get (I hope no one else reported this). the screenshot says it all:

http://kd527.frihost.net/d2x%20invalid%20polygon.png

then once I hit ok D2X-XL quits.

Posted: Mon Dec 12, 2005 1:18 pm
by inuwali
Aha!

Kaelan, that was the error I was talking about that I couldn't replicate. Kd527, can you figure out how to reproduce it, or does it seem completely random?

Posted: Mon Dec 12, 2005 1:30 pm
by Shadowfury333
inuwali wrote:can you figure out how to reproduce it, or does it seem completely random?
Every time you start a singleplayer game for the second time that session, it will do that. Also, turning right from the starting position on the first level will do it too.

Posted: Mon Dec 12, 2005 3:40 pm
by inuwali
Diedel, I got my MS in Computer Science from MSU! Are you doing any particular research there? I was in the GARAGe but I'm not sure if it's around any more.

BTW, I just checked out version 45 via SVN, and I got one compliation error in fixc.c, line 381. I went ahead and just changed #if 1 to #if 0 for now, since I'm not really sure what the 64-bit int type specifiers are on a Mac, or even if that's possible on processors other than the G5. It seems like you need to switch on a conf.h setting there.

Kaelan, I'm still having trouble getting my project to link. All the OpenGL symbols are not found. Any advice?