Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Dynamic light limit #49095
07/13/05 03:35
07/13/05 03:35

A
Anonymous
Unregistered
Anonymous
Unregistered
A



I am aware that there is a limit on dynamic lights in a level... so how can I get around that? I am designing a game set at night, which will include, if possible, one or two lights on each vehicle and a light on each trooper, to represent their headlights/torches. How can I do this for two players without overloading the dynamic light limit?

Re: Dynamic light limit [Re: ] #49096
07/13/05 03:46
07/13/05 03:46
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Perhaps updating the lights' paths less frequently and turning lights that are invisible or too far away off? What I mean by updating lights' paths less frequently is to have 8 lights to be processed in one frame, the next 8 lights processed in the next frame, then the final 8 in the third frame. After that, update the first 8 lights in the fourth frame, update the next 8 in the fifth, the next 8 in the sixth then update the first 8 again in the seventh and so on. Though I'm not sure how to script it, perhaps using a while loop for processing lights and when 8 lights are done, insert a wait instruction then the next 8 lights follow with another wait instruction like this in a way:

while(1)
{
light_1_action;
light_2_action;
light_3_action;
light_4_action;
light_5_action;
light_6_action;
light_7_action;
light_8_action;
wait(1);
light_9_action;
light_10_action;
light_11_action;
light_12_action;
light_13_action;
light_14_action;
light_15_action;
light_16_action;
wait(1);
light_17_action;
light_18_action;
...
wait(1);
}

Don't know if this'll work, but you can certainly try it. This idea is only best at slow speeds, but if you have too many lights, you'll need a longer delay and it'll soon become noticeable, especially at low frame rates.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Dynamic light limit [Re: ulillillia] #49097
07/13/05 06:46
07/13/05 06:46

A
Anonymous
Unregistered
Anonymous
Unregistered
A



In the maual it says that there is a limit of 32 dynamic lights- is there a way to bypass that? Making 'fake' dynamic lights?

And if I am using a lot of 'fake' lights, that function might be very useful, thanks.

Re: Dynamic light limit [Re: ] #49098
07/13/05 07:07
07/13/05 07:07
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Actually, the hardware limit is 8 dynamic lights and, from what I can tell, an unlimited number of static lights. Using models and sprites might help "fake" dynamic lights to some extent.

As for the function, just replace the light_XX_action with whatever the actions are for your dynamic lights. This way, 8 of them get processed per frame, but, to make best use of it, you'll need a decent or sufficient frame rate or you may notice the "faking" of it.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Dynamic light limit [Re: ulillillia] #49099
07/13/05 10:54
07/13/05 10:54
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
You'll notice it.
The new light management switches between light group and can therefor display more than 8 lights. Look at the forecast section.


Follow me on twitter
Re: Dynamic light limit [Re: mk_1] #49100
07/13/05 11:28
07/13/05 11:28
Joined: Jun 2005
Posts: 54
I
iWaNtToKnOw Offline
Junior Member
iWaNtToKnOw  Offline
Junior Member
I

Joined: Jun 2005
Posts: 54
i think it is possible to make Fake Lights like HL1 FlashLight using a bitmap with alpha channel and the Texture to be iluminated and make a Decal, but is very hard and complicated, need some shader knowledge, try use something like this in models headlights.


Tell Me, iWaNtToKnOw!
Re: Dynamic light limit [Re: ] #49101
07/13/05 11:43
07/13/05 11:43
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
You can have more than 8 lights per level...you just can't have more than 8 on at once. However, having that many lights on at once is a framerate killer in certain circumstances. I like to keep it under 4-5 in a single view.

Try out my dynamic light code...it takes care of most circumstances including shutting lights on/off if you desire:

http://www.coniserver.net/ubbthreads/showflat.php?Cat=&Board=UBB3&Number=536372

Quote:

In the maual it says that there is a limit of 32 dynamic lights-




That's a relic from the A5 days. I think Conitec had their own engine trick and could display that many, but they weren't hardware lights. I recall a lot of people hated the switch to hardware lights and actual prefer the old software look. Anyway, that shouldn't be in the manual anymore unless you're using an old one. Get the newest in the Blame the Manual forum.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Dynamic light limit [Re: Orange Brat] #49102
07/13/05 12:08
07/13/05 12:08
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Quote:

8 lights to be processed in one frame, the next 8 lights processed in the next frame, then the final 8 in the third frame.



this is a very bad idea.. this will make all of your light flicker..ugly. Bascially you cant get around the 8 light limit yet, so dont try, just design around it..instead of using 2 lights for each car headlights, just use one for each car. of course, only activate lights that are near to the camera, and can easlity fade them in and out..when you think about it, 8 lights at once is an awful lot of lights, more than you should reasonably need.

Re: Dynamic light limit [Re: Matt_Aufderheide] #49103
07/14/05 02:17
07/14/05 02:17

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Well, in a tank battle at night, you might have 5-10 tanks per side, each with a headlight.
So it would be possible to just turn off lights that aren't seen at a given point in time?

Re: Dynamic light limit [Re: ] #49104
07/14/05 05:47
07/14/05 05:47
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
yeah sure you can do this..for each light object say you have a function like this:
Code:
function check_visibility()
{
var screenpos[3];

while(1)
{
vec_set(screenpos.x,my.x);

if (vec_to_screen(screenpos,camera)!=0)
{
my.lightrange=0;

}
else{my.lightrange=light_range;}


wait(1);
}

}



Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1