Scrolling Game Development Kit Forum

SGDK Version 1 => Script => Topic started by: Bulbaboy on 2006-03-06, 09:59:09 PM

Title: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy on 2006-03-06, 09:59:09 PM
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 (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.
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: durnurd 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?
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy 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...
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy 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.
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: bluemonkmn 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)
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy 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...
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: cbass 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)
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy 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.
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: cbass 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.
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy 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...
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: eric22222 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...
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: durnurd 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.
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Zorb Burger 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
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: eric22222 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
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy 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 ;)!
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Zorb Burger on 2006-03-10, 09:03:23 PM
Quote
wood dis be kinda lik teh pokemon ditto!?
No, you're thinking of Kirby ;)!

I guess dat be wat i meanin!  wat inspired u teh mak dis gam?  was it be kirby? ???
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy on 2006-03-11, 03:01:23 AM
I think there was a slight misunderstanding...  I meant Kirby is like Ditto; I'm not planning on turning this into something that much like Kirby.
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Zorb Burger on 2006-03-11, 12:18:59 PM
dat wat i be meain!!!  sry bout dat bulbaboy!  btw, did yer name bulbaboy, com from pokemon??  it sound kinda lik bulbasaur, or however ya spel it... ???
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: hebedaymun on 2006-03-11, 07:45:38 PM
(posts deleted by BlueMonkMN)
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: hebedaymun on 2006-03-12, 05:45:33 PM
Pokemon is the worst peice of sh*t in the world.  Why don't you stay on-topic, Zorb?  Ya damn loser.

*Chops Zorb up with a short sword for liking Pokemon*
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: durnurd on 2006-03-12, 09:25:52 PM
Now, now, I thought you had learned your lesson about disrespecting other board members.  The more posts you make like that, Hebedaymun, the more you sound like a 13-year-old who is trying to sound all pompous and righteous by swearing and putting down others.

And as for Pok
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: Bulbaboy on 2006-03-12, 11:22:04 PM
Zorb: Yep, that's a correct guess.  The only explanation I can think of for this name (well, in English, anyway) is if I really liked bulbs or something.

And, uh, nice way to learn a lesson there, hebedaymun...

Edit: "The only OTHER explanation..."
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: hebedaymun on 2006-03-13, 10:10:07 AM
Why the HELL would you compare Pokemon to the Holocaust?
Title: Re: Making a many-sprite "blob" - flow rate and main body resizing
Post by: durnurd on 2006-03-14, 05:23:20 PM
I hardly compared the two, sir.  I said one was worse than the other.  Do you disagree?  I was simply making a point by picking something that was so different from Pok