Collision Mask, Image points, Hotspots, Invert Conditions?

For questions about using Classic.

Post » Sun May 08, 2011 1:58 pm

Hi, I'm Larry The Internet Guy and I'm new (1st post!). I'm building my first game. Can you help me understand these?:

*Collision Mask questions

+Does it matter if you make the collision mask first before drawing your animation?

+I clicked the collision mask button, then I used the rectangle tool to make a red box and then I used the flood fill tool to fill the box in with red. Is this way of creating the collision mask okay, or will I run into problems doing it this way?

+Should the Collision mask cover the entire character?

+I drew a collision mask for the first frame of my animation but when I clicked on the second animation in the strip and then clicked the collision mask button, I noticed that the collision mask wasn't on the second animation... Do I have to create a collision mask for each animation?



*Image Points and Hotspots questions

+What is the difference between the two? In what situation would I use a hotspot?

+I've used Image points to mark spots for collisions. Is there a reason why they're not called collision points"?

+If I already have a collision mask on a character, why would I use image points for collisions?



*Invert Condition

+What does it mean? What does it do?
B
1
G
1
Posts: 2
Reputation: 429

Post » Sun May 08, 2011 3:42 pm

Collision masks may end up being overwritten by the animation frame if you create it first. However, you can just copy and paste the collision mask back later.

Yup, that is fine for creating collision masks. Then, if you want each frame to have it, right click the frame with the right collision mask and you should see an option like "copy collision mask to all frames" I think.
EDIT: Just re-read, yes, you need a collision mask for each animation frame, but it will be generated automatically when you edit it if you do not have a custom one.

That depends on if you want the character to be collided with entirely. Sometimes you only want a certain part of it to collide (eg: you usually don't check if the string of a balloon is colliding with something, that would just make the game look buggy).

The hotspot is the "centre" of the sprite, the point that you pull X and Y values from. This is also the point that the sprite rotates around.

Image points are handy for attaching objects to each other, for example in an action game you can attach a gun to the players hand by having an image point there that moves with each animation frame. They also rotate with the sprite.

Sadly, image point collision only works for the hot spot I think. However, you can choose three different collision modes "per pixel", "bounding box", and "image point". Collision masks are only used in per pixel mode.

Invert means that whenever the condition is not satisfied (eg: inverted always events never happen, while always events will always happen).
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun May 08, 2011 9:37 pm

[quote="Jayjay":kla59kte]Collision masks may end up being overwritten by the animation frame if you create it first. However, you can just copy and paste the collision mask back later.[/quote:kla59kte]

I can do that, but how do I do it without the collision mask being slightly in a different place in each frame? Like, how do I get it precisely in the same spot for each frame?


[quote="Jayjay":kla59kte]yes, you need a collision mask for each animation frame, but it will be generated automatically when you edit it if you do not have a custom one.[/quote:kla59kte]

Hmmmm... I'm not entirely certain what you mean here. Are you saying that there is no way to just create one collision mask and then make it automatically appear on each frame?

OR

Are you saying that if I create one collision mask, and then edit the collision mask it will generate itself for every frame?

I'm confused.

[quote="Jayjay":kla59kte]The hotspot is the "centre" of the sprite, the point that you pull X and Y values from. This is also the point that the sprite rotates around.[/quote:kla59kte]

So does this mean that I should always use a hotspot for an animation? And should I always center the hotspot in the middle of the character model unless I want the model to bounce when it moves in some frames?

[quote="Jayjay":kla59kte]Image points are handy for attaching objects to each other, for example in an action game you can attach a gun to the players hand by having an image point there that moves with each animation frame. They also rotate with the sprite.[/quote:kla59kte]

I'm able to attach a gun to the player this way, but I can't get the gun to stay on the players image point. In fact, the gun goes right to the top of the players head for some reason. I'm doing something wrong but I don't know what exactly.

[quote="Jayjay":kla59kte]Sadly, image point collision only works for the hot spot I think.[/quote:kla59kte]

I'm not sure what you mean. Can you elaborate on that? I've made collisions between two characters using image points without using hotspots before. Are you saying that I should always use both together if I'm using image points for collisions?

[quote="Jayjay":kla59kte]However, you can choose three different collision modes "per pixel", "bounding box", and "image point". Collision masks are only used in per pixel mode.[/quote:kla59kte]

So if I'm going to use image points for collisions, I don't have to use a collision mask?

Also, what is a "bounding box"?
B
1
G
1
Posts: 2
Reputation: 429

Post » Sun May 08, 2011 10:28 pm

[quote="LarryTheInternetGuy":19nb51ro][quote="Jayjay":19nb51ro]Collision masks may end up being overwritten by the animation frame if you create it first. However, you can just copy and paste the collision mask back later.[/quote:19nb51ro]

I can do that, but how do I do it without the collision mask being slightly in a different place in each frame? Like, how do I get it precisely in the same spot for each frame?

[quote="Jayjay":19nb51ro]yes, you need a collision mask for each animation frame, but it will be generated automatically when you edit it if you do not have a custom one.[/quote:19nb51ro]

Hmmmm... I'm not entirely certain what you mean here. Are you saying that there is no way to just create one collision mask and then make it automatically appear on each frame?

OR

Are you saying that if I create one collision mask, and then edit the collision mask it will generate itself for every frame?

I'm confused.

[quote="Jayjay":19nb51ro]The hotspot is the "centre" of the sprite, the point that you pull X and Y values from. This is also the point that the sprite rotates around.[/quote:19nb51ro]

So does this mean that I should always use a hotspot for an animation? And should I always center the hotspot in the middle of the character model unless I want the model to bounce when it moves in some frames?

[quote="Jayjay":19nb51ro]Image points are handy for attaching objects to each other, for example in an action game you can attach a gun to the players hand by having an image point there that moves with each animation frame. They also rotate with the sprite.[/quote:19nb51ro]

I'm able to attach a gun to the player this way, but I can't get the gun to stay on the players image point. In fact, the gun goes right to the top of the players head for some reason. I'm doing something wrong but I don't know what exactly.

[quote="Jayjay":19nb51ro]Sadly, image point collision only works for the hot spot I think.[/quote:19nb51ro]

I'm not sure what you mean. Can you elaborate on that? I've made collisions between two characters using image points without using hotspots before. Are you saying that I should always use both together if I'm using image points for collisions?

[quote="Jayjay":19nb51ro]However, you can choose three different collision modes "per pixel", "bounding box", and "image point". Collision masks are only used in per pixel mode.[/quote:19nb51ro]

So if I'm going to use image points for collisions, I don't have to use a collision mask?

Also, what is a "bounding box"?[/quote:19nb51ro]

1. If you right click the frame with the correct collision mask, there is an option to copy it to all frames of the currently selected animation.

2. I am saying that whenever you don't create a collision mask for a new frame of any animation, one is created to match any non-transparent pixels of the image. Sorry to confuse you about that

3. A hotspot will always exist in every animation, it does not need to be centred on the sprite, but you can automatically change it for all frames of an animation by holding alt and clicking while in hotspot editing mode I think. The hotspot is the "base", if you imagine a string puppet, its the point where the central string is connected. That can be the head, the feet, or anywhere else in between. However, keeping a consistent hot spot should reduce the bouncing of your animations

4.I tend to number my image points rather than name them, starting from 1. This way when I use "Set position to object" actions I know exactly which number of image point they are connecting to (0 is the hotspot)

5.I've not tried much in that respect, but I thought image point collisions only work for the hotspot. If not, cool, that makes it much more useful :D But no, you don't need both, only a hotspot is always needed for a sprite.

6.And yup, you don't need a collision mask for image point collisions. They are only used in "Per pixel" collision mode in the sprite settings. Bounding box is where the sprite is treated like a solid box when it comes to collisions. It's similar to your filling of the sprite with a red square, but does it automatically for you :)

Hope this helps clear some things up
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests