Fred's Sky Modding Tutorial

Started by Phobos, October 21, 2014, 08:41:05 PM

Previous topic - Next topic
October 21, 2014, 08:41:05 PM Last Edit: May 06, 2020, 05:30:25 AM by Dark_Phantom
This tutorial is a combination of forum notes taken from secretsociety.com and the sky tutorial which shipped with bfbuilder. Everything below this line was written by psych0fred.




Tutorials: Fred's Sky Modding Notes

- NearSceneRange(start min, start max, end min, end max) where the range between the two is controlled by the slider under video options.
- FarSceneRange first requires a world have a far scene (far scene uses low res terrain for the distant texture and FarSceneRange is just min and max distance. If a world has no far scene it uses reflecting color as the fog color in the far scene.

The FarSceneRange is at what point the scene stops rendering. If you set the FarSceneRange to 0 then everything blends into the dome. What doe sthis mean? Look at Yavin1 and you'll notice there isn't a sky texture, it looks like the sky blends into a gray fog. This is because the FarSceneRange is set to 0. Otherwise the blending of teh skydone is done with LowRezTerrain, as in the scene blends to the LowRezTerrain texture rather than the dome. The gap between Near and Far Scene Ranges should be kept under 50, because in that mid range both near and far are being rendered (it's a buffer zone) and eats memory.

A couple other sky notes that may be useful:
- Suninfo(height angle, direction angle)
- The angle is the direction the light goes not comes from, so 0 is directly below, 90 is on the horizon and 180 is overhead. The heioght angle you set using common sense, the directional angle you play with and see how it looks until you like it. This is because the direction angle is based on the x direction of a world (which is different based on your sun position)
- On PC AmbientVehicle and Ambientunit are not used unless there are not top and bottom directional settings, in which case it then uses ambient vehicle, otherwise static world objects use the ambient color setting and dynamic objects (vehicles, units, etc) use the top and bottom directional settings.
- Sun shadow color is the color which is subtracted from the area that is being hit by a shadow.

Yeah if they try to render too many objects at once it could crash them. They can test it with sptest and look in the log. They can also adjust their lod settings in their control panel if you have your ranges in the sky file set to accomodate them.  I can't proivde support on MSN as I mostly do this in my spare time while I work on our next game. As for the forward command center If it's part of the side you just have to make sure you load it in the top of your lua like you would a vehicle because it's assets need to come from the rep.lvl. Aside from that I think you just place it in the world like an object.

It shouldn't be based on object count but rather the amount of memory required. It'll work off the view distances first and if it doesn't have enough memory to display everything then it will display what it can. Make sure you read the posts on the sky file, it's important that your mid range is as small as possible because it renders both high and low res models within that range which takes up even more memory. This is a good starting point for small to medium map: NearSceneRange(50.0, 220.0, 60.0, 300.0);

Note the mid range here is only between 50 and 60 meters so only in that range will objects be doubly rendered. Otherwise the low res is all you see beyond 60 meters. It's also possible that you forgot the low rez models, in which case you are only seeing the hi res and nothing renders for low res. Check the ODF file for a reference to a low rez model if you see nothing in the msh file. Otherwise check your in game video settings to see what your settings are. The lod range settings could be set low in your profile. Otherwise try bringing out the max distances on the visibility range and see if that helps.

Sky dome's should be hemisphere's as shown above, in which case the flat part (bottom ) needs to be closed off rather than open (you can use/extend the pixel from teh bottom of the dome, so it shouldn't. Open-bottomed spheres cause visual problems in certain circumstances. In the case of space maps the dome would be a sphere with the entire interior textured.

Sky meshs don't have to be a dome, but your texture needs to be matched on whatever mesh you do use so there are seams. I don't think geonosis uses a dome but rather something rectangular. Geonosis sky was used in the template so if you did not use a different mesh then try one from another world like Tatooine or Yavin. Getting the seem at the top of the sky to disappear may not be possible but you can play with it until it is as good as possible.



BFBuilder's Sky Modding Tutorial by Psych0fred

EDITING THE SKY
The sky is controlled by the ModID.SKY file located in the DataModID\Worlds\ModID\World1 folder for each project. The sky file is a text file that can be edited with a text editor. Objects in the sky are not restricted to any formal outline; an unlimited number of objects can be placed in the sky in a variety of differet ways. What ultimately is important is objects placed in the sky appear in front of objects that are to appear in the background, and the Geonosis sky used as the template sky is a good demonstration of that.
The default sky file contents appear below.

SkyInfo()
{
    ObjectVisibility(40.000000, 80.000000, 1600.000000);
    FogColor(252, 252, 252);
    FogRange(0.000000, 3000.000000);
    NearSceneRange(50.0, 220.0, 60.0, 300.0);
    FarSceneRange(450.000000, 1000.0);
    AmbientColor(120, 101, 76);
    TopDirectionalAmbientColor(120, 101, 76);
    BottomDirectionalAmbientColor(126, 70, 35);
    CharacterAmbientColor(209,156,73);
    VehicleAmbientColor(189, 136, 53);
    Enable(1559);
    FogRamp(3);
}

SunInfo()
{
    Angle(140.000005, -10.000011);
    Color(120, 120, 120);
    Texture("");
    Degree(90.000011);
    BackAngle(180.000022, 0.000000);
    BackColor(128, 128, 128);
    BackDegree(0.000000);
}


DomeInfo()
{
    Texture("SKY_Geonosis.tga");
    Angle(190.000005);
    Ambient(128.000038, 128.000038, 128.000038);
    Filter(1);
    Threshold(150);
    Intensity(50);

    Softness(1);
    SoftnessParam(60);

    PC()
    {
        TerrainBumpTexture("geo1_bump", 1.0);
    }



    DomeModel()
    {
        Geometry("geo_sky_dome");
    }

    DomeModel()
    {
        Geometry("geo_sky_arena");
        Offset(-20.0);
        MovementScale(0.995);
    }
    DomeModel()
    {
        Geometry("geo_sky_spire");
        Offset(-20.0);
        MovementScale(0.995);
    }
    DomeModel()
    {
        Geometry("geo_sky_dome_rim");
        Offset(10.0);
        MovementScale(0.995);
    }

    LowResTerrain()
    {
        Texture("geo1");
        PatchResolution(7);
        FogNear(300.0);
        FogFar(700.0);
        FogColor(142,82,38, 128);
        DetailTexture("geo1_far_detail");
        DetailTextureScale(0.25);
    }
}


//Big rep flyer
SkyObject()
{
    Geometry("rep_fly_assault_DOME");
    NumObjects(2);
    Height(200, 300);
    VelocityZ(20, 50);
    Distance(1500);
    InDirectionFactor(2);
}

//Rep fighters
SkyObject()
{
    Geometry("rep_fly_gunship_DOME");
    NumObjects(20);
    Height(80, 140);
    VelocityZ(80, 120);
    VelocityY(-10, 10);
    Distance(600);
    InDirectionFactor(0.5);
}

//CIS fighters
SkyObject()
{
    Geometry("cis_fly_droidfighter_DOME");
    NumObjects(20);
    Height(80, 140);
    VelocityZ(80, 100);
    VelocityY(-10, 10);
    Distance(300);
    InDirectionFactor(0.5);
}

//CIS rockets
SkyObject()
{
    Geometry("cis_fly_techounion_DOME");
    NumObjects(8);
    Height(0, 0);
    VelocityY(10, 12);
    Acceleration(0.0, 2.0, 0.0);
    Distance(1000);
    LifeTime(80.0);
}


SKYINFO
The SkyInfo properties define the global sky properties.These are mostly self-explanatory and their settings adjusted to see the effects in game. Again the sky files provided with the assets for the worlds that shipped with the game are a great resource for sky file settings and their effects.

SUNINFO
The SunInfo defines the actual sun object properties. No texture is used for the sun in the template, but one could be.

DOMEINFO
DomeInfo defines the actual dome and objects contained by the dome object. One object is mandatory, and that is the dome itself. The dome geometry shape is not limited to a spherical shape, it could just as easy be a cube. The dome model gemoetry is exported from Softimage XSI. In the template sky there are objects for the arena and the spire in the background. These are separate objects but they could have just as easily been a static part of the sky texture. When lifting off in a flyer, having the objects in front of the sky texture provides a different sense of perspective on the object while rising. If the objects were in the sky texture they would not change as the camera position rose above the world. With them as objects in front of the sky texture their MovementScale can be adjusted to provide a sense of closeness to the object as the camera peers over it.
LowResTerrain is the texture displayed for objects outside of the near visbility range. A good way to create a texture for this is using the ADVANCED IMAGE controls in Zeroeditor. In the Advanced Image Controls panel there is a button labeled Save HiRes Map. This button will save a huge image (4096x4096) of the terrain that can then be scaled down to 512x512 in order to maintain the image quality.

SKYBOJECTS
SkyObjects are objects that appear in the sky and not the dome. Specifically these are the capital ships and fighters that can be seen flying throughout the sky. These make use of special dome models that have less complex geometry and therefore utilize little memory. These objects must be included in the mission lua in order to load.

How to make it actual earth sky with sunset?

Just change the sky color with gimp (or any other program) to however u want it and move the sun's position. If u use ur brain, modding will be really easy
Anyder | Talent, Ops & Culture | SWBF & Player Engagement
Email: communityambassador@swbfgamers.com
SWBFSpy Discord: http://discord.swbfspy.com
SWBFSpy Info: http://info.swbfspy.com