YesNoOk
avatar

Velset/Veladd Resolution Compensation (Read 2638 times)

Started by Nep Heart, October 15, 2018, 03:41:46 am
Share this topic:
Velset/Veladd Resolution Compensation
#1  October 15, 2018, 03:41:46 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 Hit another snag. On standard MUGEN 1.0 resolution, the velsets and veladds for a cinematic custom state work as intended. However, when done in zoomed stages found in 1.1, the positions end up being off by a few times more than intended. The screenshot someone else took is an example of what I mean when the positioning is meant to be next to be directly underneath Sayaka's sword.



 I can post the full code if it's required to get an idea of what it should look like.
Last Edit: October 21, 2018, 11:44:32 pm by Nep Heart
Re: Velset/Veladd Resolution Compensation
#2  October 15, 2018, 11:25:32 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
The internal engine works at a resolution space of 320x240. All velocities are scaled based on that space.

That means, if you have vel X=3, the internal engine will use vel X=6 when using a coordinate space of 640x480.

Also, mugen has problems caluclating decimals. I think Bia tested it thoroughly and she found out that mugen failed on the third or 4th decimal, so it wouldn't surprise me that maths would fail when adding on top the zooming features of 1.1
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Velset/Veladd Resolution Compensation
#3  October 16, 2018, 10:43:00 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 I hear gamewidth is a SCTRL used to compensate for this kind of thing, but my experience with using it has been very limited beyond placing HUD based explods at an absolute screen coordinate relative to zoom. Never really used it for velsets and veladds before, so it would be nice to have some pointers to go about this
Re: Velset/Veladd Resolution Compensation
#4  October 16, 2018, 04:17:30 pm
  • ****
    • crepa.neocities.org
I was going to tell you about 'gamewidth', and also 'backedgedist' or 'backedgebodydist' (frontedgedist/frontedgebodydist) maybe can do something.
Re: Velset/Veladd Resolution Compensation
#5  October 19, 2018, 12:47:30 pm
  • *****
  • Shame on you!
    • USA
@Nep Heart: How have you built that animation combination? Meaning, Is P1 the root of the spacing and P2 flies and lands set on P1's values? Does P1 move toward P2 after it lands? Is P1's feet the 0X point, or is the tip of the sword the 0X point?
Because you're in a custom state (I'd imagine) You should be able to get all the values you need to read. 
Are the characters in question different resolutions? 
vVv Ryuko718 Updated 10/31/22 vVv
Re: Velset/Veladd Resolution Compensation
#6  October 19, 2018, 05:00:48 pm
  • ****
    • crepa.neocities.org
You can try targetbind or bindtotarget too. :P
Re: Velset/Veladd Resolution Compensation
#7  October 19, 2018, 11:41:11 pm
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
@odb718

 P2 is the one being accelerated off screen and decelerated to come back on screen so they can land right in front of P1, giving the illusion that P2 was sent flying and chased after by P1. P1 is always at the center of the screen throughout the entire cinematic. I essentially want a consistent distance regardless of resolution, but I don't have much experience with the gamewidth trigger to really know what to do for with it for velsets and possets.

 I'll just post the code regardless.

 P1's part of the cinematic.
 
Spoiler, click to toggle visibilty

 P2's part of the cinematic when in custom state.
 
Spoiler, click to toggle visibilty

 Also, I tested it on characters with different resolutions and even the ones with the same res seem to do it.
Re: Velset/Veladd Resolution Compensation
#8  October 21, 2018, 11:53:03 am
  • *****
  • Shame on you!
    • USA
Without seeing a video of what's going on, I'm trying to imagine what all of these states look like. I think I get it.

[state 3490, velset]
type = velset
trigger1 = 1
x = 30
y = 0
X = 30 is Very fast at lower resolutions and not so much at higher ones. It seems like your later P2 states have posfreeze to lock it into position but not this one. Is that it?
Also, using debug, and the boxes viewer, ctrl+C, can you see if your boxes and WIDTH are consistent with the different resolutions? I imagine this is how you kinda feel out where the char is on screen. Maybe the width is messing with things? 

P1 seems centered, I take it P2 "floats" back to P1. Which state exactly is that?
A lot of your states seem redundant, but I figure that's just how you're keeping things in order. Instead of changing animations and using multiple triggers you just switch the state.


Speaking of which,
Spoiler: This (click to see content)
Spoiler: Can Be This (click to see content)

If P2 is floating around, why don't you set the velocity to get it into position based off of P2BodyDist X? A lot of your changestates work just off of time instead of position(s). You may want to add trigger checks to see overall positions and allow it to get to the perfect spot.
Again, it's a lot to keep track of in my head, so I'm probably off on a coupe things.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Velset/Veladd Resolution Compensation
#9  October 21, 2018, 11:44:03 pm
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 Alright, spent most of my afternoon tending to this crucial issue and finally got it resolved. Decided to take the advice from both @Odb718 and @DeathScythe, which turned out perfectly. Tested it on different resolutions and got consistent results from it. Thanks a lot, you two, this means a lot to me since it was a major itch on my back.
Re: Velset/Veladd Resolution Compensation
#10  October 21, 2018, 11:59:17 pm
  • *****
or you know, dont use silly amounts of zoom or zoom in general.