Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

I counted and checked more thoroughly... from this angle I can see precisely 10 lights that are turned on, they're all torches or hanging cage fires so not all that high radius or unusual. Tried r_glProfiling but the engine says that cvar or command doesn't exist. r_showtris 3 shows the same thing as 1, 2 however paints more polygons, so here's a new screenshot with 2.

L62WfEK.jpg

Now I wasn't aware that lights create more triangles or cause actual geometry redraws. I'm well aware that high-poly meshes become even more performance intensive when casting shadows obviously, but not that each shadow spawns more triangles used by the GPU. Is this unavoidable? Sounds like something that should be optimized if not so lights can be made to avoid duplicating geometry and use existing data. Anyway this could explain why I get to a high value... 1 million tris though, that still sounds like far more than I should be producing here, though maybe I'm wrong in this case.

Oh, one more thing worth pointing out: While I have no map leaks and all portals are generated accordingly at a first glance, I do have some issue in this area. I had to move a portal because it was flickering and the engine was closing it abnormally. Some of my architecture might be triggering something dmap doesn't understand... may need to make changes just to be sure I'm rid of whatever is producing that, which may or may not be related to my unusual triangle count too.

Link to comment
Share on other sites

Okay: It seems using certain models really can bump the polygon count to 1.000.000 at a shocking pace. In the outdoor area the biggest abuser is me using dozens of instances of the models/darkmod/architecture/fencing/fence_spike_01_tall_4_segments.ase fence: Each has 3376 polygons and sadly offers no LOD model to compensate. I might switch some of them out in favor of models/darkmod/architecture/fencing/springset01_bars128.lwo which covers more areas for fewer polygons and also has a LOD model I can set on the func_static. In the meantime even setting "hide_distance 1500" on all the fence pieces helps, offering a fair balance between the snap distance and lowering the polygon count. Will continue to improve.

Link to comment
Share on other sites

@MirceaKitsune A simple illustration of how tris count grows with lighting. What I have here is an object in a caulked room that is around 380 tris. Look how the tris count grew in comparison to the original number. Especially since ambient + fog is one of the most basic setups, for outdoors in particular. The tris count is almost tripled there already.

Clipboard01.jpg.c9bcf3756fa9e6a179b09e98f836c37d.jpg

Clipboard02.jpg.dc886a0e87ab202c1c2e346b6cb06731.jpg

Clipboard03.jpg.440f907aceeb3db8ff457e49ca14f8df.jpg

Clipboard04.jpg.f01c9cb5d1979e1827d250d723d93e44.jpg

 

Edited by peter_spy
  • Thanks 2
  • Sad 1
Link to comment
Share on other sites

Great demonstration. I never realised the r_showTris output actually took into account per-light rendering, although it makes sense to do so.

So the million-triangle scene might actually be 100k triangles falling within the radius of 10 lights.

  • Thanks 1
Link to comment
Share on other sites

@MirceaKitsune, when @peter_spy said

Quote

That gate at the end of the corridor looks like it uses geometry for all the ornamental pieces instead of alphatest parts, so that might be a culprit as well.

I didn't immediately understand what was meant, but I think he means using a fence or grate texture with transparency, like textures/darkmod/metal/grate/fence_iron_01. This can be applied to one side of a brush (if the gate is immobile) with other surfaces nodraw.

Link to comment
Share on other sites

Throwing another important question in for the meantime: I'm trying to play a set of varied sounds however I don't seem to be able to get it working. Unlike a normal sound that's one file, a sound shader with multiple pieces of audio won't work intuitively: If I enable s_looping it will only repeat one sound in the set over and over again... if I don't then of course it will only play once. city_sounds_varied is an example of one I'm trying to get working on my speaker.

Link to comment
Share on other sites

53 minutes ago, Geep said:

didn't immediately understand what was meant, but I think he means using a fence or grate texture with transparency, like textures/darkmod/metal/grate/fence_iron_01. This can be applied to one side of a brush (if the gate is immobile) with other surfaces nodraw.

I don't know TDM assets much, but typically when you make that kind of ornamental stuff, you try to get away with some transparent cards where players won't notice, so you don't model all the complex stuff on geometry. It's more of a balancing act really.

6 hours ago, MirceaKitsune said:

Tried r_glProfiling but the engine says that cvar or command doesn't exist.

Hmm, r_glProfiling 1 works on 2.08. Did something change in the meantime?

Link to comment
Share on other sites

1 minute ago, peter_spy said:

Hmm, r_glProfiling 1 works on 2.08. Did something change in the meantime?

Yes, starting with 2.10 dev builds, it was replaced with an external profiler. I'll try to write up some documentation for it when I find the time.

  • Like 1
Link to comment
Share on other sites

1 hour ago, MirceaKitsune said:

Throwing another important question in for the meantime: I'm trying to play a set of varied sounds however I don't seem to be able to get it working. Unlike a normal sound that's one file, a sound shader with multiple pieces of audio won't work intuitively: If I enable s_looping it will only repeat one sound in the set over and over again... if I don't then of course it will only play once. city_sounds_varied is an example of one I'm trying to get working on my speaker.

I don't think you can have a single sound shader which loops through more than one audio file continuously.

You can either have a single audio file which loops (e.g. most ambients), or multiple one-shot audio files which get chosen at random when the shader is triggered (e.g. footsteps).

Link to comment
Share on other sites

56 minutes ago, peter_spy said:

I don't know TDM assets much, but typically when you make that kind of ornamental stuff, you try to get away with some transparent cards where players won't notice, so you don't model all the complex stuff on geometry. It's more of a balancing act really.

Hmm, r_glProfiling 1 works on 2.08. Did something change in the meantime?

That's why for huge fences or distant ones the player doesn't get a close look at,  I use a textured face. For smaller fences the player gets a close look at, I use one of the metal fencing meshes... sadly those can end up being quite performance intensive.

15 minutes ago, OrbWeaver said:

I don't think you can have a single sound shader which loops through more than one audio file continuously.

You can either have a single audio file which loops (e.g. most ambients), or multiple one-shot audio files which get chosen at random when the shader is triggered (e.g. footsteps).

I see. DarkRadiant shows the sound shader as containing multiple clips... I suspected that meant s_looping would randomly go through them, however it seems that's not the case. I wonder if having a repeated trigger targeting the speaker would work? Should probably do a better job finding a continuous loop though.

Link to comment
Share on other sites

15 hours ago, OrbWeaver said:

So the million-triangle scene might actually be 100k triangles falling within the radius of 10 lights.

Yup, unfortunately. Also, I didn't show that in the example, but try adding custom { } stage to the material your object uses, and you'll get +1 drawcall and +base amount of triangles again.

12 hours ago, OrbWeaver said:

I don't think you can have a single sound shader which loops through more than one audio file continuously.

You can either have a single audio file which loops (e.g. most ambients), or multiple one-shot audio files which get chosen at random when the shader is triggered (e.g. footsteps).

Haven't worked with sound shaders yet, but I remember I made a melody for Deadly Shadows, where I could use either several parts (different files) looped and chosen at random, or at least the same file played at different pitches. If you can't have such thing in TDM, that would be a good idea for improvement.

  • Like 1
Link to comment
Share on other sites

I have a locked door unlocked with a key. The key is worn by an AI, bound with bind / bindtojoint spawnargs. I understand from the wiki article the AI should automatically be able to unlock the door. Yet when I path my AI to walk through the locked door, they try to open it but it only moves the handle and gives the locked sound and that's it. Am I missing something?

Link to comment
Share on other sites

2 hours ago, roygato said:

Did you add "can_unlock" "door_name" field to the AI? The AI having the key to the door doesn't matter. See this video, from 43:25.

 

That solves it, thanks! Was under the impression that binding the key to a door to an AI will automatically let them unlock it. I presume there's no way to make the AI stop being able to unlock the door once you steal the key from them.

Also I wanted to ask if anyone could please check a little something for me: If you create a func_emitter and give it the model tdm_ceiling_dust.prt, are you able to see the particles in-game? All other emitters work fine for me, whereas this one even has the effect showing in DarkRadiant... for some reason however I cannot see any particles in-game for this one definition.

Link to comment
Share on other sites

About the key and AI. I know that I've had AI with keys that could open locked doors OK, even without "can_unlock" set. (Though I ended up using can_unlock anyway, so that AI paths will still be traversed even if the key is pickpocketed.)

However, given your problem, it may be that only def_attached keys work that way, not ones added using bind.

Link to comment
Share on other sites

Trying to add a number wheel lock (3 digits) to my FM for the first time. I seem to be running into an issue which may be an bug in vanilla TDM, I probably have to work around it doing things differently in my FM for now (let me know how).

I added the entity atdm:combination_lock and gave it a combination as well as targeting the door it's meant to open. Unfortunately the presence of this entity causes a map crash with the following error:

ERROR:Script object 'numberwheel' not found on entity 'idMover_atdm:numberwheel_6595'.

How do you suggest working around this problem? I know this type of number wheel works as I've seen it in other FM's, however I'm assuming it won't be as easy as adding that entity to my map until whatever bug causes that crash is solved.

Edited by MirceaKitsune
Link to comment
Share on other sites

3 hours ago, MirceaKitsune said:

Trying to add a number wheel lock (3 digits) to my FM for the first time. I seem to be running into an issue which may be an bug in vanilla TDM, I probably have to work around it doing things differently in my FM for now (let me know how).

I added the entity atdm:combination_lock and gave it a combination as well as targeting the door it's meant to open. Unfortunately the presence of this entity causes a map crash with the following error:

ERROR:Script object 'numberwheel' not found on entity 'idMover_atdm:numberwheel_6595'.

How do you suggest working around this problem? I know this type of number wheel works as I've seen it in other FM's, however I'm assuming it won't be as easy as adding that entity to my map until whatever bug causes that crash is solved.

1. Open your maps folder and create therein a script-file with the name of your mission (missionname.script) and the following content:

Spoiler

 

void closeBar(entity ent)
{
}

 

 

2. Select a random func-static entity in your mission and give it the name "safe_bar"

 

3. Put the attached scripts in your script folder. Grayman once created them for me. If my recollection is correct, they made sure that the number wheels also work if players had a certain gameplay setting ("Open door on unlock - no" - or something like that).

Not sure if theses three scripts are still needed. You can check the mission without them and try the different setting for Open door on unlock and see if it works now.

 

tdm_custom_scripts.script tdm_numberwheel.script tdm_numberwheel_lock.script

Edited by JackFarmer
Link to comment
Share on other sites

Thanks. Never had a default asset requiring custom scripts to work before. Sounds like they were omitted from TDM... could any dev confirm this perhaps? If the numberwheel entity wasn't available at all I'd assume it just wasn't included in vanilla, but if the def and its model are there yet only the scripts aren't it sounds like a potentially incomplete package.

Also could someone check the model tdm_ceiling_dust.prt please? I'm curious why this one particle model appears to work in DarkRadiant yet in TDM I never see the particles coming from my func_emitter.

Link to comment
Share on other sites

43 minutes ago, MirceaKitsune said:

Also could someone check the model tdm_ceiling_dust.prt please? I'm curious why this one particle model appears to work in DarkRadiant yet in TDM I never see the particles coming from my func_emitter.

My guess is that it's a single-cycle particle designed for triggered events. You can check this via the particle editor.

Regarding the numberwheel system, that was originally made for A New Job, but by oversight the script wasn't pasted over into core TDM from the FM. To fix this permanently, someone would have to create a new copy of the asset using a renamed version of the script so that it doesn't conflict with existing missions that have the original script ( = crash to desktop.)

Link to comment
Share on other sites

5 hours ago, Dragofer said:

Regarding the numberwheel system, that was originally made for A New Job, but by oversight the script wasn't pasted over into core TDM from the FM. To fix this permanently, someone would have to create a new copy of the asset using a renamed version of the script so that it doesn't conflict with existing missions that have the original script ( = crash to desktop.)

I see. Can core not fix it in that case? The official entity could simply reference a different script with a slightly different file / function name.

Link to comment
Share on other sites

Need help with another one. I'm trying to attach an atdm:loot_amulet_wearable to an AI and a ragdoll using bind and bindtojoint. The loot sticks but there's a problem: For the living AI it randomly causes it to spin in place as if disoriented, whereas the ragdoll will jump all over the place like crazy. This seems to be due to the wearable's collisions.

I tried setting "noclipmodel 1" and "solid 0", however both of these cause the model to no longer be frobable therefore the loot can't be picked up. How do I disable collisions on attachments but without disabling frobbing too?

Edited by MirceaKitsune
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...