'Tiling' platforms - random gaps between Actors

TesseractEngineTesseractEngine Member Posts: 180
edited August 2012 in Working with GS (Mac)
Hi all,

I'm working on a side scroller. Platforms and other scenery have been assigned a Motion.Linear.Velocity.X of -200. Some of this scenery is repeating, so, for example, I've got a 480 wide x 100 high Actor that's followed immediately to the right by another instance of the same Actor. There's a rule on the Actor that when Self.Position.X gets to < 240, it's to move to 720.

Problem is, the Actors get gaps between each other. Randomly-sized gaps. I'm assuming that because the Actors are in constant motion, the Self.Position.X change just isn't happening instantaneously, hence the gaps.

Anyone experienced this and found a workround?

Many thanks in advance,

- Mark

Best Answers

  • hotMagichotMagic Posts: 266
    Accepted Answer
    We had a similar problem in Zig Zag Zombie. If you peek at the title screen, it has a parallax cinema. We ended up overlapping the lower brick pieces because, even when the math was right, we got gaps. That's rough if you have a tile-able art piece., but we didn't. So that's one work around.
  • rhinokeyrhinokey Posts: 158
    Accepted Answer
    @TesseractEngine yeah thats what i'm doing " 'tile' Actors by placing them one after the other. There's no gaps appearing within any Actor, the gaps are between Actors,"

    each "platform" in my video is at least 3 actors, a left end cap, middle and right endcap, the longer platforms have more middle actors in them.

    are you using constrain attribute to make them move? or change attribute? i use constrain to keep any random weirdness from slowing them down. i also use constrain on y to keep them from movin down when the actor lands on them.
  • LumpAppsLumpApps Posts: 2,881
    Accepted Answer
    Okay, I had Another look at what I am doing:
    I have two actors of the same width. They move to the left. When the actor on the left moves out of the screen it changes pos.X to pos.X plus width.
    Hope that helps. Please let me know.

Answers

  • TesseractEngineTesseractEngine Member Posts: 180
    Ah, thanks @hotMagic! Yeah, I'm working round it in two ways at the mo - overlapping, as you went with, and putting a static background the same colour behind the 'tiles', where the nature of the graphics allows it.

    Luckily, this 'endless runner' version which needs the repeating scenery is only a prototype for the publisher. The finished levels will all be pre-built, not repeated.

    None-the-less, though, if anyone else has any experience with getting the method to work exactly as planned, I'd love to hear about it...will help a heck of a lot with other planned games.

    BTW, @hotMagic...I got Zig Zag Zombie when I read your Dev Profile about a month ago, great work! :)
  • rhinokeyrhinokey Member Posts: 158
    edited August 2012
    @TesseractEngine

    I'm using tiling platforms with a lin motion movement and I'm not getting any gaps in them. I'm using a system where one platform spawns the following one offset from itself.
    theres no overlaping and it seems to work fine.

    on second thought, for the lin x i am not setting it in its motion panel, i am using a constrain atribute maybe the constrain is why i get no gaps
  • TesseractEngineTesseractEngine Member Posts: 180
    edited August 2012
    @rhinokey thanks man.

    So, to clarify...I'm not using Tile in any of the Actor attributes. I'm trying to 'tile' Actors by placing them one after the other. There's no gaps appearing within any Actor, the gaps are between Actors, despite the maths being spot on for moving the off-screen Actor back to right-hand offscreen. Is this what you've done here, too, or is each platform one long Actor?

    I made an example project earlier to illustrate the gaps:

    http://tesseractengine.com/platformTileTest.gameproj.zip

    Run it for a few cycles - I see gaps randomly appearing (sometimes) between the Actors. Size of gaps seems totally irregular, and are different sizes on different devices.

    Ooh, nearly forgot to mention - this is using Constrain, too.
  • TesseractEngineTesseractEngine Member Posts: 180
    @rhinokey Hmm! Wonder what I'm doing wrong, then. Yeah, I am using Constrain.
  • rhinokeyrhinokey Member Posts: 158
    @TesseractEngine you are moving it back to the start, where in my game i just destroy and re spawn, don't know if maybe there some lag when you move them back to the other side,

    if you have a left middle and end like i do you could make the middle and end platforms move slightly faster but constrain to the correct movement as soon as they bump into the leading platform to make them bunch up. that's a pretty ghetto workaround, but just a suggestion.
  • TesseractEngineTesseractEngine Member Posts: 180
    @rhinokey your timing there was immaculate - I'd just logged on to gamesalad.com to download the creator on my new Mac mini! :D

    That's an intriguing couple of thoughts... I'll try a version that spawns and destroys, see what that does... and I love the ghetto workaround, nice lateral thinking!

    Thanks again mate.
  • LumpAppsLumpApps Member Posts: 2,881
    Hi, I have been playing around with this for a while and also got gaps. I used the same method as mentioned before. Two ground actors. When one gets to x = minus 240 it changes x to 720 (and vice versa since my game also goes to the left. I had the gaps on the creator preview but in my iPhone it works well. Have you tried that?
  • TesseractEngineTesseractEngine Member Posts: 180
    Hey @LudwigHeijden - I've tried it on an iPad 1 and iPhone 3, and I still get gaps, unfortunately.
  • TesseractEngineTesseractEngine Member Posts: 180
    Hey @LudwigHeijden - many thanks for this. I was on vacation last week, but I'm back in the office, will try this out now and let you know!
  • TesseractEngineTesseractEngine Member Posts: 180
    @LudwigHeijden - brilliant! That did the trick. Had to use width x 2, of course, so it followed the one behind it...but yes, that works a treat.

    Thank you!
  • LumpAppsLumpApps Member Posts: 2,881
Sign In or Register to comment.