Jump to content
The Dark Mod Forums

Compiling on OSX


Midnight

Recommended Posts

Oops, forgot to mention that since the mac binary isn't included in the download yet you'll currently need to copy this in manually for now. Have you downloaded the tdm_game03.pk4 and placed this in the darkmod folder, does this work?

 

I've had a similar problem myself after upgrading to 1.05 where I had an older game.dylib already in the main Doom 3 folder which doesn't seem to be getting overwritten by a new version. Can you delete this file if it exists and see if this works? I'm assuming this isn't getting overwritten when darkmod loads since the name is different to the Linux and PC libaries?

Edited by Midnight
Link to comment
Share on other sites

  • Replies 145
  • Created
  • Last Reply

Top Posters In This Topic

I found that tdmlauncher_helper.command is specific to Midnight's filesystem.

 

So this line has to be made generic:

 

#export TDMDIR="/Users/scott/Library/Application Support/Doom 3/darkmod"

 

change to:

 

#export TDMDIR="/Users/REPLACE_ME/Library/Application Support/Doom 3/darkmod"

 

And add an instruction telling the player to replace "REPLACE_ME" with what's appropriate for their system.

 

My first attempt crashed, but then I saw Midnight's reminder about the pk4. Indeed, I'd wiped the copy I'd placed in darkmod yesterday when I decided to do a full update. After the update, I forgot to add the mac pk4.

 

With that in place, TDM came up fine, though it didn't list the training mission as a FM. Is that normal? I don't remember. I used the menu downloader to grab "Fiasco", and--though it showed the download progress as it occurred--when it reached 100% it said there was no room on the disk to save the file, so I had no mission. Since I have 23gB free, something's wrong.

 

Still no Darkmod.log in Library/Logs.

Link to comment
Share on other sites

The training mission should be listed indeed, it should be included by default in fms/training_mission. The download problem - I don't know, you've got it running before on your system, haven't you? I seem to recall you downloaded the missions fine in one of the previous tests?

 

Guess I need to place the log in /tmp/ instead of messing with the ~/ folder.

Link to comment
Share on other sites

No that shouldn't be necessary (changing the users install path). The scripts should have had a relative path but I must have been messing with the script on my local system (sorry).

If you use the code from the previous page then a user would not need to edit these.

 

[Edit - Ninja'd again]

Edited by Midnight
Link to comment
Share on other sites

The training mission should be listed indeed, it should be included by default in fms/training_mission. The download problem - I don't know, you've got it running before on your system, haven't you? I seem to recall you downloaded the missions fine in one of the previous tests?

 

Guess I need to place the log in /tmp/ instead of messing with the ~/ folder.

 

Yes, I was playing missions a couple months ago.

 

The training mission is in the fms directory, but it doesn't appear on the New Missions page.

Link to comment
Share on other sites

From this directory:

 

/Users/rsphares/Desktop/Doom 3/Doom 3.app/Contents/MacOS

 

I executed this in a terminal window:

 

./"Doom 3" +set fs_game_base darkmod

 

TDM came up fine, I successfully downloaded "Awaiting the Storm", and this time it didn't complain about space. Starting the mission, however, gave me a "can't find tdmlauncher" error.

 

I looked for AtS and found it in ~Library/Doom 3/darkmod/fms/storm.

 

TDM isn't finding Training Mission because TDM isn't looking in ~Desktop/Doom 3/darkmod/fms, where Training Mission is installed as part of the game files. It wants to find its missions in ~Library/Doom 3/darkmod/fms instead.

 

That's okay, as long as we expect ALL missions, including Training Mission, to be downloaded using the New Missions downloader. We can't tell a new player to load up TDM and start playing the Training Mission that comes with it.

Link to comment
Share on other sites

Where is TDM looking for tdmlauncher?

 

I moved it to a few different locations and always got the "can't find tdmlauncher" error.

 

When I start the game using Midnight's tdmlauncher helper script, I get the same error.

Link to comment
Share on other sites

Where is TDM looking for tdmlauncher?

It is looking in the darkmod/ directory for it:

 

#elif MACOS_X
fs::path launcherExe(darkmodPath / "tdmlauncher.macosx");
#else

The darkmod path is constructed via id's filesystem (pseudo-code, see DarkmodGlobals.cpp):

darkmodPath = current_mod_path/../darkmod/;

where current_mod_path is the currently installed FM path, e.g. alchemist/ or storm/.

Link to comment
Share on other sites

Success!

 

The problem was that tdmlauncher.macosx and tdmlauncher_helper.command are in the darkmod folder that sits beside Doom's 'base' folder and the Doom 3 binary.

 

Once TDM is running, and wants to load a missions, it looks for tdmlauncher.macosx in the darkmod folder that's in the ~Library/Application Support/blah blah folder. This second darkmod folder is where the missions are stored.

 

So copying tdmlauncher.macosx so there's a copy in each of the two darkmod folders allows TDM to work. Perhaps tdmlauncher_helper.command could also be moved to the second darkmod folder, and changed to use the full pathname of the Doom 3 binary folder as TMDIR, instead of setting TMDIR to the directory tdmlauncher_helper.command is sitting in. I notice the full pathname line in that file is commented out. Perhaps just uncommenting it?

 

Anyhow, once I got Awaiting the Storm running, I learned that I for one won't be able to play TDM on my Mac (Mac Mini, 2yo, crappy graphics processor) because it's virtually unusable. I seem to be cursed with slow computers.

 

Congrats!

Link to comment
Share on other sites

Ah, I wouldn't have noticed this because my install is already in ~/Library/Application Support/. The whole point of the helper scripts is to avoid having to make users enter an absolute path anywhere, so there's got to be a better way to support a Doom3 install that isn't in the Library folder.

 

How does the linux version know where to find tdmlauncher when it restarts after a mission is installed? I can't imagine there's a fundamental reason why this has to be different on Mac, but if tdm has access to the TDMDIR variable that the .command script creates, maybe this is one way of getting around the problem?

Link to comment
Share on other sites

Once TDM is running, and wants to load a missions, it looks for tdmlauncher.macosx in the darkmod folder that's in the ~Library/Application Support/blah blah folder. This second darkmod folder is where the missions are stored.

Maybe the easiest solution is to advise users to install darkmod in the ~/Library/Application Support/Doom 3 folder in the first place? Or won't this work since double-clicking tdmlauncher.macosx won't know where the engine is located then?

 

How does the linux version know where to find tdmlauncher when it restarts after a mission is installed?

I guess the difference is that Linux users install darkmod in ~/.doom3/darkmod in the first place, and the "savepath" queried by the code will result in the correct darkmod/ path, as the savepath is also in ~/.doom3/FMNAME.

 

It appears that for OSX two fallbacks can help the game finding tdmlauncher:

- Check current_executable_path/../darkmod/ - e.g. /Users/USER/Desktop/Doom 3/Doom 3.app/Contents/MacOS

- If the above fails, check the TDMDIR environment variableset by the helper script

 

A third fallback could be checking the hardcoded value /Users/USER/Library/Application Support/Doom 3/darkmod folder.

Link to comment
Share on other sites

Those fallbacks seem like a reasonable solution, though I'm not sure how easy it would be for tdm to find the current exec path, or whether the TDMDIR variable is accessible. Once the script finishes and darkmod loads, the terminal window displays "[Process Completed]", suggesting that maybe the user environment where the variable is set might not be accessible (i.e. if I open a new terminal window while tdm is running the TDMDIR variable isn't there).

 

[Edit] - Maybe this isn't a problem: http://hayne.net/Mac...onmentVariables

A GUI program will inherit the environment variables from the process that started it. So if you launch a GUI program from the command-line, it will inherit the environment variables of the shell where you launched it.

Edited by Midnight
Link to comment
Share on other sites

In the meantime I found the problem with the log file not being created in ~/Library/Logs. Seems like the glob() function doesn't handle full paths like ~/Library/Logs/Darkmod.log, it only accepts ~ or ~/. After tweaking the routine the log file should be correctly placed in the user's Logs folder now.

 

I'll try to get an overview about the path problems above and make some improvements to the tdmlauncher handling.

 

@grayman and midnight: can you give me a brief summary about where your various folders are located? Where is the darkmod/ folder as created by tdm_update? Where is your Doom 3 application? And what you need to do you get it running (which helper scripts, and where they are located)? Did you have to copy tdmlauncher.macosx around?

 

I think Midnight has all in the same location, whereas grayman has the Doom 3 app on the Desktop and the rest in Application Support?

Link to comment
Share on other sites

I have a standard install in ~/Library/Application Support/Doom 3/darkmod/ which I originally created manually (before tdm_update for mac). Both .macosx programs reside inside this darkmod folder, as do the two helper scripts. These were zipped up for grayman in "darkmod.zip" so that when he double clicked it there would be a darkmod folder (unzipping on Mac automatically creates a container folder with the same name as the archive).

 

 

The new binary does begin logging Darkmod.log into ~/Library/Logs/, but after it opens the darkmod.ini it then says switching to "Darkmod.log" and a new larger log file is created in "~/Library/Application Support/Doom 3/Doom 3.app/Contents/Resources/", presumably this is the default location as the ini setting doesn't have a path. The tdmlauncher.log was originally created in ~/ when I started TDM (and contains the relevant fm name of the installed mission), but after installing a new mission and restarting, a separate tdmlauncher.log was created in the 'Resources' folder.

 

Do you need to see any of these logs?

Edited by Midnight
Link to comment
Share on other sites

I don't mind if it logs to the darkmod folder (preferable, since that's where tdm_update logs to) or the Logs folder, or even the resources folder, just as long as it doesn't log to the root of my users folder (it's the only folder I have the patience to keep tidy laugh.gif).

Link to comment
Share on other sites

So, after looking at all the paths I guess there are two overall cases:

 

#1 Midnight's Setup (all in Application Support)

Doom 3 app is located in ~/Library/Application Support/Doom 3

Doom 3 executable is in ~/Library/Application Support/Doom 3/Doom3.app/Contents/MacOS/Doom 3

Darkmod is located in ~/Library/Application Support/Doom 3/darkmod

tdmlauncher_helper.command is using the darkmod-relative path ../Doom 3.app/Contents/MacOS/Doom 3 to fire up the engine

 

The darkmod folder has been created manually, then tdm_update has been run in that folder (either through the console, or by using the helper script).

 

#2 Grayman's Setup (App Location is different from FM download location)

Doom 3 app is located in ~/Desktop/Doom 3

Doom 3 executable is in ~/Desktop/Doom 3/Doom3.app/Contents/MacOS/Doom 3

Darkmod is located in ~/Desktop/Doom 3/darkmod

tdmlauncher_helper.command is working without changes (am I right?), since the relative path is working

 

General

FMs are saved to ~/Library/Application Support/Doom 3/darkmod/fms

This is the so-called "savepath" which is determined by the closed source D3 idFilesystem implementation.

 

Problems

Issue with #2: Training Mission not found, since the fm path is in Application Support, and not in Desktop/Doom 3 where the game is installed. Users need to re-download that.

Issue with #2: tdmlauncher not found by the game when it's trying to restart, since the game is trying to look it up in ~/Library/Application Support/Doom 3/darkmod.

 

Looking at this, it seems the least problematic setup is #1, to put Doom 3 in ~/Library/Application Support/Doom 3, and download the mod to the darkmod/ folder below Doom 3. Is this the correct conclusion? Can we require that from our Mac users?

 

In either case, I can add instructions to tdmlauncher.macosx to let it search in the relative path ../Doom 3.app/Contents/MacOS/Doom 3 to look for the engine path. This should work with #1 and #2.

Link to comment
Share on other sites

Looking at this, it seems the least problematic setup is #1, to put Doom 3 in ~/Library/Application Support/Doom 3, and download the mod to the darkmod/ folder below Doom 3. Is this the correct conclusion? Can we require that from our Mac users?

 

That should be fine, though some hardcore Mac user might complain that Application Support is for support files, not the app itself.

Link to comment
Share on other sites

Of course, that's understandable. It's still possible to please those folks by writing up some instructions how to get it running (this would be placing a symlink in Application Support, pointing at the tdmlauncher.macosx in Desktop/Doom 3/darkmod, wouldn't it?)

 

I'd merely like to have a "recommended" setup that's requiring the least amount of work and is less error-prone than anything else, and document it on the wiki and the website. The simpler the better.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...