Staredit Network > Forums > SC2 Assistance > Topic: Perfect bouncing system?
Perfect bouncing system?
Jul 22 2013, 10:09 pm
By: Devourer  

Jul 22 2013, 10:09 pm Devourer Post #1


Hey there,
I do wonder, is there any perfect bouncing system?
I'm currently trying to have phoenixes(?) bounce off cliffs perfectly.
Physically correct, just like the green shells in mario kart.

I tried it myself and it is working, but not perfect; it is bugging now and then and I don't know how to fix that.

My attempts is to periodically check whether there is a cliff between the position of the unit and like 2 units to where it is facing.
If so, it's facing is adjusted.
However, the checking apparently is to slow and no matter what it would never work flawlessly this way, I assume.

Is there any different, rather perfect system?

Please report errors in the Staredit.Network forum.

Jul 22 2013, 11:22 pm Roy Post #2

An artist's depiction of an Extended Unit Death

There isn't an event for detecting when a unit reaches a different terrain height, if that's what you're asking; a periodic event is probably the best you can do.

To calculate the correct new facing angle of the unit, you'll need to know the angle of the wall. In another topic I figured the reflected angle to be (2*wallAngle - unitFacingDirection), but as you can see, the attached map still had some issues with all of these factors considered (similar to the issue you described). Maybe checking ahead like you're doing could avoid the seizure-wall thing.

Jul 22 2013, 11:46 pm Ahli Post #3

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Since it's traveling straight under normal circumstances, can't you just scan the path and order it around when it reaches the position where you detected it to bounce? You would scan the line when you order the unit...

SC2 runs in 16 game frames per game second. That's the resolution you can work with.

You would have the following pattern:
- unit is created: scan straight for the next cliff change or other boundaries, then order it to execute the special transient ability that makes it calculate a new scan line and make it move a short way into the reflected position.
- that transient ability is executed: do the same as above...

Also, you might want to use custom values of a unit to store the facing the unit currently travels into. Then you won't lose the direction due to slow turning, etc...

  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:23 am]
Ultraviolet -- got some light recalls behind too
[12:07 am]
O)FaRTy1billion[MM] -- 🦗
[09:53 pm]
Wing Zero -- I wonder how he knew I was in the market for a good cricket bat
[2024-6-11. : 2:27 pm]
lil-Inferno -- ya
[2024-6-11. : 10:49 am]
Oh_Man -- or scarab maybeh
[2024-6-11. : 10:49 am]
Oh_Man -- shielt battery + photon cannon blast?
[2024-6-11. : 10:49 am]
Oh_Man -- check out the animation at 7:56
[2024-6-11. : 9:06 am]
Oh_Man -- I defeated the hell boss yall, bow to my power
[2024-6-10. : 5:04 pm]
lil-Inferno -- poop
[2024-6-06. : 5:20 pm]
Ultraviolet -- I was kinda thinking something along these lines
Please log in to shout.

Members Online: Rawflesh0615