Jump to content
The Dark Mod Forums

Large Maps Do Not Display Properly [closed]


Recommended Posts

I extended the AABB of the light, otherwise the selection test would never return something positive. Only visible lights are tested against selection. It may well be that these changes are responsible for this, although I have no idea why.

 

I tend to do the following (after I resolved the other crash :)): I will go back the SVN history in steps of, say 20 revisions and make some snapshot builds. Angua and me will go through this and narrow down the revision that is responsible for that crap.

Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

I extended the AABB of the light, otherwise the selection test would never return something positive. Only visible lights are tested against selection. It may well be that these changes are responsible for this, although I have no idea why.

 

I just looked through askave.map with a text editor, and there are no light_center values that are larger than the light_radius, which suggests that this is not in fact the problem.

 

I tend to do the following (after I resolved the other crash :)): I will go back the SVN history in steps of, say 20 revisions and make some snapshot builds. Angua and me will go through this and narrow down the revision that is responsible for that crap.

 

That is certainly a good idea (however time-consuming), I was thinking of doing that myself but decided to look at the renderer first.

Link to comment
Share on other sites

We're currently setting up the development tools on angua's notebook, so we can sweep over this twice as fast. Latest SVN is at revision 740, DarkRadiant 0.7.1 was around revision 546. So we're going to check if rev 546 works, and if yes, we will split the intervals in half and track down the bogus version.

Link to comment
Share on other sites

Ok, we've located the error: the bug appears first in revision 554, which is my commit concerning the draggable light_center. Revision 553 is working well. Which sucks, because commit 554 is large and there are quite some changes that cannot be disentangled easily. I'm afraid that I will have to re-do the whole thing until I know what change exactly is responsible for the mess.

 

I will look into it tomorrow, as I have to leave now.

Link to comment
Share on other sites

Glad you've found it at last. You have also discovered the reason I always make small commits (well, that and the fact that if I get confused and have to revert the change, there is less work to redo).

 

I have started to split out the render sorting classes and have also added a stream insertion (operator<<) on AABB, which may help if you are trying to find out what is causing the objects not to appear.

Link to comment
Share on other sites

I normally mean and try to keep the commits small and separate too, but sometimes this is hard to do, because a small change entails a bunch of other changes and I don't want to commit un-compilable code or at least a non-working DarkRadiant version.

 

Admittedly, this was not entirely the case in the light_center commit, but with some of the brush disentangling and such. I could have done better and I will keep this in mind in the future, the lesson is learned :).

Link to comment
Share on other sites

I normally mean and try to keep the commits small and separate too, but sometimes this is hard to do, because a small change entails a bunch of other changes and I don't want to commit un-compilable code or at least a non-working DarkRadiant version.

 

This can be challenge sometimes, I agree. I take the view that a commit shouldn't break the build, and shouldn't regress important functionality (like disable map-loading), so sometimes it is unavoidable that a large change gets committed in one go.

 

To really get around this problem requires the use of branches, which I have never quite got the hang of. One way to do this would be to create a new branch for each major piece of work - refactoring a large module, rewriting an entire feature etc. - and then merge the branch changes back into the trunk when completed, so that the trunk is always functional but the branch can be as WIP and broken as you like, since nobody will be using it.

Link to comment
Share on other sites

Some news on this: as we suspected, it's the Light::localAABB() method that I had to adapt to make the light_center touchable when placed outside of the light volume.

 

I will further look into it what exactly can be done about this. At the moment there are three methods (I think) that return various types of light-AABBs, so I will have to figure out, which one of these is used by the renderer.

 

It's a single line that got changed, so hopefully I can work with the current SVN build as well. This would make merging the fix into the codebase easier.

Link to comment
Share on other sites

I think it's Instance::worldAABB() which is used by the renderer. I have been trying to understand the visibility code, which seems to employ a certain amount of redundancy and duplicated checks, making it confusing to understand.

 

It starts with ForEachVisible, a scenegraph walker class which gets called for every Instance in the scene graph. First there is a visibility check:

 

VolumeIntersectionValue visible = (path.top().get().visible()) 
									   ? m_state.back() 
									   : c_volumeOutside;

 

where m_state.back() has already been set to c_volumePartial. I don't think this has anything at all to do with culling, it is a nasty hack which uses the c_volumeOutside as a flag meaning "not visible for any reason", based on a visible() flag set on the Node.

 

If the visibility flag is still c_volumePartial, the AABB is then tested:

 

if(visible == c_volumePartial) {
visible = m_volume.TestAABB(instance.worldAABB());
}

 

and depending on the result, the contained walker (RenderHighlighted) is then called on the instance. What is confusing is that RenderHighlighted has its OWN visibility and culling checks.

 

if (Cullable_testVisible(instance, m_volume, parentVisible) != c_volumeOutside)
  Renderable* renderable = Instance_getRenderable(instance);
  // blah

Link to comment
Share on other sites

Yeah, I know that code, I have been there before. I don't think I will change anything here, as this would affect all other instances as well, and I certainly don't want to do change anything on that scale.

 

I'm still compiling the new revision, hopefully I can make the map visible again by reverting the localAABB() code. This will break the light_center dragging, but I will find some way around this.

Link to comment
Share on other sites

Ok, I could make the map visible again by reverting the code, so the big problem is solved. As expected the light center is only draggable when within the small light "diamond", so I will try to fix this in a different way.

Link to comment
Share on other sites

Ok, I could make the map visible again by reverting the code, so the big problem is solved. As expected the light center is only draggable when within the small light "diamond", so I will try to fix this in a different way.

 

That's bizarre. Do you have any idea why the light's AABB was causing the map to disappear? At the very most, I would suspect a dodgy AABB to cause the light to disappear, not the whole map.

 

It could be that there is a more serious bug in the culling code, which your light center just happened to expose.

Link to comment
Share on other sites

Fixed. There was a problem with an uninitialised member variable in Doom3LightRadius.h. I don't know if I should laugh or slap myself in the face. :angry:

 

It was damn hard to find, because usually the lightCenterChanged() method gets called immediately after instantiating a light, but in some cases it does not. I've no idea, why this is the case, but it seems to be random and it therefore appeared more often in large maps. Linux seems to be more stable with these things as well, maybe there is some compiler-specific initialisiation of member-variables?

 

Anyway, we can kick that one off the list...

Link to comment
Share on other sites

The stunning twist: Holmes did it!

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Well, then I will possibly be sued for aiding and abetting the crime

You cleared yourself, so you won't be sued for anything... :) But you could have been in worse situation if it was somebody else who had discovered the truth... ;)

Link to comment
Share on other sites

That's a good move. :)

 

What else is missing for a 0.8.0 release? I'm currently working on the CommandList Dialog, but that is not a very vital feature, because it's always editable through the input.xml file.

Link to comment
Share on other sites

I just did a full rebuild on Windows and now I cannot create a single brush, entity or light without DarkRadiant immediately crashing. I will see if I can replicate this on Linux so that the debugger can be used (although based on past experience this will be a stupid Windows-only bug that evades any attempt to use a debugger).

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.
      · 5 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...