Map Distant Objects
Moderator: Moderators
Map Distant Objects
I've made a Widget that draws a clean black around a map's boundaries, with a graphical "border", which makes it clear to players, visually, that this is a "game board" with finite edges.
This looks a lot more professional (imo, of course) than the current system, where "water" is being drawn ad finitum, but without any "seafloor", on maps with water, which looks very unprofessional at most angles, clearly showing the map ending in space. However, there isn't any way to turn the distant water off and limit it to the map rectangle, so this isn't a performance enhancement by any means- it's just an experiment in terms of what's possible, really.
However, I was thinking that this was just the start of doing something new, and I'm open to ideas about how to try and realize the "infinite distance" idea that many people cherish- the idea that the map doesn't really end, but continues into the far distances. I'm not sure it's practical, mind you, but I'm willing to talk about it.
My first thought as to a solution was that we could use the VaLVe approach, and have a "distant object" to do a 3D skybox with.
Using gl.Unit, I was thinking that I could make some tiny, invisible "unit" that's had its polygons offset by some giant scaling factor, and was drawn solely by Lua. 8 such "units" would constitute the sides of the "distant object".
All that said, I'm also rather concerned about coming up with a "solution" to this that creates giant piles of work for mappers.
Making a "distant environment" should be a very simple process, not something that takes weeks of work and enormous headaches.
Any thoughts on this? I don't have it prettied up yet- I'm still working on making the display lists for the fancy "border" around the edges, to make it look "framed", but I'll get them up tonight.
This looks a lot more professional (imo, of course) than the current system, where "water" is being drawn ad finitum, but without any "seafloor", on maps with water, which looks very unprofessional at most angles, clearly showing the map ending in space. However, there isn't any way to turn the distant water off and limit it to the map rectangle, so this isn't a performance enhancement by any means- it's just an experiment in terms of what's possible, really.
However, I was thinking that this was just the start of doing something new, and I'm open to ideas about how to try and realize the "infinite distance" idea that many people cherish- the idea that the map doesn't really end, but continues into the far distances. I'm not sure it's practical, mind you, but I'm willing to talk about it.
My first thought as to a solution was that we could use the VaLVe approach, and have a "distant object" to do a 3D skybox with.
Using gl.Unit, I was thinking that I could make some tiny, invisible "unit" that's had its polygons offset by some giant scaling factor, and was drawn solely by Lua. 8 such "units" would constitute the sides of the "distant object".
All that said, I'm also rather concerned about coming up with a "solution" to this that creates giant piles of work for mappers.
Making a "distant environment" should be a very simple process, not something that takes weeks of work and enormous headaches.
Any thoughts on this? I don't have it prettied up yet- I'm still working on making the display lists for the fancy "border" around the edges, to make it look "framed", but I'll get them up tonight.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Map Distant Objects
I'm guessing the border is on/offable? Certain maps have worked the border issue very well with smoke and mirrors (oooweee, for example)
Re: Map Distant Objects
Yeah, it's a Widget, not a Gadget, right now. I may make it a Gadget, for P.U.R.E., depending on how cool I think the final results look.
Re: Map Distant Objects
Does this mean that with this widget enabled, the water shader will stop drawing outside of the map boundary?
Re: Map Distant Objects
I've already done a black that goes around the entire map, hiding the water, yes. Easy to do. I'm still working on doing something... more elegant looking.
Re: Map Distant Objects
lol thats easy, simply set the height of each quad to the height of the heightmap at the edge rather than using one single quad all the way along the edge.
Re: Map Distant Objects
No, that would perform really horribly, and it won't always match the edges, due to the mesh-reduction algorithm.
I was thinking I might try making it a Gadget and set the ground-height all along the edge to a ceiling of zero, although that will probably do terrible things, for cases like this.
I was thinking I might try making it a Gadget and set the ground-height all along the edge to a ceiling of zero, although that will probably do terrible things, for cases like this.
Re: Map Distant Objects
Could do what the simcity games did and show a vertical dirt wall:


Re: Map Distant Objects
Meh, I might try that at some point, but I'm not excited by it. You'd have to have one every single heightmap square, so a 512 would result in 2048 quads... or 8096 triangles... which would have to render constantly, yet would hardly ever be seen. Seems like a very expensive solution to such a minor problem, to me.
Moreover... what about games that still use ground deformation? Not that I care, for P.U.R.E., but meh, I hate taking things off the table, just for a visual thing that makes me less irritable, frankly
However... doing it by letting a Gadget readjust the heightmap actually works fairly well, imo:

Moreover... what about games that still use ground deformation? Not that I care, for P.U.R.E., but meh, I hate taking things off the table, just for a visual thing that makes me less irritable, frankly

However... doing it by letting a Gadget readjust the heightmap actually works fairly well, imo:

-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Map Distant Objects
I suspect that adjusting the heightmap could cause serious issues with aircraft that fly off the edge of the map, or units/buildings that stray too close, etc...
Re: Map Distant Objects
Haven't seen any serious new problems with either yet, in testing. I did find some borked drawing behavior, but I tracked it down- seems that running certain things in DrawWorld() can lead to unexpected results regardless of layer assignment... ah well.
I suppose you could see borked behaviors, with ground units with go-anywhere slope tolerances, but meh, you see borked behaviors with them all the time anyhow, and I have tested with soldiers in P.U.R.E., which have fairly high tolerances, and they simply cannot go there. And aircraft do the stupid bump-into-cliffs stuff with giant heights at map edges (remember, outside the map, the height is zero) whether or not this is done, tbh.
Lastly... we're not talking a lot of heightmap pixels here- just 3 inside each edge, and only where the height exceeded 95 units in height. I tried fewer, and it's too abrupt, especially on the maps made with the old MapConv, where the lines from the lousy compression settings show pretty clearly. Nothing can be done about that, frankly.
I suppose you could see borked behaviors, with ground units with go-anywhere slope tolerances, but meh, you see borked behaviors with them all the time anyhow, and I have tested with soldiers in P.U.R.E., which have fairly high tolerances, and they simply cannot go there. And aircraft do the stupid bump-into-cliffs stuff with giant heights at map edges (remember, outside the map, the height is zero) whether or not this is done, tbh.
Lastly... we're not talking a lot of heightmap pixels here- just 3 inside each edge, and only where the height exceeded 95 units in height. I tried fewer, and it's too abrupt, especially on the maps made with the old MapConv, where the lines from the lousy compression settings show pretty clearly. Nothing can be done about that, frankly.
Re: Map Distant Objects
I think this is an improvement.
Re: Map Distant Objects
Argh, first off you cannot see all 4 sides of the border, because the ground/terrain hides the quads on the far side, so you can immediatley halve your figure with basic culling.
Also
So 2048 triangles
As far as I am aware, there are already units in P.U.R.E that exceed 2048 triangles? And you yourself argued did you not that triangle counts of this order where not going to affect frame rates in another thread did you not?
You also receive events for when the height map is deformed right? Could you not put this all in a display list and then recalculate if the terrain si deformed within a certain distance of the map borders? You could do 4 display lists, one for each map side, that way you need only call the list for the 2 sides facing you, and you can reduce the overhead of regenerating on a terrain deformation 4x
Also
Take a quad, any quad, and draw a line from one corner to the opposite. 1 quad == 2 triangles not 4.2048 quads... or 8096
So 2048 triangles
As far as I am aware, there are already units in P.U.R.E that exceed 2048 triangles? And you yourself argued did you not that triangle counts of this order where not going to affect frame rates in another thread did you not?
You also receive events for when the height map is deformed right? Could you not put this all in a display list and then recalculate if the terrain si deformed within a certain distance of the map borders? You could do 4 display lists, one for each map side, that way you need only call the list for the 2 sides facing you, and you can reduce the overhead of regenerating on a terrain deformation 4x
Re: Map Distant Objects
Btw I got that idea with strata too, while programming endless water (you can look under map at the edges, what isn't 100% optimal).
Fact is that lua can hardly predict the engine smf terrain LOD, so it is impossible to do with lua, instead it needs to be done in the smf rendering code.
Fact is that lua can hardly predict the engine smf terrain LOD, so it is impossible to do with lua, instead it needs to be done in the smf rendering code.
Re: Map Distant Objects
Yeah, sorry, I forgot that these wouldn't need to draw double-sided. It's still a waste though, tbh.Take a quad, any quad, and draw a line from one corner to the opposite. 1 quad == 2 triangles not 4.
jK, I for one would welcome a change to the way SMF is rendered that included a solution like that, for heightmap pixels > 0 at the borders.
Heck, we could even define a "dirtEdge" texture to tile with, for coolness points. It wouldn't really change the need (in my mind, at least) to address the "endless world" issues, but it'd certainly make maps look more professional, imo, and I wouldn't have to resort to something this crude to solve that problem.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Map Distant Objects
Looking pretty decent.
Overhead arghs solution looks really nice, but unfortunately when viewed from the side it looks pretty bad :-/
Endless water sounds promising, and would look somewhat decent, but what about that 10% for water rendering on maps with no water (that really need voidwater implemented).
I suppose the obvious solution is to have an area around the heightmap where everything goes down to black 0 and use a normal level of say 25 or 50, but that screws with heights badly.
I fear that if this is to be done, the only way to do it and have it not look like a carebear bandaid on a bullet wound is to have it done engineside.
Overhead arghs solution looks really nice, but unfortunately when viewed from the side it looks pretty bad :-/
Endless water sounds promising, and would look somewhat decent, but what about that 10% for water rendering on maps with no water (that really need voidwater implemented).
I suppose the obvious solution is to have an area around the heightmap where everything goes down to black 0 and use a normal level of say 25 or 50, but that screws with heights badly.
I fear that if this is to be done, the only way to do it and have it not look like a carebear bandaid on a bullet wound is to have it done engineside.
Re: Map Distant Objects
What I did, pretty much, was to lower the edges, not to true zero (black), but to whatever the lowest level of "above water" is.I suppose the obvious solution is to have an area around the heightmap where everything goes down to black 0 and use a normal level of say 25 or 50, but that screws with heights badly.
In short, what you're talking about is essentially what I did- it's exactly like a 3-pixel fade-to-black around a map (I usually use 5, on my maps). And you're absolutely right, it's not an ideal solution to this.
I will happily get rid of the Gadget if the engine can do the "dirt" idea, frankly, it'll look far more professional, and will treat mappers' work with more respect. It won't cure the need for a "frame" around the map, to cut the endless water or blank-nothingness-that's-frequently-an-entirely-unsuitable-color(whew!) problem, however, but meh, that's a Widget, and entirely optional.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Map Distant Objects
Actually I meant that it's obvious for the mapper to do that and account for it. A texture that is designed for it would look a lot better. The only problem is that that cust down on playable area, screws with heights in the compiled map and other various small complications.
Suffice it to say that doing it that way by the mapper isn't really a great solution.
Suffice it to say that doing it that way by the mapper isn't really a great solution.
Re: Map Distant Objects
I would love this as part of the engine.Decimator wrote:Could do what the simcity games did and show a vertical dirt wall: