Game Maker Community YoYo Games

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Iceeffects Engine, Sprite and Background Effects Made Easy
IceMetalPunk
post Oct 29 2009, 02:12 AM
Post #1


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



While working on the effects for ShadeWorld, I realized that many people are in search of a quick-and-easy graphical effects engine. So I made one to release to all you lovely members (and perhaps the not-so-lovely ones as well tongue.gif ).

The effects are by no means fast enough for realtime applications, which is why I designed the scripts to apply the effects to graphical resources (sprites and backgrounds) and create new resources from them. When used in this way, I've managed to generate one of each effect -- a total of 6 effects, including two animated effects -- in less than 1/5 of a second. And without the animated effects, I can generate the other 4 in less than 0.02 seconds (20 ms).

To facilitate ease of use, I designed the system to use just two scripts -- sprite_create_effect() and background_create_effect() -- which take as one argument the type of effect to apply.

NOTE: You will need a registered version of GM7 or GM6.1 to use this system.

Here's the download link to a ZIP containing a .GML file, an example .GMK file, and a merge .GMK file:

http://willhostforfood.com/users/I/IceMeta.../IceEffects.zip

I honestly recommend the simple installation method, which means merging IceEffects.GMK with your own game. The reason is I use some constants to define effects, so if you want to use the .GML file, you must remember either to add in those constants manually or uncomment the README script and cal it. All three installation methods are described in the README script, so read it smile.gif .

Here's a screenshot from the demo .GMK:



Note that the two wave effects are actually animations, and as such are the only two effects that cannot be applied to backgrounds.

And here's a short description of each effect, copied/pasted from the README script:

QUOTE
FX_GRAYSCALE - Produces a grayscale (black & white) copy of the resource

FX_INVERT - Produces an inverted copy of the resource

FX_HWAVE (Sprites only) - Produces a horizontal wave animation from a
single frame of the resource

FX_VWAVE (Sprites only) - Produces a vertical wave animation from a
single frame of the resource

FX_ALPHAMASK - Produces an alphamask from the given resource.

FX_COLORIZE - Produces a colorized version of the given resource.


The download link again: http://willhostforfood.com/users/I/IceMeta.../IceEffects.zip

Please comment or criticize, whichever you think is more appropriate smile.gif . And if you have any ideas for other effects, let me know and I'll try to add them.

-IMP wink1.gif smile.gif

This post has been edited by IceMetalPunk: Nov 3 2009, 10:30 PM
Go to the top of the page
 
+Quote Post
Newly Discovered
post Oct 29 2009, 03:07 AM
Post #2


Harmonious Genius
Group Icon

Group: GMC Member
Posts: 2033
Joined: 14-October 05
From: ....Wonderland.... Pwned? Of Course
Member No.: 36998



very neat, and nice to see how fast they are. good job!
Go to the top of the page
 
+Quote Post
T-Bird
post Oct 29 2009, 05:28 AM
Post #3


GMC Member
Group Icon

Group: GMC Member
Posts: 1288
Joined: 5-November 05
Member No.: 38296



The two rooms gave me 125 and 31 MS respectively.

Very good looking. To bad they all require resource creation.

It seems like if you did this to all of a level's resources when the level started, you could do it in a decently fast loading screen without annoying anyone. If memory is a concern, the edited forms can be destroyed after the level.

This post has been edited by T-Bird: Oct 29 2009, 05:29 AM
Go to the top of the page
 
+Quote Post
IceMetalPunk
post Oct 29 2009, 12:08 PM
Post #4


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



Thanks to both of you smile.gif .

@T-Bird: Yes, unfortunately if this were used in real-time it would destroy the FPS (the grayscale effect alone would cut the FPS completely in half). So until Game Maker becomes a bit faster with its graphics work.

By the way, do either of you have ideas for more effects? tongue.gif

-IMP wink1.gif smile.gif

*EDIT* Oh, and the reason the first room takes slightly longer is because the two animated effects take slightly longer than the static effects.

This post has been edited by IceMetalPunk: Oct 29 2009, 12:09 PM
Go to the top of the page
 
+Quote Post
fredcobain
post Oct 29 2009, 01:47 PM
Post #5


GMC Member
Group Icon

Group: GMC Member
Posts: 87
Joined: 4-June 04
Member No.: 10137



Congrats!! So Nice!!!

=)
Go to the top of the page
 
+Quote Post
Tarik
post Oct 29 2009, 02:02 PM
Post #6


Hello my friend ^^
Group Icon

Group: GMC Member
Posts: 1992
Joined: 21-January 04
From: Amsterdam
Member No.: 4992



There's no effect I haven't seen before on the GMC, but I like the compilation and the user-friendliness you offer to novice users. Should be rather helpful to some, as effects have always been somewhat limited to those who know how to use surfaces, primitives and blend modes effectively. There are scripts for all these effects, but most are not as easy to use as this one.

I got 31 and 0 ms respectively btw. I love this computer, cost me 400 euros. Built it myself a year ago from parts from several large warehouses with only an online store and practically no service. Big economies of scale and very few overhead and operating costs.

As you can see, I had 0 ms on the second room, which of course is only due to a lack of precision with GM's timing functions. Would be interesting if you were to expand on this and add more effects, to time it with yourself's precision timing, and time each individual effect separately. Some will be faster than the other. Anyway as you mentioned, realtime is tricky, but pre-rendering graphics is an option. If you use external resources, you can load and free memory on the fly and manage memory that it won't cost you any speed apart from the initial prerendering, which can be done by the user to save downloading bandwidth, but you can also prerender all your graphics and include them with the game (externally, so you can manage memory). Using TARC you can even encrypt and compress the external resources.

Nice work in any case, good luck with the project.

This post has been edited by Tarik: Oct 29 2009, 02:05 PM
Go to the top of the page
 
+Quote Post
IceMetalPunk
post Oct 29 2009, 05:22 PM
Post #7


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



Thanks for all the positive comments.

I can't think of any more effects, so for now, I've just added a parameter to the FX_GRAYSCALE effect. Now you can choose the amount to which the image is desaturated (meaning 1=completely grayscale, 0=no change, 0.5=halfway desaturated, etc.) But I don't want to re-release the system for just that, so I'll have to think of some new ones...

-IMP wink1.gif smile.gif
Go to the top of the page
 
+Quote Post
tangibleLime
post Oct 30 2009, 03:32 AM
Post #8


Lunatic
Group Icon

Group: Local Moderators
Posts: 2164
Joined: 23-December 03
From: United States, MA
Member No.: 3850



Very nice, IMP. I got 78ms and 32ms respectively. The simple implementation is also very appealing since there isn't a labyrinth of scripts to sift through. Thoroughly documented and well coded - very professional smile.gif. Perhaps when you've perfected everything you desire, you could package it in an extension for even easier use.
Go to the top of the page
 
+Quote Post
IceMetalPunk
post Oct 30 2009, 03:08 PM
Post #9


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



I plan to do just that...once I have enough effects, that is. 6 effects (or 4 if you don't count the animations, as they don't work for backgrounds) doesn't seem like enough. But again, I'm having effector's block tongue.gif . So as much as this will sound like I'm just parroting myself again, any effect ideas are appreciated smile.gif .

-IMP wink1.gif smile.gif
Go to the top of the page
 
+Quote Post
athrowawayxyz
post Nov 3 2009, 05:12 AM
Post #10


GMC Member
Group Icon

Group: GMC Member
Posts: 31
Joined: 23-October 09
Member No.: 143306



For some reason, I get an error when I try to load the Demo.
Go to the top of the page
 
+Quote Post
IceMetalPunk
post Nov 3 2009, 05:24 AM
Post #11


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



Can you be more specific? What errors are you getting?

I can't test it out at the moment (should never have upgraded to Windows 7....), but knowing the error can help me figure out if it's a problem on your end and how to fix it.

-IMP wink1.gif smile.gif
Go to the top of the page
 
+Quote Post
tangibleLime
post Nov 3 2009, 06:37 AM
Post #12


Lunatic
Group Icon

Group: Local Moderators
Posts: 2164
Joined: 23-December 03
From: United States, MA
Member No.: 3850



QUOTE (IceMetalPunk @ Nov 3 2009, 12:24 AM) *
I can't test it out at the moment (should never have upgraded to Windows 7....)
If it helps to know, I'm running Windows 7 Ultimate and it works perfectly without flaws or errors.

I also must note that I enjoy the fact that multiple effects can be applied to a single sprite.

athrowawayxyz - Are you using a registered copy of Game Maker?
Go to the top of the page
 
+Quote Post
IceMetalPunk
post Nov 3 2009, 10:28 PM
Post #13


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



I know; 7 should not have caused any problems. Yet since the upgrade, no GM games run on my account. As it turns out, if I create a new Windows account, GM runs perfectly fine there, but it won't on my main account. I've tried ending all nonessential processes, thinking it was a program running that was causing the problem, but no luck.

Someone said to do the same for the services, not just the processes, which will be my next step.

Anyway, back on topic. Yes, since the system generates a new resource from a given resource, you can chain asmany together as you want for multiple effects (not counting the speed considerations of chaining, though).

And athrowaway, you do need a registered versino of GM. I should have been more specific; I'll add that into the first post now.

-IMP wink1.gif smile.gif
Go to the top of the page
 
+Quote Post
Tiby312
post Nov 4 2009, 08:40 PM
Post #14


GMC Member
Group Icon

Group: GMC Member
Posts: 439
Joined: 29-March 05
From: Philippines
Member No.: 24939



Ooo! Similar to the script I did, but better. How about adding a blur option?

Yeah I would suggest making all the sprites at game start and then putting them in global variables. Just make sure you don't make the sprites preload!

This post has been edited by Tiby312: Nov 4 2009, 08:44 PM
Go to the top of the page
 
+Quote Post
IceMetalPunk
post Nov 4 2009, 10:39 PM
Post #15


Rocker
Group Icon

Group: GMC Member
Posts: 3900
Joined: 12-March 04
From: USA
Member No.: 6970



Ah, blur; of course I forget the obvious one smile.gif .

Well, as I said, I'm still working on getting GM to work with my main Windows 7 account, but when I finally get everything fixed, I'll see what I can do.

Glad you like it, by the way!

-IMP wink1.gif smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2009 - 10:31 AM