1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

(Solved)isometric bullet to wall collision issues

Discussion in 'Programming' started by CatOnMushroom, Oct 26, 2016.

Tags:
  1. ok this might be a cosmetic issue but am sure there is a technical way, but can someone give me a hint or direction on how to handle a bullet collision in isometric like view. becouse for example holding a gun in your right hand and go for example up/right like (x + 2, y - 1) makes a collision on the walls on the right side of the character. the only sulution I can figure so far is making a different direction sprite bullets and one mask for all so the mask spawns in the center of the character and the bullet shows right sided in a up/right direction.(giving aiming issues when it actualy needs to hit something)....

    still need to try the collision timer on spawn and walls, but doesn't feel accurate enough.
    thanks if there is directions and I was understandable enough.

    ps. it's like free movement and not grid based. (needs the speedy control and else it's not an issue)
     
  2. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    My recommendation is to do all collisions based on character's and bullet's "shadows". So the collision mask is a square or a circle around their feet.

    Then, bullets need a "height" that they draw themselves above the ground. I usually use a variable "z" for this. Then in the draw code:
    draw_sprite(sprite_index,image_index,x,y-z); The higher the Z the further off the ground it will appear.
     
    Mick likes this.
  3. DariusWolfe

    DariusWolfe Member

    Joined:
    Sep 23, 2016
    Posts:
    32
    Damn, I saw a question I knew the answer to, so I came in to give it, but it was already taken care of.

    To expand a smidge though, you should treat a collision box in an isometric (or even pseudo-isometric) game as though it's a box on the "ground" below the object. So for characters, it should be near the feet, same for walls; This will allow a pawn to walk up to a wall and have their sprite overlap the wall, or walk behind a wall and have its sprite overlap them.

    Bonus tip if you're not already doing so: Set depth to y, so as they go up and down on the playing area, they'll be overlapped by objects "south" of them, and overlap objects "north" of them.
     
  4. I know you feel, sigh...
     
  5. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    depth = -y. The negative is important, so the further down towards the bottom of the screen the more "on top" of things they are.
     
  6. DariusWolfe

    DariusWolfe Member

    Joined:
    Sep 23, 2016
    Posts:
    32
    WHOOPS. Good call. It's been a hot minute since I've done an iso. I was remembering the advice I got way back when.
     
  7. thanks all but thats not exactly what I ment altough going to work a lil on Pixelated_Popes sugestion. yet I think this is about the drawing in depth (-y) still. what I try to say if the character walks next to the wall on the right side, the bullet spawns on top a a wall collision mask and never shows up being destroyed right away. thats the issue I have. spawning the bullet in the center of the character is no issue. and I can create a bullet on the wall mask but won't be destroyed when it visualy hits a wall.
    lol,(hopefully) while trying to visualise it(helpfull tool in the future perhaps) with a screenshot I realised that it might be the spawning or collision point of the bullet(might still be the direction)/wall mask as it shows me that it doesn't come close at all. back to some more attempts.
     

    Attached Files:

  8. solved. my bad(again) useing action collision instead step/script it, can't slack or be lazy on programming I suppose.

    now to close this thread somehow lol
     
  9. DariusWolfe

    DariusWolfe Member

    Joined:
    Sep 23, 2016
    Posts:
    32
    You should be able to put a "Resolved" tag on the post title, or just add "Resolved" to the front of the title. You can't literally close the thread, but that will let people know you're not looking for a solution.
     
  10. lol to much daily work for it to be a hobby, but as I could expect the problem is still here. check this picture as it might explain what I mean better.
    the arrow shows the collision point when spawning a bullet. at the very same time the walls block the bullets as soon they are created.

    edit part: it didn't make sens at all at first.(at all)
    Image333.jpg
     
    Last edited by a moderator: Oct 28, 2016
  11. solved(lol so far) used a grid cells for wall collision with the bullets.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice