Jump to content
The Dark Mod Forums

hiding/unhidding entities


Darkman

Recommended Posts

hi guys!

 

i hope that anybody can help me out... so here's the base problem:

 

situation: think of a map with one indoor and one outdoor area; the outdoor area contains some big trees. both areas are connected by some kind of hallway, tunnel or whatever. the task i demand help for is about hiding all the trees in the outer area as long as the player is located inside the inner area.

 

 

this aim refers to having some trees rendered even if the player sneaks through the indoor by default - although they are located in a complete different visportaled and so culled place. for the moment, just believe me that this is not caused by internal leaks but lies in the engine's responsibility. so i'm aiming for hiding the trees as soon as the player reaches the indoor area (forget the LOD-system, as this solution would require some distance) and unhiding them as he gets close to the other place.

 

by default, this can be done by simply triggering the tree-entities (sets "hide" to "1"); another triggering-effect unhides them. so, there should be 2 triggers in the hallway: one sitting close to the indoor-entrance and hiding the trees and one sitting close to the outdoor-entrance and unhiding them.

 

and here lies the problem: i'm only capable of creating triggers/multitriggers that, as soon as the player runs into them, trigger the trees. but that only changes the hiding-state, whatever it is at that moment - so if you run into the same trigger twice, that state isn't really changed after all. that's why i need one trigger only to be capable of saying "hide" and another trigger only being able to say "unhide".

 

of course i'm also open for any other ideas, like a script maybe of whatever... but i hope that i was at least able to carve out the problem itself... rolleyes.gif

 

 

 

oh and one further question: am i right that hidden objects do nearly have zero performance-impact (no polygons/shadows/cm performed as long as they are hidden) ?!

Edited by Darkman
Link to comment
Share on other sites

put a visportal at the end of the opening to the outside world, then another visportal further on down the hallway, if looking towards opening to outside, only trees seen through opening drawn, face the other way and trees not drawn.

Link to comment
Share on other sites

Check the wiki article for location settings. You can achieve exactly what you need with the script call thingies: when the player enters the location you want, a script is called, which just triggers the hideable entities. You can have the same script called when the player leaves the area.

 

I think I wrote an example dealing with a thunder switch in the end of the location setting article.

 

Good luck!

 

Edit: yeah I think hidden thingies do not drain performance.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

@stumpy: looks like you missunderstood me.

 

VP's do not help here, as the error lies in the engine still rendering trees which are fully located in a leaf where the player is not in - even if all matching VP's are closed and that leaf is culled for that reason (well, except it's trees)... as i experienced, this can mainly happen where large func_statics are sitting behind but close to a leaf-border which separates the player's leaf from the one with such func_statics. so at the very end i look for a possibility to somehow force the engine not to render func_statics (under the mentioned circumstances)...

 

 

@sotha: perfect! that's exactly that i was looking for!

 

as a result of your link to the wiki-files, i was really able to create a testmap where trees (sitting in the courtyard) were hidded while the player was inside a building - including model, shadows and collision model. Once he left the building and so entered the courtyard, the trees were unhidden. smile.gif

 

that will later give me to chance to optimise my map through connecting func_statics to fewer but bigger ones and still force the engine not to render these, as long as not necessary.

 

 

@both: thanks a lot! you two became my heros now laugh.gif

Edited by Darkman
Link to comment
Share on other sites

It's possible that the bounding box of the model is sticking into an area that is still open. That is the ONLY reason I can think of that the model would not be culled if the geometry is properly sealed and portalled.

If so possibly rotating the model so the bounding box doesn't cross areas might help.

 

f_s's will do it if they extend into an open area or is only a little part of them is visible the entire f_s will show. Up to author to divide them up as needed

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

It's possible that the bounding box of the model is sticking into an area that is still open. That is the ONLY reason I can think of that the model would not be culled if the geometry is properly sealed and portalled.

If so possibly rotating the model so the bounding box doesn't cross areas might help.

 

f_s's will do it if they extend into an open area or is only a little part of them is visible the entire f_s will show. Up to author to divide them up as needed

 

well, the engine would render such a func_static under those circumstances, that's surely correct.

 

 

however, fs's may also be rendered by the reason i mentioned above. i figured out, that the chance for such "render-errors" raises especially in relation to the thickness of leaf-brushes and the entities' tallness and position:

 

- the error mainly occurs when a small distance between leafs/leafborders (in my case: one box at grid size 8 = 8 units) meets with tall objects (in my case: largest version of a pine with leaves) which additionally are located close behind to such a small leaf-border (in my case: ~a gap of about max. 5 meters).

- the chance raises even higher, when such a leafborder is drawn by diagonal brushes, rather than by straight ones.

 

but do not regard this as an exact rule...

Link to comment
Share on other sites

@Darkman: Btw, instead of "triggering" the entities to hide/unhide them, you should use the $entity->hide() and show() script events in the script function that you are calling from the location triggers. That way their presence does not depend on their current state (or things can get out of sync for whatever reasons).

 

// Makes this entity invisible.
scriptEvent     void    hide();

// Makes this entity visible if it has a model.
scriptEvent     void    show();

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

@Darkman: Btw, instead of "triggering" the entities to hide/unhide them, you should use the $entity->hide() and show() script events in the script function that you are calling from the location triggers. That way their presence does not depend on their current state (or things can get out of sync for whatever reasons).

 

// Makes this entity invisible.
scriptEvent 	void    hide();

// Makes this entity visible if it has a model.
scriptEvent 	void    show();

 

 

yeah, that's even better as possible errors will be merged when leaving/entering a zone again. sounds reasonable... thanks! smile.gif

 

i have allready rewritten my testscript/testmap, works like intended

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