Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsJedi Knight and Mysteries of the Sith Editing Forum → My Idea for Dynamic Lighting
My Idea for Dynamic Lighting
2005-06-26, 1:38 PM #1
I don't know if this is possible or not, but can you give Dynamic Lights both a range and an intensity value? You know, just like static vertex lighting in JK? If this is possible, I have a great, easy method in mind for lighting levels without flicker or an excessive number of things.
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-26, 2:19 PM #2
I don't think so. The range value is mainly a JED thing. It's also quite illogical. Light has only an intensity, it's range is (nearly) infinite.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-06-26, 2:21 PM #3
A while back, Sige found the "proportionality constant" for dynamic lights :p

http://forums.massassi.net/vb/showthread.php?s=&threadid=30544

In short, light range = 1.25 * intensity

Er...
*reads Daft's post again*
...oh darn, this isn't exactly what you wanted is it? :o :\
May the mass times acceleration be with you.
2005-06-26, 2:23 PM #4
Quote:
Originally posted by zagibu
I don't think so. The range value is mainly a JED thing. It's also quite illogical. Light has only an intensity, it's range is (nearly) infinite.

When you say light has "infinite" range, you're talking about real life aren't you? Because I don't give dingle-berries about real life, this is a computer game! :p

For my intents and purposes, a way to control a dynamic light's range and intensity would be phenomenally helpful. So if there is any conceivable chance there is a way to do this, I'd love to know.
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-26, 2:25 PM #5
Quote:
Originally posted by Darth Slaw
A while back, Sige found the "proportionality constant" for dynamic lights :p

http://forums.massassi.net/vb/showthread.php?s=&threadid=30544

In short, light range = 1.25 * intensity

Er...
*reads Daft's post again*
...oh darn, this isn't exactly what you wanted is it? :o :\

No, but I remember reading that thread. If we can use it to help find a way to "manipulate" range/intensity values for DLs, I'd be a happy camper. ;)
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-26, 3:00 PM #6
hmmm, I've just notice for the first time that the actor class has these values:
Code:
...lightoffset=(0.000000/0.070000/0.040000) lightintensity=0.80
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-26, 11:52 PM #7
Yeah, I was talking about real life, because computer game engines are usually modeled after that.
Anyway, actors spend some light, because it's not funnay to play in absolute darkness. It's also not funnay to not see a punching Gran, I guess.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-06-27, 9:09 AM #8
And this is why JK > Doom3
:p :p :p I can't really judge D3 because I've never played it, hence the plentiful number of :p 's
May the mass times acceleration be with you.
2005-06-27, 11:23 AM #9
Quote:
Originally posted by zagibu
Yeah, I was talking about real life, because computer game engines are usually modeled after that.

Jedi Knight is by no means a "realistic" game, and would only become so after extensive modifying of the engine, which is currently not an option. If anything, it's almost "cartoony". Now don't get me wrong, I want to make JK as cool and refreshing as possible, but a Star Wars Shooter set in a galaxy with Jedi and Lightsabers .... it's just not going to be realistic, at least not the sort of realism we're used to.

This is a concept of mine which almost certainly won't work, but if it did, could be a very convenient way of lighting levels. I'm not in this for realism, I'm in it for something new - something that has the potential to be both easy to implement and effective in practice.
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-27, 11:41 AM #10
Alright, before someone posts back, I thought I'd explain my idea in more detail. It's probably pretty cooky, and you may be wondering why the heck someone wants to do this, but bear with me for a moment:

My idea is this. Instead of lighting a level with either A) Static lights which are placed in the editor and calculated long before the player even enters the level or B) dynamic lights which are placed virtually the same as static but have many shortcomings maybe we could have C) an "Extra Light" value attached to the player, including both range and intensity. This way, the level is effectively and dynamically lit by a single individual walking around with a gaint radius of light following him.

This would be good because it would:
- Reduce the number of things
- Remove the flicker problem associated with DLs, because the light would always be in the same sector as the player
- Improve frame-rate

You might say that this idea is obsolete because of GBK's Dynamic Light cog which stabilizes them so that they no longer flicker. However, I have found after experimentation with this that it seems impossible to create more than 30 lights before they start shutting off. Also, it is inefficient because it creates twice the number of things - the ghosts where the lights will be positioned. So for example, you can have 30 ghosts, 30 lights and thus 60 things. Plus, they will start to shut off if too many are in view, or if a massive firefight breaks out.

However, if the method I'm proposing is possible, you could have 1 light for 1 player - even if you had a JK MP level crammed with 16 players, you'd still have barely half of the former number of lights with the old method. I'm thinking, that you could extend the range value to something gigantic, like 10-100 but have the intensity value at 1 - 10, depending on how bright you want your level to be.

Problems with this (other than the fact it may not even be possible):
- Wouldn't work very well for wide open levels; it would be best suited for in-door levels with lots of corridors and rooms that are not, say, Planet Sith size (otherwise, the player might see the vertices farthest away from him darken as he moves away)
- Might be hard to sync over MP, and the light values of two players might increase if they get to close together, which would look a bit silly (there may be a way around this using cog though)

This probably won't work, but here's my idea all the same, and I'd love some input and suggestions.

Thanks. :)
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-27, 12:29 PM #11
Even with low intensity, it would seem odd. You'd be able to see the light changing as you move. It'd be like if your character were holding a sun or something. It could also really destroy chances for some great lighting. If you really want something like this, I'd suggest just using mainly extra light and a small dynamic light near the player to give him some shading...
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-06-27, 1:16 PM #12
Well it could be used for special levels, to simulate a sort of lantern effect. But I don't really see how you would realize dark corners that the player can go to.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-06-27, 1:21 PM #13
Thankyou for your input, both of you. :)

Again, I realize this seems impractical, but currently, I'm just curious if it's possible - via cog, or maybe even more preferably just by simply editing the master tpl.

We won't know how this works until we try it!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-27, 2:07 PM #14
Let's say you find a way to change light intensity dynamically (parsearg, whatever, I don't know :P)
Then the problem you have to deal with is, up to something like Light_Range (assuming the light intensity = Light_Range) jkus away, everything will be fully lit, and it will only get darker for a short distance after that until it gets completely unlit. So, you would have trouble creating a long range but not fully bright light.
Air Master 3D (my iPhone game)
My Programming Website
2005-06-27, 2:12 PM #15
I experienced the "shut off" problem of dynamic lights myself, but that was before the thing limit patch and before I used GBK's flicker COG. I'm unsure if the thing limit fixes the dynamic light limit thing. Idea for the next patch, Sige?
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-06-27, 5:33 PM #16
Well, I am not too big on another patch yet. It is hard to get wide usage (never mind how many people *could* still make use of it). I did make one to show that you can add new cog verbs, but I am not sure how far I will take that. Jon`C is working on a new game engine that will be mostly backwards compatible, and perhaps helping with that is better than spending time on patches.
Air Master 3D (my iPhone game)
My Programming Website
2005-06-28, 11:45 AM #17
I was looking at the JK Specs, and noticed some interesting values for the "Explosion" template:

Quote:
FLASHRGB Explosion

A tint for the explosion

Use: flashrgb=(r/g/b) (vector for red,green,blue)

Is this implying colored dynamic lighting, or does it just mean it tints the color of the sector the exploson is in?

There's also another value:
Quote:
MAXLIGHT Explosion

Amount of maximum light given off by explosion

Use: maxlight=flex

Perhaps this could equate to intensity?

The next one interests me the most.
Quote:
RANGE Explosion

Specifies the blast radius

Use: range=flex

Could this be used to alter the range of the dynamic light generated by the blast? Or will it only affect the splash damage and physical blow-back of the explosion.

I know I'm grasping at straws here, but perhaps a modifed explosion template or could be used (or the explosion template could be set as the parent for a new template). Using cog, a dynamic light "explosion" could be created right next to the player and repeatedly exploded at a very fast pulse so that their is no flickering, with 0 damage and blowback set so that the player is not affected.

I know I'm starting to deal in realms of limited understanding for me, so perhaps someone could just tell me if this has any chance in heck of happening?
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-28, 11:54 AM #18
You must have something really wicked in mind. And yes, you are grasping at straws. The flashrgb is for a color effect, that has nothing to do with lighting (it simply colorizes the rendered frame before sending it to the display, or something similar at least). The blast radius is just the range of the explosion.
As said before, seperate range/intensity values are JED-only. JK works with intensity alone. I don't know this for a fact, though, it's just my feeling.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-06-28, 12:07 PM #19
This Infernal Machine cog is why I hate LEC! :mad:
Code:
# Jones 3D Cog Script
#
# aet_DynaLight.cog
#
# [TRM] [TL]
#
# Simple dynamic light pulseing cog. 	
#
# 10/21/98 RT: Added radius
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ========================================================================================
symbols

message	startup

thing	thing0
thing	thing1
thing	thing2
thing	thing3
thing	thing4
thing	thing5
thing	thing6

flex	rval=0.5	local
flex	gval=0.5	local
flex	bval=0.5	local
flex	radius=0.1	local
flex	speed=1.0	local

vector	color		local

int		numThings=7	
int		index		local

end

# ========================================================================================
code

startup:

Sleep(5.0);	# remove this later

color = VectorSet(rval, gval, bval);

for (index = 0; index <= numThings; index = index + 1)
	{
	if (thing0[index] > -1)
		{
		SetThingLight(thing0[index], color, radius, speed);
		}
	}

return;

# ........................................................................................
end
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-06-28, 4:09 PM #20
I wonder if Sige could reverse engineer the code to get it into JK...
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2005-06-28, 4:12 PM #21
From what I know about templates, the light emited from an explosion is just like a dynamic light and the blast radius only deals with damage range. The flashrgb is for a blinding affect if the explosion is close and in view, like when sabers clash up close. The actor light things you found are for the headlight(fieldlight) settings.
visit my project

"I wonder to myself. Why? Simply why? Why why? Why do I ask why? Why do I need to find out why? Why do I have to ask why as a question? Why is why always used to find out why? Why is the answer to why always why? Why is there no final answer to why? Simply why not? Holy cow, this is pretty deep, meaningful **** I wrote. Glad I wrote it down. Oh man."
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [slog], Echoman

↑ Up to the top!