Anyway to work around "invisible edges" ?

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

Comments

  • ChakkuChakku Member Posts: 1,513
    @Zenith_Digital

    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
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    @Zenith_Digital

    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
    Phew! That's a relief! But I'm afraid I'll have to see some rules as I can't grasp how to do what you said.
  • ChakkuChakku Member Posts: 1,513
    @Zenith_Digital

    So instead of having it collide with the big actor, have it collide with 'custom collision' boundary actors.

    image
    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
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    @Zenith_Digital

    So instead of having it collide with the big actor, have it collide with 'custom collision' boundary actors.

    image
    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
    OK, but can you give me an example of a rule I might use?
  • ChakkuChakku Member Posts: 1,513
    @Zenith_Digital

    So instead of having it collide with the big actor, have it collide with 'custom collision' boundary actors.

    image
    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
    OK, but can you give me an example of a rule I might use?
    @Zenith_Digital

    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
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    Ok, so let's say I have an actor 100 pixels wide and I put a pixel actor on each end of the actor. How would I say for it to only detect collision on or between these two points? Would I just use the greater than or equal to function and the less than or equal to function?
  • ChakkuChakku Member Posts: 1,513
    edited March 2013
    @Zenith_Digital
    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
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    How would it recognize that the 1-pixel actor is attached to the actor in question? Sorry lol
  • ChakkuChakku Member Posts: 1,513
    @Zenith_Digital
    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
  • SocksSocks London, UK.Member Posts: 12,822
    @Zenith_Digital
    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.

    Set the actor's collision shape on circular rather than rectangular.
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    @Zenith_Digital

    So instead of having it collide with the big actor, have it collide with 'custom collision' boundary actors.

    image
    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
    OK, but can you give me an example of a rule I might use?
    @Zenith_Digital

    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
    Ok, I am trying to use this method but how could I zoom in so I can be more precise with my collision border placements around my actor?
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    Ok, I am trying to use this method but how could I zoom in so I can be more precise with my collision border placements around my actor?
    @Zenith_Digital

    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 ?
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    Actor is circular
  • SocksSocks London, UK.Member Posts: 12,822
    Actor is circular
    @Zenith_Digital

    Set the actor's collision shape on circular rather than rectangular.
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    Already done that. That is not a problem. The problem is that the actor is circular with a square collision border due to cropping limitations
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    @Zenith_Digital
    The problem is that the actor is circular with a square collision border due to cropping limitations
    I'm not 100% sure what you mean here ?

    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 ?

  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    The imported image, although visibly circular, has square dimensions as part of the file. Although you cannot see this in game unless you click on the image, Creator still recognizes it as part of the actor and therefore an object could collide with the invisible part and still destroy the actor. The collision with the ground is fine, the actor moves along the ground as it should with circular collision. However the falling objects that are targeted to collide with it can destroy the actor equally if they hit the visual image itself (which is ideal) but also destroy it if they hit the invisible extra bit of the image (not wanted). This makes the player see that if the falling object falls a little bit to the right or left of the character's body dimensions (in my example it's a head), it will still destroy the character when in fact it should have whizzed by without colliding with the actor. Sorry I don't know how to otherwise explain this issue.
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    Sorry I don't know how to otherwise explain this issue.
    Personally I'd avoid non-standard terms like 'collision border' and 'cropping limitations' when asking questions, especially when they are used alongside actual GS terms like 'collision shape' but mean something different (you'll just confuse the natives :)) well they confused me at least !).

    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' ?
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    Sorry I don't know how to otherwise explain this issue.
    Personally I'd avoid non-standard terms like 'collision border' and 'cropping limitations' when asking questions, especially when they are used alongside actual GS terms like 'collision shape' but mean something different (you'll just confuse the natives :)) well they confused me at least !).

    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 ;)
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    Exactly
    Well if you've set your collision shape to 'circular' and your actor is still being recognised as a square then all I can think its that your project (or even GameSalad itself !!) is perhaps corrupted ?

    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 . . .
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    The actor is being recognized as a square because the dimensions of the file that is brought into GameSalad are square. The invisible parts are the ones I erased with alpha channel but are still recognized as part of the image. So no, it's not a bug. I know very well why it's happening and am just trying to work around it. Would superimposing an identically sized circular actor on top of the character in question, constraining that actor to the x,y position of the main actor, and adding collision only to the superimposed actor work to help this issue? That's a theory I have of doing it...
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    The actor is being recognized as a square because the dimensions of the file that is brought into GameSalad are square.
    The collision area is defined by the collision shape rather than the shape (??) of the file.

    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).
    So no, it's not a bug.
    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.
    I know very well why it's happening and am just trying to work around it
    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)

    ?
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    Ok I tested your project and it works as it should.
  • SocksSocks London, UK.Member Posts: 12,822
    Ok I tested your project and it works as it should.
    Ok, so your copy of GameSalad is working.

    All I can guess is that your actual project is corrupt then ?
  • Zenith_GameworksZenith_Gameworks Member Posts: 310
    edited March 2013
    Ok, just to be clear here is what I have set

    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?
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    The falling spikes (triangle shaped) are set to rectangular collision and the ball is shaped to circular collision. Is this because triangle images collide different,y or something?
    "Is this because triangle images collide different,y 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.
Sign In or Register to comment.