Jump to content
The Dark Mod Forums

Visportals


BEAR

Recommended Posts

I have some questions about visportals, but before I start blathering off I'm going to try and figure out as much as I can myself. I did a test map where I experimented with what would break them and what wouldn't, and that helped my understanding of them quite a lot and I thought I pretty well had it figured out, but when I got to the huge and complex "real' map I'm working on, things did not work out nearly as well.

 

What I'm wondering is there a good example map out that I could look at? I have looked at thiefs den a little bit but without the layer info its pretty hard to see whats going on (getting that might be enough). Preferably it would be nice to look at something with fairly big open spaces (unless I'm the only one daft enough to do that) with doors and windows and what not to see how others have done it.

 

I don't have access to betamapper stuff just yet but as I understand it I will sometime here in the future, so does anyone know of something that might help me out? I've read through the wiki article several times and it has done me really well, but some real specifics of how I have things placed as well as the large scale make testing and fixing problems very time consuming.

 

Thanks

Link to comment
Share on other sites

I don't really have any maps in mind that would be good to look at.

 

Really vis portals are a very simple concept.

 

They are just a cube. 5 sides textured with nodraw, 1 side with visportal tex. So when the map compiles it just becomes one plane (not a cube).

 

You map is just a series of spaces. Each space has to be sealed with 2 things.

 

1: world spawn brushes (does NOT include func_statics). Sky tex DOES work.

 

2:vis portals. They go in spaces NOT filled with world spawn brushes (like open windows and openable doors). Their purpose is to seal a space.

 

These spaces can be anything, and of any shape. Windows, doors (easy ''cause they are square), hallways, rooms, caves (not as easy because they are weird shaped).

 

The purpose is to divide the one large area (sealed from void with world spawn brushes) that is your map into smaller areas but still letting the player pass through and not notice that the areas are divided. This lets the engine only render what is in the space the player is in to cut down on computations.

 

The engine will render the space the player is in plus the spaces past all visportals that can be seen through from players position. Smaller portals are better because it's harder to see through more of them than larger portals.

 

Think of a portal as a picture frame. Now put another picture frame past it. Look through the first, if you can look through it AND the next one everything on the far side of the second one will be rendered. Now move your position so you can see through the first but not the second. Now the second is closed.

Another way to think of it would be house windows.

Look out your front window of your house. That's visportal 1. Look through it at your nieghbors window. That's visportal 2. Right now they are both open because you can see through both in-line.

Now move to the side of your window. You can still see through it, but your nieghbors window has gone out of view, it closed at the point it went out of view.

 

That's the concept.

 

It would be nice if game levels just had windows and doors. They are all fairly small and square so they 'go out of view' faster. If your front window is 2x as big you will be able to see through your nieghbors window longer.

 

You just have to put that into work in more areas in a game level. It helps if you can seal off streets in the same way. That means at some points you need a 'square doorway' in your street. Parts of it can be sky texture, parts can be brick, but you need a square (or rectangle) to place a vis portal.

 

OK you say, that sucks 'cause I don't want my street to look square. What about trim that sticks out of a building, effectively ruining my square.

You can have trim running thru a visportal, but it can't be world spawn, you have to make it a func_static. This is how you make your 'square' visportal NOT look like a square.

This is how you do cave entrances too. You make a square hallway out of worldspawn. You add your square visportal. Then you add detail brushes that give it a cave shape and make them func_statics or objects or patches to give it a cave look, but underneath it all you really have a square.

 

-----------

Breaking vis portals.

 

There are really only 2 things that break your portal other than wrong textures.

 

1: map leaks. This can be a leak to the void that isn't filled with worldspawn brushes.

 

2: it can be a leak from one space to the next. Say you have a house with only to doors (no windows, no chimney...)

You put a visportal in the front door but not the back.

Now the area inside the house leaks to the outside because the back door is still open. You have to plug all the gaps so this house would need 2 visportals to be sealed from the outside space.

 

Keep in mind that a doorway should be very simple. basically a square in a wall. Seal that up with visportal. Then you can put as fancy or weird shaped door frame in there as you want, but make it func_static so it doesn't interfere with the visportal.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Thanks, that clears a few things up. The actual visportal has to be surrounded by worldspawn correct? How would that work if I made it bigger than the frame surrounding a window, causing the visportal to encompass a worldspawn or two? Does the portal like/need to have a single worldspawn that it touches on all sides or can it be a bunch of them that touch?

 

The main problem I'm having is some portals work fine, and others dont work at all and I'm having trouble figuring out why, I've copied door+frame+visportal and moved it thinking that it would work and it sometimes doest. I ended up "concreting" up a lot of my windows so that I can tackle them one at a time (I did a ton of them at once because it takes a while to compile the map).

 

The finding leaks thing is where I'm worried, but in some cases I've plugged all the holes I can see and there are some portals that refuse to work, with others right next to them that work, making the hole problem seem unlikely.

 

I'm thinking I'll pay more attention to my windowframes, because a lot of them were func_static's but I made them worldspawn to select individually and didnt turn them back into func_static which might be causing some of my problem.

 

The tower I have (if you've seen the screenshots) was of particular problem, I couldn't get a single visportal to work in it and I'm not sure why, but the func_static issue might be part of my problem. I think I hoped to knock this out in a big flurry of work but I think its going to probably be a long steady process of doing them one at a time and fixing errors with my map while I'm at it.

 

Thanks for the tips!

Link to comment
Share on other sites

i had Major FPS lose when my map started to grow. after visportaling it really picked up nicely. ive been constantly working on raising my fps. its a very good idea to vis portal your map as you go so you dont have to spend alot of time back tracking threw it. can be a pritty time consuming process to achive great stability.

 

also lights really lag down the game. rendering to manny lights is very hard on the performance. visportal every room with a light, hall ways, exc. good luck with the map :)

Link to comment
Share on other sites

I did not do this as I should have, I really should have taken it into account as I built the map, but its decieving because when you are working on it with ambient lighting it runs at 50fps solid even with huge areas. I clearly saw as soon as I started lighting that I needed to work on it.

 

My problem is not putting in visportals or knowing where, but making them work ;) I think that I can, my map is just kind of quirky (like building a house on an unlevel and unsquare foundation, by the end it gets kind of tedious), but I'm pretty sure I can get it. I've already made it a lot better at its current level but I don't think I can keep doing significant lighting until I get it totally visportaled (and it would irresponsible of me to try).

Link to comment
Share on other sites

I'm sure you've probably still got leaks.

 

They can be easy to get simply by being off the grid a hair if one brush isn't snapped. And you have to zoom in REAL close to even see it.

 

You can put 2 vi-portals together (say to fill an L shaped hole). This can be a little testy.

 

It also sounds likely that maybe some of your windows didn't get turned back into func_statics, or maybe just a piece and that can be enough to break a vis-portal.

They are VERY touchy. Easy to work with if you're careful, also easy to mess up. I recommend trying to keep them as simple as possible.

 

Thanks, that clears a few things up. The actual visportal has to be surrounded by worldspawn correct? How would that work if I made it bigger than the frame surrounding a window, causing the visportal to encompass a worldspawn or two? Does the portal like/need to have a single worldspawn that it touches on all sides or can it be a bunch of them that touch?

the portal ABSOLUTELY HAS TO TOUCH worldspawn on all 4 sides. If not it leaks and doesn't work. You can have 100 world spawn brushes around it but they have to seal all the way around it.

 

But still, simple is good and only 4 brushes around it would be simpler.

 

Like I said, make the hole in the wall a square, put in your vis-portal, then put in as fancy a window frame as you want, but make sure it's either an object or func_static.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

also lights really lag down the game. rendering to manny lights is very hard on the performance. visportal every room with a light, hall ways, exc. good luck with the map :)

 

Make sure you test your performance with and without our custom interaction.vfp though. Due to the way id harmonized all of the lights into a single interaction.vfp, the changes made to fix the ambient shading is also performed on normal lights....this means that all lights are having an extra 2 or 3 calculations done on them, and it will drop a lot of cards by 10 or 15 fps. Rename the interaction.vfp to something else and test performance again. If we had access to more of the idtech4 renderer, we could fix this issue. I've been asking for assistance through some id contacts, but after their initial response...I never hear back from them again.

Link to comment
Share on other sites

I'm sure you've probably still got leaks.

 

They can be easy to get simply by being off the grid a hair if one brush isn't snapped. And you have to zoom in REAL close to even see it.

 

You can put 2 vi-portals together (say to fill an L shaped hole). This can be a little testy.

 

It also sounds likely that maybe some of your windows didn't get turned back into func_statics, or maybe just a piece and that can be enough to break a vis-portal.

They are VERY touchy. Easy to work with if you're careful, also easy to mess up. I recommend trying to keep them as simple as possible.

the portal ABSOLUTELY HAS TO TOUCH worldspawn on all 4 sides. If not it leaks and doesn't work. You can have 100 world spawn brushes around it but they have to seal all the way around it.

 

But still, simple is good and only 4 brushes around it would be simpler.

 

Like I said, make the hole in the wall a square, put in your vis-portal, then put in as fancy a window frame as you want, but make sure it's either an object or func_static.

 

I found some of my problem by blocking off rooms totally to isolate the problem and was able to check off a couple big spots that had previously not worked at all, but it still leaves a few portions where I'm going to have to find the leaks.

 

Just to clarify, it would be better to have the whole window be func_static and have the visportal bigger than the window touching the worldspawn on all sides? I changed a bunch of things back to worldspawn from func_static thinking it had helped but fixing leaks might have been what helped instead.

 

Are extra portals considered good for sealing leaks? It seems like maybe a cobbled solution but in a couple cases I was able to create visportals that I initially didn't plan to use that sealed a leak allowing others to work. I was thinking of doing that in another area that was causing me problems if I cant find the actual leak.

Link to comment
Share on other sites

Just to clarify, it would be better to have the whole window be func_static and have the visportal bigger than the window touching the worldspawn on all sides? I changed a bunch of things back to worldspawn from func_static thinking it had helped but fixing leaks might have been what helped instead.

 

Exactly. The vis-portal and the world spawn together should make 'a solid wall'.

 

Any details that interupt that 'wall' should be func_statics. They can overlap either the worldspawn brushes, the vis-portal or both. But they should be thought of as an object because they don't seal and they don't split the terrain they touch. They are just an easy way to make details in the editor instead of using a 3d modelling program.

 

Are extra portals considered good for sealing leaks? It seems like maybe a cobbled solution but in a couple cases I was able to create visportals that I initially didn't plan to use that sealed a leak allowing others to work. I was thinking of doing that in another area that was causing me problems if I cant find the actual leak.

No, deffinately not. If you have a leak from world spawn 'inside your map' to the void outside the map you need to seal it at some point with worldspawn brushes. There's no way around it.

 

But you do have the advantage of using your 'pointfile' (I think in file menu? maybe edit menu). This will draw a red line through the leak, if you have more than one it will only do the first it finds. You'll need to compile and run again for each leak after that.

 

You might get lucky and fix a visportal leak in one area by placing an extra vis-portal, but that's just a lucky hack and only fixes the leak for an area, you'll just have another area that won't seal.

-------------

If you have a leaking area that you want sealed with vis-portals the only way you can tell if it has a leak is that vis-portals just won't work.

Like I said with the house above. If you seal the front door but not the back the front one just won't work. (you can test in game with the view vis-portal command - I forgot it, it's on the Wiki)

If it's green it's open, red is closed, if you can't see it it doesn't work and you have a leak.

 

Basically if you can find a way to go from one side of the vis-portal to the other (go out back door and come around front) without going through another vis-portal or solid terrain (not func_static) it will leak.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Exactly. The vis-portal and the world spawn together should make 'a solid wall'.

 

Any details that interupt that 'wall' should be func_statics. They can overlap either the worldspawn brushes, the vis-portal or both. But they should be thought of as an object because they don't seal and they don't split the terrain they touch. They are just an easy way to make details in the editor instead of using a 3d modeling program.

No, definitely not. If you have a leak from world spawn 'inside your map' to the void outside the map you need to seal it at some point with worldspawn brushes. There's no way around it.

 

But you do have the advantage of using your 'pointfile' (I think in file menu? maybe edit menu). This will draw a red line through the leak, if you have more than one it will only do the first it finds. You'll need to compile and run again for each leak after that.

 

You might get lucky and fix a visportal leak in one area by placing an extra vis-portal, but that's just a lucky hack and only fixes the leak for an area, you'll just have another area that won't seal.

-------------

If you have a leaking area that you want sealed with vis-portals the only way you can tell if it has a leak is that vis-portals just won't work.

Like I said with the house above. If you seal the front door but not the back the front one just won't work. (you can test in game with the view vis-portal command - I forgot it, it's on the Wiki)

If it's green it's open, red is closed, if you can't see it it doesn't work and you have a leak.

 

Basically if you can find a way to go from one side of the vis-portal to the other (go out back door and come around front) without going through another vis-portal or solid terrain (not func_static) it will leak.

 

Ah, I think we've confused each other slightly. My problem is not leaking with the void, but leaking within the map (I might not be using the term correctly). I should provide some screenshots or something. Its more a matter of sealing rooms off from eachother (some have doors and some don't but in my testing it seems a door doesn't really matter unless you have the visportal touching it so it takes the open/closed attribute of the door). The map itself doesn't leak with the void, but all I can figure is there are leaks between a few of the rooms to eachother or the outside of the church because the visportal/door/door frame have been tested independently and are working.

 

I've been using the r_showportals 1 extensively, would be nearly impossible to know what was happening without it its quite useful really).

 

What I meant I'd done was to put a visportal over an open space (like a stairwell) even if it isn't going to be all that useful as a visportal, it seals a room off from a room that might have a leak in it somewhere, its helped me to isolate where my problem is. I think my map is so poorly organized for visportals my issues are probably more confusing than most.

Link to comment
Share on other sites

It's been awhile since I've done some mapping. I think it's even possible (quite likely) that if you have a leak to the void that NONE of your visportals will work. This just came to mind.

 

So yeah, if some of them work you probably don't have a void leak.

 

But it sounds like it's all within the building. Those are deffinately harder to track but you're probably on the right track.

 

I might help overall performance to have a vis-portal in the stairs. That's really up to you to determine. I'd likely not put excessive vis-portals in myself. A small house probably doesn't require a vis-portal at every door.

And yeah, doors by themselves don't block rendering beyond them. They just block player/AI view.

 

Sounds like you've got a pretty good handle on it now though. I scrapped quite a few maps alreadydue to bad optimizing, huried building and not thining things out. I'm trying to get motivated myself to start on a map that I will actually take to completion. Starting a map is always the hardest part (other than finishing it :D )

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

It's been awhile since I've done some mapping. I think it's even possible (quite likely) that if you have a leak to the void that NONE of your visportals will work. This just came to mind.

 

So yeah, if some of them work you probably don't have a void leak.

 

But it sounds like it's all within the building. Those are deffinately harder to track but you're probably on the right track.

 

I might help overall performance to have a vis-portal in the stairs. That's really up to you to determine. I'd likely not put excessive vis-portals in myself. A small house probably doesn't require a vis-portal at every door.

And yeah, doors by themselves don't block rendering beyond them. They just block player/AI view.

 

Sounds like you've got a pretty good handle on it now though. I scrapped quite a few maps alreadydue to bad optimizing, huried building and not thining things out. I'm trying to get motivated myself to start on a map that I will actually take to completion. Starting a map is always the hardest part (other than finishing it :D )

 

I've noticed a trend in things that I do, where I reach a level of complexity that troubleshooting really becomes impossible. To fix one thing you must fix 3 others first, but fixing those breaks several others and it just keeps cascading like that. I do a few things thinking that surely there is no way to break something, so I copy a working door+visportal to replace open walkway minus door, and the new doors work fine but the doors I copied to make them, all the sudden THEIR visportals quit working.

 

Is it possible copying a visportal texture causes only one of them to work? That would be a hillarous bug if so because there would be nothing better for making me lose my mind :)

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

      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
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...