Jump to content
The Dark Mod Forums

Reckless and Mh's TDM optimizations...


nbohr1more
 Share

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.

 Share

  • Recent Status Updates

    • STiFU

      We are taking our son on his very first holiday trip to see the sea for the first time. 🙂 Will be back in a week.
      · 0 replies
    • Gilkar

      When I was a young man my father was so ignorant I could hardly stand to have him around. As I grew older I was amazed at how much the old man had learned in such a short time.
      · 1 reply
    • jaxa

      RTX 3090 Super, RTX 3070 Ti 16 GB, RTX 2060 12 GB
      https://wccftech.com/nvidia-launching-rtx-3090-super-rtx-3070-ti-16gb-and-rtx-2060-12gb-by-january-2022/
      · 0 replies
    • duzenko

      CPU benchmark time - compiling DarkRadiant (2nd run)
      i5 8600K 6C/6T@4.4GHz DDR4 2x2133MHz 9MB cache
      Parallel builds: 1. 3:57 Parallel builds: 6 (default). 2:28 r5 1600AF 6C/12T@3.3GHz DDR4 1x2666MHz 16 MB cache, temp folder on HDD
      Parallel builds: 1. 5:05 Parallel builds: 4. 2:47 Parallel builds: 6. 2:55 Parallel builds: 12 (default). 2:57
      · 6 replies
    • nbohr1more

      Status updates are back so it is also a good time to return to contests!
      https://forums.thedarkmod.com/index.php?/topic/21095-christmas-connections-contest-2021
       
      · 0 replies
×
×
  • Create New...