Jump to content
The Dark Mod Forums

Recommended Posts

Posted (edited)

I'm trying to get DR to work with my Godot projects, to replace TrenchBroom, but my first attempts haven't been fruitful. I need DR to see my project's textures, 3D models and entity definitions. I told DR where to find my game in the Game Setup window, but I'm having some issues.

As far as entities go, I think I'm probably fine. I unpacked a few of TDM's .pk4 files and found the folder def with many .def files. I tried placing misc.def and tdm_base.def in there, to see if DR would load those entities after restarting, and it does but only if the game type is TDM. I'm probably fine with that, as it makes no difference, as far as I can tell. The Godot importer only cares about the contents of the .map file, which I know I can export in a few formats, so that should be fine (Q3 at least should work fine).

However, DR is not seeing my project's textures. I don't know if DR can work with .png files, but I brought in some .tga files from TDM for testing and DR doesn't see them either. So something is missing, but I don't know what it is.

I tried placing the textures in a textures folder at the project's root, but nothing happened. Although ideally I'd like to have the textures in root/assets/textures.

I haven't tried to use 3D models at all yet, so I'm in complete darkness about that. I wonder what formats DR supports, though. I usually work with .obj, which bypasses Godot's import weirdness.

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted (edited)

Ok, so I remembered that TDM textures are declared in mtr files in the materials folder, so I copied over `tdm_internal_engine.mtr` and it works. DR sees textures, but... only .tga files. The console has quite a few lines like: "[shaders] Unable to load texture: textures/tool/clip.png", referring to my own textures.

Can DR not work with png files?

 

EDIT: I presume it can, and maybe it has to be set in the game config file, but I have a very feeble understanding of those files, and I can't find any information anywhere on how to set them up. I've used NRC a bit, which uses the same kind of game config files, and I also had trouble detecting textures. But the only way I could get it to work was... the NRC developer gave me a working config that could see my textures.

So... I'm not very confident that I'm gonna get this working on my own.

I tested the NRC game config in DR, but nothing seemed to change.

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted
13 hours ago, Skaruts said:

So... I'm not very confident that I'm gonna get this working on my own.

Is the png issue your only problem?

 

15 hours ago, Skaruts said:

I haven't tried to use 3D models at all yet, so I'm in complete darkness about that. I wonder what formats DR supports, though. I usually work with .obj, which bypasses Godot's import weirdness.

afaik DR suports lwo and ase. obj is supported by tdm, but afaik not by DR yet.

Posted

Yea, it seems models are going to be a problem. DR doesn't detect gltf or dae. It does detect obj, but crashes as soon as I click the model. 

I don't know if I can work with lwo or ase in Godot, but I don't even have plugins for that in blender. I've only made one model for TDM once, and it was back in Blender 2.79. 

 

As far as textures go, I suppose it's not much of a problem. I could work with tga. It's just that free textures are usually distributed in jpg or png, so working with .tga requires going through the trouble of converting each of them (base texture plus normal map, ao map, rough map, etc).

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted (edited)

Yeah DR should definitely support more formats, especially at least one that is supported by other open source engines like Godot.

Quote

Godot supports the following 3D scene file fomats:

  • DAE (COLLADA), which is currently the most mature workflow.
  • GLTF 2.0. Both text and binary formats are supported. Godot has full support for it, but the format is new and gaining traction.
  • OBJ (Wavefront) formats. It is also fully supported, but pretty limited (no support for pivots, skeletons, etc).

 

 

Edited by datiswous
  • 2 months later...
Posted

DarkRadiant does not care about engines at all, it only cares about file formats. Whether you can use DR with your Godot-based game will therefore depend on whether your game's assets are arranged in the same way as TDM.

More specifically:

  • Your game will need to read map data from the Doom 3 .map format. If it does not, there will be no way to save your map from DarkRadiant in a form that your game can access. Export to OBJ is available but if all you want to do is produce OBJ models then DarkRadiant isn't the right tool for the job (you should use a proper 3D modelling app like Blender/Max/Maya/LightWave etc).
  • Your game assets will need a tree of .def files defining important entities to be placed in your map, including certain "fixed" entity types which are used directly by DarkRadiant itself. There will need to be a light entity defining light volumes, a func_static entity defining a static model, an info_player_start entity to define the starting position, a speaker entity to define sound sources, and probably several others. If these entity types are not defined, then built-in features like "Create light" and "Place player start here" will not work correctly.
  • Your game will need a tree of .mtr files defining material shaders, referring to image paths which will be resolved to either uncompressed .tga files in a textures/ hierarchy, or compressed DDS files in a dds/ hierarchy. If these material shaders are not defined, no materials will appear in DarkRadiant. DR does not make any attempt to load "raw" image file hierarchies which are not referred to by material shaders.
  • Your game will need to define a hierarchy of 3D models in ASE or LWO format. No other formats will show up in the model selector. These models can be stored directly on disk (there is no "model shader" tree required like with materials).
  • Like 1
Posted (edited)
55 minutes ago, OrbWeaver said:

Your game will need to define a hierarchy of 3D models in ASE or LWO format. No other formats will show up in the model selector. These models can be stored directly on disk (there is no "model shader" tree required like with materials).

I read @greebo stated obj is also possible, but it has to be specified in a config file..

Edited by datiswous
  • 2 weeks later...
Posted (edited)

I agree with @OrbWeaver, IMO DR is not the right tool to make models for Godot or any other engine using triangle mesh's only, if anyone wants a simple and relatively easy 3D tool (but still very powerful in the right hands) to make models, I personally recommend Wings3D instead, is free as Blender, way less complex (no animation/bones support) and it supports obj, collada, and other formats.

Edited by HMart
Posted (edited)

Oh my, I completely forgot about this.

@OrbWeaver I actually got DR to work fine with png images and obj models.  Seems like it supports them fine, as long as the mtr files are correct. Greebo helped me out on discord.

Also got it to be compatible with Godot's importer plugins by exporting as Quake 3 format (as long as there's no complex geometry, like patches, etc, it seems to work).

 

The only reason I didn't keep using DR, is because DR doesn't seem to store the game's path properly. When you switch game setup, the path remains the same, so you have to manually set the path every time you switch project. 

I tried having separate portable DR installations for each project, but it seems DR isn't properly portable either, as the game setups are also stored globally. So that didn't work either.

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted (edited)

I wonder if you could use a sandbox for 2 portable editions.

Edit: I tried this with sandboxie and that works. But I read below it isn't necessary.

Edited by datiswous
Posted
16 hours ago, Skaruts said:

I tried having separate portable DR installations for each project, but it seems DR isn't properly portable either, as the game setups are also stored globally. So that didn't work either.

You can create shortcuts to DR, passing an fs_game=your_fm parameters to DarkRadiant.exe, e.g.

DarkRadiant.exe fs_game=fms/yourmission

It will override the setting saved to the user.xml file in your settings folder. Works with fs_game_base as well.

  • Thanks 2
  • 5 weeks later...
Posted (edited)
On 1/19/2024 at 10:00 AM, greebo said:

Works with fs_game_base as well.

I was just giving this another go, and it seems neither fs_game nor fs_game_base set the actual engine's path. This is the problem I was having before.

Looking at other game types in the drop down menu (in the Game Setup window), some of them show that fs_game sets the "Mod" (Mission ) and fs_game_base sets the "Mod Base", and not the "Engine Path".

(fs_game is actually useful for Dark Mod mapping, though, for working on multiple projects. Thanks a lot for that. 👍)

 

What I really need is to launch DR with an engine path (and no Mod or Mod Base at all)

Is there a parameter to do that? 

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

  • 1 month later...
Posted (edited)

So..., texture issues are being the only road block I'm having so far in trying to use DR with Godot, but I'm not exactly sure why yet. 

However, I've noticed when exporting maps in quake3 format, that the texture values don't match the ones in the editor.

image.png.93cf802dd4baa56e375a919972fae77a.png

This is the door face in the map file:

                                                                                 hs  vs  rot  hscale vscale
( 24 64 0 ) ( -24 64 96 ) ( 24 64 96 ) darkmod/door/wood/board_brown_nails_hinge 64 256 -180 -0.375 -0.375 0 0 0

The horizontal shift is the only correct value.

Is this a bug?

 

 

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted

When you say the value is not correct, do you mean it actually gives wrong results in the Q3 engine, or it just "looks wrong" when examining the text file?

If it's the former, then that's arguably a bug (although supporting Q3 isn't top priority for DR). If it's the latter, then that doesn't really mean much at all — raw numbers in a map file don't necessarily correspond directly to values shown in the GUI, especially when transformations are involved (for example the -180 might be a rotation to match the default orientation in a particular engine).

Posted (edited)

I'm not using the Quake 3 engine, I'm using the Godot engine. The results seem ok, except when faces are slanted, but I'm not sure why it happens. I'm trying to find out. I don't know anything about the Q3 engine, so I'm not the one to say what's correct and what isn't about the map format. When I said "correct", I just meant that it's the same value that is displayed in the editor.

But there are differences between the Q3 format from DR and from other editors I've tested, like TrenchBroom and NetRadiant Custom. They keep the texture values as they are in the editor. One other difference is that DR exports entity brushes with coordinates relative to the `origin` spawnarg, for example. Though DR is also the only editor that enforces the `origin` spawnarg.

(I know there are two Q3 formats, and I'm using the equivalent one on all editors.)

I'm importing maps into Godot using a plugin. I've made some changes to it to accommodate for the differences in the map format and some editor specific stuff (e.g. DR uses "rotation" matrices instead of euler "angles").

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted (edited)

Actually I think I found what's causing issues with my textures: DR changes the texture's Horizontal and Vertical Shift when a face gets slanted.

E.g., my test door is facing -Y and sitting flat on the ground, which is at 0 in Z, so the v-shift is 0. When I move the bottom vertices of the door 8 units forward, and then re-fit the texture, the v-shift turns to 4 (3.97241). If I do the same but backward, the v-shift turns to 90.7035. But these values depends on the distance the face is from the world origin, and sometimes if I move the top vertices instead, the values don't change. I can't make sense of it...

The other editors don't do this, so the plugin's import code doesn't account for it.

Do you think you could help me understand the logic behind this? If I could understand it, maybe I could get the plugin working with it. 

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted
21 hours ago, Skaruts said:

I'm importing maps into Godot using a plugin. I've made some changes to it to accommodate for the differences in the map format and some editor specific stuff (e.g. DR uses "rotation" matrices instead of euler "angles").

Could you store that somewhere? For example in Github. I'm learning Godot at the moment and might be interested in this in the future.

Posted
20 hours ago, Skaruts said:

Do you think you could help me understand the logic behind this? If I could understand it, maybe I could get the plugin working with it. 

I can certainly help to locate and identify the relevant code, but I didn't write it myself and I'm not really a maths guy so the help I can provide with respect to its logic might be limited.

Posted (edited)
5 hours ago, OrbWeaver said:

I can certainly help to locate and identify the relevant code, but I didn't write it myself and I'm not really a maths guy so the help I can provide with respect to its logic might be limited.

Might be worth a try.

I browsed the source code yesterday a little, but I had no idea where to even start looking for it. 

 

6 hours ago, datiswous said:

Could you store that somewhere? For example in Github. I'm learning Godot at the moment and might be interested in this in the future.

I've been building a sort of starter-project for it, but it's not public yet. But my support for DR is not ready for production or anything. Everything seems to work fine, except I'm having issues with textures, and tbh I'm not sure I'm gonna make it. I am about to make my repo public regardless of that, though, but I still need to get a lot of stuff in order. 

Meanwhile, if you'd like to move forward without DR, you could try NetRadiantCustom or TrenchBroom. Personally I recommend NRC (although TB might be a bit easier to start with).

The plugin I'm using is FuncGodot (formerly known as Qodot). It's currently the most recommendable.

 

Patches and NURBS aren't supported by any plugins yet, btw.

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted
On 4/12/2024 at 3:29 PM, Skaruts said:

I browsed the source code yesterday a little, but I had no idea where to even start looking for it.

This appears to be the function which calculates the texture values for Q3 export:

https://gitlab.com/orbweaver/DarkRadiant/-/blob/master/radiantcore/map/format/Quake3Utils.h?ref_type=heads#L56

It's largely based on legacy GtkRadiant code and means absolutely nothing to me.

  • Thanks 1
  • 9 months later...

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

    • jivo

      I just uploaded a new version of the Visible Player Hands mod. It's been updated for TDM 2.13 and has new animations. Check out the post if you're interested!
      · 0 replies
    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 5 replies
×
×
  • Create New...