Making a 2D Katamari Damacy in Construct!

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • That file isn't working xiao, btw.

    I guess I suck at dropbox. D:

  • [quote:7u7r5om6]What I still don't understand is the ability to have these things (katamaris) grow. I'm not entirely sure myself of how it would work conceptually, not just on Construct. I tried adding the size value of the pickup to the size value of the ball when it picks it up but it didn't work out so well.

    make the physics sprite visible, and set the opacity to 20 percent

    make sure it is on top of everything else

    so you can see the physics circle, but you can see the trash and katamari through it

    now watch what happens when it gets bigger

    your bigger sprite probably isn't repositioning itself to be circling around the katamari and the trash, it's just making a big invisible circle around the original katamari.

    you have to figure out the math to make the new size be circling the katamari plus the junk.

    it should stretch to an oval, and set itself to an angle thats the best fit for the trash

    math is power

    and the math section of the system expressions wiki will come in handy

    for this to work, you may have to destroy the original physics sprite and create a new one in it's place in order to align the physics circle with the trash it's supposed to be circling. the physics behavior doesn't allow you to move objects without using the physics itself to do it. you can copy over the velocity and angular velocity to the new object so it will continue to move the way the original one did

    may also use a second invisible sprite to choose which objects should be picked up

    because if you think about it, if you pick up a pencil and it's poking far out from the karamari, causing it to roll differently, you don't want guys sticking to the tip of the pencil. it's a growing circle around the katamari itself, even if the trash is changing the overall shape with one or two odd items, it never loses it's roundness for too long, so the collision mask should grow, but not in the same way the physics object does.

    EDIT: For dropbox, make sure you put the file you want to share in the public folder of dropbox, and then rightclick and copy public link

  • I'm thinking of ditching the wobble thing. As nice as it is I've been messing around and I can't seem to find a system that doesn't break the way the original katamari moves.

  • My name is Madster and I endorse this thread.

    I also endorse Lucid for giving the most awesome help.

  • In the video you show, the Katamari doesn't "wobble" anyway... so yeah, I'd ditch the wobble idea (even though it would be more "realisitc" to have the wobble) and go with a simple circle that gets larger with each added object.

    This would also stop problems from arising, like if your "oval" gets too much oval shaped, it may not want to roll properly. If it is a circle, it will always roll.


  • May I first say you guys (especially lucid) are my fuggin' superheroes for being so damned helpful! You blow away the Clickteam community : D

    now, ON TO THE KATAMARI! : O

    okay, the problem about the circle enlarging is that it will pick up stuff the katamari isn't touching. So really the only way to do this is to "simulate" the sticking? I guess? I don't know.

    everybody watch the video. my mind is broken. D:

  • The phyics ball doesnt have to be the thing that picks stuff up... it just has to be the physics device and "roller". the objects attached to the ball can be what picks stuff up.

    If you watch the video you notice how the katamari spins like a perfectly round wheel... that's probably because it most likely is. The objects that attach to the ball, also attach to other objects. You really only need the first object (your base katamari sphere) to link to the ball, and everything else will link to the katamari sphere. The balls dimensions should be determined (somehow) by measuring the inner most pixel diameter of all the objects combined.

    You could probably fake this by say, adding 1 pixel in height and width to the katamari for every 1cm of object that touches it?


  • By the "katamari sphere" you mean the invisible one right?

    [quote:1n2t5mi2]The balls dimensions should be determined (somehow) by measuring the inner most pixel diameter of all the objects combined.

    Here lies the problem...

  • May I first say you guys (especially lucid) are my fuggin' superheroes for being so damned helpful! You blow away the Clickteam community : D

    that's just how we roll here at scirra

    never been to clickteam, or used mmf or whatever their thing is

    now, ON TO THE KATAMARI! : O

    I just noticed now, that the katamari video you posted and were talking about was a 2d version. I hadn't watched it

    I think you should aim higher than a better looking version of the 2d one, you should make it like a 2d version of the original, which would be much cooler and interesting looking

    I played around a little with the katamari thing

    unfortunately I don't have alot of time to explain too much

    and it's getting really ugly(the code)

    but I will list the basic changes I made and you can investigate and analyze and ask questions

    the level is larger now

    I made the little guys you pick up not physics objects, they weren't in the original katamari. Also, I made the sticking system based on a canvas. it's cleaner this way, and when you have hundreds of objects it won't be tracking them all at all times, also, when your katamari reaches a whole new zoom level, like the original you will be able to draw the same katamari and trash, and forget about all the objects that are sticking to it. you'll notice there's a strange blurring effect that happens to the canvas over many uses, so the older stuff stuck to you gets blurry. I'm not sure why it's doing this, but there are ways around it, even if we don't figure out why it's doing that.

    also, I made it so the controls change torque, not angular velocity, this means that the ball won't just keep spinning faster even when it should be slowed down by physocs, you're not telling it how fast to roll, you're telling it how hard to roll

    also, I put limits on the speed, so if it's spinning too fast it won't add any more angular force

    then I set it up so the physics ball get's 0.5 pixels larger length and width for every piece stuck on. I still think eventually you should add the ellipse thing, but this at least illustrates the basic concepts. all that weird temp variable setting and destroying the physics and remaking it, is to keep it from colliding with the ground when it gets 0.5 pixels bigger. you can press spacebar now to view the physics ball

    finally, there was a problem with the growing physics ball and collisions, o things would start connecting to further and further invisible points away from the ball or other people stuck to it, so they looked like they were floating in an orbit of the ball. the solution is to make the canvas update it's collision mask with each new guy stuck to it. then you make it so new guys stick only if they intersect the physics ball AND the canvas. this means there's an invisible circle they are allowed to stick to, but only if they are also touching the canvas, which consists of the ball, and the guys stuck to it. they won't be able to stick to eachother in a long chain away from the ball. and they won't stick to random points in space where the invisible physics ball is.


    gotta go for now,

  • uh you could calculate the mean center (ponderating by volume) of everything and then displace the physics ball's center halfways from the true ball's center and make the ellipse deform accordingly.

    Also, let the objects pick up other objects but ONLY if they're within a set distance of the physics ball (to avoid center to shift excessively to one side). That's what the 3D Katamari did. Also, allow long shaped objects to affect movement, like lamp posts, because they'll probably stick out. Have them in a family or something.

    I want to play this btw

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • updated with zoom out feature, and large area to drop down and get alot of stickies to test out zooming out

    EDIT: there's a glitch where if you get alot of stickies at the same time your ball starts acting weird, if you press space, you can see it's because more than one ball spawned and the invisible balls are hitting eachother. fun stuff

  • We should have a katamari challenge

    Btw lol at getting stuck between two platforms >_<

  • updated with zoom out feature, and large area to drop down and get alot of stickies to test out zooming out

    EDIT: there's a glitch where if you get alot of stickies at the same time your ball starts acting weird, if you press space, you can see it's because more than one ball spawned and the invisible balls are hitting eachother. fun stuff

    This is amazing, I love what you're doing. The zoom seems to work very well and the katamari itself is also working well.

    I noticed that glitch on your last upload. Somewhere, the deletion and re-insertion of invisible balls messes it up. Perhaps you can add a code that deletes any balls that aren't the "main" ball, by allowing no more than one in the playfield.

    Also, the ball rolls too fast and too spinnish, it needs to be slower, more like the katamari and less like a car tire... and one thing that concerns me still is how, with all these events, this is going to work with tons of different pickupable objects.

  • it will be much cleaner when it's not like a prototype hack on thing where we're trying out different features, and leaving other ones halfway on. I don't think the tons of pickupable objects will be a problem, you could do the same thing with families and it shouldn't need any extra events as far as the picking up itself is concerned. as far as the spawning multiple physics ball glitch, it should be easy to fix once we've decided on a final method of doing the sticking.

    As far as moving slower, yes, you're probably right, but for it to work, the katamari needs to be able to climb walls and do the superspin for it to work slower without limiting it too much. also, eventually it should have the thing where it bumps into something too big and pieces fall off

    also, figured out while it gets blurrier and blurrier,

    it's because of constructs linear sampling, when it copies the ball and trash at an angle, it's copying extra little semi transparent pixels here and there, that construct puts in to make games look smooth normally, but when added together over and over, gives it that blurry look. it's either antialiasing, or it's like antialiasing. there are two ways to fix it I can think of off hand. one is by using that original stick method from the first example, but only when you pick up a new object, so it's not keeping track of all those objects every frame, when you run over something, it can put them all back in place take a picture, and delete them all again. if that's not fast enough, you can use the stick method to rotate the new object around to where it it's rightside up with the canvas. The second one is far better I would think. I didn't mention this before, but the reason i did the copy back and forth between two canvases is because if you paste to a canvas that's at an angle, it pastes it on the canvas as if it were right side up, so it's stuck to the wrong part of the ball.


    gotta go to bed for now

    this is some fun stuff though

  • You guys want to form a little team to try and make this game? I think it's be great fun and an interesting experiment that could test the power of Construct.

    We don't have to but I can't do this stuff on my own and you guys are awesome. haha.

    Lucid - What I'm concerned about is... with private variables or whatever they're called, we should be able to have a large family of pickupables that all add different amounts of size to the katamari, right?

    Well in the final product I'd like the katamari to take up more of the screen than it does now so it'd be pretty important that it moves slower, but yeah I want to at least add the dash move. Not sure if we'll need to climb walls, the game will probably be pretty straight forwards (literally. i mean horizontal) But the dash would be great, with some nice motion blur in there too.

    smashing into things and losing pieces, absolutely. I may just make "junk" sprites that fly off your Katamari so we don't have to deal with actual pieces falling off the katamari. Unless there's an easy way to do this. It'd be nice if there was, so you could pick them back up again.

    Ahhh, the blur makes a lot of sense now. And yeah your second method sounds much easier.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)