Jump to content


Photo

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


  • Please log in to reply
466 replies to this topic

#51 Binsk

Binsk

    -Insane Kid-

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

Posted 02 December 2008 - 11:21 PM

Hm... good ideas... I like it. :) With the light_object_visible() I can see how that would be an extremely useful function, I will have to look into how hard it would be to make. I think I might also make some others for check if a light is on and such. Thanks. ;)

As for your second, what do you mean "fade"? Like, I light fades out or something? That would be easy to make yourself actually, but as said I will see if I can add it. (Since light effects can easily be made manualy, they are of a lowest priority for me)
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#52 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 03 December 2008 - 12:42 AM

When there is a large amount of light say and the visible is set to false it just dissapears.
Adding a fade would save alot of coding on each single object ;P
  • 0

Posted Image


#53 Binsk

Binsk

    -Insane Kid-

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

Posted 03 December 2008 - 07:18 PM

Ok, I am in need of an opinion. I have found and tested a way to see if a point is located in the light or not. The problem is is that is would be considered a "slow" function, and there is no way for me to speed it up. In other words, you can't place it in the step, draw, or any fast event like that. Would you still want it? It works great under key-presses and such, you just cant use it too much without huge lag.

I tested on a computer with 1ghz and 512mb ram by placing it in the draw event. It brought the fps down to about 5. Tested also on a 2.4ghz with 2gb ram at 30fps. So... you can place it in step even if you are aiming at higher-end computers with no probs, but for the average computer it lags like crazy.

Give me your oppinion and depending on that, I will add it or remove it.
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#54 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 03 December 2008 - 08:10 PM

My adverage comp has to have a Quad core with 4gb ram min xD.

Umm, well it could run abit faster if you placed it into a reoccuring alarm say every 5 steps.
But that is very bad framerate, may have to skip =/

Edited by Krisando, 03 December 2008 - 08:15 PM.

  • 0

Posted Image


#55 Binsk

Binsk

    -Insane Kid-

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

Posted 03 December 2008 - 08:16 PM

Dang, nice computer.. :(

Yeah, that is what I was thinking... tis a bummer, but I can't find any other method because of the custom images. (If I didn't have to support custom images it would be a piece of cake, but I am not going to do that)

Edited by Scyler_27, 03 December 2008 - 08:17 PM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#56 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 04 December 2008 - 01:15 AM

Maybe you could check each part of a sprite "if possible" to see if it is the colour black e.g. if the whole sprite is then return visible is false. Could be faster if possible.
  • 0

Posted Image


#57 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 04 December 2008 - 10:00 AM

how can you set the depth?

i mean.. i want to use the lights.. but i dont want the black rectangle on my screen.. or just a little bit...

i got some alarm lights in my game but its outside and its in the afternoon... how do i make the lights go flash without the black rectangle?
so everything within the light becomes whiter...
and for other room with the rectangle?
  • 0


Game Maker 8 Pro
-------------------------------------------------------------

YAY NEW WEBSITE !
Click to visit my website

#58 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 04 December 2008 - 04:15 PM

I am making a 2d platformer which requires a day to night cycle, and multiple light sources which light up dark areas. I have a working method that I like, but it's just too slow, dragging my fps below 60, which the game needs to maintain. My method was to use a layer of square objects covering the view, each of these objects changes its alpha value based on proximity to the light source object. The effect is a lighted area around the light source while everything else is in darkness. This method has a bit of a "grid" look to it since the darkness objects are squares, but I didn't find this to be much of a drawback. I think the speed loss comes from all the distance_to_object() calculations that are being made by each of the squares (the grid I'm using is 34x19 which is 646 objects). I tried some methods for cutting down the number of objects that needed to make calculations, but still could not maintain the 60fps, and that was with just 1 light source object.

Anyway, since my method doesn't seem viable, I searched the forums and came across your extension package. I haven't had a chance to try it out yet, but it looks like exactly what I need, and if it does work as I think, I'll be very appreciative.

One thing that I'm wondering though is an aspect of the lighting that I was wanting, but even my own method could not produce. I'm wondering now if you have any ideas on how you could add this feature to your package. What I wanted to do was have the "darkness" ignore certain background layers. The reason I want this is that my game is a 2d side scrolling type of game with outdoor environments as well as indoor, and if you think about it, the sky layer shouldn't be affected by the "darkness". If it is, the problem becomes that your sky will light up around your light source (unless its 100% black), when it should remain the same. What would be ideal is to have certain backgrounds ignore the darkness completely. I would prefer to handle the light/dark effect of the sky background layer in some other method. Well, if you think this could be done, I'd love to see it. If not, I may be able to work around it. One thought I had was to create a mask in the shape of the sky, perhaps it would even work to create a light in the shape of this "sky mask", though it would have to have a sharply defined edge, rather than a soft one (I can't tell yet if that's supported but I think it is).

Anyway, I'll let you know how this works for me, looks good from what I can tell so far. Thanks.
  • 0

#59 Binsk

Binsk

    -Insane Kid-

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

Posted 04 December 2008 - 07:13 PM

@Krisando, I can't think of a way to do that because the objects are drawn on the screen while the lights are drawn on a layer. So if anything, it would make it slower.

@frog, Your post was sort of hard to understand... But with the function light_main_set() you can change the blackness to any color you want, and also make it more or less intense. (if you put the alpha to 0 then it disables the lights altogether) As for the flashing or whatnot, I don't quite get what you mean. :P
As for setting depth, you cannot do that, I did it to avoid problems. If you want to draw a HUD or something place it right after the function light_draw(). Another way is using the "if (view_current==0)" so it only draws lights in view 0, then you can draw stuff in the other views without lights.

@motormann, Well, there are actually 2 ways to draw a background above the lighting source currently. (1) In the room editor, under the background tab, select the background you want and check the box saying "Foreground Image." And it should draw it in front of everything. (2) simply draw a background directly after calling light_draw() and it will be drawn in front.

Though both you and frog have given me an idea, I think next update I will be adding a way to remove chunks of background light, that way you could have it dark inside a cave while light outside or something. Would that solve your problems?

Edited by Scyler_27, 04 December 2008 - 08:18 PM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#60 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 04 December 2008 - 10:06 PM

Thanks for the info, but the background can't be drawn on top of the "darkness" layer otherwise it wouldn't be a background, meaning characters and other objects would be covered over by it when they're supposed to be drawn in front of it (I had already thought of that). What is needed is for either entire background layers to be somehow ignored completely by the "darkness" layer, which I'm not sure is possible, though maybe there is some way to do it with advanced blending options that I haven't explored yet. Or else a mask is needed that is the exact shape of the area to be ignored. I think this may be already supported by your extension package, simply need to create a custom light shape that is entirely white (rather than shades of gray for the blending of a normal light) in the shape of the sky. That should in effect keep the darkness from being drawn on top of that part of the background. Another use for it would be if you're inside a dark room, and you want a window from outside to be brightly lit. You would want to mask the window so it's not going to get darkened.

Anyway, I'll know more once I get a chance to use this. Knowing it's possible though I may decide to try and create my own code to do what I need. I had the idea for this method as my "backup" plan when my other method proved too slow. But I had missed some key functionality in GM that was making me think this wouldn't be possible. The ability to properly blend a sprite with levels of gray to indicate various levels of transparency was what I was missing. I thought the image_alpha setting was all we had. After browsing around the forums today I see that there are a number of blending functions that I had missed.

And maybe I can clarify what I think frog was after. He wants the light to actually add brightness/color to the environment rather than what it currently does which is add darkness to everywhere there isn't light. I think this might be pretty easy using a sprite and the blending functions (though I need to read up on them to know what all can be done). I think it would be a good feature to add this to your extension package, since it's definitely related.
  • 0

#61 Binsk

Binsk

    -Insane Kid-

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

Posted 05 December 2008 - 03:53 AM

Hm I see, so basically making the darkness "ignore" a section would be the same as not drawing the darkness there at all. I have actually already finished coding that. I just need to make a few adjustments, and the possible support for custom images and I can upload the update.

As for the "make things brighter" suggestion I always see people asking for, explain to me, what exactly would you say qualifies for that? Raising the intensity of the images? Just drawing them with a higher hue? What? If I get a decent doable answer, I might consider trying for it. :medieval:
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#62 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 05 December 2008 - 06:09 AM

Well, I spent quite a bit of time trying to work out the method behind this, and by that I mean do what you're doing with this extension package with my own original code. I think I understand how it's done, but I'm coming up empty when it comes time to draw the darkness layer. I simply cannot work out the combination I need for the sprite_set_alpha_from_sprite(), and draw_set_blend_mode_ext(). What I think should work doesn't. I want to do this myself because I want to better understand how to use GM, and also I want to have the ability to add my own functionality to this.

But don't get me wrong, your extension package is extremely good. In fact, after getting frustrated trying it on my own, I finally played around with your functions, and as I suspected, they do work just the way I was hoping. I was able to create a mask for the sky like I wanted quite easily. Now, you mentioned you're working on adding some additional feature for this, the only thing I can see that is not 100% perfect as it is now is that when the ambient light is set with an alpha value less than 1, if a light overlaps the sky mask, you can see a slight halo effect on top of the sky. Also any colored light will show up on top of that sky mask. If I understand how this all works I would think you could solve this by distinguishing between a light and a mask, and make sure that the mask sprites get drawn onto the surface last. Since they have sharply defined edges, they don't have to worry about mixing badly with the gradations of the lights the way multiple lights do, so they should be able to be drawn onto the surface with a simple draw command and not worry about blending, which is I think what's causing the halo effect now.

The idea of creating the masks also gave me some ideas to create shadows. It would be quite a bit harder, but you should be able to create "shadow masks" which are the opposite of the sky mask idea, being black all the time (or the ambient darkness). A shadow mask could be like a rectangular shape that is tied to a point underneath an object. As the associated light moves around near that "caster" object, the shadow mask would change shape and rotate around the caster object opposite the light. It could stretch out and get longer as the light gets further away, and would basically disappear once the light moves far enough that it isn't being drawn over by the shadow. Don't know if it's worth the code to put this into effect, but it might be something cool to add down the road.

Regarding the "additive" lights, you kind of have this already to a degree with colored lights. They seem to add to the color in the existing background or objects. But without a colored light, you never get any additive brightness from the light, meaning all you see where the light is, is what's already in the background image. I think what you may want to try is using a few of the blend mode options to create light objects that don't act in a negative manner on the darkness in the room, but rather simply blend on top of the room adding white light. While attempting to do my own lighting code, I found this type of effect was actually easy to achieve, though my settings were resulting in some overly bright effects (playing with the white/black ratio of the sprite can probably improve this).

Okay so back to my own coding dilemma, if you feel like giving me some pointers please do, or at least tell me if I'm on the right track. The way I think this is done:

Create a surface
fill it with black
draw light sprites onto that surface with gradations of white/gray, white representing the part of the surface that will be transparent
to get multiple light sprites to blend together properly some sort of blend option such as bm_add must be needed when drawing them (I did not get this far since I was only using one light)
create a sprite from this surface image
translate this sprite to an alpha map so that it represents transparency (I think this is done with sprite_set_alpha_from_sprite())
draw the sprite onto the screen in the correct spot

Now what has me stumped is how to draw the sprite so that it comes out showing the correct transparency behavior. If I did nothing to the sprite, simply draw exactly what is being put onto the surface, I got what I was expecting, a bright white circle gradating into black throughout the rest of the room. That circle would move around with my character sprite (which was invisible underneath it). I know that my surface code and sprite drawing code is working.

The closest I came to the desired effect was using:
draw_set_blend_mode_ext(bm_inv_dest_alpha,bm_src_a
lpha);

I got this just through trial and error with the various bm_ modes that are listed in the GM help file. This actually produced the correct result with regards to transparency, but for some reason when the light is moved around in the room, it leaves a faint trail of light behind it wherever it moves, and that's pretty ugly.

After fighting blend modes for awhile, I thought maybe they weren't needed at all. The sprite_set_alpha_from_sprite() function seems like it should do the trick by itself. I created a rectangular black sprite called Darkness, I then used this: sprite_set_alpha_from_sprite(Darkness,DARK_SPRITE)
;
where DARK_SPRITE is the sprite created from the surface with the lights drawn on it as white spheres. Seems like you should then be able to just draw Darkness onto the screen, and since it should have the alpha map from DARK_SPRITE, it should be black where it should be black and transparent where it should be transparent. But this doesn't show up at all. I tried setting the Darkness sprite both to transparent, and not in it's sprite properties, but neither seemed to make a difference. I even put white dots in the corners of the original all black rectangular sprite thinking that the black was getting assigned as the transparent color, but that didn't help either.

Sorry if this is just confusing (and long), I can provide some code if you want to look at it, but I thought that maybe you could just see what I'm doing wrong from my basic logic. If I can't figure this out, at least I have your functions to use which work perfectly fine, I just know that there will probably be some aspects of it I'd want to do a bit different for my own game.

Thanks again.
  • 0

#63 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 05 December 2008 - 06:29 AM

@ scyler.. ok thanks..i was having troubles with the hud...
and i figured it out... i download the new version yesterday.. after my post -.-...

and it worked.. nice extension man keep working on it...
but i got the same problem as motorman with the fps...

my room is 3000x3000 big and it has 40 fps... when i use the light object my fps become 30 and even 28 sometimes, probably because the surface action....

lol and maybe my room is too big :medieval:

-sorry for my bad english... im dutch :angry:-
  • 0


Game Maker 8 Pro
-------------------------------------------------------------

YAY NEW WEBSITE !
Click to visit my website

#64 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 05 December 2008 - 12:57 PM

6 posts? lol...

I found an easier way to draw a hud that isnt affected by the lighting. Make a new object to handle drawing the hud, and set its depth to -1000000000. Congrats your hud isnt behind the darkness.

I think what everyone means by "make things brighter" is change your default shapes, so that they are brighter and don't fade to black as quickly as they do. At least that is my understanding of it.

Edited by bocochoco, 05 December 2008 - 01:01 PM.

  • 0

#65 Binsk

Binsk

    -Insane Kid-

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

Posted 05 December 2008 - 07:52 PM

@motormann, Um... I was a little confused with the sky-mask problem. (Are you drawing the sky above or below the black? Etc etc.) Mind just whipping up a quick example and sending it to me so I can examine the code? I am much better at understanding problems when they are right in front of me. As for your questions with making lights and such, I will send you a PM.

@frog, well it could be how many lights you have being drawn. Looking at the fact your room is 3000x3000 you probably have allot of lights in there. I am trying to think of a way to draw the lighting system ONLY within a view or something, that would surely boost up the speed a bit. I will see if I can get that working.

@bocochoco, if what you say is true, then they can easily make things brighter with their own lights. But what I think they are asking for is something that makes the objects colors lighten up instead of just appear their normal color when in full light.

@motormann again, you wanted brighter objects? Do something for me, make a colored light with the color c_white at alpha 0.5 and tell me if that is similar or at least a little close to how you want the lighting to work.
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#66 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 05 December 2008 - 09:22 PM

Okay, thanks to the info from the PM you sent me, I got the method figured out now. I was very close before I got your PM, had it working actually, but it was causing some slow down. What I was doing wrong was using sprite_set_alpha_from_sprite() on the image grabbed from the surface after drawing in the lights (which were not being given any aplha map prior to drawing them). This was needing to be done in every step since the image changes. I also had to have everything inverted, white for black and black for white, and create an extra sprite, etc.. It wasn't that complicated but the slowdown was never going to be acceptable.

But, with your help, I've gotten it working correctly without the slowdown, and I'm very happy. Good job figuring this out, and thank you very much for sharing. Hopefully I can return the favor at some point. I've got a good method for upscaling your game's resolution by 1x or 2x or whatever without loss of image quality, I could share some tips on that if you would have any use for it.

Also, it does look like you've got the additive light that I was thinking of, I just hadn't tried using a colored light with c_white. I think you could get some more intense light effects though if you draw the colored lights using bm_add (or maybe you are and I just need to experiment some more with the colored lights).

Regarding the sky mask, what I'm doing is making a custom light sprite in the shape of the sky, and giving it only a solid white where the sky is, and black everywhere else. Then I just use that custom light placed at the right point so it lines up perfect with the actual background sky. So, this works pretty well, but I think to make it perfect, it needs a different way to draw that type of object onto the surface, maybe just making sure it's drawn after all the other lights, I'll play around some more to be sure what works and let you know in case you want to improve this functionality further. As I said though, it works okay as is, but with an alpha setting of less than 1 for the ambient light, the other light objects will draw a kind of halo over the sky when they should not show anything. And also colored lights show up on top of the sky. I don't think it's going to be hard to fix it.

This morning I implemented your light extension into my game (I was still stumped on coding it myself at that point). I got it working nicely, but was having trouble with colored lights, so I was making my own with a different method. I combined one of your lights with 2 colored sprites drawn with bm_add, mixed in some random variables to influence both the position the light, and its size, and ended up with a beautiful flickering torchlight effect. So cool to see this type of lighting working well with no slow down at all. A couple days ago I was pretty sure this wasn't going to be possible after my first method proved such a disappointment.

So, thank you very much for everything, my game is going to be considerably better with these effects. I can think of lots of ways to use them, for magic spell effects, wisp-type creatures (think really small but intense white light floating about), and of course good old light and shadow effects. You can get some neat effects from this simply by playing around with the custom sprite, instead of smooth gradations, you can have static, or neat effects created with photoshop filters. Maybe another feature to add is a way to have the custom sprites be animated. Not sure how useful it would be though.

Oh, I did notice a couple things missing from your help file that were added in with more recent updates of your extension package. Some of the scripts need another argument than is shown(rotation is one I remember that is not listed).
  • 0

#67 Binsk

Binsk

    -Insane Kid-

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

Posted 05 December 2008 - 09:39 PM

I am glad I could help you out. :medieval:

As for the background, I understand it now. It is doing that, however, because you are treating the "gap" as a light so it lets the other lights try to blend in with it. I am not sure if I mentioned this already, but I am almost finished with working on functions that do exactly what you are trying to do and it works great. So far you can cut out blocks of black which also remove the light in that area. All I need to add is support for custom shapes and it will be released. :angry:

Also, with the help file, thanks for the info, it will be fixed in the next upload. ^^

P.S. Actually, I am using bm_add. It is mostly up to the user to make the colored lights bright and vibrant. Which is easily accomplished with the alpha and color functions. :D I am trying to make these functions as if they were built into GM as originals. I want them to be flexible so they are easy to use, but if you want to do something really fancy with them, you will have to use your imagination.

EDIT: I have added v4.0 beta to the download list. It has two new functions explained in the first post and in the help file that comes with the .gmk. Please tell me if it works well, and how you like it. This is not the completed version of these scripts, but they DO work. I released these early to hold you over while I try to figure out a problem I am having with the full scripts.

Edited by Scyler_27, 06 December 2008 - 05:58 AM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#68 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 06 December 2008 - 01:30 PM

I did play around some more with your colored lights, and there are limits to how good they can look. For example, if I use your lighting system to create a colored light, all it can do is overlay a partially transparent colored light on top of the background, which does the job, but doesn't look as real as it could. It cannot affect the background itself, by adding intensity or brightening its colors in any way. The reason is, all your lights are created on a surface, which does not contain any of the background information. So when you draw that surface onto the background using a normal draw, the colors are just painted over the top. Unless you draw the surface with a blend mode, it will only be able to show transparency. By contrast, if you create your colored lights as a separate process from your other lights, and use draw_set_blend_mode(bm_add) to draw them directly onto the screen (I don't think you would need to use a surface for this at all), the effect is considerably better looking. This isn't very hard to do actually, but getting them to work with the sky mask idea makes it considerably more difficult. I'm pretty sure I know how to do it, and plan to implement this into my own code, but whether any of this is something you want to try and add to your extension is up to you, because it's pretty good as it is.

Also, I'm thinking you may have a small problem with your surface code. When using your extension in my own game, I'm noticing some strange graphical "garbage" type artifacts showing up at first, which are quickly eliminated once the lights start to move around. When you create a surface, you want to make sure you clear it first using draw_clear(c_black) or something like that otherwise it shows stuff that is contained in the video memory. I don't seem to get that with my own lighting code, so I'm guessing you might be forgetting that step. If not, I don't know what could be causing this. For some reason though I wasn't noticing this with your sample, so maybe it's in the way I'm implementing it.
  • 0

#69 Binsk

Binsk

    -Insane Kid-

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

Posted 06 December 2008 - 07:43 PM

Huh interesting. With the colored lights, you say it is simple which it probably is, but it is a little more complicated for ME because of how it is integrated into my entire lighting system. I might mess around and see what it looks like before trying to add it to the .gex, and if I DO add it it will take allot of work. Though that DOES sound like a good idea, I just don't know if all the work would be worth it. I will mess around and tell you what I think.

I noticed that with the earlier versions, but I am not noticing it at all anymore. No, I am not using draw_clear(c_black) but I was changing blend mode to subtract and drawing a rectangle over the whole surface. (though I wasn't using it for that purpose specifically, I thought it was working) Guess not so I will add that, thanks.

EDIT: Messed around with drawing the colored lights directly on the level instead of on the surface, noticed no difference whatsoever so I am keeping it how it is.

Edited by Scyler_27, 06 December 2008 - 09:06 PM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#70 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 07 December 2008 - 10:18 AM

I had around 30 lights with >30 fps so Im not sure whats happening there xP

I leave for a day and u go nuts and release a 4.0, will try =P can't wait to see what you come up with for your great extension.
  • 0

Posted Image


#71 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 07 December 2008 - 05:06 PM

Here's a screen showing the difference:
Image Link

I've made 2 new lights using the code below (not using your extension) added to the draw event of the int_obj:
draw_set_blend_mode(bm_max);draw_sprite(custom_light_s,0,200,100);draw_set_blend_mode(bm_add);draw_sprite(custom_light_s,0,100,100);draw_set_blend_mode(bm_normal);

The white light on the left is bm_add, in the middle is bm_max, the one on the right is your standard colored light with alpha 1, the brightest you can make it.

The simple way to do this is just to add a new script for "add_lights" and just draw them on the screen as above. Better yet, is to combine your normal uncolored light and this type of colored light together, otherwise the light just makes a colored ball if drawn over a dark area. If you don't have that it requires creating two separate lights and making them move together. The alpha setting you use when drawing the sprite will determine the intensity.

Now this does give problems with the masks as I've mentioned earlier. You will always see the colored light on top of the mask, unless your mask is drawn above it, which defeats its purpose (other objects will end up behind the mask when you want them to move in front of it).

I've solved this with my own code, but it wasn't easy. I had to modify the mask shape so that it cuts out the shape of any object that passes in front of it on the fly. I managed to work out a blending mode for this using draw_set_blend_mode_ext(). If you get the right combination, it will turn any sprite's transparency into a mask (actually you want the inverted transparency). I'm not real good at explaining this, but if you really want to add this functionality, I could give you some code. Don't do it on my account though because I've been working on my own code to do all this.

Also, I think you've said that your extension uses a room sized surface for the lighting, which might be a bit taxing on memory and fps with exceptionally large rooms. With my code, I've done it so that it's only a screen sized surface. To do this, you have to position your lights on the surface using a relative position to the view port. That of course requires the use of views being used, but I think most games do. Perhaps your code could check for views and if not present, it would use the room sized surface instead. Just a thought for possible future improvements. You would probably need to create some extra parameters in your light initialization for screen size and maybe for view settings.

I will probably end up making an extension of my own with the light system I'm making because I like the way extensions integrate into the normal code. And I also want to learn how to make extensions. I don't intend to release it to anyone, but when it's done I'd be happy to share the code with you so you can see if you would want to implement any of the features I've got. Some of the things I've got working in script form now:

-additive colored lights with a falloff setting, which determines the amount of "negative light" created (that's just a standard light that subtracts from the darkness area), you can also set the depth of each colored light so that it draws in front of or behind other objects in the room.

-flame lights, which allow you to set 2 colors, a back light color and an intense flame at the center, and you can set flicker frequency and amount.

-masks, which are drawn in the foreground but subtract the shape of any object that collides with them. You can give the mask a sprite so that it will draw whatever you want it to, be that a sky, a dark shadow, etc.. I intend to create additional function to darken these masks so that you would be able to have the sky get darker with time (because it's in the foreground your standard darkness doesn't effect it, which is the whole point).

Well there is a lot you can do with lights, now that I know the basic process I've got more ideas than time to work on them. I'm also wanting to play around with shadow effects at some point.

For your extension, at the least I'd suggest adding the additive colored light functionality, because I don't think it's as hard as you're thinking it is. Maybe though it's a part of your method I'm not understanding which is making it harder than the way I'm doing it.
  • 0

#72 Binsk

Binsk

    -Insane Kid-

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

Posted 07 December 2008 - 08:10 PM

Wow, well that certainly isn't how it turned out for me. (But sure enough looked great when copying your code) I think I will have to add that to the lighting system if I can get it to work right. Wow, thank you very much.

With the room-size surface lighting, I am trying to think of a way to do that and make it easy to customize... I hate to have to depend on views because some games don't use views, or they use multiple views. I want this fully compatible with any game.

You seem to be really good with blend modes (this is my first time so I am still learning the ropes) I bet you could make one kick-butt lighting engine. I vote that you release it here as a .gex, it will give people more options for different kinds of lighting!

Thanks again for all the great advice and help. :blink:
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#73 motormann

motormann

    GMC Member

  • GMC Member
  • 26 posts

Posted 07 December 2008 - 10:28 PM

Maybe some extra incentive for you to get additive colored lights working, here's a screen shot of my WIP with 4 types of lights and a small mask. The effects are really good I think:

screenshot

Up in the upper left I have a quite large red colored light, where the character is I have a flame type light (which flickers convincingly), down in the lower left is a mask for the blue (which is supposed to be daylight coming through a crack), there's a small white colored light just under that, and a normal type of subtractive light giving the shape of the light coming in through the crack.

As for making my own lighting engine, I'm not really wanting to do that since I'm trying to stay focused on my own game, and also yours is quite good as is, and could be made even better if you get the additive colored lights working. As you said, it's harder to make something that's good for all types of games than it is to make it work specifically for your own. As for being good with blend modes, I would not say that at all. Other than the 3 basic ones, bm_subtract, bm_add, and bm_max, I can't stand the way GM uses blend modes. It's just trial and error really, and mostly error since they usually have very wierd effects you're not even wanting.

Anyway, I'm kind of proud of that screenshot that's why I posted it, and it's nothing more than a hastily thrown together WIP. I can only imagine how good it's going to be once I really start working on background graphics. A week ago, I did not have had any hope of getting anything close to this good.
  • 0

#74 qwertyuil390

qwertyuil390

    GMC Member

  • GMC Member
  • 232 posts
  • Version:GM8.1

Posted 07 December 2008 - 10:58 PM

Wow, awesome engine. but how do you make good custom lights? do u use the game maker paint program?
  • 0

I've moved to C++, but I still go on here and know most of GML still so if you need me I might be here...

Not like you knew me in the first place, right? ;)


#75 qwertyuil390

qwertyuil390

    GMC Member

  • GMC Member
  • 232 posts
  • Version:GM8.1

Posted 07 December 2008 - 11:08 PM

Wow, awesome engine.
  • 0

I've moved to C++, but I still go on here and know most of GML still so if you need me I might be here...

Not like you knew me in the first place, right? ;)


#76 Binsk

Binsk

    -Insane Kid-

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

Posted 08 December 2008 - 03:18 AM

Thanks. :blink: If you didn't know, when making a light you use white, black, and grays. The lighter the color the more transparent the light will be in that area.

To make a good light, well, there is no special way. You could use the built-in gradient maker. Or use photoshop or something. You could probably also find something on google by looking for "grayscale images" or "gradients" or something.

Edited by Scyler_27, 08 December 2008 - 05:33 AM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#77 NickToony

NickToony

    GMC Member

  • New Member
  • 463 posts

Posted 08 December 2008 - 05:12 PM

I never thought I'd use an extension package.. until I saw this one.

I do have my own lighting engine, but this one is unbelievably faster and smoother. I'm sure to replace mine with this one. Great job.

Edit: Tell me, does this use surfaces?

Edited by NickToony, 08 December 2008 - 05:16 PM.

  • 0

There's nothing quite like a bit of Prison Break

#78 Binsk

Binsk

    -Insane Kid-

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

Posted 08 December 2008 - 10:19 PM

NEW UPDATE!!! Woot! This is what has been changed:
-Removed the light_draw() and light_update() commands. It is done automatically for you now!
-Slightly sped up the light-position-updating.
-Greatly improved the colored lights! They look MUCH better now, instead of being so dull. (Thanks motormann for all the help!)
One thing now though, you MUST put light_init() at the beginning of the room. No exceptions, and you MUST place light_end() at the end of the room. There could be some serious bugs if you don't.

@NickToony, yes this uses surfaces. :) I am glad you like my .gex, and I hope you find v3.7 much better!
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#79 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 09 December 2008 - 04:30 AM

Nice update. Weird bug happens though... without ligh_draw() in the draw event of the object that creates lights, there is no lighting. Another weird bug that I cant find words to describe. see screenshot ( Link ). That red bar with the 0 underneath it is the health bar and score, which are set to draw at (view_xview[0]+16, view_yview[0]+16). Also notice that the flashlight is not pointing at the crosshair (which is where the mouse should be). You can't see it in the screenshot, but the mouse is in the direction of the flashlight.

Did you do things with views with this update? I can't think of any reason that this should be happening. This is with 3.7 that I am having these issues.

Also, my control_light object is created first in the room.

edit: This has to have something to do with views, I created another test room with just the player and the light controller and everything works fine.

Edited by bocochoco, 09 December 2008 - 04:32 AM.

  • 0

#80 Binsk

Binsk

    -Insane Kid-

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

Posted 09 December 2008 - 04:37 AM

Argh! I thought I fixed this problem. >.< It is when you use surface_set_target() in the draw event, it messes everything up. But if I DON'T the colored lights don't match up with the non-colored. So I had to find a fix, which I guess isn't working. :)

without light_draw() in the draw event of the object that creates lights, there is no lighting.

That is impossible considering how it is coded. Or do you mean only lights defined in that object aren't showing up? Also, make sure your not also using v3.1 in the game by accident!

EDIT: Hm... I did a test, and it worked fine! Then I downloaded the zip and re-installed the .gex and it messed up! o_O I might have uploaded a bad version, let me re-upload. Then mind telling me if it works?

Edited by Scyler_27, 09 December 2008 - 04:44 AM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#81 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 09 December 2008 - 04:40 AM

I've uninstalled 3.1 and all previous versions. light_draw() is a recognized function in 3.7 and without it, there are no lights; the room is full bright.

doesnt surface_reset_target() after you draw what you need fix that? If you need to, I can send you my gmk.

edit: damn scyler, you reply fast. Are you constantly refreshing the page or something?

Edited by bocochoco, 09 December 2008 - 04:41 AM.

  • 0

#82 Binsk

Binsk

    -Insane Kid-

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

Posted 09 December 2008 - 04:47 AM

Hah, I dnow, probably just coincidence. By the way, if you didn't catch my last message, I think I uploaded a bad version cause it worked for me till I tried re-installing the .gex with the downloaded version. Also, v3.7 should NOT have light_draw() so this almost guarantees that I messed something up. (Also, that should be the problem for the weird positioned hud.)

EDIT: Ok! Try re-downloading it! It WAS a bad version, I noticed the file size was 50kb instead of 63kb like it was supposed to be! It should work now. :)

Edited by Scyler_27, 09 December 2008 - 04:50 AM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#83 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 09 December 2008 - 04:52 AM

You sure you fixed the link? It's the same file as before (same md5) and same filesize 50kb...

Edited by bocochoco, 09 December 2008 - 04:53 AM.

  • 0

#84 Binsk

Binsk

    -Insane Kid-

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

Posted 09 December 2008 - 04:55 AM

What the hell? Huh, even the host said that it was 63kb. Ok I uploaded it with a different file name this time, checked, 63kb, this MUST be the fixed version! :)

EDIT: Yay! Thanks, glad it works now. :)

Edited by Scyler_27, 09 December 2008 - 05:05 AM.

  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#85 bocochoco

bocochoco

    GMC Member

  • New Member
  • 140 posts

Posted 09 December 2008 - 04:59 AM

yay works. bugs fixed. Colored lights look sooo much better now

Keep updating scyler! This is amazing
  • 0

#86 frog

frog

    GMC Member

  • New Member
  • 228 posts

Posted 09 December 2008 - 01:47 PM

Woot !!
new update.. this extension is awsome... keep improving it when you can :)
i realy love this extension...
  • 0


Game Maker 8 Pro
-------------------------------------------------------------

YAY NEW WEBSITE !
Click to visit my website

#87 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 09 December 2008 - 08:50 PM

I think Ill stick with old version maybe, I like parts of the lighter lighting but it can be too bright for some things =/
Maybe have an option for Intensity, some things look nicer and some things look horrible. Good update though
  • 0

Posted Image


#88 Binsk

Binsk

    -Insane Kid-

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

Posted 09 December 2008 - 11:31 PM

I do have an option, it is called alpha. :lol: You can change the alpha value when setting the color to make it less bright. Also, when designing your lights, don't use so much white, use more grays to get a duller light. With this version, there is a way to tone it down. But with the old version, there was no way to get it brighter. Thanks for the feedback though.
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#89 Krisando

Krisando

    GMC Member

  • New Member
  • 1351 posts

Posted 10 December 2008 - 08:40 AM

I do have an option, it is called alpha. :lol: You can change the alpha value when setting the color to make it less bright. Also, when designing your lights, don't use so much white, use more grays to get a duller light. With this version, there is a way to tone it down. But with the old version, there was no way to get it brighter. Thanks for the feedback though.

Oh gray will do the trick, It looks like hdr lighting is on lol which looks wiked
  • 0

Posted Image


#90 Binsk

Binsk

    -Insane Kid-

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

Posted 12 December 2008 - 01:56 AM

A very slight, but important update today! I have removed the light_init() bug! It no longer has to be placed with the first object in the room, you can call it whenever you want! (Though it is still best to call it first) Though now, I have changed things with the light_end() command, so unless you want bugs and glitches, you will place it at room end of every room that is using this .gex. That is the only update, but it was certainly needed. :)
  • 0

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#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

Posted Image


#92 jobro

jobro

    GMC Member

  • GMC Member
  • 1300 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

Marketplace.png


#93 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 3014 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

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#94 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 3014 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

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#95 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 3014 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

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#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


Game Maker 8 Pro
-------------------------------------------------------------

YAY NEW WEBSITE !
Click to visit my website

#97 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 3014 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

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#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


I am an experienced GML user according to The Real GML Test - Too bad the image looks crap in my signature.

#99 Binsk

Binsk

    -Insane Kid-

  • GMC Member
  • 3014 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

NEWS FLASH! You can't get to heaven by your works. No chance. Hopeless. Give up now. No amount of works will get you anywhere, in fact all your efforts have been botched years ago because you already missed perfection the first time you lied, stole, or performed any of those other lovelies.

 

That said, do you want to go to heaven? Not the hellish picture given by cartoons. You know, the nightmarish one where you are renting a cloud and harp? I mean, holy crap, where did that come from? I am talking about a bonafide city, people, designed by God no less. Heck, read John's Revelation 21 if you want details. Getting to heaven is extremely simple, actually, the how and why is spelled out in Paul's letter to the Romans, summarized in Romans 10:9,10. God lived a perfect life and died in your place, covering every one of your mistakes and failures past and future. All you have to do is believe that He did what he said He did and accept the gift. Bam, you're saved. Done deal. Complicated, no? Questions? PM me.


#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


I am an experienced GML user according to The Real GML Test - Too bad the image looks crap in my signature.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users