Jump to content
The Dark Mod Forums

Reckless and Mh's TDM optimizations...


nbohr1more

Recommended Posts

I've been in communication with a couple of coders over at Inside3d forums.

 

"Reckless" appears to be a junior C++ coder with a lot of enthusiasm for experimenting while "Mh" is a well known Quake engine coder. I wont go crazy and get any hopes up but Reckless claims to be working to merge Mh's and his own latest engine optimizations into the TDM sources.

 

I will post the results here should they be viable.

 

That said, Reckless felt that he should share the following code regarding the DLL loader:

 

 


/*
==============
Sys_Mkdir
==============
*/
void Sys_Mkdir(const char *path)
{
  int      ret;
  char   *dup, *c;

  ret = _mkdir(path);

  // if it allready exists no need to recreate it.
  if (!ret || (errno == EEXIST))
  {
     return;
  }
  dup = _strdup(path);

  c = dup;

  // unix path magic
  if (*c == '/')
  {
     c++;
  }

  while (*c)
  {
     if (*c == '/')
     {
        *c = '\0';

        ret = _mkdir(dup);

        if (ret && (errno != EEXIST))
        {
           Sys_Error("ERROR: Can not make path %s %s (%s)\n", dup, path, strerror(errno));
        }
        *c = '/';
     }
     c++;
  }
  ret = _mkdir(dup);

  if (ret && (errno != EEXIST))
  {
     Sys_Error("ERROR: Can not make path %s (%s)\n", dup, strerror(errno));
  }
}

 

I noticed you used boost for some unix path magic in the DLL loader so heres a mkdir that also handles that

 

I'll keep this thread cooking as long as the replies are forthcoming...

  • Like 1

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

Does this mean this code from his replaced a bit of boost code? That would be cool, one step towards getting rid of boost.

"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

Yes, his reply is a little unclear but it seems that's what he's saying. He is stream-lining the process by writing it natively rather

than relying on boost.

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

Sounds good to me. But apparantly my opinion regarding these things doesn't count for much these days, so I don't know how to proceed from here.

"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

Well, I hate to bring any contentious topics to the fore but I am genuinely curious about the merits

and pitfalls on either side. From what I gather, Boost has a lot of pre-made thread safe MP code

that would be tough to write from scratch. OTOH, I do recall a discussion at work about code bloat in modern

apps and that the general consensus was that reliance on lots of large libraries for small code segments

was one of the prime culprits. Though I guess that's not what is really driving the contention here...

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

Using basic functions is always better than relying on libraries, that might become outdated or obsolete eventually. However, the problem here was that boost was responsible for compiling issues under linux a couple of times. That's all. But to my understanding, getting rid of boost is not a quick and easy thing to do.

 

By the way, I had been meaning to ask whether Sikkpin is working on the D3 code as well. I would love to see some engine improvements from his side. :)

Link to comment
Share on other sites

Using basic functions is always better than relying on libraries, that might become outdated or obsolete eventually. However, the problem here was that boost was responsible for compiling issues under linux a couple of times. That's all.

 

It is much more than "compiling problems". The boost library is tied to the compiler version and libraries you use.

 

So if you:

 

* compile TDM on a long-term support (5 years!) Kubuntu/Ubuntu version, it will run there, but not on anything 2 years newer

* if you compile TDM on the newest Ubuntu/Kubuntu, it will run there, but (very likely) not on the version released next year, and definitely it won't run on the long-term support version from 3 years ago, or maybe even not on the Ubuntu from last year (we already had exactly that problem with v1.08)

* if you compile it on a version from last year, there is a good chance it will run on the long-term, the current and hopefully not break next year (what we did with v1.08)

 

The basic problem is that it is a moving target, you always have to recompile, to choose the system for recompiling, and it will still break next year, anyway. And by break I mean "not even start".

 

This is just Ubuntu, other linux archs like Arch, Gentoo etc all complicated this even further, because they might use older and/or newer boost libraries on the system.

 

Yeah, removing boost might not be easy, but since original D3 lives entirely w/o it, I don't see why we can't. But don't blame me for adding it, because I'd never started using it inthe first place. It's not that I want to re-invent everyting, but using such a huge library (the include/boost library of TDM is roughly 220 Mbyte with the .svn overhead) which needs constant maintaince is just not worth it. You safe some time not implementing some features, and spent a lot more time baby-sitting the failures afterwards... Just my 0.02€, of course.

 

(That we do have some bugs that are caused by boost code and that we can't really fix is another matter. They are not that important compared to "TDM will not run", tho).

"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

    • 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...