Wide/large terrain using physics ground objects

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I would like to make a level of, let's say, 10 000 pixels wide frame with physics ground objects. The problem is that there seems to be too many of ground objects as things slow down quite drastically.

    Is there any workaround that would allow this with good performance?

    I tried to create the physics ground objects at runtime based on player position, so that the number of ground objects would stay very low regardless of frame size, but that didn't work (should it?). The created ground objects did not have any effect on the player.

    3000 pixels wide frame with ground objects is still ok performance-wise. I was thinking of setting the virtual width to -1 and wrapping the layer horizontally so that the same terrain would repeat 3 times (~10 000 pixels in total). However, wrapping did not take into account the physics ground objects, and my player fell through the background immediately when the layer repeated.

    Thoughts?

  • Is the ground of your game build out the duplication of ONE ground object, or do you have several segments made out of several ground objects? Each segment is one Box2D internal object. If not, maybe try the later, create segments, not too large each (say 1000 pixels) : Box2D is set to automatically inactivate objects that are for from the display. If you use only one big object, everything will be activated as you will always see one portion of the big object.

    Francois
    PM: Please login to see this link.

  • I split to more segments as you suggested and indeed the performance is now much, much better. So it was not the number of physics ground objects but just the size of regular background objects that caused the slowdown. Issue solved, thanks!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!