★★★ Video Tutorial: Bigger/Smaller Collision Area ★★★

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
Hi Guys,

Noticed a few users asking for something similar so made a quick video, got a stinking cold atm but i hope my voice is clear enough.

At the end of the video there's also a nice trick to cut down on constraints that seasoned GS users use.

You would obviously turn the alpha to 0 on the white actor so its not visible.

The same method can be used for smaller collision areas useful for platform games where the hero bounding box is too big.

More free video tutorials can be found on our forums (link in my sig).



Darren.

DeepBlueApps over 10 million hits and home of:
GS Tools
Templates
Video Tutorials
Forum
3rd party marketplace

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Less is certainly better when it comes to GS, looking forward to the video.

    Darren.
  • keweworkshopkeweworkshop Member Posts: 377
    tshirtbooth said:
    uptimistik, its not meant to be an oh snap :)

    cheers

    I seem to remember an oh snap a few days ago which got me in trouble. How does it feel to be on the other side??

    ohhhhh snap!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Definitely gonna be a better solution for Squares and circles but it will not work for Rectangles right? If you have a long skinny actor it will not work right as I see it. Am I wrong?
  • UtopianGamesUtopianGames Member Posts: 5,692
    Nice video and tutorial, i made the simple falling box as a quick demo, it's got me thinking though if yours would be lighter if i had an 80x80 space ship actor and wanted the hit area to be 40x40 for the bullets to hit.

    Darren.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    Nice and simple tip TSB, cheers.

    Another way to have a different size collision area is to move an invisible actor using the game.time

    That way it will work for rectangles.

    So moving stuff 'manually' by updating the x and y co-ordinates should be light on the processor. So you can have loads of these in one scene and it won't effect the frame rate.

    Change the invisible actor's x and y positions to your visible actor every (whatever time interval you want), but use the game.time instead of the timer attribute.

    So make an integer attribute 'zero' with a value 0.

    Rule:
    When zero = floor((game.time*40)%2)
    change self.x to TheVisibleActor.x
    change self.y to TheVisibleActor.y

    Shaz
    __________
    www.honeytribestudios.com
  • imGuaimGua Member Posts: 1,089
    2 UtopianGames, Bit disappointed, cause i'm using the same method, and a was sure that in the video I will see more advanced\optimized method. Tshirtbooth method is interesting, but it's not suits every situation.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    imGua said:
    Bit disappointed, cause i'm using the same method, and a was sure that in the video I will see more advanced\optimized method. Tshirtbooth method is interesting, but it's not suits every situation.

    no constrains, no extra actors, one rule. how much optimized can u get?
  • imGuaimGua Member Posts: 1,089
    HoneyTribeStudios said:
    Nice and simple tip TSB, cheers.

    Another way to have a different size collision area is to move an invisible actor using the game.time

    That way it will work for rectangles.

    So moving stuff 'manually' by updating the x and y co-ordinates should be light on the processor. So you can have loads of these in one scene and it won't effect the frame rate.

    Change the invisible actor's x and y positions to your visible actor every (whatever time interval you want), but use the game.time instead of the timer attribute.

    So make an integer attribute 'zero' with a value 0.

    Rule:
    When zero = floor((game.time*40)%2)
    change self.x to TheVisibleActor.x
    change self.y to TheVisibleActor.y

    Shaz
    __________
    www.honeytribestudios.com

    Interesting. But will it work if invisible actor is smaller, and i have to change visible actor position in that way, will it be smooth?
  • imGuaimGua Member Posts: 1,089
    JohnPapiomitis said:
    no constrains, no extra actors, one rule. how much optimized can u get?

    If you are taking about tsirtbooth method, I just have situation where is collision involved, that's why tsirtbooth method doesn't work for me.
  • UtopianGamesUtopianGames Member Posts: 5,692
    TSB's method seems to work well for a space ship being hit by bullets, just done a quick test with 3 bullets and set it up so they need to hit the main part of ship to register a hit.

    Not sure if loads of magnitudes in a shooter example is better than 2 constrains for a collision actor but food for thought as they say...i still think the constrained collision actor has its place for some games.

    Nice post this one:) nice to share ideas.



    Darren.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    nice work indeed guys...I do like tidy rules

    thanks for sharing...

    now if we can just get Gamesalad to add a 'collision area box' where we enter the number and it increases the collision area as standard for any actor that would be great...
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    imGua said:
    Interesting. But will it work if invisible actor is smaller, and i have to change visible actor position in that way, will it be smooth?

    Only use that method to move invisible actors as it will move visible actors jerkily. But yes, you can have the invisible actor as small or big as you want if you are using it to detect when a collision occurs with another actor.
  • POMPOM Member Posts: 2,599
    tshirtbooth said:
    here is the link, it says its still processing at the time i posted this so give it a minute



    cheers

    Ha! Good to see you already using my magnitude method ;)
    Greate video guys!
    Roy.
Sign In or Register to comment.