overbound / SonicTimeTwisted2.0

5 stars 0 forks source link

Dehardcoded Resolutions - The Aspect Ratio Mode (no cutscenes) #50

Closed BlueSpeedsterYT closed 8 months ago

BlueSpeedsterYT commented 8 months ago

This attempts to remove any and all hardcoded variables in regards to game resolutions (in case of if a 4:3 mode were to be made, altho that would require a complete partial rewrite of some code functions) This also includes a new option in the level select to view the cutscenes (only text is in English for all languages), alongside a first pass attempt at modifying the Past Intro cutscene to work in 4:3 (not working as intended currently, may need to rework all cutscenes to make them fit both 16:9 and 4:3)

BlueSpeedsterYT commented 8 months ago

With an earlier commit, the Title Card has now been adjusted to work with 426! image image The reason why that's the case is due to the fact that the value for the Title Card's Text position was left at it's default of 320-22 from the framework the game was built under... Whoops... thankfully it now uses objScreen.width-22 which essentially does the same thing in 320x240 but it also now outputs 404 if the game is in 426x240.

BlueSpeedsterYT commented 8 months ago

and speaking of earlier commits... A new menu option is added to Level Select! image The "Cutscene Gallery" option now allows the player to view the cutscenes within the level select! No need to finish two levels to check! image This also includes a selection of new options for the game's endings, which should allow the development of the game to speed up ever so more! image It also works in other languages too, however it is all set to English currently, It should be no issue tho to correct it for all other localizations.

overbound commented 8 months ago

If you want to follow this through @BlueSpeedsterYT I think the next step would be to make a build and give it to a few testers. Explaining that they should look for 4:3 display issues as well as insuring 16:9 does not regress. It will need to be thoroughly tested on Android and Windows at least.

jtn00b commented 8 months ago

lmao oops

BlueSpeedsterYT commented 8 months ago

Currently, as of the latest commit, the game should now be sorta playable in 4:3, but there are some additional issues that may crop up, these include

Aside from those, the first pass at dehardcoding the resolution should be semi-done. Any additional fixes may come in at any point but that should be over for now.

BlueSpeedsterYT commented 8 months ago

I would like to state that placeholder BGs have now been added for 2.0's aspect ratio mode, there is no plans for them to be kept for the final release as I would prefer to find a way to make the aspect ratio mode work on not stretching the game screenshot when paused. If they are kept in then it's either by accident or they're unused by the time the aspect ratio system in the pause menu has changed

BlueSpeedsterYT commented 8 months ago

One thing I neglected to mention is the fact that the game now shows a message if the player swaps aspect ratios between each other during a stage, however, this does come at a cost. image The text warning is covered up with the two options in the confirmation window. This should be an easy fix, but how easy depends on if I can manage to handle something like this at all. ...Maybe this is something @AlexKhayrullin could help out on.

AlexKhayrullin commented 8 months ago

I will, but I'm a bit swamped at the moment.

I wanted to adjust the height automatically depending on the length of the text when I originally implemented the dialog boxes, but for some reason it never worked correctly.

I'll keep you posted.

Or we could simply disable changing aspect ratio mid-game so that the option doesn't appear? 🙃

BlueSpeedsterYT commented 8 months ago

Or we could simply disable changing aspect ratio mid-game so that the option doesn't appear? 🙃

haha... funny... would make the dialog option moot @AlexKhayrullin

AlexKhayrullin commented 8 months ago

In my opinion, it is a perfectly legitimate choice to not display the option during game play. I'm not saying it because I don't want to fix the dialog, not at all, but because... I don't know, it feels too impactful to be switchable on the fly.

Like, if I absolutely needed to keep this option during gameplay, I would at least force a level restart or something, so that the map can reinitialize properly without any unintended side effects I can't possibly imagine (but then, we'd need to make the character lose a life so that it doesn't become an accidental cheat code...)

But if you are absolutely sure this is the right way, no problem, I'll fix the dialog this weekend.

AlexKhayrullin commented 8 months ago

@overbound confirmed during his stream that removing the option during normal gameplay would be better, and as you know, I agree for a lot of reasons, all of them technical. You can check the way the button "Warnings and disclaimers" is hidden and do that.

However, I do suggest one more thing: move the aspect ratio option to the top, to the first place. It's kind of a major thing, so to see it buried at the very end seems wrong. You don't need to renumber the actions, just move the code that adds the option to the beginning of the list and we'll be good.

BlueSpeedsterYT commented 8 months ago

I think I'll just reuse the warning message for the regular non-stage one instead but you're right. could help avoid issues in the long run

BlueSpeedsterYT commented 8 months ago

the deed is done @AlexKhayrullin @overbound

overbound commented 8 months ago

I think we can consider this done. If we want to update the cutscenes we can do it as we update the art. @AlexKhayrullin you good with merging this? I think I'm good with it.

AlexKhayrullin commented 8 months ago

I still need to deal with this first, no?

"I think I'll just reuse the warning message for the regular non-stage one instead but you're right. could help avoid issues in the long run"

I still need to adjust the message because of the lines.

BlueSpeedsterYT commented 8 months ago

@AlexKhayrullin while I have reworded it, the only issue currently is that the notification message is still not adjusted well at all, I feel like that we can try looking around for a way to get someone to fix it but who knows

BlueSpeedsterYT commented 8 months ago

These should be the last two needed reviews before merging

AlexKhayrullin commented 8 months ago

There are a lot of cases where calculations are a bit more complicated than they need to be.

For instance, a pattern I see a lot is this one: expressions like objScreen.width - (objScreen.width - another_value)

In math, if you remove parentheses, these three expressions are equivalent:

  1. objScreen.width - (objScreen.width - another_value)
  2. objScreen.width - objScreen.width + another_value
  3. another_value

Please check your commits for this kind of expressions.

BlueSpeedsterYT commented 8 months ago

that should be the last commit currently, barring any more clean up, it should now be good to go for merging @overbound @AlexKhayrullin

BlueSpeedsterYT commented 8 months ago

This should actually be over for now. Still waiting for the final reviews before pushing out a build that can be used for testing

AlexKhayrullin commented 8 months ago

As I've said before, you still have some redundant additions. Only three of them left, so that's cool :)

Also, I have a problem with the files src/objects/objScreen/Other_20.gml and src/objects/objScreen/Other_21.gml (hehe, I recognize the code I wrote for dealing with Android resolutions 😉) : these two scripts are identical except for the value of width. Can you please create a function in a script and use it with a different width parameter instead of duplicating the same code?

AlexKhayrullin commented 8 months ago

src/objects/objScreen/Other_20.gml and src/objects/objScreen/Other_21.gml are still distinct scripts, but I'm open to refactoring them as part of the work on the Android part of this feature.

Approved.