LoG Sky System [BETA]

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

LoG Sky System [BETA]

Post by Diarmuid »

Hello folks, so, due to popluar demand, here's the sky system I've developped for LoG: https://docs.google.com/file/d/0B-rVman ... sp=sharing.

See video here: http://youtu.be/RyX7iUs9eFA

You'll find in the above archive a example dungeon source which shows how to implement it. It's still in beta state and needs more tweaking, I call here to the forum community in helping further development of the project. Required elements for this to work:

1. LoG framework installed
2. the dx_sky_system folder in mod_assets, which contains all the required objects, models and textures for the sky system. You have to import dx_sky_system\dx_sky_system.lua in your init.lua.
3. the skyScript script_entity in the dungeon editor, where all the functions are.
4. the initialization section at the bottom of that script where you define ambiances and interior objects.
5. a wallset with an invisible ceiling. You can simply replace the ceiling line with this in the wallset definition:

Code: Select all

	ceilings = {
		"mod_assets/dx_sky_system/dx_remove_ceiling.fbx", 1,
	},
So the system revolves around that concept of ambiance. For example:

Code: Select all

defineAmbiance{
	name = "rainy_day",
	skySphere = "dx_skysphere_grey",
	skyLightColor = {0.9, 0.9, 0.9},
	skyLightBrightness = 8,
	skyLightParticleSystem = "dx_sun_clouds",
	weather = "dx_rain_2",
	weatherRadius = 2,
	thunder = "lightning_bolt_hit",
	thunderFrequence = 0.08,
	clouds = "dx_clouds_grey",
	cloudsFrequence = 9,
}
Ambiances are defined with skyScript.defineAmbiance{properties}, and switched with skyScript.setAmbiance(name). Included with the file actually you can find: "day", "night", "dark_night" (less light & cloudy), "rainy_day" and "rainy_night". Someone must definitely add "snowy_day" and "snowy_night", at least. There are test scrolls in the first champion inventory which show how you can switch ambiances.

A quick run-through of ambiance properties:

name = the name of the ambiance

skySphere = if you want, the name of the projectile object for the background color. There's a blue and a grey one included, and you can make your own. If ommited, background is default black.

skyLightColor = RGB color table of the global light.
skyLightBrightness = brightness of the global light.
skyLightParticleSystem = a particle system for the light source. One is included for the sun, look above in the "day" ambiance. If ommited there won't be a particle system with the light.

clouds = the projectile object with the clouds texture. There are two white clouds, one grey and one dark grey included, and you can make your own. If omitted, there won't be clouds.
cloudsFrequence = a number between 3 and 12 approx, on how many clouds to randomly distribute across the level.

stars = the name of the particle system to use to generate stars. None if omitted. Included are stars and dark_stars.

weather = the particle sysstem to use for weather. Only rain is included now. None if omitted.
weatherRadius = how many tiles around the party to generate weather (for performance issues)
thunder = the name of the sound to play for thunder. None if omitted.
thunderFrequence = the frequence of the random thunder. 0.08 is used in the actual rain ambiances.


the interiorObjects = {} table at the end of the skyScript defines which objects should the script look for to define as "interior" so that it doesn't spawn weather on those tiles. In the example dungeon, there's a dungeon_ceiling object in objects.lua used for that purpose.

For more technical details on how all this works, see my post here: viewtopic.php?f=14&t=4741&start=100#p56648

What's left to do?

- For some reason, when the weather radius is set to 3, turning around 180 degrees and moving forward crashes with a duplicate id on the weather objects
- Ambiance is generated on a single level. It would be good to make code that can destroy and respawn ambiances when taking stairs. Probably just calling setAmbiance from a hidden pressure plate on the new level should work, at it cleanes up any previous skyScript objects, needs testing.
- The skkylight is generated as an fx, and might not stay after save/reload. setAmbiance(currentAmbiance) must be called on reload, I remember that someone made a load detection script somewhere.
- When looking at an "interior" more than 7 squares away, you'll see the sky. There's a dx_skyblocker_black object which is just a black panel, which has to be generated and moved dynamically on those tiles, maybe using the isInterior(level, x, y) function. This, or design the dungeon so that you cannot see deep inside the interior from the exterior.
- Moving skySphere was out of sync with the party sometimes, and there's no code yet to check for slower movement due to weight.

So feel free to tweak it! I don't have time to fix all those issues, but I'll be glad to answer questions on how the code works - I think I wrote in a legible enough way with clear variable and function naming.
User avatar
odinsballs
Posts: 288
Joined: Thu Dec 20, 2012 4:25 pm
Location: south of heaven

Re: LoG Sky System [BETA]

Post by odinsballs »

sorry for asking but what is log framework? (not familiar with that) :oops:
otherwise looking forward to experimenting with this system. :)
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: LoG Sky System [BETA]

Post by Diarmuid »

odinsballs wrote:sorry for asking but what is log framework? (not familiar with that) :oops:
otherwise looking forward to experimenting with this system. :)
Here: viewtopic.php?f=14&t=3321
User avatar
odinsballs
Posts: 288
Joined: Thu Dec 20, 2012 4:25 pm
Location: south of heaven

Re: LoG Sky System [BETA]

Post by odinsballs »

Diarmuid wrote:
odinsballs wrote:sorry for asking but what is log framework? (not familiar with that) :oops:
otherwise looking forward to experimenting with this system. :)
Here: viewtopic.php?f=14&t=3321
ah yes thanks for the link (this looks like some heavy duty scripting stuf, very interesting.)
User avatar
Conchron
Posts: 137
Joined: Mon Dec 31, 2012 1:20 am
Location: Sweden

Re: LoG Sky System [BETA]

Post by Conchron »

That looks great. :)
valley609
Posts: 16
Joined: Thu May 09, 2013 4:32 pm

Re: LoG Sky System [BETA]

Post by valley609 »

This looks really great, I will definitely download this and take a closer look during the week
User avatar
odinsballs
Posts: 288
Joined: Thu Dec 20, 2012 4:25 pm
Location: south of heaven

Re: LoG Sky System [BETA]

Post by odinsballs »

concerning ceiling removal: i usualy used to use a ceiling removal tool from skuggasveins yuleland mod (individualy placed tiles) and more custom stuf to achieve ceiling kill. wil this method suffice under framework/skysystem. ( ceiling wil be gone one way or the other right?), or do i need to look in to more options (this whole ambiance /skysystem is a lot to take in at once, but well worth mastering i might add). a lot but briliant. :shock:
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: LoG Sky System [BETA]

Post by LordGarth »

Amazing I am going to have to try this. Wish there was an easy way to install all of this stuff.

LordGarth
Dungeon Master and DOOM will live forever.
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: LoG Sky System [BETA]

Post by LordGarth »

Got it all to work.


Wheeee

:shock:

How do I get the weather to change with a timer or pressure plate?

Thx,

LordGarth
Dungeon Master and DOOM will live forever.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: LoG Sky System [BETA]

Post by bongobeat »

waouuu
amazing!
nice work, greetings!
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply