Author Topic: Making a many-sprite "blob" - flow rate and main body resizing  (Read 9383 times)

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Okay, so I'm trying to make a somewhat realistic blob of goo.  My solution for this is to make it composed of many sprites (currently about 50).  Here's a link to what I've currently got:

http://www.istori.com/bulbaboy/Blobtest.zip

Hit ctrl once, then click and drag the green ball of which there's an initial instance.

So far, pretty much everything has gone okay, but I've got two major problems: first, the flow rate (for lack of a better word, I guess) is FAR too slow when there are lots of sprites.  I won't be able to make it playable unless I can get stuff to move faster.  You can try lowering nBlobNumber (located near the beginning of the script file, luckily) to see the kind of speed I want.

Second, it would be cool if I could make the (apparent) size of the main body change depending on how far out the arm is reaching.  You know, it grows when the arm is close to the body, shrinks when it's far away.  I'm thinking the only/by far the best way to do this is to have lots of overlapping sprites, but I'm not sure how to effectively do that (without needing even more sprites, at least).

So, if you guys don't mind, it'd be cool to have some opinions on how I'd be able to solve these problems effectively.  The second problem is less urgent, but I'm not sure how I'd implement it.  The first one, on the other hand, is a direct roadblock to making it playable, but I think it might be a bit easier for me to fix it.  And if you don't feel like downloading the .zip, I can always describe the behavior I've currently got.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #1 on: 2006-03-06, 10:44:24 PM »
I'm curious... this slow down you speak of, does it affect the speed of the mouse pointer and everything?  I noticed no noticable slow-down except for the fact that the blob was moving quite slowly, which could be remedied with a simple multiplier when setting velocity, correct?

How fast is the processor in the computer you're using to test this?
Edward Dassmesser

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #2 on: 2006-03-06, 10:49:31 PM »
Well, the mouse and everything are fine - it is just the blob, and it would be possible to just put a multiplier, but the thing is, I eventually want the arm to be able to extend out a certain distance, and then maybe be able to grab or stick onto something and pull the body towards it.  And I'm not sure how long it would take me to get that looking right, at a reasonable speed...

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #3 on: 2006-03-06, 11:01:40 PM »
Hmm...  I'm going to have to come up with some code to limit how far the player sprite can move anyway; maybe applying that to the other ones, and then having them all accelerate towards the player sprite (and have them lag) at a fixed rate or something...  At least, I HOPE something like that would work.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #4 on: 2006-03-07, 06:54:44 AM »
I got an interesting effect that might be closer to what you're looking for by changing these two lines:
Code: [Select]
arBlobParts(nBlobPart).X = arBlobParts(nBlobPart - 1).X + (nXDiff / 2)
arBlobParts(nBlobPart).Y = arBlobParts(nBlobPart - 1).Y + (nYDiff / 2)
to this:
Code: [Select]
arBlobParts(nBlobPart).X = arBlobParts(nBlobPart - 1).X + (nXDiff / 3)
arBlobParts(nBlobPart).Y = arBlobParts(nBlobPart - 1).Y + (nYDiff / 3)

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #5 on: 2006-03-08, 09:01:01 PM »
Yep, changing the second instance (I think I need to clean up my code...) of the former code to the latter does produce a result closer to what I want.  I think maybe making the individual segments "know" how far they're supposed to go might really be what I want, though, so I'm gonna try that...

cbass

  • Expert
  • Regular
  • *****
  • Posts: 97
  • script this
    • View Profile
    • Squest RPG
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #6 on: 2006-03-09, 06:20:16 PM »
you also might want to reorder the sprites so the one you have to click is drawn last (drawn on top)

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #7 on: 2006-03-09, 07:10:42 PM »
To make it look better, right?  I plan on turning them all the same color with no outlines eventually anyway, so I don't think it would matter at that point.  Well, unless you meant for internal code purposes, then I'd like to hear why it would affect it.

cbass

  • Expert
  • Regular
  • *****
  • Posts: 97
  • script this
    • View Profile
    • Squest RPG
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #8 on: 2006-03-09, 11:57:50 PM »
nope, just visual, so i know where to click.  if its all gonna be same color, then no reason to do so now.

I'll save any comments for the finished product ;)  It looks like you have some good idea and talent to back it up, I look forward to a playable demo.

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #9 on: 2006-03-10, 12:51:10 AM »
Yeah, I'm planning on basically making the player a blob of goo, for lack of a better description, that can do stuff like stick onto walls and maybe shapeshift or stuff.  The unfortunate thing is, there's, like, only coincidental support for pretty much anything I want the player to do, so I'm having to use an unfamiliar scripting language just to make the basic player behaviors  :-\.  And my PS2 memory card doesn't work anymore, so I can't unwind with Katamari all that well.

But, at least it should be pretty easy to make a playable demo once I've got the player working.  And I suppose technically I'm working on graphics problems right now, but still...

eric22222

  • Fanatic
  • ***
  • Posts: 177
    • View Profile
    • Eric Online
    • Email
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #10 on: 2006-03-10, 09:02:23 AM »
Reminds me alot of a game I ran across a few weeks back. Not sure what the name was, but it was basically an amazing physics engine combined with awesome lighting effects rolled into a platformer. The demo was online, but it was only a few levels. If I find it, I'll link to it. Maybe you could get some ideas, though I don't think the kind of stuff it had could be replicated on GameDev...

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #11 on: 2006-03-10, 10:41:30 AM »
Was it called "Gish"?  That's a game I found on the "Independant Games" CD (which SGDK was recently published on).  It was very much like what you are describing.
Edward Dassmesser

Zorb Burger

  • Guest
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #12 on: 2006-03-10, 01:32:43 PM »
Yeah, I'm planning on basically making the player a blob of goo, for lack of a better description, that can do stuff like stick onto walls and maybe shapeshift or stuff. 

wood dis be kinda lik teh pokemon ditto!? :)  cuz it can shape shift n stuff... jus wonderin

eric22222

  • Fanatic
  • ***
  • Posts: 177
    • View Profile
    • Eric Online
    • Email
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #13 on: 2006-03-10, 05:52:47 PM »
Yeah, that was it. "Gish." I found the website if anyone's interested. The demo's just a few levels, but still pretty fun: http://www.chroniclogic.com/~gishgame/index.htm

Bulbaboy

  • Regular
  • **
  • Posts: 36
    • View Profile
Re: Making a many-sprite "blob" - flow rate and main body resizing
« Reply #14 on: 2006-03-10, 08:46:38 PM »
Yeah, Gish, I've tried the demo.  Somewhat similar to what I'm thinking of...  Namely, what I meant by "shapeshifting" is roughly analogous to Gish's powers (currently, it's still in the "vague idea" phase, but maybe like make a portion of the player harder and pointy to break stuff or something), and I do plan on having lots of physics-type stuff that you can do, like Gish (or Super Metroid, for that matter).  At the same time, though, I definitely am not planning on just doing Gish with stretchy tentacles.

Quote
wood dis be kinda lik teh pokemon ditto!?

No, you're thinking of Kirby ;)!