Moving skybox (discussion + sample)

Discussions about Coding and Scripting
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Moving skybox (discussion + sample)

Post by Higor »

Dr. Flay's thread about ICE reminded me of an old idea I had.

It was about increasing realism in terrain (or any open zone) maps regarding transition between actual map, and skybox.

While it still remains an optical illusion, that would make a very cool effect which, with design genius, makes it possible to see the real map and the skybox as one object where all polygons seem to be perfectly joined.

Excuse the mspaint horror, after all it's a concept.
And a picture does a lot of explaining.
Image

The SkyZoneInfo must be a locally processed actor, so it's default RemoteRole would be ROLE_None.
The SkyZoneInfo should be moved, so no bStatic and no bNoDelete.
The SkyZoneInfo doesn't need to hook into a PreRender method, since it belongs to the map, it will Tick() before the player does.
Edit: there is one little problem, due to ticking before the player does, the special SkyZoneInfo will be one tick behind when it comes to relocation.

Now ultimately, if we're splitting the map in different zones, instead of making many skyboxes, we add many movable SkyZoneInfos around the same skybox and use a script to link the play zones to each specific skybox.
EDIT: Silly me, if the SkyZoneInfo moves and both zones are cojoined, there's would be absolutely no need to use more than one SkyZoneInfo.

This can be applied to almost every map that tries blending terrain and play zone, i'll give you one of the greatest possible examples within UT Stock maps:
LavaGiant, just take a look at the lava in the middle, and the lava from the outer zone (not sure if expressing myself clearly here).

Code + sample map.
MovableSkyZone.zip
(68.61 KiB) Downloaded 234 times
Feel free to embed the code into maps, it's the original purpose of this.
No need to embed the dummy actor, the MovableSkyZone has a reference to it in its code.
Mess with the map as you wish as well.

EDIT: The zone actor has a network problem, download the map below and use THAT MovableSkyZone.u instead
http://www.ut99.org/viewtopic.php?f=5&t=4159
Last edited by Higor on Mon Sep 03, 2012 8:08 pm, edited 6 times in total.
AlCapowned
Experienced
Posts: 130
Joined: Mon May 16, 2011 2:45 am
Personal rank: Layman

Re: Moving skybox (discussion)

Post by AlCapowned »

It's a very cool concept. From what I've seen of UArchitect's 3d skybox project, it makes the skybox look like a seamless part of the map without any problems. I think it was used in some maps for EXU2 that Waffnuffly is working on.
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Moving skybox (discussion)

Post by papercoffee »

I can't say that I understand what read there ...can you explain it for dummies like me.
Even better if you could explain it in a video.
User avatar
UnrealGGecko
Godlike
Posts: 2900
Joined: Wed Feb 01, 2012 11:26 am
Personal rank: GEx the Gecko
Location: Kaunas, Lithuania
Contact:

Re: Moving skybox (discussion)

Post by UnrealGGecko »

papercoffee wrote:I can't say that I understand what read there ...can you explain it for dummies like me.
And me!
User avatar
Dr.Flay
Godlike
Posts: 3347
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: Moving skybox (discussion)

Post by Dr.Flay »

I think I half understand this :?

The CTF map I've been working on, had a skyzone actor in the middle of the map for some reason. There is no skybox !
I switched the outside walls of the map to be in "backdrop" mode, and when I stood near the spot where the skybox actor was, it was...
freaky and...psychedelic would be a good word !
The scale was way too large but, it creates a great optical illusion. You cannot tell how far away the edge of the map is.
I was stood in a map, inside a map, looking out... or in? It fried my eyes and head.
It was like being in a map made by Escher :omfg:
If someone feels brave there is an idea for mind-bending maps, where you may find you've been trying to shoot yourself in the back of the head :satan:
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Moving skybox (discussion)

Post by JackGriffin »

I see what you mean about this, but it appears to be a very specific usage.

Let me try to explain a bit more how this works so we can get a few more "A-ha!" posts. Imagine I want to build a DM map that takes place on the top of a mushroom (give me a little creative license here). The mushroom cap would be a normally made floor map. There would be a short part of stem underneath made from normal BSP and that would be the end of the BSP.
Now you create a rather large and intricate skybox with other mushrooms scattered across the floor of a forest. In the center you add a tall stem that matches texture with the mushroom you made your map from.

Now carefully add the skyzone so the stem stub from the map aligns with the stem stub from the skybox and it appears that the skybox is a simple extension of the map. If this was done carefully to preserve the scale you couldn't distinguish between real and fake until a rocket hit the fake wall.

I see some cool usage for this but it's going to be limited to places where your point of reference doesn't change. Places like the top of a building or the like but that you cannot exceed the edge of lest you fall off. The illusion would fail with multiple buildings or a greatly altered point of view relative to the skybox position but overall it's a neat idea. I've often thought that skybox potential was severely underused but it's better for mappers to concentrate on gameplay anyway.
So long, and thanks for all the fish
User avatar
Dr.Flay
Godlike
Posts: 3347
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: Moving skybox (discussion)

Post by Dr.Flay »

*Extrapolation alert*
You could fake endless swarms of hoard enemies coming from the distance, in a siege type game.
Great for a Lord of the Rings size swarm.
Disappearing down a hill or dip (edge of map), as they get closer the real ones then spawn there or behind things.

Is that the sort of "can of worms" you are opening?
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Moving skybox (discussion)

Post by Higor »

In order of difficulty in terms of application:

Easy: Islands -
Make for example... a 8192 x 8192 small island map, make a water sheet of that size.
Now make a huge 2048 x 2048 skybox, place a water sheet as well there.
In the middle if the skybox, substract on the water sheet a 32x32 square.
You connect the points of reference to generate the illusion the water is one face.
The good thing of this, if you go to the edge of the map and go underwater, you'll also see the skybox water from below.

Mid: Buildings
As explained before, all you have to is connect the playzone building tops with the skybox building bottoms.
If you have more than one building, it doesn't matter, if you placed those correctly in the skybox as well, they will appear connected.

Difficult: Terrain
Make a 4.000 x 4.000 skybox made of 120 x 120 sections.
Intersect the middle 40x40 sections of it.
Enlarge it to 20.000 x 20.000, that's your play zone.
Substract the middle 40x40 in the skybox and make the remaining 5 faces (bottom and 4 sides) invisible (fast rendering).
Connect the points to exactly the middle of both terrains, you got a huge terrain map.

Nintendo hard: Ground based map + Super elevators + Sky platform above clouds.
Connect the ground just like a terrain.
The elevators are inside substractive cylinders, that means, the outside part of the lift pipes (that have windows to see outside) must be in the skyzone.
Don't forget to create an attractive transition.
Create a good cloud effect for the lower view, a nice sky for the upper view, the clouds will be seen from above if you look down.
If only part of the sky platform is playable, then make the remaining parts in the skyzone and connect them as well.


An outer zone covering the boundaries of the playable sections can be used to make projectiles disappear without detonating.
Remember to make the sky zones as large as possible so that stars and/or sun won't move that much.


PS:
To prevent the zone from rendering on tick behind the local player (clients as well).
The MovableSkyZone will only Tick to try and detect the local player.
Once located, spawn a dummy (Role=Role_None) actor that will happen to Tick AFTER the local player's tick (and before the rendering functions).
Use that dummy actor's tick to update the location of the MovableSkyZone actor.

I should post an example map...
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Moving skybox (discussion)

Post by papercoffee »

Higor wrote:I should post an example map...
:tu: would be great ...
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Moving skybox (discussion)

Post by Higor »

EDITED FIRST POST

EDIT:
The code uses PlayerCalcView method to determine zone position, for that reason when in behindview mode or spectating someone else, the moving skyzone will still appear ok.
The only 'unfixed' thing so far is changing viewtarget or moving during pause or playersonly mode, things which prevent Tick.
But i don't really want to hook into PreRender...
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Moving skybox (discussion)

Post by Feralidragon »

As for "playersonly" you can set your actor defaultproperty (or in runtime) bAlwaysTick to True.
As for pause, I don't remember if the same works or not, but you shouldn't worry much about that since with pause *everything* stops anyway.
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: Moving skybox (discussion + sample)

Post by Sp0ngeb0b »

Awesome concept! :tu:
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
User avatar
GenMoKai
Godlike
Posts: 2896
Joined: Tue Mar 18, 2008 9:39 pm
Personal rank: Mapper
Location: Netherlands, the land of cheese and weed!

Re: Moving skybox (discussion + sample)

Post by GenMoKai »

Owke... now i get it! and its awesome!
Image
EAT THOSE FRIGGIN BANANAS !!!!!
1000 MPH Studios MAY NOT play any ut99.org community mappack 2 map without George W. Bush explicit permission
Bloeb
Experienced
Posts: 95
Joined: Tue Apr 06, 2010 11:07 am

Re: Moving skybox (discussion + sample)

Post by Bloeb »

This is very nice. The skybox merges almost seamless. In the demomap only the lighting is a bit off at some points and the oceanfloor doesn't merge correctly. :gj:
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Moving skybox (discussion + sample)

Post by JackGriffin »

If you spent a bit of time tweaking the lighting in the waterzone nearly all of that would disappear. Yeah this is a pretty damn neat thing, well done.

Edit: I tweaked the waterzone ambient brightness to 120 and in the areas where lighting is constant the seams are very faint. With some careful lighting this could be done up nicely.
So long, and thanks for all the fish
Post Reply