Jump to content
The Dark Mod Forums

My first map – questions & work in progress


peter_spy

Recommended Posts

sorry if this was already discussed:

@biker

I did some tests with jpeg way back in the early days. The jpegs created graphic issues...I recall banding, and maybe some bad noise on the textures. The game just didn't like them. :(


jpgs should only be used for the editor icons, along the visual problems already discussed, they also crashed the engine for me, more than one time.

I must say I'm impressed, in T3Ed one light hitting that many objects (not to mention shadow-casting) would easily bring down the framerate by half.

tut_2017_01_14_21_00_21.jpg


Tell that the guys always complaining about how bad idTech4 is in regards to performance. ;)


Idtech 4 performance is very nice indeed, specially if we take into account that its advanced lighting and shadow system (at the time) was optimized to run on what is now more than 10 years old hardware, people just has a bad stigma on it because of Doom 3, many complained on the plastic look of the normal maps and the pitch black shadows, things easely solved with good specular maps and ambient lights.

I can tell them that I also used 2x AA ;)


Technically not UE, it's so-called "Flesh" renderer that was hacked into Unreal Editor 2.x. Nobody really knows what it can or can't do, but man does it obey the "Lights that touch too many objects" metric like the law of gravity ;)


Well, that's still very good news! Typically calculating light and realtime shadows should put a strain on CPU (or is it GPU? not sure which process uses which hardware). In T3ed, I used one shadow casting light and a few "nonshadows" to fake light bouncing and such. I had a daylight mission prototype and it was pretty good for that purpose.

I don't really know much of the TDS engine but i always assumed it was Unreal Engine 2 with a real time per pixel light render glued into it, has no UE 2 games before add such capabilities.

About real time shadows "putting a strain on CPU or is it GPU?" that depends on the engine and implementation, on idtech 4 is the CPU, is used to calculate the model edge for the stencil shadows (the TDM current shadow system) but this type of shadows can now be calculated on the GPU has well, shadow maps for example that i hope some day come to TDM, run on the GPU as they are just textures.

 

IMO you should still use that T3ed trick on TDM as well, there's no need for every single light to cast shadows, not only they kill performance they look bad overlapped, is still a very good trick for performance and used by professional developers, a good example is Amnesia and now Soma they use for the most part a "hero" light that cast shadows in a obvious way and then use no shadow casting lights to set color and mood.

  • Like 2
Link to comment
Share on other sites

Judith, you can try to put a cubemap in the material stage of the texture you want to have rim lighting. Don't know how good that will approximate the look, but I think it's worth a try. The object will most probably have to be high poly and curved in order for the fresnel to show up. Here's the code snippet for inserting a cube map in a material.

  • Like 2

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

I got a basic cubemap material ready, but this one looks like it works better with specularity, so I'd definitely use it, thank you. A subtle glow map for key items looks good too. I don't even have to use textures, just grey solid color is fine.

 

As for the lightning, I've done some experiments and I'll probably stay away from real-time shadows as much as possible. Right now, I'm at the AI and "gameplay lightning" stage for my first location, and I came up with a few ideas. I want to have some player freedom in putting out lights, but the setting is more Victorian and steampunk-ish rather than medieval. The setting is either recently abandoned or overgrown (not sure my modeling skills will suffice here, I was never too good with organics). Using skylights, windows, and other types of "lightning from outside", along with moonlight / before dawn setting is much more interesting visually (baked lightmaps). In terms of gameplay, those light / shadow patterns are also more interesting to traverse than the run-of-the-mill omni lights. Player freedom takes a hit here, but I hope that will be a minor casualty. Further tests will reveal more :)

  • Like 1
Link to comment
Share on other sites

Question about the multiple textures/materials on meshes: I was taught that using multiple diffuse and other textures for one mesh is generally a bad idea, performance-wise. Meshes from UE-based games like UT3 or Gears of War use one texture space for e.g. window frame + glass. Things get a bit more complicated with Thief/TDM and multiple surface types, but I always addressed that by using the same textures in cloned materials, just changing the surface type and assigning the material to proper parts of given mesh (wood, glass, stone etc). In TDM's mesh browser however, I see simple meshes like windows having multiple tiling textures with 5-6 materials, with stuff like dirt or AO as a separate texture and material. Are you sure this is efficient?

Edited by Judith
  • Like 1
Link to comment
Share on other sites

Re-using textures tends to decrease load times and video memory usage, and can make for easier skin creation, but it increases drawcalls. I don't know which is more efficient.

 

edit: Actually, I'm not 100% sure whether multiple materials that point to the same texture have a different number of drawcalls than multiple materials pointing to different textures.

Link to comment
Share on other sites

Why should using the same texture over and over again increase drawcalls?

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I don't remember all the details anymore, but SteveL explained a lot of this to me while I was working on the modules. I could be remembering this wrong, but I think the engine does a separate pass for each material shader on a model. Someone who understands it better will have to explain it. I remember we ultimately weren't sure whether the benefits of less texture loading would balance out the extra drawcalls created by multiple materials.

Link to comment
Share on other sites

What I meant is this window uses 6 materials, so at least 6 different textures (probably more like 12, e.g. diff+normal, diff+spec):

Clipboard03.jpg

 

 

While in other engines it's more efficient to go like this:

Clipboard06.jpg

 

One mesh, one material, diffuse, normal, spec textures. Material instance for lit version with additional mask texture. As you see, this one also uses mirrored UVs to save space, which is a very good idea (not sure whether older engines support that).

 

AFAIR, using multiple textures and materials increases drawcalls, impacts loading time, and wastes video card memory, especially with non-square textures. To minimize the impact, I always used one texture space for the whole model, and one material, if possible. Two materials (glass, stone) for the window would be fine, 6 seems a bit too much.

Edited by Judith
Link to comment
Share on other sites

Ah, I think you are referring to a Texture Atlas!

 

Yes, this has been discussed here before. It's still not a widely used practice because of how our material folder structure is setup

but some models do have a proper atlas setup.

 

Example:

 

http://wiki.thedarkmod.com/index.php?title=Creating_LOD_Models#Texture_atlas

 

Of course, the ultimate atlas is a Megatexture...

  • 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

Well, that's the usual workflow, you have to maximize the efficiency of 0-1 space and yet allow for some flexibility, but with as few textures as possible. On that note, I wish unwrapping wasn't such a chore, it almost feels like punishment for the joy of modeling...

Link to comment
Share on other sites

It definitely is a lot more time-consuming, and would reduce my model output by more than half.

 

But beyond that, I don't think it actually does increase video memory or loading time. In fact it has the potential to reduce them. That window uses six textures. But those same textures will be used by multiple other models in the set. The textures only have be loaded and stored in memory once. Ten different models all using those same six textures only results in six textures being loaded. Ten models with their own textures require ten textures to be loaded, and those textures will have to be larger to get the same resolution.

 

Not only that, but that window model can have multiple skins that can be swapped independently. You can make a lit version by only swapping the glass texture. You can make a clean version just by hiding the grime textures. You don't get that flexibility if each model has its own texture.

 

I'm not going to argue that it's the best or most professional way to do it, but it's worked fine for me thus far.

  • Like 1
Link to comment
Share on other sites

That's 6 materials. I guess apart from the two decals which probably use one texture per material, the rest has to use at least two 2 textures per material, glass probably uses more (cubemap etc). You can be efficient with big textures, e.g. you can divide your mesh into interchangeable parts, like in the exploded view. Of course that requires a bit more planning. E.g. these parts use one material per set:

 

Clipboard01.jpg

Edited by Judith
  • Like 1
Link to comment
Share on other sites

Btw. long ago, there was a mod for Mount and Blade called Polished Buildings, the author made an excellent tutorial on modular buildings. English translation is a bit rubbish, but you'll get the idea:

 

http://wiki.polycount.com/w/images/0/09/Modular_MountBladeMod_01.jpg

 

http://wiki.polycount.com/w/images/a/af/Modular_MountBladeMod_02.jpg

 

http://wiki.polycount.com/w/images/9/93/Modular_MountBladeMod_03.jpg

  • Like 3
Link to comment
Share on other sites

Just a small update, the AI and patrol points are there, now the "gameplay lightning" phase.

 

Clipboard01.jpg

 

I got one question though: is it possible to make AI walk back a certain route and stick to path_corners? Linking the last node with the first makes the AI take the shortest route towards destination as it turns back, and it's not necessarily a good thing.

 

On unrelated note, I knew the editor was lying to me about texture scale, as most editors do, but didn't know how much. It looks like the actual ratio with scale 1 is 0.25 (i.e. the 2048 texture fits on the 512 wall). This will be useful later, to maintain consistent texel ratio for modular meshes and unique objects vs tiled textures on brushes and patches. And, you know, the general sense of scale ;)

  • Like 2
Link to comment
Share on other sites

I think you want to add a path_wait in between, node1 > node2 > path_wait > node1.

 

I don't recall whether this has come up before but I also think making a 3rd node close to

the first node would accomplish what you want?

 

node1 > node2 > node3 (near node1)

 

Relevant:

 

http://wiki.thedarkmod.com/index.php?title=Path_Nodes

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

Yup, I'm using wait points so guards take a break before patrolling, this works fine. But when they're patrolling, it looks like this:

 

1) This guard starts at the lower level, and he sticks to patrol points:

image.jpg

 

2) But this is how he walks back to his starting point:

image.jpg

 

He hugs the wall to get there as fast as possible, he's not following the partol points.

  • Like 1
Link to comment
Share on other sites

AI will take the shortest route between two points. If you want them to walk in a straight line, you need to add more path_corners.

  • Like 1
Link to comment
Share on other sites

Alright, I'll keep that in mind, thank you. That will effectively double the number of path corners though. Not that I'm hitting any limits yet ;)

 

A thing to consider then: TDS had a property like TurnBack: [bool]. You put that in first and last patrol point and you had a nice loop. Fast and simple solution. FWIW, TDS had a decent AI pathnode design, clean and fast to use. A bit less "sequential", so any modifications were a bit easier to implement, especially with complex routes. How AI used it in real-level situations though, that's another story ;)

Edited by Judith
  • Like 1
Link to comment
Share on other sites

You can have dozens of path corners in any single patrol route (a fairly common case for long, branching patrols with RITs). I generally fine-tune mine to the small details, e.g. my latest mission has 440 path corners and about 85 other path entities. The only limit is the general entity limit, but it's probably not path entities which will make you hit that. All in all, go wild.

  • Like 1

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

8192 is it? I don't think I'll hit that, definitely not with this small project :) I was referring to TDS path system as something to use as inspiration, because it minimizes the clutter these path points make in the level (and at some point they always do) and it's easier to debug. Default patrol points we're linked to each other from start to end and used properties where possible (like for waiting, changing the walk direction or speed). Properties that needed to be in separate nodes because of the directional data (like LookAt points) were sort of "plugged into" certain patrol points (i.e. the link was from LookAt point to a patrol point). I wish I had TDS editor installed, screens would give you a better idea on that.

  • Like 1
Link to comment
Share on other sites

 

On unrelated note, I knew the editor was lying to me about texture scale, as most editors do, but didn't know how much. It looks like the actual ratio with scale 1 is 0.25 (i.e. the 2048 texture fits on the 512 wall). This will be useful later, to maintain consistent texel ratio for modular meshes and unique objects vs tiled textures on brushes and patches. And, you know, the general sense of scale ;)

I never noticed any discrepancies between how the textures look like in the editior and how the look like in game in terms of scale. Do you have an example?

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

That quote is the example :) 2048 x 2048 tiling texture with default scale set to 1 fits on a wall that is 512 x 512. So, it's actually scaled down by 4. Every editor does it a bit differently. TDS editor is old and didn't scale textures at all. I think UT3 editor scaled textures by 2, UDK did the same thing. Of course this is for practical reasons, noone needs 2048 texture on a 2048 wall and texel ratio of 1 pixel to 1 editor unit ;)

 

Edit:

 

1) 2048 texture with scale 1 - fits on a 512 u wall:

image.jpg

 

2) The same texture with scale 0.5, it fills area of 256 x 256 units:

image.jpg

 

3) And the scale of 0.25, you can see the pattern because the texture area covers only 128 x 128 units:

image.jpg

...but it looks sharp as hell, you can basically stick your nose to the wall and it still looks great ;)

Edited by Judith
Link to comment
Share on other sites

Afaik is one drawcall per material it doesn't matter if that material uses more than one texture, but i'm not certain right now.

 

Judith don't know if you are saying you want to use 2048 textures but if so, i would not recommend, they take to much GPU memory and are heavier to render, specially for GPU's with 1 GB of RAM, if you want to get detail near a wall, then imo use materials with a detail texture stage, also imo 1024 is more than sufficient to most cases and in others a 32x128 (or even less) texture is sufficient, for example trims, railings, etc, using a 2048 texture in a rail for example is a total overkill, how many pixels does that take on screen? Almost none, but it's texture will occupy a large section of GPU memory.

Link to comment
Share on other sites

Our standards are generally for 512*512 or 1024*1024 textures, but I am starting to wonder if that's still an absolute yardstick. The guidelines were written with 2009 PCs in mind, and there has been an increase in computing power since then. I have used 2024*1024 and 2024*2024 textures in a few areas without apparent ill effects on performance. I suppose as long as you don't use several of them, you ought to be fine. (JohnP's Thief 3 texture upgrade was already using 2024x2024 textures a few years ago.)

  • Like 1

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • 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
×
×
  • Create New...