Recent posts by 2DArray on Kongregate

Flag Post

Topic: General Gaming / Spewer!!

Actually that’s already finished – Edmund’s Basement Collection is up on Steam as of a few days ago.

 
Flag Post

Topic: Game Programming / Liquid Physics

EDIT: Ack, Rivaledsouls beat me to it. Oh well. This explanation is probably still helpful.

I didn’t use PixelBender at all because I forget if it was out when I made Spewer, and either way, I don’t know how to use it. I’ll learn eventually.

I ended up rendering the metaballs by first rendering each particle to a screen-sized transparent bitmap. Each circle has a radial gradient. In this image, black means full alpha and white means zero alpha.

Also note that each circle is larger than its particle’s physical size. This means that if two particles are close to touching, their gradients will already be overlapping. That leaves us with something like this:

Doesn’t look particularly goopy. But, if we remove every pixel that’s below a certain alpha (ie, things that are close to see-through will become fully see-through), it starts to look pretty cool. I do this with Flash’s built in threshold() function. Check it out in the docs. It does cool stuff.

(Note that I fiddled with the contrast in this image, too, to make it look a little prettier–I just found this example on the internet so metaballing it doesn’t look particularly great)

But, uh, yeah. That’s about it. Messing with everything a whole lot is generally the only way to make it look good, so always fiddle.

 
Flag Post

Topic: Game Programming / Liquid Physics

Okay, uh, I made Spewer a while ago, but this is a basic rundown of how I remember it working.

Some of you guys have pointed out the methods I used already: It’s a bunch of particles rendered with an effect called “metaballs.” It would be helpful to view the simulation as two distinct steps: Physics and rendering.

The physics are very, very simple to explain: It’s basically one of those ball pits you used to play in when you were a kid. It’s a bunch of circles that aren’t allowed to overlap, and they all have stuff like gravity and collision detection/reaction with the levels so they’ll fill up wells and bounce off of walls.

The physics between particles is nowhere near physically accurate: I based my engine on Smoothed Particle Hydrodynamics, but the final result is so simplified, approximated, and generally bastardized that it has almost none of the features of the original model. Particles do not attract each other nor stick to things/each other, etc.

The reason that I could get away with such a shoddy physics model was that the rendering is particularly good at hiding the problems. Metaball rendering basically means that you have a bunch of circles (or spheres, if you’re in 3D) that “stretch” to meet each other when two of them get close enough. This image is obviously 3D, but I’m sure you can imagine what the same thing would look like in 2D. (Spoiler alert: It looks like what you see in Spewer.)

This works (read: looks good) for any arbitrary number of circles that may or may not be close to or overlapping each other. The rendering is all done with Flash’s BitmapData, by the way. All kinds of fun tricks hiding in there if you snoop around in the docs and such.

At the end of the day, the code in Spewer isn’t immensely complicated or anything. I just spent a really long time tweaking all the little parameters and trying new stupid crap until I ended up with something that looked good enough and performed well enough to be fit for release. Still wish it ran faster, though.

 
Flag Post

Topic: General Gaming / Top 20 characters of Kongregate

Number 4 and number 13?

WOOOOOORD.

 
Flag Post

Topic: Collaborations / Need Programmer - I have a good scince of games

…And what exactly is a scince?

 
Flag Post

Topic: Collaborations / What do you think? Your own opinion!

Busy as hell, yeah. The fire is way too much, and the reflection doesn’t look like a reflection–Try some blend modes or something, to get it to sink into the background image. Then the UFO is, uh, I don’t really know what it’s doing there. What does it have to do with Kongregate? Actually, what does anything in this picture have to do with Kongregate?

You’re moving along, though, so keep at it.

 
Flag Post

Topic: Collaborations / I need someone to make a game and we can share the revenue

$25?! Dang!

Richard, you need to understand that in order to be useful in a Flash game, you’ve got to contribute. That means art, code, or both. You can’t go asking people to make a game for you and then take some money from it.

 
Flag Post

Topic: Collaborations / Artist looking for Programmer

MyLuckyDay, words don’t exist to accurately describe just how happy I am for you. Certainly one of the best posts in recent memory.

Gloriously, gloriously indignant! Good work!

 
Flag Post

Topic: Collaborations / ENOUGH. BE GONE!

I’m not sure where to stand on this one.

First off, though, killer. You’re way, WAY too pissed off. Cool down a bit. It’ll make everyone happy.

Here’s why it’s a weird issue. The collab stories don’t fit into what the Collabs forums were made for–The Collab forums were set up to connect Flash devs with Flash artists and other people who’d end up making Flash stuff together. Stories written by a bunch of people don’t really fit that. They are collaborations, but they’re not what the forum was set up for.

On the other hand, there isn’t another place where they’d complete fit, either. The best fit at this point would probably be Off-Topic.

Ideally, the happiest ending would be the addition of a new forum, probably something like Literature. That would work for people who want to post short stories or whatever, and at the same time it would be a good fit for these collaborative stories.

I’m not in charge of any of that, though, so oh well.

 
Flag Post

Topic: Collaborations / Need Team for game (rpg/sidescroller)

I’ll make the same offer, but $19.50/hour! Take THAT, Fenris!

Seriously though, alex, you need to learn to work with either art or code to be useful in a Flash project. You can also make the music or sounds, but if you do, don’t expect to be the project lead.

 
Flag Post

Topic: Collaborations / Recruiting One Beta-Tester

I’m willing to test for you. I’ve been making games for a while, so I know what’s actually helpful as feedback from a tester. Let me know if you’ve still got a spot open. MSN is twodimensionalarray@gmail.com.

 
Flag Post

Topic: Collaborations / I'll pay you to write some music

Actually, I wound up finding someone pretty quick, so this is all taken care of. I’ll keep you guys in mind in the future, though, when I need more stuff written.

 
Flag Post

Topic: Collaborations / games

let’s fighting love

 
Flag Post

Topic: Collaborations / need coder and programmer for new game

Maybe this is mean, but I’m laughing so hard I can barely breathe.

 
Flag Post

Topic: Collaborations / I'll pay you to write some music

(Nurr, the website is breaking, I can hear the walls begin to creak.)

I’m making a game, and the guy I originally wanted to write music for it is backed up all to hell. This leaves me needing someone new to write music for the game. I’ve got some money to throw around, so if you’re looking for a way to make some cash, this is one option.

All I need is either one or two loops, one minute each. Whether it’s one or two loops depends on how quickly you work, your rates, etc. Regardless of how many loops, they’d all be slow and moody. You can check out the game they’d be tied to here, as long as you promise to be aware that it’s still very unfinished and contains lots of elements that will change and be improved upon.

http://2DArray.net/once-more-demo

I’m willing to talk over how much you’ll be paid, so none of that is set in stone at this point.

Bonus points: If you’re as cool as I hope you are, there’s opportunities to write more music for stuff I make later on.

Who’s got talent?

 
Flag Post

Topic: Kongregate Multiplayer Games / [Kongai] Help name a Kongai character

Keeping with the current design spec, I’d suggest something along the lines of Boobs McCleavage. If it’s not fit for the cover of Cosmo, it’s not fit for Kongai.

 
Flag Post

Topic: Collaborations / I need an artist.

Truendy, your stuff looks real good. You got an AIM/MSN address? I’d like to talk. I’m The2DArray on AIM, and twodimensionalarray@gmail.com on MSN. 2DArray@gmail.com for email.

 
Flag Post

Topic: Collaborations / I need an artist.

Erm, I mean, the output is a 2D image, but you made them in Swift3D, or something similar. I don’t know of any other 3D modelers that export to Flash, so unless I’m just behind the times, I’d say probably Swift. I’m looking for stuff that’s created in 2D–I don’t really like the way it ends up looking when it’s modeled in 3D and then used in a 2D game.

 
Flag Post

Topic: Collaborations / I need an artist.

Moose, WhenTheBombGoesOff is adorable, haha.

Leguma, I’m looking for 2D art. If you’ve got anything there, it’d still be worth showing. Good work on the stuff you posted, though, they look nice!

kosmo, do you have any animation samples? I like how a lot of those images look, but do you have anything in motion?

 
Flag Post

Topic: Collaborations / I need an artist.

Hey everyone. I’m looking to make another game (My previous one was Spewer), but the artists I usually work with are busy. So now I need a new one. I write code in AS3, and have been doing this for a while now, so I know how things work and what’s needed.

I don’t have a specific project laid out yet, so we can figure something out together. I need to pay for college, though, so whatever it ends up being, there’ll be some money to split between us.

Interested? Show me something you’ve made. I’ve gotten used to working with people who regularly and consistently amaze me, so hopefully you can do the same!

 
Flag Post

Topic: Game Programming / Kongregate Flash 6K Competition.

Haha, the only redeemable part of this game is the powerdowns. Drugs Are Bad and Enjoy Your Seizure might as well just be the whole game. Everything else is near worthless.

BOOYAH

 
Flag Post

Topic: Game Programming / Kongregate Flash 6K Competition.

I made something, but I’m not really satisfied with it at this point. It’s a little over 4kb, so I’ve still got plenty of space left, but the game’s just not fun enough yet. If it gets better, I’ll submit it.

EDIT: Screw it. I’m finishing up Spewer right now, which is easily the best game I’ve ever made, so I don’t feel so bad about putting out this little shitbag. I don’t expect to win, haha, but maybe I’ll at least piss someone off with the powerdowns.

http://megaswf.com/view/b155a1a7d229fc14f13e521f721caf34.html

5588 bytes.

 
Flag Post

Topic: Game Programming / Broad Phase Collision Detection.

It’s really simple point-point “don’t allow them to be too close to each other” collisions. Basically just verlet, but they’re allowed to be as far apart as they want to be.

As for a hint for string compression, it’s just LZW. It may or may not be composed of pure magic.

 
Flag Post

Topic: Game Programming / Broad Phase Collision Detection.

Bahaha, I had no idea that I could be this inane. I must have melted my fuckin’ brains working on this game. Yeah, the second loop is totally unnecessary, as is storing arrays. I’m almost proud of myself for failing this hard.

 
Flag Post

Topic: Game Programming / Broad Phase Collision Detection.

So I’ve been working more on Spewer lately, and a key element of the game is the inclusion of a particle based fluid sim. The problem at this point is that the fluid sim is too damn slow.

At first I was using a grid based maneuver to separate up the particles. This worked, but wasn’t quite good enough.

Earlier today, I switched to Sort and Sweep. AS3’s sorting is mega fast, so that’s really easy to handle. The slow part is looking for axis overlaps. I made a little test prototype of the method, so here’s what the “sweep” loops look like at this point.

//Sort all the particles according to
//x position on the screen
boxSort.sort(sortX)
//And then run through them all...
for (i=0;i<boxSort.length;i++) {
//"tar" is the current particle.
//we set its possible hits array to
//emptiness, and the "hitAnything"
//value (which lets us know if it's,
//uh, hit anything) is set to false.
	tar=this[boxSort[i]]
	tar.hits=[]
	tar.hitAnything=false
//Now we run through all of the particles
//that are to the right of the current one.
//(if we checked to the left as well, we
//would end up with duplicate collision pairs)
//As soon as we find one that isn't overlapping
//in x values, stop checking.  All of the
//possible hits so far are stored in the
//particle's "hits" array.
	for (j=i+1;j<boxSort.length;j++) {
		tar2=this[boxSort[j]]
		if (tar2.x<tar.x+r*2) {
			tar.hits.push(boxSort[j])
		} else {
			break
		}
	}
}
//And now we start over, but for y...
boxSort.sort(sortY)
for (i=0;i<boxSort.length;i++) {
	tar=this[boxSort[i]]
	tar.finalHits=[]
	for (j=i+1;j<boxSort.length;j++) {
		tar2=this[boxSort[j]]
		if (tar2.y<tar.y+r*2) {
//If two particles are overlapping in y,
//then check and see if they were also
//overlapping in x.  If they are, then
//their bounding boxes are overlapping!
//Hooray!  hitAnything is set to true.
			if (tar.hits.indexOf(boxSort[j])!=-1) {
				tar.hitAnything=true
				tar2.hitAnything=true
			} else if (tar2.hits.indexOf(boxSort[i])!=-1) {
				tar.hitAnything=true
				tar2.hitAnything=true
			}
		} else {
			break
		}
	}
}

This method works just fine, but it’s still too slow. I can’t think of any sort of trivial optimization, so is there some sort of brilliant change I could make to speed things up? Some guy said that using this method in Flash, he managed to get down to 5ms for finding overlaps in both axes for 700 particles. What the hell could he have done?