YesNoOk
avatar

BG issues (Read 2989 times)

Started by N., May 29, 2018, 06:27:05 am
Share this topic:

N.

BG issues
#1  May 29, 2018, 06:27:05 am
  • avatar
  • ***
I ran into some issues and decided to stop dragging my feet and get some thoughts on it (mostly about the 1st issue). 

Spoiler: 1 (click to see content)
Spoiler: 2 (click to see content)
Spoiler: 3 (click to see content)

Thanks for reading.
1 Last Updated: 4/19/23
2 Last Updated: 1/16/21
3 Last Updated: 04/20/23
4 Last Updated: 7/16/17
Last Edit: June 01, 2018, 09:25:47 pm by N.
Re: BG issues
#2  May 29, 2018, 11:02:37 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
As far as I know, the internal mugen engine renderer runs at 320x240. All internal calculations such as position or velocities are based on this 320x240 space. In higher resolutions, mugen basically applies a multiplier to the calculations.
For example, a VelSet X=3 results in a 3 pixels/tick movement in a 320x240 . However, when running the same character in a 640x480 space, the velocitiy becomes 6 pixels/tick

If you use a tool such as SwissArmyKnife, it's really easy to see what I said. Velocities reported by the tool will change based on the resolution used, despite them being constants in the CNS.

To answer your question, since mugen applies these multipliers to the every parameter calculation, it's quite easy to lose 1 or 2 pixels due to rounding up/down, especially when long decimals are involved such as 1.109375
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: BG issues
#3  May 30, 2018, 08:40:14 am
  • *****
  • Shame on you!
    • USA
N. With problem 1, honestly I think what I'd do is scale the images 2x with no filter. Double the size of everything. You'll have to rebuild the entire stage... you may be able to figure out the math easy to just translate it. I've tried. I never get it to just automatically work.
I can't tell the difference in the images though.
vVv Ryuko718 Updated 10/31/22 vVv

N.

Re: BG issues
#4  May 31, 2018, 01:29:42 am
  • avatar
  • ***
XGargoyle:  I was thinking something like that might be a possibility, but I wanted to try and rule out human error as much as possible.

Odb718:  That is not an option for me, unfortunately.  I don't like rescaling my rips (had to redo some stuff because of it).  At this point, I don't think there's anything more I can do, and I'm ok with this. 

Here.  If someone's curious (B has a floor with no parallax effect).

Edit: I'm gonna set this to solved.  If it turns out I overlooked something making this stage, I'll come back to this.
1 Last Updated: 4/19/23
2 Last Updated: 1/16/21
3 Last Updated: 04/20/23
4 Last Updated: 7/16/17
Last Edit: June 03, 2018, 11:16:43 pm by N.
Re: BG issues
#5  June 02, 2018, 09:21:44 am
  • ***
  • WEB OF KAINE
    • Mexico
    • www.kaine.mugenimperiolatino.com
The problem in the change of resolution is that you are obtaining a delta of an odd number, in this case 675 (sprite 0,0), in the original scenarios it is usual to use odd numbers in the size of the images, but for mugen the parameters have to be measured in even numbers for the symmetry (left side and right side).

The error is not detected in 320 x 240 resolutions because there is no space for "half pixels", unlike higher resolutions such as 640 x 480 than there is if a "half pixel" is detected, the scenario should actually use a value of 676 for get the symmetry and the pattern of the colors in the pixels gives us the reason.

With an even value (676) the change to resolution Hi-res is not a problem.
But the stage will be a little more away from the original, maybe.

N.

Re: BG issues
#6  June 03, 2018, 11:16:25 pm
  • avatar
  • ***
Sprites 0-7, 0-16, 0-25, and 0-34 wouldn't also be "half a pixel" off if that were the case (because they have even pixel widths).

That's also not an option.  I wouldn't be comfortable with the floor being off in both resolutions.
1 Last Updated: 4/19/23
2 Last Updated: 1/16/21
3 Last Updated: 04/20/23
4 Last Updated: 7/16/17
Re: BG issues
#7  June 03, 2018, 11:36:01 pm
  • *****
  • Shame on you!
    • USA
Knowing the math could you easily make two stage.def files, for the two resolutions? That might be an option.
vVv Ryuko718 Updated 10/31/22 vVv
Re: BG issues
#8  June 04, 2018, 05:17:36 am
  • ***
  • WEB OF KAINE
    • Mexico
    • www.kaine.mugenimperiolatino.com
Sprites 0-7, 0-16, 0-25, and 0-34 wouldn't also be "half a pixel" off if that were the case (because they have even pixel widths).

That's also not an option.  I wouldn't be comfortable with the floor being off in both resolutions.

That's because your delta is made from an odd number 599 px, (599-320) /320=0.871875
You have 13 pixels (6 integers and 1 "half pixel") towards the end of the image from the reference point


Take the 0.7 sprite as an example, if you will used instead of 599 an even number like 600 px, (600-320) /320=0.875 Applying it is like this:

320 X 240


640 X 480


in the first there are 7 pixels towards the end and in the second image there are 14 pixels towards the end for obvious reasons.

Now the other shore:

320 X 240


640 X 480


It is exactly the same.

You can see that by managing the correct delta of an even number, the change of resolution to Hi-res (I not know in higher resolutions) does not affect.

As I mentioned, the stage would be a bit further away from the original.
Last Edit: June 04, 2018, 05:31:57 am by KAINE

N.

Re: BG issues
#9  June 04, 2018, 06:30:40 am
  • avatar
  • ***
Odb718:  TBH, I'm not entirely confident in the math.  It works, but not perfectly.  I think I'm missing something I shoudl've done to get it all to work.

KAINE:  :gonk: 0.871875 × 320 + 320 = 599..........oh, I see what happened.  I must've changed the deltas to those 4 at some point, forgot to update the notes, and just assumed they were the correct widths.  But yeah, the floor would be shifted over and look ok on the left side, but not the right (at SD.  I didn't look at 320x240).  I would not be ok with this, because then I would have to try and fix that too (one way I tried resulted in the rest of the stage having the problem instead of the floor).  How it currently is isn't perfect, but I'm cool with it if there's no other way.
1 Last Updated: 4/19/23
2 Last Updated: 1/16/21
3 Last Updated: 04/20/23
4 Last Updated: 7/16/17
Last Edit: June 04, 2018, 06:39:30 am by N.