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.
[11:31 pm]
Vrael -- :wob:
[08:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[2024-5-08. : 10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
Please log in to shout.


Members Online: Ultraviolet, RIVE