Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Dynamic lights - crashing issues

The general place to discuss MOD''ing Freelancer!

Post Wed Jun 20, 2007 1:35 pm

Dynamic lights - crashing issues

http://img.photobucket.com/albums/v521/foxUnit01/88Flak/Other/DynamicHeadlight.jpg

As you can see in the screenshot, many fun things can be done with Freelancer's lighting system, such as actual headlights that project light. If you don't know what I'm talking about, I'm talking about the lgt_effect lines that one can find under effects_explosion.ini, used mainly for the explosions ships make (when Fighters in Freelancer explode they use an exposion effect that makes light using a lgt_effect entry). When you put a lgt_effect entry on an infinite-duration effect, you can produce a constant light-source - for example, my headlight above.

The problem is when Freelancer gets a lot of lgt_effect-effects on-screen at once, or your lgt_effect-effect is hitting a lot of objects, Freelancer instantly crashes. So my question is this - anyone know a way around this? I'm quite perplexed, as the mine-explosion effect that minefields use also use lgt_effect-effects; so when you hurtle through a minefield, there's light being thrown everywhere - and Freelancer is completely fine with it. Yet when I have a simple, steady headlight, Freelancer is very un-happy. Any thoughts?

Edited by - fox Unit 01 on 6/20/2007 2:35:26 PM

Post Wed Jun 20, 2007 6:03 pm

wow, now thats awesome. i have to experiment with that

Post Wed Jun 20, 2007 7:32 pm

Here, I'll post the code I was using at the time:


light_equip.ini:
[AttachedFX
nickname = LargeWhiteSpecial ;in place of the "LargeWhiteSpecial" light
particles = headlight

effects.ini:
[Effect
nickname = headlight
effect_type = EFT_EQUIP_ATTACHED
lgt_effect = dyn_headlight
lgt_range_scale = 300
lgt_radius = 300

lightanim.ini:
[LightAnim
name = dyn_headlight
frame = 0.0, 255, 255, 255, 1

If my memory serves me correctly, that should produce what I was testing above. If you can find a way to make that work without crashing, you'll be my new best friend.

Edited by - fox Unit 01 on 6/20/2007 8:32:22 PM

Post Wed Jun 20, 2007 10:09 pm

i know the problem i guess - and since you've revealed one of the secrets i was keeping i can share it you need an effect for dynamic lights, and some FX won't work - but mainly you can't use it with beam weapons w/ no ALE fx. i haven't noticed any limit and i have had hundreds or thousands of "lit" proj's flying around - good work on the headlight, i was thinking about that myself - should be a great addition to lots of mods

1
2
unrelated

Edited by - Cold_Void on 6/20/2007 11:12:27 PM

Post Wed Jun 20, 2007 10:51 pm

Heh, I see you like Pittsburgh Cold_Void. Did you just plop the CMP in a system, or is there something more complicated involved? I've never tried it myself as I never saw much reason aside from coolness factor (which admittedly is pretty high =P) - are the models actually textured on all sides, etc.? I know some of the cityscapes aren't, but what about scapes like Pittsburgh? If you used a large "shield bubble" model, they might make good PvP systems (use ModelResizer on the Tekagi's Base Shield?), which would be something to think about.

So anyways, what you're saying is that lights work no problems with you? I see you have light from gunboat engines, shots, etc., which would normally crash my Freelancer in an instant. Admittedly, I have a Geforce 6600 GT, which is quoted specifially to have problems with Freelancer. It may be my card, but something tells me I'm just not doing it right.. *scratches head*
If you wouldn't mind could you paste some code? If you'd prefer to E-Mail it to me instead of post it here I can be reached at astrout89(a)gmail(d)com.

Edit: Hey, I just remembered, you're the guy behind FL Redemption! Duh, I have a short memory lol - you still interested in the wingmen project? I can't remember if I ever even got back to you or not on that. Perhaps we can reach an agreement and share a little "secret" info here and there. *hides knife*

Edited by - fox Unit 01 on 6/20/2007 11:55:46 PM

Post Thu Jun 21, 2007 5:58 am

ok, I couldnt make your dynamic headlight work at all.
(you sure, that is the code that works?)

I could however add the lightning effect to weapon projectiles, but that would immediatly crash my client.

Cold_Void enlighten us please. Evil secret hider

/ok, the weapon projectiles work now when not using beams.
The problem is, there seems to be an odd limit in some situation when there are too many lightsources to be rendered..

headlight still doesnt work however

/wooho, had an error in my code. It actually works if you put some weapon vis_effect and vis_generic to the headlight effect!

Edited by - w0dk4 on 6/21/2007 7:23:06 AM

Post Thu Jun 21, 2007 11:55 am

bingo - you need an ALE effect for lights to run. i still haven't had joy with the headlight, but heres some projectile code.

;//////////////////////////////////////////////
;//////////////////////////////////////////////
[VisEffect
nickname = br_particle_01_flash
alchemy = fx\weapons\br_particle_01.ale
effect_crc = 384691528
textures = fx\planetflare.txm
textures = fx\sarma.txm
textures = fx\missleeffect.txm
textures = fx\lightning2.txm
[Effect
nickname = br_particle_01_flash
effect_type = EFT_MUZZLE_FLASH
vis_effect = br_particle_01_flash

;//////////////////////////////////////////////
[VisEffect
nickname = br_particle_01_impact
alchemy = fx\weapons\br_particle_01.ale
effect_crc = -502791836
textures = fx\planetflare.txm
textures = fx\sarma.txm
textures = fx\missleeffect.txm
textures = fx\lightning2.txm
[Effect
nickname = br_particle_01_impact
effect_type = EFT_WEAPON_IMPACT
vis_effect = br_particle_01_impact

;//////////////////////////////////////////////
[VisEffect
nickname = br_particle_01_proj
alchemy = fx\weapons\br_particle_01.ale
effect_crc = -80629787
textures = fx\planetflare.txm
textures = fx\sarma.txm
textures = fx\missleeffect.txm
textures = fx\lightning2.txm
[Effect
nickname = br_particle_01_proj
effect_type = EFT_WEAPON_PROJ
vis_effect = br_particle_01_proj
vis_beam = br_particle_01_beam
snd_effect = fire_particle1
lgt_effect = projectile_flash_blue
lgt_range_scale = 100
lgt_radius = 1

;//////////////////////////////////////////////
;//////////////////////////////////////////////
[VisEffect
nickname = br_particle_02_flash
alchemy = fx\weapons\br_particle_02.ale
effect_crc = 371948119
textures = fx\planetflare.txm
textures = fx\sarma.txm
textures = fx\missleeffect.txm
textures = fx\storm.txm
[Effect
nickname = br_particle_02_flash
effect_type = EFT_MUZZLE_FLASH
vis_effect = br_particle_02_flash

;//////////////////////////////////////////////
[VisEffect
nickname = br_particle_02_impact
alchemy = fx\weapons\br_particle_02.ale
effect_crc = 83937798
textures = fx\planetflare.txm
textures = fx\sarma.txm
textures = fx\missleeffect.txm
textures = fx\storm.txm
[Effect
nickname = br_particle_02_impact
effect_type = EFT_WEAPON_IMPACT
vis_effect = br_particle_02_impact

;//////////////////////////////////////////////
[VisEffect
nickname = br_particle_02_proj
alchemy = fx\weapons\br_particle_02.ale
effect_crc = -427776669
textures = fx\planetflare.txm
textures = fx\sarma.txm
textures = fx\missleeffect.txm
textures = fx\storm.txm
[Effect
nickname = br_particle_02_proj
effect_type = EFT_WEAPON_PROJ
vis_effect = br_particle_02_proj
vis_beam = br_particle_02_beam
snd_effect = fire_particle1
lgt_effect = projectile_flash_blue
lgt_range_scale = 200
lgt_radius = 1

[LightAnim
name = projectile_flash_blue
frame = 0.000000, 111, 111, 255, 1.000000
frame = 10.000000, 111, 111, 255, 0.300000

also GFX cards should be no problem - i'm doing this on a geforce 5200; the worst of the worst; and it runs fine with no noticeable slowdown; this is some pretty primitive lighting

P.S. yeah the pittsburgh model is mostly just plopped; it has a large cube-SUR and some docking points. yeah its textured on every side; some bases are some aren't - mostly cityscapes though (i wish they had fully modeled them.. doh) - yes i still need some code for the wingmen, and I have some more secrets for trade if you're interested in lending some more direct help than useful pointes on DIY

Edited by - Cold_Void on 6/21/2007 1:00:38 PM

Post Thu Jun 21, 2007 1:48 pm

Interesting. I see you're using a lgt_range_scale of X, yet always a lgt_radius of 1. I'll also try lighting with ALE-using effects. Perhaps with that something may actually work. Cold_Void, if you want, I can send you what's done of my stand-alone AI Wingmen project. The only thing that's not done on it is detailed tutorials and bug-testing, however all of the complicated stuff _does_ have tutorials written and the stuff not covered by tutorials so far has at least what was inserted into the files covered. Do you use MSN Messenger or AIM? I could work with you on there to easily implement a functional and stable version of wingmen into a mod if you wanted.

Post Thu Jun 21, 2007 2:09 pm

I was wrong with the headlight code; I tried it again and yeah, it didn't work - however, I've come to understand the lights a little better and made a quick hack:

[LightAnim
name = dyn_headlight
frame = 0.0, 255, 255, 255, 1
frame = 999999.0, 255, 255, 255, 1

It goes "frame = (duration), (r), (g), (b), (brightness)", so this makes a simple 2-frame light that glows at 255, 255, 255 at 0.0 secs, until 999999.0 seconds, where it will then go out. It works for now, but the second I enter a jumpgate or have a lot of lights on-screen at once I crash just like before.

Edit: I should mention that I failed to note it's just a radiant light - it doesn't only point forward. I thought it did originally (and couldn't explain why), however the first test I did must've been somehow flawed. It'd still be nice to get this to work though.

Edited by - fox Unit 01 on 6/21/2007 3:10:08 PM

Post Thu Jun 21, 2007 5:12 pm

that's workable, you'll just have to create new headlamp hardpoints farther out -> that way it *looks* like a spotlight. then put the regular light back, to give the illusion that its the source

the jumpgate crash is new to me; also using it on attached FX is new to me. -> i will be glad to trade you my FX inis (projectile lighting only -> i think engine lights only add a bloom effect around the 'fire') for your standalone wingmen addon - anyhoo i should have an old hotmail account for MSN if you want to discuss it privily; or you can write me at the email addy in my profile

speculating now... there is a remote possibility that the reason lighting was never used was because it was found to have bugs on certain hardware, however there's only one way to find out

Edited by - Cold_Void on 6/21/2007 6:13:43 PM

Post Sun Jun 24, 2007 4:40 pm

after playing with this idea (some more) i've concluded that it just refuses to work (if you want to test it remove lights from a system and make the ambient color 0,0,0).
the good news is that the projectile lighting *does* work and is much brighter than whatever we're seeing here...i'm testing a 'flaredropper' mine archetype ATM, i'll get back to you on whether it can work.

*edit*

works like a charm - i have no idea how long these can run for; probably indefinitely if you like but long lasting mines supposedly lag servers.

*edit july 1st*
oh another thought about crashing lights on things other than mounted fx - try using the quickfix's 'advanced graphics' option, and/or make sure you don't assign lights to effects with vis_beams only - beams without fx cannot use lighting

Edited by - Cold_Void on 7/1/2007 3:44:47 PM

Return to Freelancer General Editing Forum