Jump to content
The Dark Mod Forums

Compiling TDM with tools using MSVC 2013 ?


motorsep

Recommended Posts

So recently someone tried compiling our engine, which includes same MFC-based tools as Doom 3, with MSVC 2013. It was not possible as MFC was dropped from MSVC 2013. Using MFC hack (repackaged standalone MFC that allows compiling Doom 3 and derivatives with MFC tools using MSVC 2010 Express) doesn't work either with MSVC 2013.

 

What MSVC version do you use to compile TDM with tools ?

Link to comment
Share on other sites

My method:

 

1. install vc_mbcsmfc.exe

from an official microsoft.com download site. Because VS2013 has dropped support for multibyte character sets from MFC by default.

 

 

2. Upgrade boost

Either use the files I'm about to link, or download boost for VS2013 (v 1.55) and compile the static libraries for yourself.

 

2.1 precompiled static libraries

Add these to darkmod_src\win32\lib

 

Either unzip mine ( https://www.amazon.c...uTm4k3EkmA-Dc6E ) or compile your own with this command:

b2 toolset=msvc variant=release,debug link=static threading=multi runtime-link=static stage /boost/chrono /boost/date_time /boost/filesystem /boost/program_options /boost/regex /boost/system /boost/thread

 

2.2 boost headers

Delete the contents of darkmod_src\include\boost and replace with the contents of this zip ( https://www.amazon.c...HTK8lVt3on6LXnw ) or the contents of the /boost/ folder in a standard boost v1.55 download.

 

 

3. Retarget solution

Open the darkmod solution in VS, right-click the Solution and retarget it to upgrade everything to point to vs2013 libraries. This doesn't change any source code, just the project and solution files.

 

 

4. VS 2013 configuration

 

Set current configuration to Debug

 

Navigate to Game > Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions and add ;NO_MFC;_ALLOW_KEYWORD_MACROS; to the listed options.

 

_ALLOW_KEYWORD_MACROS is needed for an adventurous preprocessor macro in TypeInfo.cpp, because VS2013 disallows redefinition of c++ keywords by default:

Quote:

// This is real evil but allows the code to inspect arbitrary class variables.
#define private  public
#define protected public

 

 

5. Source code change

 

Hoping someone will tell me this isn't needed. The problem is that the idTech4 engine imports the standard c++ <float> module then #undefines FLT_EPSILON so it can replace it with a constant idMath::FLT_EPSILON (which has the same value). Unfortunately, one cpp file then goes on to #include a boost header that references FLT_EPSILON. I don't know why this works in VS2010. Maybe because of a precompiled header? Anyway, my fix for now is to redefine FLT_EPSILON just before that boost inclusion and undefine it immediately after. It's in game/MatrixSq.h:

 

 


#ifndef FLT_EPSILON //~SteveL testing VS2013 compile
#define FLT_EPSILON idMath::FLT_EPSILON //~SteveL testing VS2013 compile
#include <boost/numeric/ublas/matrix.hpp>
#undef FLT_EPSILON //~SteveL testing VS2013 compile
#endif //#ifndef FLT_EPSILON //~SteveL testing VS2013 compile

 

6. Other stuff

If you're doing this using the current svn solution settings, you'll want to retarget the engine build to match the output folder of the game build:

Set Engine > Properties > Configuration Properties > General > Output Directory $(SolutionDir)..\darkmod\

 

----

 

From that point on , you should then be able to compile the entire solution -- game and engine -- in a single step.

Link to comment
Share on other sites

Not sure if this is where to put this but Revelator was struggling with severe shadow artifacts in his Doom 3 builds because MSVC was optimizing away

parts of his code... I think Greebo or Serpentine encountered similar issues with both TDM and DR.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Not sure if this is where to put this but Revelator was struggling with severe shadow artifacts in his Doom 3 builds because MSVC was optimizing away

parts of his code... I think Greebo or Serpentine encountered similar issues with both TDM and DR.

 

Specifically when built by MSVC 2013 ?

Link to comment
Share on other sites

Any links for that nb? I miscommitted some binaries earlier this week with severe shadow artefacts (despite playing a whole FM to test them, and by chance choosing one that didn't show the problems) and I haven't got to the bottom of it yet. This seems an important clue.

 

The artefacts do not occur in a debug build. I've been using a debug build in VS2013 for months, and it definitely doesn't happen. That's consistent with optimization being at fault.

 

@motorsep, yes this is a VS2013 problem it seems.

Link to comment
Share on other sites

Hoping someone will tell me this isn't needed. The problem is that the idTech4 engine imports the standard c++ <float> module then #undefines FLT_EPSILON so it can replace it with a constant idMath::FLT_EPSILON (which has the same value). Unfortunately, one cpp file then goes on to #include a boost header that references FLT_EPSILON. I don't know why this works in VS2010. Maybe because of a precompiled header? Anyway, my fix for now is to redefine FLT_EPSILON just before that boost inclusion and undefine it immediately after. It's in game/MatrixSq.h:

 

Wouldn't it be better than that TDM leaves FLT_EPSILON alone instead of redefining it (with the same value?)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Steve, if you want, I'll copy your info to the wiki for further reference :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...