Jump to content
The Dark Mod Forums

A few questions from a first time mapper


Recommended Posts

I’m creating my first FM for any game ever. I’ve got the bulk of the mission completed and have a handful of things to left to add and tweak. I have a few questions which might have simple solutions.

1. I’ve created a manor/mansion and it starts with all of the lights off. I have a circuit breaker that restores power and therefore most of the lights will turn on. I know this can be done by setting the lights “start_off” to 1 and connecting all of the lights to the switch. I have started to create a nested solution. Every light in a section of the manor is connected to a hidden switch, that switch is then linked to the main circuit breaker switch. This means only a handful of switches are linked to the main circuit breaker rather than every light in the whole manor.

With the lights setup this way, it means I can’t have any light switches around otherwise you could turn the lights on with having the main power switched on.

Is there a more efficient/better way of setting this up?

2. This also leads to another problem, I have an electric elevator that is operated by a button but I only want it to operate when the circuit breaker (power) is on.

3. I have also noticed some models have a weird brightness to them. Check the examples below. I have tested creating a patch with the same texture and the brightness stays the same. Is there a way of darkening the texture on a patch or some other method of making all of the stained glass windows the same?

4. Is there a way of darkening transparent glass? All of the transparent glass I have tested has a glow when in the dark with only ambient light. See pic attached. can I change the colour of the glass?

5. Is there a way of darkening or changing the colour of water? I have changed the surface texture to dark water but it’s not dark enough. I also want to be able to change the colour. I see it mentioned that you can change the color keyword but I have no idea how to do that.

6. Is there any benefit to export multiple entities to create a single model? That model can then be added and all of the entities deleted. I know a downside would be that tweaking individual entities can’t be done if they are a single model.

Thanks

Sorry if some of these questions have been answered in the wiki/faq or in this forum somewhere.

 

1manor_2020-11-02_20.32.jpg

1manor_2020-11-02_20.37.43.jpg

1manor_2020-11-02_20.35.jpg

  • Like 2
Link to post
Share on other sites

I can answer number 6. Entity limit of about 8100 or so. In my big map I’m working on I’ve hit the limit several times. Combining models within visleafs will drop your count thus freeing up more room to get creative.  But yes the downside is you better make sure you’ve got them right where you want them for good before combining/exporting.

As for water, when applying a texture look under the folder ‘water_source’ or something like that. I do wish choosing water color was like choosing a light color.


Please also see the Newbie Radiant Thread, it’s pretty damn active, I’d say there questions asked and promptly answered several times a day on a good week. Also the TDM Discord has its moments,  but ther is almost always someone online.

Edited by Jedi_Wannabe
  • Like 1

As my father used to say, "A grenade a day keeps the enemy at bay!"

Link to post
Share on other sites
3 hours ago, ddaazzaa said:

3. I have also noticed some models have a weird brightness to them. Check the examples below. I have tested creating a patch with the same texture and the brightness stays the same. Is there a way of darkening the texture on a patch or some other method of making all of the stained glass windows the same?

There are two reasons for this. Some materials have "blend add" (emissive) stage, so the surface looks lit without placing a light source nearby. This is typically used for windows, lamps and glowing surfaces. The other example is cubemap reflection – it's more pronounced when a light source is absent. If you don't want such effects, you need to override material definitions for these surfaces.

Link to post
Share on other sites
10 hours ago, ddaazzaa said:

I’m creating my first FM for any game ever. I’ve got the bulk of the mission completed and have a handful of things to left to add and tweak. I have a few questions which might have simple solutions.

 

1. I’ve created a manor/mansion and it starts with all of the lights off. I have a circuit breaker that restores power and therefore most of the lights will turn on. I know this can be done by setting the lights “start_off” to 1 and connecting all of the lights to the switch. I have started to create a nested solution. Every light in a section of the manor is connected to a hidden switch, that switch is then linked to the main circuit breaker switch. This means only a handful of switches are linked to the main circuit breaker rather than every light in the whole manor.

 

With the lights setup this way, it means I can’t have any light switches around otherwise you could turn the lights on with having the main power switched on.

 

Is there a more efficient/better way of setting this up?

 

2. This also leads to another problem, I have an electric elevator that is operated by a button but I only want it to operate when the circuit breaker (power) is on.

You could achieve this by having each switch have no target at map start and have the circuit breaker target a trigger that then adds the lights as targets (apart from turning the lights on) via the Stim/Response system. If you have not worked with the Stim/Response system so far, just ask, then I can give you some pointers or check out the Wiki page, if you would rather infrom yourself. The disadvantage is, that you would have to set this up manually for each switch and the according light. Do you intend that the circuit breaker can be turned off again or the "turn on" permanent? The former case may be a bit more complicated.

  • Like 2
Link to post
Share on other sites
On 11/2/2020 at 10:59 AM, ddaazzaa said:

I’m creating my first FM for any game ever. I’ve got the bulk of the mission completed and have a handful of things to left to add and tweak. I have a few questions which might have simple solutions.

 

1. I’ve created a manor/mansion and it starts with all of the lights off. I have a circuit breaker that restores power and therefore most of the lights will turn on. I know this can be done by setting the lights “start_off” to 1 and connecting all of the lights to the switch. I have started to create a nested solution. Every light in a section of the manor is connected to a hidden switch, that switch is then linked to the main circuit breaker switch. This means only a handful of switches are linked to the main circuit breaker rather than every light in the whole manor.

First I don't work with TDM engine, so don't take my advice as gospel, I do work with another idtech 4 version of the engine and most of it is more or less the same. 

Now making lights not turn all at the same time, like Destined said can be done using triggers, simple example https://wiki.thedarkmod.com/index.php?title=Lever,_switch,_2-way_target_sets

With the lights setup this way, it means I can’t have any light switches around otherwise you could turn the lights on with having the main power switched on.

Is there a more efficient/better way of setting this up?

2. This also leads to another problem, I have an electric elevator that is operated by a button but I only want it to operate when the circuit breaker (power) is on.

Again use triggers.

3. I have also noticed some models have a weird brightness to them. Check the examples below. I have tested creating a patch with the same texture and the brightness stays the same. Is there a way of darkening the texture on a patch or some other method of making all of the stained glass windows the same?

Like others have said this is because the material has a blend add stage or a cubemap stage. Btw a peace of advice, materials can have many stages the more stages it has, more draw calls it needs and the heavier the material becomes to render.

4. Is there a way of darkening transparent glass? All of the transparent glass I have tested has a glow when in the dark with only ambient light. See pic attached. can I change the colour of the glass?

5. Is there a way of darkening or changing the colour of water? I have changed the surface texture to dark water but it’s not dark enough. I also want to be able to change the colour. I see it mentioned that you can change the color keyword but I have no idea how to do that.

There's multiple ways to change the look of a surface in idtech 4 but most of them require overriding the original material by your own or the original material has the option to change colors or turn off stages, read this https://wiki.thedarkmod.com/index.php?title=Material_Files

Or if possible and the material supports it, using spawnArgs https://wiki.thedarkmod.com/index.php?title=Color

Or shader parms.  https://wiki.thedarkmod.com/index.php?title=List_of_shaderParm_variables but this one imo requires more advanced knowledge like scripting. 

6. Is there any benefit to export multiple entities to create a single model? That model can then be added and all of the entities deleted. I know a downside would be that tweaking individual entities can’t be done if they are a single model.

Not sure what you mean by this, are you saying exporting to blender or such? 

If yes, first IMO that is not easy to do, entities are made of many submodels, some even invisible, like collision models and shadow models, they also have many different materials, imo exporting them to blender (or other) will be hard to manage, but is possible and if you are willing to do that, there's something to keep in mind. The engine uses the entity bounding box, for visibility culling and for light interaction testing the entity surface triangles, if you have many static models in a single entity the BB will be huge and if just a small part of it is "visible" to the player (through a wall or such) or a single triangle of a model within the entity "group" gets light, then the entire entity will be rendered! Afaik even if behind a closed portal. And depending on the amount of models, in the entity that could mean, many polygons and material drawcalls.  But if you can solve those problems, than putting many static entities in a single entity, has big benefits, one is the ability to put more models in the level and be able to stay bellow the max entity count. 

Hope this helps. 

Thanks

Sorry if some of these questions have been answered in the wiki/faq or in this forum somewhere.

 

 

Edited by HMart
  • Like 2
Link to post
Share on other sites
20 hours ago, Jedi_Wannabe said:

I can answer number 6. Entity limit of about 8100 or so. In my big map I’m working on I’ve hit the limit several times. Combining models within visleafs will drop your count thus freeing up more room to get creative.  But yes the downside is you better make sure you’ve got them right where you want them for good before combining/exporting.

As for water, when applying a texture look under the folder ‘water_source’ or something like that. I do wish choosing water color was like choosing a light color.


Please also see the Newbie Radiant Thread, it’s pretty damn active, I’d say there questions asked and promptly answered several times a day on a good week. Also the TDM Discord has its moments,  but ther is almost always someone online.

I've seen those water source textures and but there's only a couple of different colors. Not hugely customizable from what I can see.

20 hours ago, peter_spy said:

There are two reasons for this. Some materials have "blend add" (emissive) stage, so the surface looks lit without placing a light source nearby. This is typically used for windows, lamps and glowing surfaces. The other example is cubemap reflection – it's more pronounced when a light source is absent. If you don't want such effects, you need to override material definitions for these surfaces.

So basically I could make it a custom map specfic texture and create a material file without blend add. I suppose I should refer to the wiki "How to add Textures to The Dark Mod".

12 hours ago, Destined said:

You could achieve this by having each switch have no target at map start and have the circuit breaker target a trigger that then adds the lights as targets (apart from turning the lights on) via the Stim/Response system. If you have not worked with the Stim/Response system so far, just ask, then I can give you some pointers or check out the Wiki page, if you would rather infrom yourself. The disadvantage is, that you would have to set this up manually for each switch and the according light. Do you intend that the circuit breaker can be turned off again or the "turn on" permanent? The former case may be a bit more complicated.

I had a quick look into that and it looks like it's a complex solution. It's probably my lack of understanding exactly how it works. I'll have a further look when I have more time.

10 hours ago, HMart said:

There's multiple ways to change the look of a surface in idtech 4 but most of them require overriding the original material by your own or the original material has the option to change colors or turn off stages, read this https://wiki.thedarkmod.com/index.php?title=Material_Files

Or if possible and the material supports it, using spawnArgs https://wiki.thedarkmod.com/index.php?title=Color

Or shader parms.  https://wiki.thedarkmod.com/index.php?title=List_of_shaderParm_variables but this one imo requires more advanced knowledge like scripting. 

 

Not sure what you mean by this, are you saying exporting to blender or such? 

 

I didn't realise that changing the water color would be quite complicated.

I was referring to the "export selected as model" within dark radiant. You can select multiple static entities and create a single model you can then insert that model back into the map and delete all the individual entities.

Thanks guys for the suggestions I'll see what I can get done, ultimately none of these things are mission breaking and I can leave as is and/or work around it. Once I'm ready to release a 'pre-alpha', whatever questions/problems remain, others might be able to check the map and see if the are able help.

  • Like 1
Link to post
Share on other sites
25 minutes ago, ddaazzaa said:

So basically I could make it a custom map specfic texture and create a material file without blend add. I suppose I should refer to the wiki "How to add Textures to The Dark Mod".

No, you don't even have to make custom textures, you just need to copypaste material definition files to your project (using the TDM assets folder structure), and modify the files, so that the blend add stage or cubemap stage is reduced or deleted. The copy of material files in your project will override the default TDM ones, as long as you keep the path and file name.

Edited by peter_spy
Link to post
Share on other sites
21 minutes ago, peter_spy said:

No, you don't even have to make custom textures, you just need to copypaste material definition files to your project (using the TDM assets folder structure), and modify the files, so that the blend add stage or cubemap stage is reduced or deleted. The copy of material files in your project will override the default TDM ones, as long as you keep the path and file name.

Ah ok, makes sense. Thanks.

Link to post
Share on other sites

1. Lightswitches and elevator buttons.

A push button has spawnarg: trigger_when_opened : 1 and the flip swiches have: trigger_when_opened : 1 and trigger_on_close : 1

For the push button you could set trigger_on_close to 0 so the swich seems to work normally, but it won't trigger. At the moment the power is restored you can trigger a target_setkeyval to set that value back to 1, so the buttons wil trigger from that moment. The target_set keval has to be triggered by something and should be targeting all buttons. The spawnarg to add in the target_setkeval should be: keyval : trigger_when_opened;1

If you want to use the 2 state flip swiches there is the problem that, if the player flipped one already it will work in reverse when the power is restored/the swiches start triggering.

What you could do is set it up as with the pushbutton but hide this button (texture nodraw), have the swich trigger the button, and set the swich spawnarg auto_close_time to 0. This way the swich wil get back to it's initial position when swiched and the player will also think something is wrong You now need an other target_setkeyval to set auto_close_time to -1 (don't auto close) when the power is restored.

 

 

Edited by STRUNK
Link to post
Share on other sites

Hey there, I can help with a couple of these things.

  • The light switch/  main power can be done fairly easily with some  scripting. You mind PM'ing me your FM? I can have a look and probably work up a script solution for ya. 
  • As far as I know, brightness on most textures can't be edited in DR, unless they have special properties on them (shaderParms). 
  • Combining meshes or models together helps reduce entity count and sometimes performance or just for convenience.
  • The entity limit is around 8k but you want to save between 1 - 1.5k for other stuff that gets spawned in.
  • Like 1
Link to post
Share on other sites
3 hours ago, kingsal said:

brightness on most textures can't be edited, unless they have special properties on them (shaderParms)

You can use blend add stage,  _white system texture, and rgb parameter to add brightness to the material, although it will be independent from lighting conditions (so glowing in the dark with stronger rgb values). You can also use blend filter stage with _black system texture and rgb parameter to darken a material, as with Multiply layer mode in 2d editing software.

 

Edited by peter_spy
Link to post
Share on other sites
4 hours ago, kingsal said:

Hey there, I can help with a couple of these things.

  • The light switch/  main power can be done fairly easily with some  scripting. You mind PM'ing me your FM? I can have a look and probably work up a script solution for ya. 
  • As far as I know, brightness on most textures can't be edited in DR, unless they have special properties on them (shaderParms). 
  • Combining meshes or models together helps reduce entity count and sometimes performance or just for convenience.
  • The entity limit is around 8k but you want to save between 1 - 1.5k for other stuff that gets spawned in.

Thanks, I'll PM you this weekend.

  • Like 1
Link to post
Share on other sites

Kingsal can probably help you, but FYI my FM Patently Dangerous uses a simple script to do exactly what you asked about the elevator for the warehouse elevator (i.e., you have to flip a circuit break switch first to use it). You can open up the .pk4 and just take that script, and then search for that script name in the .map file to see what spawnarg to put on the button. Basically, you use the function on a button that calls a script when you push it. I believe you can use the same model for the lights too.

To explain it really simply, you just put a simple conditional at the top. When you flip the circuit breaker, it sets some global variable to "electricity : on" (when you flip it again it goes back to off), and then at the top of the button script you have a simple check, if electricity = on then activate the elevator, else end.

I think the same kind of logic will work for the light situation, depending how you want to set it up, e.g., is the master switch like the circuit breaker case above, or does it turn on all switches no matter what, how do the local switches override it, etc. Work out the logic first, and then use a simple conditional (or set of conditionals) like the above to implement it.

  • Like 2

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to post
Share on other sites
On 11/11/2020 at 10:39 AM, demagogue said:

Kingsal can probably help you, but FYI my FM Patently Dangerous uses a simple script to do exactly what you asked about the elevator for the warehouse elevator (i.e., you have to flip a circuit break switch first to use it). You can open up the .pk4 and just take that script, and then search for that script name in the .map file to see what spawnarg to put on the button. Basically, you use the function on a button that calls a script when you push it. I believe you can use the same model for the lights too.

To explain it really simply, you just put a simple conditional at the top. When you flip the circuit breaker, it sets some global variable to "electricity : on" (when you flip it again it goes back to off), and then at the top of the button script you have a simple check, if electricity = on then activate the elevator, else end.

I think the same kind of logic will work for the light situation, depending how you want to set it up, e.g., is the master switch like the circuit breaker case above, or does it turn on all switches no matter what, how do the local switches override it, etc. Work out the logic first, and then use a simple conditional (or set of conditionals) like the above to implement it.

Kingsal helped me out on the circuit breaker light/elevator script.

Link to post
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.

×
×
  • Create New...