overbound / SonicTimeTwisted

Source Code for a Sonic Fan Game Made in Game Maker Studio
https://overboundstudio.com/
GNU General Public License v3.0
58 stars 16 forks source link

Unexpected behaviour when using YYC. #73

Closed nkrapivin closed 4 years ago

nkrapivin commented 4 years ago

The title.

Since the platformer engine was written by @VectorSatyr, I tried his SonicForGMS example, but it worked just fine, even the oldest one I could find in the git history ran just fine.

So I have no idea why's it broken.

AlexKhayrullin commented 4 years ago

IIRC, there was a situation where slopes could work correctly either on PC YYC or on Android YYC, but not both.

nkrapivin commented 4 years ago

That is exceptionally weird, since YoYo prefers to use the same clang++ compiler everywhere they can. The only exception is consoles, on consoles they use whatever the manufacturer gives.

nkrapivin commented 4 years ago

Just tried, Android YYC is also broken.

VectorSatyr commented 4 years ago

Since the platformer engine was written by @VectorSatyr, I tried his SonicForGMS example, but it worked just fine, even the oldest one I could find in the git history ran just fine.

Sonic For GMS doesn't quite work the same way; it can be considered a successor or a very distant cousin.

I, too, am unsure what is different about the YYC compilation that causes slope collision to work differently than when using the Virtual Machine.

nkrapivin commented 4 years ago

I suppose the guilty script is player_get_terrain_angle.

nkrapivin commented 4 years ago

ARGH, why YYC is so hard.

nkrapivin commented 4 years ago

image

okay player_get_terrain_angle is innocent, did a test, got x1/y1/x2/y2/expected angle from VM and tried to calculate the angle on YYC, expected angle matched the YYC angle.

the new suspect is player_get_terrain

nkrapivin commented 4 years ago

image

huh, it always snaps between 0 and 270?

tried floor()ing x/y, still broken.

nkrapivin commented 4 years ago

ookay, player_floor_transfer returns false on YYC, so the object still thinks we're on a regular platform. that causes everything else to kwek out.

nkrapivin commented 4 years ago

How curved slopes in STT are different from slopes in SonicForGMS?

VectorSatyr commented 4 years ago

@nkrapivin @AlexKhayrullin Please do a thorough test of the latest commit from origin/rebuild.

nkrapivin commented 4 years ago

It fixed the slopes! I've noticed just now that Future/Past posts are broken image (Sonic just freezes there)

I'll try to fix that myself.

Thank you!

nkrapivin commented 4 years ago

Okay here's the fix for time posts:

You can't return from an event, but for some reason, if you try, the expression in the return statement will be evaluated on VM. But since YYC events are void functions, they can only return;, that means whatever was in the return statement will be cut off.

yeah it took me hours to find. I can commit that fix to my surf-fix branch and make a PR. It'd be nice to have that fix in origin/rebuild too!

nkrapivin commented 4 years ago

After playing STT + #81 (YYC) for a while I didn't notice any huge issues. (at least obvious YYC bugs)

So I'll close this issue for now.