Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to object type support, object versioning #2542

Merged
merged 43 commits into from
Sep 2, 2023

Conversation

Vankata453
Copy link
Member

@Vankata453 Vankata453 commented Jul 16, 2023

Object, utilizing object types to have their sprites changed, now change their default sprite, according to their type. This stops the game from having to save the object type's sprite to the level file, when it's supposed to be the default.

Also features code improvements, like the initial on_type_change call for GameObjects being moved to the parse_type function, and changing an object's sprite on type change being moved to MovingSprite::on_type_change.

Another major feature, included in this PR, is GameObject versioning. It aims to provide a simple way to deprecate features in an object, which would allow for retaining proper functionality in old levels, whilst providing new functionality for new levels. Object versioning is supposed to be used, when introducing changes to objects, which are incompatible with the previous way of functioning of the object.

TODO:

  • Make more objects support object types, rather than having hardcoded behaviour based on sprite, or containing other default sprites in a non-obvious way.

Fixes #2502.

@Vankata453 Vankata453 changed the title Improvements to object type support Improvements to object type support, object versioning Jul 17, 2023
@mrkubax10 mrkubax10 added involves:functionality status:in-progress Progress has been done, but more is intended be done type:feature category:code labels Jul 18, 2023
@Vankata453 Vankata453 marked this pull request as ready for review July 19, 2023 14:08
@mrkubax10 mrkubax10 added status:needs-review Work needs to be reviewed by other people and removed status:in-progress Progress has been done, but more is intended be done labels Jul 19, 2023
@Rusty-Box
Copy link
Member

Some issues I found regarding certain types:

  • The object types: Pumpkin, Bumpkin, BSOD, Laptop are immune to ice
  • "Corrupted" type for Crusher shows Rock Crusher (the "Rock" type is missing entirely!)

@Rusty-Box
Copy link
Member

Looks alright code-wise but I'm not sure Laptop should be type of both Smartblock and Iceblock. They behave differently (turning around on edges) and it may cause inconsistency.

I agree. Laptop should only be an object type for Mr. Iceblock and not Smartblock. Just like BSoD is only an object type for Mr. Snowball and not Smartball.

@Vankata453
Copy link
Member Author

This must have been an oversight on my part, I forgot SmartBlock inherits MrIceBlock.

Copy link
Member

@Rusty-Box Rusty-Box left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just remembered tthat Bouncing Snowball actually has an object type as well that is missing! Fatbat is the object type for Bouncing Snowball.

Another thing: Rusty Trampoline seems to inherit code from Rocks hence they have the same object types, which is a mistake!

Also, didn't you make Ice the new default for new instances of weak block?

@Rusty-Box
Copy link
Member

Another bug I discovered too: you can squish forzen Bumpkin, Pumpkin and BSoDs

@Vankata453
Copy link
Member Author

@Rusty-Box Additionally, I also removed the "linked" property from weak blocks. Only "Hay" is linked, "Ice" is not. This would ensure consistency.

@tobbi
Copy link
Member

tobbi commented Aug 24, 2023

Does this fix #2502 ?

@Vankata453
Copy link
Member Author

It doesn't, but probably should.

@Rusty-Box
Copy link
Member

The flat/kicked laptop bug is fixed, though it will now come to a halt in an instant, instead of slowly losing speed until 0. This looks a bit harsh.

@Vankata453 Vankata453 merged commit e5e919a into SuperTux:master Sep 2, 2023
@Vankata453 Vankata453 removed the status:needs-review Work needs to be reviewed by other people label Sep 2, 2023
@Vankata453 Vankata453 deleted the object-type-improvements branch September 2, 2023 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Skull Tiles an option/type of Unstable Tiles
4 participants