Anyway to work around "invisible edges" ?
Zenith_Gameworks
Member Posts: 310
So in my game, it is very important to its dynamics that if the character you are playing as gets hit by an enemy object, it looks like it "dies" only if the object hits the visible images. However, with the limited cropping abilities I am set up with, I can only crop rectangularly and not circularly. My character is circular and when I crop it it leaves invisible edges which, if receive a collision in creator, kill the character just the same as if the "visible" image were to get collided. This quite noticeably detracts from the realism of my game, so my question is if there is any way to fix this or work around it?
Zenith_Digital
Zenith_Digital
Comments
Yep, I had the same problem as you on the game I'm currently working on.
You have to constrain some custom 1-pixel wide 'custom collision' boundaries, so that they can get hit within the zone of your custom shape. Does this sound clear? If not I can elaborate; it's much less complicated than it sounds
Chakku
So instead of having it collide with the big actor, have it collide with 'custom collision' boundary actors.
Those pink lines are where the collisions are taking affect, not the white lines by GS. The problem witht his is that the pink boundaries have to be constrained, and when there are a lot of them, it takes its toll on performance. Hopefully GS will implement custom collisions soon...
Chakku
I would, but it depends on the actor's size. All you have to do is use trial and error to make the 1 pixel width actors perfectly go on the boundary you want.
Chakku
No, constrain the 1pxl boundary to the specified 'custom collision' you want; there's not specific number for that, it completely depends per actor (not its size, but where in it you want the boundary to be).
Chakku
Because there is no reason for it to recognize your main actor. You need to make the rules say, when collide with 1pxl do ---, rather than when collide with main actor.
Chakku
Set the actor's collision shape on circular rather than rectangular.
Unfortunately GameSalad Creator lacks a zoom option, if you are on OSX try using the system zoom (turn 'smoothing' off first).
What shape is your actor ?
Set the actor's collision shape on circular rather than rectangular.
If the actor is circular . . .
and the collision shape is circular . . .
The what is this square 'collision border' ?
And what are these 'cropping limitations' ?
Sorry If I'm being stupid here, but setting up a circular collision shape on a circular actor is fairly straightforward ?
So if I understand the issue correctly . . .
You have a circular image applied to an actor, but when it comes to collisions GameSalad recognises the actor as a square rather than a circle ? So other actors set to collide with it can catch and collide with the corners (where there is no image) ?
Is that basically the issue ?
And you've definitely set the collision shape to 'circular' ?
Exactly
Circular collision work perfectly well for me - every time.
Let me make you a demo project - and then see if it runs ok in your copy of GameSalad.
One minute, I'll be back . . .
All image files are square therefore if the shape of the file defined the collision shape we would never be able to do circular collisions (which we obviously can). I didn't say it was a bug, I said your project might be corrupted.
If you've made the collision shape 'circular' and it still acts as if it's rectangular, I'd be tempted to at least consider the idea that your project is corrupted - I've had stranger things happen with corrupted files. If you know what the issue is why not share it with us !? Please !
Here, see if this project works* on your copy of GameSalad:
http://www.mediafire.com/?l9m9fvvgngtdudk
(works* here means: the actors collide as if they are circles)
?
All I can guess is that your actual project is corrupt then ?
The falling spikes (triangle shaped) are set to rectangular collision and the ball is shaped to circular collision. Is this because triangle images collide differently or something?
GameSalad doesn't know what's inside an image file, it's not aware that the image is a kitten, a spaceship, a cloud, a triangle or a shoe - so it wouldn't be able to apply different physics based on what the image is, a picture of triangle will collide exactly the same as a picture of a shoe.