Animated Image & Collision Area Changing After Save

Discussion in 'Technical Discussion' started by Phill Mason, Dec 16, 2015.

  1. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Hey guys, I've got something really funky going on with an animated png sequence and I can't work out what's happening. Maybe you've come across this or have an idea.

    I've been adding some visual effects to my upcoming game 'Mr Buzz' to create more of an atmosphere and have created a nice short steam sequence. When I add it as an object, I set it to decoration and position it on the scene. Everything looks fine until I save it and come back to the bbdoc.

    It starts off as a nice long streak of steam with the collision area surrounding the steam, just as you would expect, but following the save and then reopening, the collision area has automatically moved and the visual representation on the scene has turned into a tiny square - I'm baffled.

    I've tried this in a brand new bbdoc to take my larger Mr Buzz file out of the equation, but it does exactly the same thing. Could it possibly be the png sequence? Any ideas?

    Mr-Buzz-Steam-Ani-Error.png
     
  2. ajcoryat

    ajcoryat Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    241
    Likes Received:
    111
    @Phill Mason I guess you need to start a process of elimination. Place one frame at a time (of the png sequence) into the scene and see if the culprit shows his ugly head :)
    I like the steam idea though.
     
    Phill Mason likes this.
  3. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Trying that now, cheers.
     
  4. Rebel Studios

    Rebel Studios Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    466
    Likes Received:
    280
    @Phill Mason .... don't worry bout it... most likely it's just one of the frames in the animation... We've experienced it in one of our games... the item being a flame thrower whereby the machine spits fire... so if you wanna position the steam you can go to the animation editor and select the particular frame then in the main frame of the game the actual steam size should appear...

    Otherwise in the previewer all will actually be ok ;) Hope this helps... Cheers mate
     
  5. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Yeah, tried that, but coming back to the file somehow seems to corrupt the steam, it's most bizarre. That's not the only issue though, because the centre is being thrown off, the collision area is way off from the actual graphic. You can see the two columns of steam have the small collision squares above the steam rather than at the bottom which is where they start off.. None of this makes sense. See Image:

    Screenshot-1136x640-2015-12-16-05.19.35PM.png
     
  6. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    @Andy, is there a 'height' size limit to png files within a sequence? My steam is 323px high.
    I'm really stumped on this one. Could the strange small collision box be because the actual image content changes size from small steam and the beginning to large steam at the end?
     
  7. ajcoryat

    ajcoryat Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    241
    Likes Received:
    111
    @Phill Mason You may be onto something. 1. Check and make sure that all the .png frames are the exact frame size e.g. 10wx323h, because maybe your smallest image (with the least steam) is a smaller frame size and the collision shape is modeling that. So, the smallest image should have the most negative space but be the same frame size. 2. Try changing the order of sequence in your loop of animation e.g. start with the largest, and check the collision shape based on the 1st png file/frame.
    It may just be that the collision shape is recognized on the 1st frame of the sequence. Just a thought.
     
    Phill Mason likes this.
  8. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    No, have no idea why this might be happening. Best thing would be to send example to support so @seanjonathanconnor can check it out. Might be something simple to correct (hopefully) or more involved.

    Oh, missed the point @ajcoryat brings up. Your images all need to have the same dimensions. This pretty typical for game animations.
     
    Sean Buildbox and Phill Mason like this.
  9. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Thanks @ajcoryat and @Andy, good points, but I always make sure every image within a png sequence is exactly the same size, otherwise the sequence tends to jump around a bit and looks odd. All my images are 117w x 323H. I was just wondering, even though the physical image is the same size, the actual content of the frame is almost empty and I'm thinking that BB is taking it's collision reference from this.

    I've just tried positioning a full frame image as image_001 in the sequence and it looks like its staying stable after a save and reopening, so it looks as though BB needs to see some actual content in the first frame of the sequence.

    I just made image_001 100% transparent and the problem came back, so I tried a 99% transparency and it works okay. So it confirms that BB needs to identify something within the first frame, rather than a completely empty transparent box.
     
  10. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    Ah, interesting, so the first frame is 100% completely transparent/empty? What is the purpose for this? I'm not even sure if that image would get "saved" in the Atlas, which could be part of the reason.
     
  11. Christoph

    Christoph Miniboss Boxer

    Joined:
    Oct 4, 2015
    Messages:
    2,807
    Likes Received:
    2,309
    If you have an object you want to appear from nothing like lets say a ghost then it appears and disappears. It goes from 0% to 50% and to 0% back in transparency. If this ghost is going to kill you then it would be an enemy that needs a correct collision shape. I have several of these elements but all are decoration. Buildbox makes weird things with it but it never was a problem for me because they are only decoration objects. Interesting what you found Phill. The solution is pretty simple though. You don't need the 0% image. You can start with 5% for example and then go up. Just make sure it is within the fps of your animation. As an example: if you let a ghost appear in 1 second with 25fps to 50% transparency then your linear increase would be 2%. So use the first image with 2%, then 4% etc. The animation will be smooth because the first 0% frame "is still there" but not part of the animation anymore.

    @Andy: an interesting question for BB2: do we have animation properties for transparency, scale, etc? This would help so much because we could import just 1 image and BB would do the rest.
     
  12. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    The UI editor has keyframe animations, postion, scale, rotate and opacity are supported.
     
  13. Phill Mason

    Phill Mason Serious Boxer

    Joined:
    Sep 25, 2015
    Messages:
    880
    Likes Received:
    721
    Yup, no point in having a completely empty first image in a sequence, just did it as an experiment to see what BB was looking for. So, removing 99% of the image to leave only 1% worked just fine.

    Thanks @Christoph, that's pretty much what I did, thanks.

    @Andy, the only small oddity left, is that when I open the bbdoc, I cannot see where I've positioned any of the steam sequences until I go into the default animation of the steam and move the timeline along until I can see the steam, then it appears in the scene editor. It seems BB is not remembering which frame I've chosen to display in the editor. No biggie and it won't stop me from finishing, which is most important.
     
    Rebel Studios likes this.

Share This Page