Jump to content


Photo

Easy Lighting V7.0.2 | Last Updated: 06/07/11


  • Please log in to reply
465 replies to this topic

#91 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 13 December 2008 - 08:46 PM

I wish light_init(); returned 1 if successfully executed just incase for any reason it didn't
-_- Good extension can't think of anything more useful which is really necessary.. Seems like you've finished your brilliant gm extension xP
Can't wait to see your next project :) This was very simple to use.
  • 0

#92 jobro

jobro

    GMC Member

  • GMC Member
  • 1268 posts
  • Version:GM:Studio

Posted 16 December 2008 - 05:59 PM

Useful for GM pro's, useless for GM beginners which I am, now do us beginners a huge favour and create a drag&drop library and include it. I could see me using it, but not now.
  • 0

#93 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 17 December 2008 - 11:54 PM

I have actually been thinking of making a library for it. The only problem is the number of arguments needed, and the number of arguments provided for D&D. If I DO make a library, it will probably be used differently so that the GML won't go smoothly and you will have to use one or the other. I will have to think about it. I have been on a trip for the past week though, get home late tomorow, so I can't work on anything probably till friday or saturday.

Anyway, glad you guys like my extension, it isn't QUITE finished, still need to find some improvements for certain areas if possible and I will be able to finish it all up. :D

EDIT: I have fixed one of the things bugging me. You no longer have a light_init() or light_end() function! It is automatically done now (after some serious code alterations) so the only way to turn lights on and off is with light_main_set() of which I added another argument.

EDIT2: I have added a new function which supports views! You can now use light_view_set(view) to make the surface follow a specific view. (If you don't set, it draws over the entire level) This is a slow function and should never be placed in the step event. If sometime later you want to stop using views, you can re-set it by using v_noview. I don't know if this will solve any lag issues or not, but it was requested so tell me if it speeds things up at all!

Edited by Scyler_27, 19 December 2008 - 11:32 PM.

  • 0

#94 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 22 December 2008 - 03:09 AM

Anyone tried using the new view-setting function? I want to know if it speeds up games at all. ;) Especially the guy mentioning the lag with his 3000x3000 room.

Remember, all feedback is appreciated, good are bad. ;)
  • 0

#95 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 22 December 2008 - 03:56 AM

No, because (1) you can only use .gex files with GMPro and (2) it uses surfaces and blending which are registered functions.

EDIT: For those interested, I have just finished another slight update. I have added a separate function, light_surround_setcolor() to set the surround lighting's colors. You can have up to 4 colors now! This will be good for making sun-set effects and such. You can use 0-4 arguments with that script, any undefined argument will automatically be set to black. I also removed the color option in light_main_set() because it is now unnecessary.

Edited by Scyler_27, 22 December 2008 - 04:29 AM.

  • 0

#96 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 22 December 2008 - 04:24 PM

im the guy from the 3000x3000 room lag... i havent tried it yet, ive been very busy with my work lately...

Im gona try it later this evening and ill edit maybe tomorow...

b.t.w. Real nice extension
  • 0

#97 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 22 December 2008 - 11:48 PM

Ok awesome, I hope it helps at least a little. :unsure:

New update today! Can now download version 3.11! I have added support for animated lights, and provide a quick example. I tested with 50 animated lights over the current lights with no lag at all! There are 2 new arguments added to light_add_light() and light_set_light() to set which sub-image of a light you want to use. Use -1 for it to cycle through all the images.
  • 0

#98 spazman0

spazman0

    GMC Member

  • New Member
  • 213 posts

Posted 25 December 2008 - 10:07 AM

I am making a game using your lighting engine, but it seems to lag up after a while. I have an emitter that shoots particles (circle sprites), and each of these particles has a motion trail (another object that decreases image_alpha every step). I have a larger light on the main particle, and smaller lights on each of the motion trail objects. My main question is whether there is a way to destroy a light, not just turn it off, or, if turning it off is destroying it. The reason I think that turning them off doesn't destroy them, is because everywhere I have an instance_destroy();, I also have a light_set_on(my_light,0);.

The game runs smoothly for the first 30 secs or so, and then it starts to lag up real bad, even when the particles are getting destroyed after about 3 seconds of life.
  • 0

#99 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 26 December 2008 - 06:34 AM

There is currently no way to destroy lights I am sorry to say. Since v1.0 I have been trying to think of a way to do that, but I still haven't figured out something. I am still working on it, however, so no worries there. ^_^ But yeah, it looks like since you can't destroy them, your objects keep creating more and more lights thus causing the lag.
  • 0

#100 spazman0

spazman0

    GMC Member

  • New Member
  • 213 posts

Posted 26 December 2008 - 06:38 AM

So is there a work-around? I would really like to use your engine in my game, but if it lags that much I don't think I can.
  • 0

#101 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 26 December 2008 - 06:51 AM

Well, you could "re-use" lights perhaps. After the particle or what-not is destroyed, have it jump to another particles position.
  • 0

#102 flankattack

flankattack

    BETA Tester

  • New Member
  • 407 posts

Posted 26 December 2008 - 09:20 PM

Wow, even better now!!
  • 0

#103 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 06 January 2009 - 03:51 AM

I have a request which is quite urgent sorta,
likey due to my friends video card (internal hp one eeuh) he receives the following message:

___________________________________________
ERROR in
action number 1
of Draw Event
for object int_obj:

Trying to use non-existing surface.
___________________________________________


So in "light_init(colour,true);" could you return if it has successfully initilised returning either 1 or 0 like 39dll and many others. Thankyou :(
  • 0

#104 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 12 January 2009 - 08:18 AM

@Kris, well I actually removed that function from the newest version, and if you have the newest version you shouldn't be using that function. :( (It is hidden, but I think you can still call it) Also, either way, there isn't really a way for me to check if the surface is created. (That I know of)

Also, for those interested, I ran a speed test on my computer (2.4Ghz, 2GB RAM) with a 3000x3000 room and a view and managed to get constant 30fps to about 900 256x256 lights, then it went and hung out at 27-28 for another hundred and I shut it off. I created lights and destroyed the objects, so it was just lights. I am still thinking of a way to destroy lights, in the mean time I am working on some "get" functions that check if a light is on, what view they are being drawn in, etc.
  • 0

#105 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 12 January 2009 - 01:11 PM

@Kris, well I actually removed that function from the newest version, and if you have the newest version you shouldn't be using that function. :( (It is hidden, but I think you can still call it) Also, either way, there isn't really a way for me to check if the surface is created. (That I know of)

Also, for those interested, I ran a speed test on my computer (2.4Ghz, 2GB RAM) with a 3000x3000 room and a view and managed to get constant 30fps to about 900 256x256 lights, then it went and hung out at 27-28 for another hundred and I shut it off. I created lights and destroyed the objects, so it was just lights. I am still thinking of a way to destroy lights, in the mean time I am working on some "get" functions that check if a light is on, what view they are being drawn in, etc.

If surface_exists lol?
Actually the new version may have fixed this error for him. Not sure.

Edited by Krisando, 12 January 2009 - 01:16 PM.

  • 0

#106 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 12 January 2009 - 08:29 PM

Rofl, your right. Wow, and I even looked through the manual for that function. Must have skimmed over it (it was1:30 in the morning so I have an excuse. :( )

Tell me if the error is gone with the newest version please, that would be great help. If not, I could use the function to check and have the game say an error and end the game if you like. Or, I could say an error and remove all lighting functions so the game continues without lights. Which of the two would you prefer?
  • 0

#107 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 13 January 2009 - 09:11 PM

Rofl, your right. Wow, and I even looked through the manual for that function. Must have skimmed over it (it was1:30 in the morning so I have an excuse. :) )

Tell me if the error is gone with the newest version please, that would be great help. If not, I could use the function to check and have the game say an error and end the game if you like. Or, I could say an error and remove all lighting functions so the game continues without lights. Which of the two would you prefer?

Hmm, Id prefer a returned value so I could either display a message or notify a the game server.
And it was 2:30 am when I posted the last one ;P lol

Also latest version works on his pc =]

Edited by Krisando, 13 January 2009 - 09:34 PM.

  • 0

#108 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 14 January 2009 - 05:01 AM

Awesome, glad it works for him now. Must have been something with the previous version. Guess I don't need to add an error screen now.

By the way, I couldn't return something, because you aren't calling the function. ^_^
  • 0

#109 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 14 January 2009 - 07:36 PM

Awesome, glad it works for him now. Must have been something with the previous version. Guess I don't need to add an error screen now.

By the way, I couldn't return something, because you aren't calling the function. :P

Click oh duh me xD I forgot this is an extension heh ^_^
  • 0

#110 A saurus1

A saurus1

    GMC Member

  • Sandbox Moderators
  • 1609 posts
  • Version:GM8.1

Posted 16 January 2009 - 02:50 PM

Could you add 4 more things?

1. An lt_flicker option. This would be great for effects like the lighting of fire, which unlike lt_flash, does not randomly go on and off. Instead, the lt_flicker setting would make the light randomize it's alpha a little bit over time, like it is flickering.

2. A function light_set_frequency(frequency). This would set the frequency of the effect. For lt_normal, this would be obsolete, but for lt_blink, lt_flash (and maybe lt_flicker :D ), it would set how fast the light blinks, flashes, or changes its alpha.

3. Allow alpha values over 1 to be drawn as simply a light repeatedly drawn. What I mean is, ceil() the alpha value of the light, and repeat the drawing of that light that many times. After each time you draw it, subtract 1 from the alpha value. This would mean you could have really intense lights. If you need a code example, I can give you one.

4. A depth value for the lights (or light systems, however your lighting extension works).

BTW It's really good already, but I think this would make it even better.

Edited by A saurus1, 16 January 2009 - 03:16 PM.

  • 0

#111 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 16 January 2009 - 09:58 PM

Hey, thanks for the ideas, I am liking them. :)

1. I will certainly add this, great idea, thanks.

2. This one could work, but I use 1 global variable to adjust all the lights, which makes them all flicker and whatnot together. So if you were to set the frequency it would adjust all the lights. I don't mind doing that, and I suppose it could be useful, just not very flexable. And remember, you can always create your own effects using the light_set_ligh() function.

3. I think I will pass on this one, if you want more intense lights instead of having the .gex have to do all the extra math and draw multiple lights in one spot, you can do that easily. :medieval: (In fact, it should be faster if you were to do it instead of me placing a whole bunch of if's or switch statements I think)

4. I have been pondering this one for some time actually, I am trying to think of a purpose for it though. Why would you need it? I will think it over though.

Thanks for the complement by the way, I am currently trying to figure out how to make a function to delete lights. (Which is much harder than you would think, though I think I have finally found a solution.) Once I get that finished I will start working on the rest of the updates which shouldn't take that long. :D

EDIT: LARGE UPDATE!

Hi guys, I have finished and released version 4 of my lighting .gex! This is what is new:
-Added new effect, lt_colorflicker.
-Added 5 new functions! A few to set some effect properties, but mostly functions to get information like if a light is on etc.
-Added the ability to delete lights! I have finally finished it, and tested it and it works great!

I hope you guys like the update!

Edited by Scyler_27, 16 January 2009 - 11:25 PM.

  • 0

#112 A saurus1

A saurus1

    GMC Member

  • Sandbox Moderators
  • 1609 posts
  • Version:GM8.1

Posted 17 January 2009 - 12:11 PM

4. I have been pondering this one for some time actually, I am trying to think of a purpose for it though. Why would you need it? I will think it over though.


So you could draw things like HUD's and Healthbars over the lighting.

Also, what are you using for your lighting system that makes it so hard to delete them.

Edit: Does light_set_effect() have any effect on lt_color flicker. If not, it should control the flickering speed, so that the alpha values can fade into each other. I.E. the light picks its next alpha value x steps ahead, and then fades towards that. Once it reaches it, the light picks its next one, and fades towards that one. And on and on and on...
That would be really cool.

Edited by A saurus1, 17 January 2009 - 01:14 PM.

  • 0

#113 tablekorner

tablekorner

    GMC Member

  • GMC Member
  • 121 posts

Posted 19 January 2009 - 05:54 PM

every time i try and open example it says cant find lighting gex?
  • 0

#114 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 2935 posts
  • Version:GM:Studio

Posted 20 January 2009 - 05:40 AM

@A saurus1: You can have a hud, draw it at depth -100001 I think it is. Though, I will try to come up with a work around for that. I would prefer not to have the user define the light's depth, but I need to think of a better way to draw things on top. As for the light_set_effect, it changes the max amount of alpha value that will be changed while flickering. If you want any further effects for your lights, you can create them yourself. It is actually quite easy. I wasn't even planning on having effects, but I did it so people wouldn't have to re-program basic effects every time, sorta like how I have the built in circle light. It is just there to save time, if it isn't to your exact liking, make it custom.

@tablekorner: That is because you need to install the included .gex file. Go here for instructions on doing so. Once you do that everything should work fine. :D
  • 0

#115 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 21 January 2009 - 07:44 AM

nice update scyler. i love this gex
  • 0

#116 TheMyst

TheMyst

    GMC Member

  • New Member
  • 166 posts

Posted 21 January 2009 - 06:18 PM

This will add some nice effects to my games scenery. Thanks!
  • 0

#117 Galious

Galious

    GMC Member

  • New Member
  • 8 posts

Posted 24 January 2009 - 12:09 AM

Hi there! I've been using your gex for a while and it is really great. The problem is that I don't know how, it suddenly rendered everything wrong, like in negatve


Please take a look... this should be all dark, with a torch and little glowing monsters
Posted Image


Do you know what happened? I've tried to reinstall the gex, Game Maker ... and it still is the same. The weirdest thing is that it works in my other computer.

Edited by Galious, 24 January 2009 - 12:11 AM.

  • 0

#118 Romano

Romano

    GMC Member

  • New Member
  • 675 posts

Posted 24 January 2009 - 01:31 AM

Looks amazing, too bad its not possible in lite :\
  • 0

#119 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 24 January 2009 - 01:52 AM

Hey Scyler, any chance of getting a function to determine how much light is being drawn in a particular spot? A value between 0 and 1 would be enough.
  • 0

#120 LoserHands

LoserHands

    GMC Member

  • New Member
  • 17 posts

Posted 24 January 2009 - 07:40 PM

How do you set a light's depth? So it doesn't go over a wall, not asking for a shadow system, just that I can give the illusion that there is one in the game.

Edited by LoserHands, 24 January 2009 - 07:43 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users