Jump to content


Photo
- - - - -

Thesnidr's Grid Distortion


  • Please log in to reply
30 replies to this topic

#1 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 24 August 2009 - 02:29 PM

  • Title: TheSnidr's Grid Distortion Effect
  • Description: Creates a grid and lets you distort it. Can also be textured.
  • GM Version: GM 7
  • Registered: yes
  • File Type: gmk
  • File Size: 68kb
  • File Link: Host-a | YoYo
Additional Info
This is a dynamic grid engine very similar to geometry wars!
It was updated to version 2 21/9/10, download old version here:
Host-a

Version 2 has been almost completely rewritten, and with Sapidus3's tips, it's a lot faster. Geometry is now stable, as opposed to before ^^
I've removed the implode script, as it now is the same as an explosion with negative force

Posted Image
Old picture: http://i26.tinypic.com/mjq0zl.jpg

Use arrowkeys to change room.

The grid can be any size, but too many cells might slow your game down.

Edited by TheSnidr, 13 July 2011 - 04:59 PM.

  • 1

#2 dadio

dadio

    I miss my cupcake

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

Posted 25 August 2009 - 02:19 PM

Ooh! Nice little example there!
Yeah, could be cool for texturing with a face & "distorting" (like a 2D version of Mario's head in Mario64).

Pretty much all your examples are really groovy tbh!
Keep 'em coming :whistle:
  • 0

#3 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 26 August 2009 - 12:39 PM

Thank you!

The engine is highly customizable. In the _update script, the second argument decides how fast the points in the grid should move back to their starting point (if they have been moved). Make it a low number to make it look like syrup.
You can decide yourself how many cells the grid contains, how big it is, and the radius and strength of the "_explode" and "_implode" scripts.

It seems it is similar here to how it is in the WIP section, people won't download without a picture, so I added one to the first post.
  • 0

#4 Newly Discovered

Newly Discovered

    Harmonious Genius

  • New Member
  • 2467 posts
  • Version:GM8

Posted 28 August 2009 - 02:27 AM

wow that is really cool!
this would make an insanely awesome topdown water effect, you should give it a shot!
you could probably be able to create some sweet water ripples as well.

good luck if you try! I know I wont.
  • 0

#5 pubby8

pubby8

    GMC Member

  • New Member
  • 577 posts

Posted 29 August 2009 - 03:34 AM

I wrote an engine for something similar to this last year. xD I'm actually writing a game on it right now :whistle:
distort image


Nice effect.
  • 0

#6 commander of games

commander of games

    Kaos Kreator

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

Posted 31 August 2009 - 12:46 AM

This is fun XD! I went online and got some face images of people(Bill Gates and stuff) and distorted them! This could make an intresting little game thing.
  • 0

#7 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 01 September 2009 - 01:29 AM

"Almost like in Geometry Wars"
How about EXACTLY like geometry wars - I think they used a combination of textures and warped 3d models to render a quick, and efficient grid distortion effect.
Looks like you replicated their' method in GM :)

Nicely done *thumbsup*
  • 0

#8 Newly Discovered

Newly Discovered

    Harmonious Genius

  • New Member
  • 2467 posts
  • Version:GM8

Posted 14 October 2009 - 07:40 PM

I had an idea on another way you could use this, but I'm not entirely sure how to go about it.
if you like the idea, maybe you could give it a try.

you'd select an area and create the grid. you'd texture the grid with a surface of that area. then distort it!
I was thinking you could easily create refractions, like heat from a flame or maybe water.

think it could work?
  • 0

#9 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 15 October 2009 - 02:47 PM

Yeah, maybe! Good idea.
I'll look into it when I get the time, but I believe it should be possible.

Edited by TheSnidr, 20 October 2009 - 06:36 PM.

  • 0

#10 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 20 October 2009 - 06:57 PM

Yeah, maybe! Good idea.
I'll look into it when I get the time, but I believe it should be possible.

I just uploaded a new version!
I've made an example of how to use the engine for, for example, heatwaves (thanks to Newly Discovered for the idea!)
I added a script that lets you create a texture index of a specified area on the screen. You can then use the texture in the draw_grid scripts.
Posted Image
As always, use the arrow keys to move between the rooms. The first room has no controls, use the mouse in the two other rooms.
  • 0

#11 Newly Discovered

Newly Discovered

    Harmonious Genius

  • New Member
  • 2467 posts
  • Version:GM8

Posted 20 October 2009 - 09:22 PM

very cool! not exactly what I was looking for, but it's still awesome looking. nice job!
this is actually a very powerful effect.

aw I see...it only captures the screen once. too bad it leaks!

Edited by Newly Discovered, 20 October 2009 - 09:38 PM.

  • 0

#12 LoopStan

LoopStan

    North-See Developer

  • GMC Member
  • 1398 posts

Posted 31 October 2009 - 07:33 PM

This is really cool! Good job, I needed a script and such just like this.
  • 0

#13 Shadowrend

Shadowrend

    Master of Shadows

  • GMC Member
  • 1571 posts
  • Version:GM8

Posted 12 March 2010 - 10:58 PM

Pretty cool.Posted Image
  • 0

#14 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 21 September 2010 - 05:05 PM

The engine has been almost completely rewritten!
It's much faster, and the geometry is stable now, as opposed to before!
Instead of just moving back to their initial positions, the vertexes now bounce instead, giving it a much more dynamic feel

Thanks to Sapidus3 for tips on how to improve speed
  • 0

#15 CaptainLepidus

CaptainLepidus

    GMC Member

  • GMC Member
  • 850 posts
  • Version:GM:HTML5

Posted 22 September 2010 - 12:25 AM

Try putting this picture into it:http://www.swisseduc...bble-mf9330.jpg

It creates quite a cool effect.
  • 0

#16 saim

saim

    GMC Member

  • New Member
  • 1085 posts

Posted 10 February 2011 - 02:04 AM

Am I too late to comment? It is awesome! Really really cool!
But I lack understanding. Can you comment things step-by-step? I got lost on the creation of the grid! (the for loop, to be more precise)
Or can I ask for info by private messages? I'm really interested in this effect, and it seems that it would take a while until I fully understand everything.
  • 0

#17 MudbudGoldfish

MudbudGoldfish

    Indie Game Dev Team

  • New Member
  • 494 posts
  • Version:GM8

Posted 10 February 2011 - 04:57 AM

wow, that was a bump..... This reminds me of the Nintendo DSI's picture changeing thing
  • 0

#18 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2435 posts
  • Version:GM:Studio

Posted 10 February 2011 - 07:55 PM

Never too late to comment, and every bump is much appreciated! Even though there are no posts in my engine topics, I usually update the engines regularly.

As for commenting the engine.. you want me to comment what's happening inside the scripts? I'm not sure people would care, but I can give you a brief explanation here.
Basically the for-loops initialize the points that the grid is made of.
Each point's variables are double arrays, where the first index (eg_ind) is the grid index (so that the user can make multiple grids without messing up the variables) and the second index (eg_dots[eg_ind]) is the index of the point.
Each point has the following variables:
eg_dsx= start x
eg_dsy= start y
eg_dx= x-value
eg_dy= y-value
eg_vx= horizontal speed
eg_vy= vertical speed
Also, eg_dots increases for each loop, giving each point a unique index.
The explode-script loops through the points closest to the explosion area and checks the distance and direction, then uses sine to achieve a smooth displacement.
The update scripts loop through all points, adding the speed variables to their position variables, and forces the points back towards their starting positions.

Unnderstand better now?
  • 0

#19 saim

saim

    GMC Member

  • New Member
  • 1085 posts

Posted 11 February 2011 - 11:29 AM

you want me to comment what's happening inside the scripts? I'm not sure people would care

I don't know about other people, but I love fully commented tutorials. But I understand how boring it can be to explain something that the code itself is supposed to explain.

Unnderstand better now?

MUCH better. Although I can't open the file right now, it explains in general lines what I remember from it. I'll re-read this as soon as I'm able to open the file, but I'm sure it will make a lot more sense, now.
Thank you! Again, that's a wonderful effect!
  • 0

#20 bluesy_92

bluesy_92

    GMC Member

  • New Member
  • 49 posts

Posted 01 March 2011 - 10:56 PM

I'm having trouble editing the engine to work when I create an explosion in another instance, rather than the one that is handling the grid. It has something to do with eg_vx not being recognized as a variable. I know all variables were declared as global in the create code, because I checked your script. How can I fix this?

EDIT: By editing the create script to set the variable as global, it works fine now. Sorry I did not see this sooner. You can ignore this post :-)

Edited by bluesy_92, 01 March 2011 - 11:20 PM.

  • 0




1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users