Jump to content
The Dark Mod Forums

Where Tds Went Wrong


bob_arctor

Recommended Posts

  • Replies 85
  • Created
  • Last Reply

Top Posters In This Topic

Well i made that guess based on that it's nice and simple and with a little physics knowledge it would provide you with a method of determining how much light would be reaching an object. The line of sight test to check if the light can shine on you and a distance check to determine the brightness of the light at the distance it is away from you. Of course you'd probably have to do this multiple times for different sections of the body so the head can get a seperate lumination result from the foot. Also you'd need to factor in ambient lighting too.

 

It seems that it is how it's done in your simple yet innacurate version, so i'm partially right, perhaps if multiple measurements were taken you could improve it's accuracy and reduce load. T1/T2 never had dynamic shadowing, there pretty much isn't any other way to determine how lit up something is in those engines. Also TDS had horrible framerates, using dynamic shadowing would fuck em over even more, though i guess it may be possible that they used the TDM accurate method (which could be why the framerates suck ass).

 

I hope you noted that i asked sparhawk to provide more info dave, I was never sure about any of that nor did I say I was, so go read non existant meanings into someone elses post please.

Link to comment
Share on other sites

It seems that it is how it's done in your simple yet innacurate version, so i'm partially right, perhaps if multiple measurements were taken you could improve it's accuracy and reduce load.

 

The accuracy of the "inaccurate version" is fundamentally limited by what Sparhawk posted above: It cannot take into account animated light textures, like faked fan blade shadows, and other "light shaders." The only way to know about those things along the surface of the player would be to have access to the renderengine (which we don't), or take a snapshot of the scene (which we do). Taking more measurements would not help with that.

 

I don't see how taking more measurements would decrease the load either, usually adding computations increases the load. :) Unless you mean interleave the measurements in time, which we are also doing.

Link to comment
Share on other sites

It seems that it is how it's done in your simple yet innacurate version, so i'm partially right, perhaps if multiple measurements were taken you could improve it's accuracy and reduce load.

 

The simple version works like that, but there is a inherent problem (actually several).

 

First of all, I can not know which lights contribute to the world, so I have always test all the lights in the world and do a distance check, which is already expansive. The reason is, that lights have no limits. And some lights are used as ambient and spread over a pretty big region. If such a light is very bright, it would look strange if the player sees a very bright gameworld but the lightgem tells him he is invisible. I found this always very confusing in Thief FMs when the author used to much ambient light. I remember one FM wheer the map lookd really like daylight but the lightgem told me I was well hidden. The consequence was that I couldn't concentrate on gameplay anymore, because I always had to rely on the lightgem instead of the gameworld as seen on the screen.

Another problem is that Doom 3 can create light without lights (so to speak). You can create a light with a pretty low lightlevel, and put a texture on it. The result is that the light can get brigther or darker, but the lightlevel always stays the same. I actualy wrote code to also take this into account. So I'm loading these textures and include them in may calculation. This works pretty good. Where it gets complicates though, is that you can animate these textures. At this point it doesn't make sense to reprogramm this, because it means that I would have to rewrite the entire lightgenerator to factor in animated textures. In fact I would reproduce a big part of the renderengine if I have to do that. Since this would be very complicated and timeconsuming I devised another way to do this, which is more straightforward and will also run with any changes to the renderengine. My new method will work even if the renderengine will be modified and new stuff is added.

Gerhard

Link to comment
Share on other sites

I don't see how taking more measurements would decrease the load either, usually adding computations increases the load. :) Unless you mean interleave the measurements in time, which we are also doing.

 

Well, the calculation is still much less expansive than teh rendering process. :) So even if we added several testpoints, it would still be much faster than doing the rendertest. But the inherent problems are the real reason to not do it this way, because no matter how much time you spend on tweaking it, you will always get wrong results in many situations.

Gerhard

Link to comment
Share on other sites

Hey Spar, what about visportals? Surely lights cannot shine outward from deactivated visportals, because for the visportal to be deactivated, everything contained in it can't be visible to the player.

 

And if you are outside and there is one huge light lighting everything (as you described) then that would all be one visportal anyway.

Link to comment
Share on other sites

And if you are outside and there is one huge light lighting everything (as you described) then that would all be one visportal anyway.

 

I don't think so, but I could test it. The geometry has not to be rendered, but it still needs to render it's effect, otherwise there would be no point in creating such a light. And IMO this was even used in the original maps to provide some ambience.

 

Also this would be yet another argument to not code this, because it would get more complicated again. We would have to locate and take into account the visportals as well.

Gerhard

Link to comment
Share on other sites

As far as portalling is concerned, it is not the light's origin that is important but its bounding box (the pink box).

 

If ANY PART of a light volume extends into a given portal area, the light is active when that portal area is visible.

Link to comment
Share on other sites

Well that would still depend on the layout of the map. Anyway if you are using the rendering engine to check the players visibility wouldn't it already do the culling?

 

And how big can doom 3 maps get? is it a hard limit or a limitation of the hardware? and could you through clever design exceed what would normally be very taxing on a system?

Link to comment
Share on other sites

Anyway if you are using the rendering engine to check the players visibility wouldn't it already do the culling?

There's some confusion here, they're talking about the "mathematical" version of the lightgem where we were basically trying to rewrite the render code ourselves, because we do not have access to the renderer. They were discussing not using the render engine, in an effort to increase performance. We do indeed use the render engine to take a snapshot and analyze it for the current lightgem, but doing it that way has a performance penalty.

 

As for the 4096 entity limit, I think we have access to that limit in the SDK, and could increase it if we really wanted:

 

In gameLocal.h :

#define	GENTITYNUM_BITS			12
#define	MAX_GENTITIES			(1<<GENTITYNUM_BITS)

Link to comment
Share on other sites

Not the way I understand it. Only the lights whos boundaries enter the PVS will be active. On huge levels this would be a huge saving, if you didn't check every light in the level.

 

I have thought this through in detail when I coded it, and there is no way I can determine which lights contribute, because they can be arbitrary big. There is no point in revisiting this every few months.

Gerhard

Link to comment
Share on other sites

But if Orbweaver is right, the engine deactivates lights - so you're checking them for nothing.

 

And it makes sense - doesn't matter how big a light is outside the building - if you're in a room with no connecting visportals to the outside area, you will not see the effect of the light.

Link to comment
Share on other sites

To be honest I don't know exactly to what extent they are "deactivated" if they are in a non-visible portal zone. I was primarily addressing the question "how can a light shine through a portal behind you if the portal is closed", to which the answer is "if the light is shining through the portal, it's bounding box MUST extend into the current portal zone".

 

The code the handles whether a polygon is within a light volume may or may not take account of visportals, you would need to contact a developer to confirm this.

Link to comment
Share on other sites

As for the 4096 entity limit, I think we have access to that limit in the SDK, and could increase it if we really wanted:

 

In gameLocal.h :

#define	GENTITYNUM_BITS			12
#define	MAX_GENTITIES			(1<<GENTITYNUM_BITS)

 

That looks worrying. If it is a bit field you cannot arbitrarily extend it since you don't know what the other bits are used for - maybe it is the lower 12 bits of a 16-bit WORD value for example, with the other 4 bits being used for something else.

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

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...