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

Hello

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.

edit:
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...




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
Please log in to shout.


Members Online: Ultraviolet, Roy