Page 1 of 2

far away buildings

Posted: Tue Feb 27, 2007 1:19 pm
by psYco
Im starting to work on my first level, and its a courtyard, with walls you can see over so you just see the sky, and thats fine, but at one point you have to posses the guard standing in a watch tower overlooking the yard off to one side, now from his perspective, you will have a complete view of the courtyard and then you see into the distance, so im going to build some buildings to the sides, but I want to give the feeling of great space, so within the skydome I wanted to have those kinda 2D backgrounds that you see in games such as quake 4, doom 3, the other quakes and I think a few times in HL2.

here are some examples of what I want:

Image

Image

So basically I want to make 'fake' skylines, does anyone have an idea how this could be done in RF???

Posted: Tue Feb 27, 2007 1:24 pm
by QuestOfDreams
That are just simple skybox effects with some nice textures...

Posted: Tue Feb 27, 2007 1:26 pm
by Jay
The easiest way is to do this with a skybox. (that's a box with 6 sides that each represent one direction, front, back, left, right, top and bottom) But the FarClipPlane is somehow broken with Skyboxes and also you're left with a totally undynamic sky.

About the skydome, you can set the skytexture with a command, i don't remember its name right now (it's in the docs i am sure), but i am unsure what the format has to be for the texture. Maybe it has to be round?

I hope these two ideas help you. :)

EDIT: lol QoD wrote at the exact time as me!

Posted: Tue Feb 27, 2007 2:36 pm
by psYco
well I know how the skydome works, but as far as I know RF only supports one BMP for the texture, and so it wouldent be possible to have the sky at the top and buildings on the sides... Im going to try just make a skydome for the sky, and then use some brushes with the Skybox entity applied and have them be the buidings, since they dont have to be dynamic at all...

Posted: Tue Feb 27, 2007 3:21 pm
by Juutis
You could actually have the buildings painted on the skydome bitmap. It would be tricky though, since the the skydome is a sphere and you would have to paint the texture accordingly.

Posted: Tue Feb 27, 2007 3:26 pm
by psYco
hmmm, your idea sounds really good, but im not quite sure I understand what you mean? I think i get what I have to do (make the image of the buildings 'round') but im not sure how you would apply the texture to the skydome?

Posted: Tue Feb 27, 2007 3:48 pm
by Juutis
Just to make things clear:
skydome is the spherical 'sky', the dynamic one you control with a script.
skybox is the 'cube sky' around your level that can have 6 different bitmaps.



So - if I'm not totally lost here - with a skydome you would need a texture like this:
The black blocks represent the buildings and white areas are the actual sky.
Image

The texture is then placed on the skydome something like this:
(side view, I hope you get it :) )
Image



You apply the texture to the skydome in the script.
The manual:
SetSkyTexture(texture);

Define the bmp file used to texture the skydome

Posted: Tue Feb 27, 2007 4:07 pm
by psYco
oh yeah, I totally get it now, and i will try it out. But i just always thawt that the skydome texture was like looped, just like the textures on the level, so in that case that wouldent work... But I think that using what your saying i should be able to get it to work... I might have to tell the skydome to strech the texture rather than looping it some how.

I'll post back in a bit when ive tried.

Posted: Tue Feb 27, 2007 5:05 pm
by psYco
Well, i created a basic sky texture, to let the buildings show up

here it is;

Image

I then added the sky dome entity and set it up like this;

Image

and this is the script that i told it to use;

Code: Select all

{
	Start[ ()
	{
                SetHeightOrigin(-1000);
                SetLandscapeSize(2000);
		SetSkyDome(500, 50);
                SetSkyTexture("level1sky.bmp");
                SetDesiredTriangles(2000);
                SetTerrain("flat.bmp", "desert256.bmp");
                SetDistanceFromSunFactor(4000);
                SetTwilightDistanceFromHorizon(0.6);
                SetLocation(920, 10, 16, 23);
                SetTwilightColor(255, 101, 114, 255); 
                SetSkyColor(116, 208, 241, 255);
		SetTimeScale(512);
		DisableSun(false);
                SetSunColor(255, 226, 146, 255);
                SetSunScale(8);
                SetAmbientLightColor(128, 128, 128, 128); 
                DisableCloud(false);
                UseSkyFog(false);
                
	} ]

	Run[ ()
	{
		SetWindDirection("northeast");
	} ]
}
but now when I compile the level the rite sky bmp doesnt show it just shows some random blue and purple colours which is another sky picture i used ages ago... oh and ive put the level1sky.bmp into the media/bitmaps/terrain directory. and the image is 512x512

can anyone see what im doing wrong? [/code][/quote]

Posted: Tue Feb 27, 2007 5:37 pm
by Juutis
I think that 'Start' should be the 'InitOrder' and 'Run' the 'StartOrder'.
Also, does your script have the '.s' extension? If so, you should add it in the entity properties.

Great looking texture, BTW. :)

Posted: Tue Feb 27, 2007 5:44 pm
by psYco
THANK YOU!!!! It works! and for the first time ever i understand the skydome! (i never used to notice my changes but thats cause it wasnt running the script!!!!) seriously Juut, without you this game would NEVER get done... Thanks, when i get the size and that sorted out ill post a screen.

Posted: Tue Feb 27, 2007 6:00 pm
by psYco
well ive sorted out the scale and that, and I stopped the way it cycled through the entire day in about 10 seconds, but there is still these 'blocks' and I dont think its because of the number of triangles, cause they are still there whether i use 100 triangles or 2000 triangles... anyway here it is,

Image

Posted: Tue Feb 27, 2007 6:08 pm
by Jay
That looks really good! :)
I have no clue about the blocks but i just wanted to say that you made good work with the texture!

Posted: Tue Feb 27, 2007 6:37 pm
by Juutis
Wow! That looks awesome! :D
I really like the texture, too.

I've tested skydomes a couple of times, but never had that problem with the blocks.
My sky textures have been kinda dark, though, so maybe I just haven't noticed.

The only idea I have is that the sky is rendered with the wireframe thing.
Try adding RenderWireframe(false); in the script.

Or could it have something to do with the sky colour?

Posted: Tue Feb 27, 2007 6:45 pm
by psYco
hmmm, i think that just mabey, its just my PC, cause i get similar lines going across my other textures sometimes... So ill try it with the turn off wire frame command, but if it doesnt work ill try it on another PC, and then hopefuly the lines will go away... :D

oh and thanks for the compliment on the texture...