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!
  • I'm working on a 2D Katamari Damacy game that mimics this:

    Subscribe to Construct videos now

    I'm using Construct, but I have hardly used it before and I need bigtime help.

    Basically, I need to create an engine that allows you to have a physics ball that can jump, roll, pickup objects smaller than it, and stick those objects to it (they need to rotate with the ball)

    But I really have no idea where to start. Could anyone help me with this? Seriously, I'm lost.

    So can anyone help?

    I understand this shouldn't be TOO difficult in construct. But I'd like the camera to zoom out as the ball gets bigger...

  • k

    first, this is a harder project than you think, mainly because I don't think construct physics are stable and refined enough to take center stage on gameplay, you're going to need to be comfortable with construct to make something like this work, let alone playable and fun

    that being said, you asked for some help to get started, I have to get to bed, so I can't go into detail of how it works, but you can examine the cap, and if anyone else is awake they can help you as well

    this is to help you get started, some ideas of how some things might work

    it's a physics ball, with left and right arrow keys to roll, and spacebar to jump

    and when you run over things they stick and roll with your ball

    http://dl.getdropbox.com/u/1013446/katama.cap

    some more info:

    I originally tried making them stay real physics objects when you picked them up, using stiff hinges, but they didn't turn with the ball

    you'll have to find a way to fix it so your ball rolls differently when things are stuck to it,

    one idea which will work fairly well considering how easy, is to make the sprite for your ball not have physics on it, and make your ball sprite always update it's position and angle along with an invisible physics ball sprite of the same size. until you pick something up it would look exactly the same as it does in this example

    every time the ball hit's an object, use math to change the shape of the invisible physics ball, so it encircles both the sprite of the ball, and all the things attached to it

    if you're using ellipse physics, it will still be able to roll, but it can have a wobblyness to it, as it get's stretched more in certain directions

    this should be a pretty good starting point

    if you're unclear about the idea of using invisible sprites, a different example is in deadeye's platform school tutorials. I won't post a link, because if you haven't already, you should familiarize yourself with all the help resources

    good luck, and welcome to construct

  • wow, that was super helpful, thanks tons!!

    okay, a couple things. the example looks pretty good. do you suggest the actual ball should grow as more and more stuff is picked up, or just that the stuff is getting more and more?

    you lost me on the invisible stuff but it all sounds very good on paper.... also, how will i be able to have the camera zoom out as the ball gets bigger? would there be an easier way to "simulate" this effect? and how will the ball know to only pick up objects that are bigger than it?

  • wow, that was super helpful, thanks tons!!

    no prob

    okay, a couple things. the example looks pretty good. do you suggest the actual ball should grow as more and more stuff is picked up, or just that the stuff is getting more and more?

    I'd suggest the second one, although you might need to do what they did in katamari, and have smaller versions of each sprite that you load up as it gets bigger to save vram, also maybe something using canvas to paste all your sprites to everytime you get a major zoom , so you're not keeping track of the rotations of hundreds of objects

    you lost me on the invisible stuff but it all sounds very good on paper....

    imagine that you made the exact same red circle, without physics

    and you made a pink circle with physics the exact same size, but set to invisible

    every frame you told the red circle to set it's location and angle to the invisible pink circle

    so far it behaves the same, but when you pick things up, you figure out a math formula that will change the shape of the invisible pink circle so that it circles the redball and the junk, and you'd have to find other formulas and expressions to position the ball on this new pink one, but the idea would be something like this:

    <img src="http://dl.getdropbox.com/u/1013446/kata.jpg">

    .... also, how will i be able to have the camera zoom out as the ball gets bigger? would there be an easier way to "simulate" this effect? and how will the ball know to only pick up objects that are bigger than it?

    really, before you tackle this you should go through all the tutorials and the wiki, there are zoom commands here for layers: http://apps.sourceforge.net/mediawiki/construct/index.php?title=Layer_Properties these might affect physics...not sure

    and as for the size of the objects, you say

    On collision with PickUpableObjects
    System-Compare-If PickUpableObject.x*PickUpableObject.y is less than or equal to [the total size of your ball+junk]
    then stick things to it[/code:39ux9du4]
    gotta go, gonna be late to work
    but seriously, I know construct is superfun and easy, but, play around with all the tutorials, and read the wiki, construct has a lot of awesome stuff to make things easier
    
    have fun
  • Hmmm this might be doable with straght physics objects... using two hinges per object instead of one would effectively "weld" it to the new object... in theory.

    I might have a tinker later with some ideas and see if I can figure something out. I love the Katamari games (no pun intended), so it would be fitting to have a Katamari clone made with Construct.

    ~Sol

  • I'd suggest the second one, although you might need to do what they did in katamari, and have smaller versions of each sprite that you load up as it gets bigger to save vram, also maybe something using canvas to paste all your sprites to everytime you get a major zoom , so you're not keeping track of the rotations of hundreds of objects

    imagine that you made the exact same red circle, without physics

    and you made a pink circle with physics the exact same size, but set to invisible

    every frame you told the red circle to set it's location and angle to the invisible pink circle

    so far it behaves the same, but when you pick things up, you figure out a math formula that will change the shape of the invisible pink circle so that it circles the redball and the junk, and you'd have to find other formulas and expressions to position the ball on this new pink one, but the idea would be something like this:

    Yeah, I was thinking the same also with the smaller versions of sprites. If this is anything like what I want it to be like, there's going to be hundreds of objects and I'm not sure if people's computers could handle it. But I am very new to construct and I have no idea how to use canvas to "take a screen shot" of the katamari when it goes through the zoom process so that we're not rolling the actual ball anymore.

    I'm very new to Construct but I'm well-versed in MMF2 and I've been using it for years. I very recently switched to construct because it seemed much more powerful.

    The pink ball is a great idea, but I'm not well versed enough in Construct to even start thinking about how to code something like that... I'm sure someone could do it though. I need a team of people for this game, I'm thinking.

    Hmmm this might be doable with straght physics objects... using two hinges per object instead of one would effectively "weld" it to the new object... in theory.

    I might have a tinker later with some ideas and see if I can figure something out. I love the Katamari games (no pun intended), so it would be fitting to have a Katamari clone made with Construct.

    ~Sol

    That was my initial thought, although I couldn't find a way to get the objects stuck to the katmari stick to each other. See, an object that is stuck to the katamari needs to pick up other objects that it touches. But the objects can't stick unless one of them is stuck to the katamari, otherwise you'd have objects stuck together everywhere. So we need something like this...

    If the katamari touches an object...

    If object is smaller than katamari...

    Stick the object to katamari

    Turn on variable "stuck" to object

    If variable "stuck" is on...

    On collision with new object...

    If new object is smaller than katamari...

    Stick new object to object

    Turn on variable "stuck" to new object

    I'm actually working on a lot of art and sound for this game and it's going to have an interesting paper cutout style, or perhaps a retro one. But if anyone is interested in joining the team with me and helping with coding, I'd love it.

    Another important feature is that every object is assigned a size, and that the katamari automatically picks up anything smaller than it. This way you don't have events for EVERY OBJECT that the katamari picks up. Something like this.

    (Object is 5cm, size is a variable. Katamari is 55 cm.)

    If Katamari size is > than object size, pick up object.

    On collision with object smaller than katamari...

    Stick object to katamari

    Add object size variable to katamari size variable.

    So the katamari should now be 60cm.

    However there is a problem with this too (other than the fact that I don't know how to code it.) The katamari needs to only pick up objects that are at least 40% or maybe 50% smaller than it. You don't want a 200cm katamari picking up a 199cm object.

  • The pink ball is a great idea, but I'm not well versed enough in Construct to even start thinking about how to code something like that... I'm sure someone could do it though. I need a team of people for this game, I'm thinking.

    That was my initial thought, although I couldn't find a way to get the objects stuck to the katmari stick to each other. See, an object that is stuck to the katamari needs to pick up other objects that it touches. But the objects can't stick unless one of them is stuck to the katamari, otherwise you'd have objects stuck together everywhere. So we need something like this...

    If the katamari touches an object...

    If object is smaller than katamari...

    Stick the object to katamari

    Turn on variable "stuck" to object

    If variable "stuck" is on...

    On collision with new object...

    If new object is smaller than katamari...

    Stick new object to object

    Turn on variable "stuck" to new object

    I'm actually working on a lot of art and sound for this game and it's going to have an interesting paper cutout style, or perhaps a retro one. But if anyone is interested in joining the team with me and helping with coding, I'd love it.

    Another important feature is that every object is assigned a size, and that the katamari automatically picks up anything smaller than it. This way you don't have events for EVERY OBJECT that the katamari picks up. Something like this.

    (Object is 5cm, size is a variable. Katamari is 55 cm.)

    If Katamari size is > than object size, pick up object.

    On collision with object smaller than katamari...

    Stick object to katamari

    Add object size variable to katamari size variable.

    So the katamari should now be 60cm.

    However there is a problem with this too (other than the fact that I don't know how to code it.) The katamari needs to only pick up objects that are at least 40% or maybe 50% smaller than it. You don't want a 200cm katamari picking up a 199cm object.

    im in a bit of a rush, so im probably answering in the wrong order, but the last thing you said, to code stuff, just learn to say the problem in construct:make a family-pickupables

    on collision with pickupable, if pickupable.size, is less than katamari.size/2...then do whatever.

    soldjah boy is right, i had done that by mistake, and didnt think of the usefulness at the time..double hinging will stick the object.

    theres a solution to the other thing too, but breaks over

    gotta get back to work

  • Okay, got the family thing down. Although will this method work?

    Say the katamari is 5 cm. you pick up a 2cm object and now your katamari is 7cm.

    Will construct still think the katamari is 5cm, because the katamari and the object are only hinged together, but not considered the same object? In MMF2, I'd fix this with flags.

    Also, what do you mean double hinging? I know how to hinge, but the object doesn't roll with the katamari once hinged, it just makes it drag awkwardly.

    Right now, it's like this:

    <img src="http://img244.imageshack.us/img244/1362/code.png">

    All I changed was the grouping thing, no hinging or anything fancy. It only picks up things at least half as small as it is, which is good. But it's still far from what we're trying to achieve - the ball needs to roll on what it's picked up, not just pasting images of what it's picked up to the outside of the ball.

  • ok, did the double hinging thing (thanks soldjah boy)

    there are much fewer events and objects now

    http://dl.getdropbox.com/u/1013446/katama2.cap

    there's a problem now

    it should be easy to say, if you're stuck, and you collide with them, they get stuck to you

    however, if they're both the same family, it won't be easy to make events

    that say hinge one to two, and two to one, because they'll both be picked and they'll both be the same family

    there's a hacky way out of it, which is to do kindof what we were doing before, which was to replace the physics one, with a nonphysics one

    this time, it would be to replace the physics one, with anotherphysics one

    but from a different pickedup family

    that way we can instruct construct about them separately

    maybe soldjah or someone can come up with a better way than that. I suspect there might be, but it would definitely work, and I'll try to whip it up before my kids get home

    [quote:2u37aa4z]Will construct still think the katamari is 5cm, because the katamari and the object are only hinged together, but not considered the same object? In MMF2, I'd fix this with flags.

    you can use private variables in the katamari to update it's size, by adding together the size of everything that's on it.

    but seriously, I know it's getting annoying by now, but read some of the tutorials and the wiki, you should really have known about private variables at least before you started this project. I'm not discouraging you from doing it, or even doing it now. I'm just saying at least one wiki page or tutorial a day. they don't take long, and you'll feel more comfortable. I don't mind helping, and I'm sure neither does anyone else. but at this point you're not going to learn as much as you would if you had some more of the basics down. and you're having other people develop your game, when it starts turning into a real game with your own graphics, and your own custom features, it's going to get bigger and bigger, and you're not going to want to give up just because you don't understand all the code so far, or because you can't recruit coders. construct is really easy, but different from other languages and dev packages. just make it a point to learn at least one thing a day, and then when you have a question of how to do something, you'll at least know where to look in the wiki for the basic stuff. know what I mean?

    so...your first assignment is: http://apps.sourceforge.net/mediawiki/c ... _Variables

  • Okay, checked out the example (and I've been reading the wikis.)

    This is closer to katamari goodness, however the ball has now become a nightmare to control and sometimes has a habit of just shooting off into the distance at top speed.

    Also, the grouping thing will also be a problem.

    I think I can think of a way to solve a few things.

    Referencing the original katamari video I posted, the ball seems to move as an invisible circle like you mentioned, not literally moving using every object as an actual attatchment. See how lots of the objects on the ball lay behind the floor background? So it seems that your first example would work better.

    Perhaps there is a way to simply "paste" on anything you pick up to the ball, and have an invisible ball that follows your visible ball. This invisible ball, if say, is 5cm, picking up a 2cm object, no matter its shape, will become 7cm, but the original ball does not grow. So you have a "pickup area" ball and the physical ball that the player sees. I think this would also take care of your grouping problem, as no object would have to stick to itself - everything is sticking to the ball, creating the illusion that the things that stick to the ball are sticking to the other things on the ball, but really they're just sticking to the ball. And you wouldn't have to deal with a lumpy, erratic moving ball (which would be cool because it's like that in katamari, but not so cool in this version because construct's physics aren't entirely stable.)

    Perhaps if there was some way to make the inivisible ball stretchy, or liquidy, odd objects would cause a satisfying limp for the ball - but this is probably more effort than it's worth

    So theoretically, nothing has to have physics except the ball. Everything else can be moving on its own path or whatever. Watching the 2d katamari video, I don't think anything but the katamari has physics (although I may be wrong, I wasn't looking out for it when I watched it.)

    Does that make any sense?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • it all makes sense

    you'd be surprised how nice the wobble would feel

    load up the original katamari thing I posted

    and stretch the katamari a little bit

    so it's an oval and then run a preview

    it has a nice feel to it

    very katamariesque <---that's a real word, look it up

  • it all makes sense

    you'd be surprised how nice the wobble would feel

    load up the original katamari thing I posted

    and stretch the katamari a little bit

    so it's an oval and then run a preview

    it has a nice feel to it

    very katamariesque <---that's a real word, look it up

    That's true, it's a very nice feel.... hmm...

    Well I think that what's most important is getting the invisible circle idea to work, and if it does, then maybe the wobble and oval thing will come next.

    I'm pretty sure the katamari in the original video i posted has no wobble at all and it still functions fine...

    This invisible circle... how can this work? I understand the concept, just not how it would be done.

    The invisible circle needs to be the one picking up the objects, but they'd appear to stick on the real ball. I think this mechanic, once mastered, would fuel the whole game and it'd be easier from there...

    Perhaps the circle should not be a physics object at all, but rather a platformer object that is somewhat "bouncy"? I'm not even sure if the katamari has physics on the video..

  • I didn't watch the video

    but I was a big katamari fan back in the day

    I think the katamari has phyics, and I think it's kindof similar to the oval thing

    or else it would never roll with a big pencil sticking out

    check out the platform school tutorial...I'm not sure which one, but it uses an invisible sprite to control collisions

    it's quite simple though, you can try it for yourself

    I don't have much time at the moment to make a cap, but try this

    right click the ball we have now

    then right click on blank space

    right click - then paste clone

    this makes it paste a whole new object, not just a copy of that object

    now the new sprite

    go into behaviors, and delete the physics behavior

    edit the sprite of the original object

    just color it green or something

    make that sprite invisible

    it's at the bottom of the properties panel

    start invisible

    now make a new event

    system-always

    in this event create an action

    double click the new sprite (that looks like the one we've been using, but has no physics now, remember)

    doubleclick on the action set position to object

    and then choose the green physics object as the object

    create another new action under that one

    again with our new sprite(not the green physics sprite)

    the new action will be set angle

    now play it again

    it should look and play exactly the same as it did before

    if it does that means, you did the invisible sprite thing

  • Okay, did all that and we have this:

    https://dl-web.getdropbox.com/get/katam ... w=bea387b8

    Works as it should. 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. The ball just awkwardly picked up things way out of its reach. Perhaps it's because in the events, things are still sticking to the red ball and not the green one? (The green one is the invisible one in my example.)

    Also, the grouping problem. As it is right now, I don't see a way to be able to have stuff stick to the ball without needing to code every single object - the group thing doesn't work because the actions apply to the entire group.

  • That file isn't working xiao, btw.

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