Jump to content
The Dark Mod Forums

Automatically select active mission based on the map being edited


Recommended Posts

Figured I'd ask about this here before posting on the bug tracker, there might be a reason why it hasn't been done yet. Let me explain my reasoning first:

When creators are working on multiple FM's at once, each one will obviously be located in its own directory. Most FM's contain custom assets and definitions, when working with maps in DarkRadiant you need to select their data folder for additional defs. This is done by going to File - Game / Project Setup - Mission and selecting it there.

Screenshot_20221124_162508.png.d362333067e8c47eea8fbac2dceedcf7.png

The issue: Let's say you want to take a break from one FM and work on another. Each time you load a map from a different FM, you also need to go to that menu and select it from there, otherwise custom assets won't be detected and appear as missing in DR. This is quite a bit of an annoyance.

Suggestion: Is it not possible to detect and automatically select the active mission from the path the map is located in? We know every map should be located in "darkmod/fms/name/maps", so why not automatically extract the maps directory and set that to "darkmod/fms/name"? If there's an issue with getting such detection right, we can at worst simply store this information in the map.darkradiant file, so even if the player needs to first select it manually the choice is remembered per map and automatically reverted when you load it.

We could technically do this with the other settings in that menu, such as Game Type and Darkmod Path. Not sure how much we need it for those unless someone is working with multiple installs and wants the convenience. Sounds good if doable but the important one is the mission directory as that must always be changed with the map you're editing.

  • Like 1
Link to comment
Share on other sites

Changing the project/game setup and paths is a pretty massive change from DR's perspective. Almost everything needs to be re-initialised when setting the paths, which sometimes takes longer than a clean restart. (For similar reasons, the TDM engine itself needs to be restarted completely when you install a FM.) DR is able to make that leap while keeping the same process alive, but it's a very expensive step, and it's better to restart to clean up any resources that are left behind when switching configs (for instance, all defs that have been loaded from another map/project are kept in memory.)

From a design perspective, I'd rather not have loading a map implicitly change the whole project setup. At some points it might not be deducible or even wanted to have the paths changed on map load.

When regularly switching between projects, a possible help might be to create separate DarkRadiant shortcuts, passing the FM project path as argument to DarkRadiant.exe.

 

 

  • Thanks 1
Link to comment
Share on other sites

53 minutes ago, greebo said:

Changing the project/game setup and paths is a pretty massive change from DR's perspective. Almost everything needs to be re-initialised when setting the paths, which sometimes takes longer than a clean restart. (For similar reasons, the TDM engine itself needs to be restarted completely when you install a FM.) DR is able to make that leap while keeping the same process alive, but it's a very expensive step, and it's better to restart to clean up any resources that are left behind when switching configs (for instance, all defs that have been loaded from another map/project are kept in memory.)

From a design perspective, I'd rather not have loading a map implicitly change the whole project setup. At some points it might not be deducible or even wanted to have the paths changed on map load.

When regularly switching between projects, a possible help might be to create separate DarkRadiant shortcuts, passing the FM project path as argument to DarkRadiant.exe.

Thanks for the explanation. My only remaining curiosity then: Would it make sense to offer it as an option still (off by default) for those who don't find a performance an issue? I haven't noticed much additional reload time when changing the active FM in DarkRadiant so I could likely use it well. But I can understand why this change might not be possible.

And I'd love to know what that command line parameter for DarkRadiant is! I use Linux but presume they're named the same way as the Windows exe. I already use a custom shortcut to launch TDM for testing my FM without changing the selected FM, via the super helpful "+set fs_currentfm my_fm_name" argument: I take it for DR it's something similar?

  • Like 1
Link to comment
Share on other sites

6 hours ago, datiswous said:

This works well (tested under Linux), thanks. You do have to specify it for all shortcuts, because the shortcut changes the setting for all future startups of DR (until another shortcut changes it).

Is there also a parameter to load the map in cause? For single-map FM's this would also make the shortcut open exactly the map you need so you don't have to look for it and open separately.

Link to comment
Share on other sites

11 hours ago, greebo said:

I think you can just pass the map file name along as another argument.

Got it, tested and it works! For anyone else looking to use this trick, these are the full arguments you need to pass to your shortcut and add after darkradiant.exe, obviously for your respective FM and OS:

/home/mircea/Games/Quake/TheDarkMod/darkmod/fms/testing/maps/test.map fs_game=fms/testing

Note that for thedarkmod.exe you need a different format for some reason, it's "+set var val" instead of "var=val".

+set fs_currentfm testing

But you can't use the Recent Files list to jump between editing FM's and have it automatically work: If my suggestion is possible as an option I hope you can keep it in mind. For now I'll add those shortcuts to every FM I'm editing which helps!

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

    • peter_spy

      Perhaps an unpopular opinion: TDM team might benefit from someone with actual QA experience; someone with naturally and professionally developed curiosity, who is interested in how and why things work, how they break At least to me it's kind of mind-boggling how untested some rather important features are (first the absence alert feature for items, now the rope +body carry behavior).
      · 4 replies
    • nbohr1more

      The Dark Mod is hosting an Ask Me Anything thread on the PC Gaming reddit forum:  https://www.reddit.com/r/pcgaming/comments/10nfcwj/hello_we_are_the_international_development_team/
      Feel free to join the discussion there
      · 2 replies
    • stgatilov

      Bumped into an interesting piece of wisdom called Hyrum's Law:
      With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.
      · 5 replies
    • The Black Arrow

      I love playing The Dark Mod when it's cold in my place. Bonus points when it's a bit (or even very) dark and it's raining, too.
      · 2 replies
    • The Black Arrow

      I've been having stutters in Vulkan, apparently it's Nvidia Drivers' fault, so I reverted to 512 according to this: https://www.nvidia.com/en-us/geforce/forums/geforce-graphics-cards/5/505679/regular-microstutter-in-vulkan-applications-after-/?topicPage=40

      And no, that did NOT fix it. What's going on? My GPU is an RTX 2070, by the way.
      · 4 replies
×
×
  • Create New...