YesNoOk
avatar

coordinate space question (Read 1334 times)

Started by inktrebuchet, June 25, 2018, 08:43:11 pm
Share this topic:
coordinate space question
#1  June 25, 2018, 08:43:11 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
If I'm making a calculation based on the vel x of an enemy and the vel y of my character, do I need to take into consideration their coordinate space or even the size being scaled? or is all of this already calculated by mugen during the match? My testing seems to show mugen takes care of it but I'm hoping to get conformation.

example:

Jump over enemy at last possible moment when they are rushing at you.
Code:
trigger1 = enemy, p2bodydist x / enemy, vel x = (ceil( 95 / abs(const(velocity.jump.y)))) ; 95 = max height during a neu jump.
Last Edit: June 26, 2018, 06:12:42 pm by ink
Re: coordinate space question
#2  June 26, 2018, 03:45:43 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
P2Dist and P2BodyDist already keep the stage coordinate space in mind so there's no need for special calculations.
Re: coordinate space question
#3  June 26, 2018, 04:55:37 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
It's not even possible to factor an enemy's local coordinate space into an equation.  Seriously!
The data returned will always be scaled to the game's coordinate space.

Re: coordinate space question
#4  June 26, 2018, 06:00:58 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
Damn, that's what I was just testing.. In my test p1's readings of p2's velocity change depending on p2's localcoord. This does throw some stuff off for what I was hoping to make. My example code would probably work just fine.

I had read velocity was done this way but I was hoping it wouldn't work like this.

Thanks guys.
Last Edit: June 26, 2018, 06:12:10 pm by ink
Re: coordinate space question
#5  June 27, 2018, 10:31:31 am
  • *****
  • Shame on you!
    • USA
just a question, your = value. Isn't going to be a set value?
Are you setting this chunk of AI up to port over to other chars?
I think localcoord was one of those values we were talking about stuffing into the sysvar, right?
Apparently a few questions..
vVv Ryuko718 Updated 10/31/22 vVv
Re: coordinate space question
#6  June 28, 2018, 12:49:17 am
  • ****
    • USA
    • twitter.com/inktrebuchet
It turns out that it working like this is actually in my favor. I don't know what I was thinking before...

My = value isn't a set value because it has to do with the velocity and distance of the enemy. So if the character is to jump over a speeding character, they wouldn't jump to early or late but at just the right time. But yeah, generally if I mess with code I try to make it fit any character.

I don't think localcoord did come up in that stuff with the sysvar! That would probably be a good one since it's impossible to get otherwise. We should really get a list of stuff together for that.
For anyone wondering about that sysvar stuff. >> http://mugenguild.com/forum/msg.2406866

Actually now that I'm thinking about it clearly... what could localcoord be used for if it were available to the characters???
What were you going to use it for altoiddealer??
Re: coordinate space question
#7  June 28, 2018, 01:05:47 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Why even use localcoord if you're just going to convert it to your coordinate space anyway which MUGEN does for you?

Besides, localcoord is busted, doesn't even use the Y component.
Re: coordinate space question
#8  June 28, 2018, 06:12:30 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
What were you going to use it for altoiddealer??
Jailbot's Arcade hyper draws p1 and p2 in the middle of the screen.

There are Stages which have floors that move up and down.  This movement constantly affects all players/helpers, regardless of StateType, Physics, Gravity, etc.

Explods are not affected by this movement (unless bound to a player).

However, when used in a custom state, Explod fails to factor p2's local coordinate space for drawing p2's sprites.  Meaning if p1 and p2 are not the same local coords, the sprites will display in an incorrect scale.

So, it's not possible to detect and manually correct the issue using the scale parameter.
This only leaves ChangeAnim... and the issue with stages that have moving floors.


I was able to come up with a workaround, but it's kind of a hack, and making it work required much more complicated coding... P2 has a constantly active VelSet that counteracts the stage movement.  I would have much rather just been able to just draw p2 sprites as Explod's.

Last Edit: June 28, 2018, 06:18:59 am by altoiddealer