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

WIP: Moving Tiles #9469

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

WIP: Moving Tiles #9469

wants to merge 7 commits into from

Conversation

M0REKZ
Copy link
Contributor

@M0REKZ M0REKZ commented Jan 3, 2025

WIP PULL REQUEST

Related to #6683

This is a basic implementation based on infclass code (so yeah this should credit infclass developer too), it is still WIP so some things are still weird and the code is not perfect

This uses Quads combined with Envelopes that are Synchronized to the game

NOTE: I made the layer being searched by the layer name, i don't know how editor works to add it as a kind of game or front layer

Video and map file used on the video:
quadtest.map.zip

moving_tiles.mov

Checklist

  • Tested the change ingame
  • Provided screenshots if it is a visual change
  • Tested in combination with possibly related configuration options
  • Written a unit test (especially base/) or added coverage to integration test
  • Considered possible null pointers and out of bounds array indexing
  • Changed no physics that affect existing maps
  • Tested the change with ASan+UBSan or valgrind's memcheck (optional)

@def-
Copy link
Member

def- commented Jan 3, 2025

This uses Quads combined with Envelopes that are Synchronized to the game

I feel like tiles would be easier to reason with, was it only done with quads so that no client modification is required?

@M0REKZ
Copy link
Contributor Author

M0REKZ commented Jan 3, 2025

was it only done with quads so that no client modification is required?

Yes, also for old DDNet version compatibility.

@M0REKZ M0REKZ force-pushed the quads branch 2 times, most recently from 98b83fa to aceb92e Compare January 3, 2025 23:18
Copy link
Member

@Robyt3 Robyt3 left a comment

Choose a reason for hiding this comment

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

Maybe tiles should be used instead and quads only for compatiblity with old versions?

To correctly support bezier envelopes of both DDNet and Teeworlds you should use/create an implementation of IEnvelopePointAccess (see render.h). Those classes would have to be moved to a different file though since including render.h from collision.h would be wrong.

@M0REKZ
Copy link
Contributor Author

M0REKZ commented Jan 4, 2025

Maybe tiles should be used instead and quads only for compatiblity with old versions?

Translating tiles into quads could be kinda heavy, it could produce bigger size maps (since a rotating square of 100 tiles requires more memory than just a Big quad), manipulation for each tile while moving could also be heavy, and we still are on the need of using quads, just in a more limited way

@l-ouis
Copy link
Contributor

l-ouis commented Jan 5, 2025

I don't think the quads style implementation is what mappers and players hope for when they think of 'moving tiles' -- in my mind, I imagine a tile-based system that not only supports envelopes but also switch triggers and maybe even physics bodies, which would be really difficult with the current map type.

For some tiles like freeze or tele, the quads implementation feels great, but not for anything else IMO

@M0REKZ
Copy link
Contributor Author

M0REKZ commented Jan 5, 2025

I don't think the quads style implementation is what mappers and players hope for when they think of 'moving tiles' -- in my mind, I imagine a tile-based system that not only supports envelopes but also switch triggers and maybe even physics bodies, which would be really difficult with the current map type.

For some tiles like freeze or tele, the quads implementation feels great, but not for anything else IMO

This Quad implementation supports Switches and Teleports by setting the Red and Green colors for Number and Delay (I assume that the quads in this layer will be invisible anyways), also would be heavy or even impossible to send physic bodies to old clients that does not support them in a good way, like old DDNet clients, 0.7 and 0.6, would need to break compat;

Seems like Developers does not feel comfortable with this implementation, so i guess ill wait until a decision is given: Should we use Tiles or the Quads implementation?

Anyways, ill push now the latest changes so others can experiment with them, collision with solid quads sometimes is still weird and there are bugs, i recommend using the client from this pull request since it has good prediction

Updated test map:
quadtest.map.zip

@Kaffeine
Copy link
Contributor

Kaffeine commented Jan 6, 2025

The author already tried to upstream it: #601

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants