spritebuilder / SpriteBuilder

Objective-C Game Development Suite
http://www.spritebuilder.com/
Other
742 stars 293 forks source link

Physics Categories/Masks changes not saved, published or read consistently #792

Open LearnCocos2D opened 10 years ago

LearnCocos2D commented 10 years ago

What I have observed repeatedly today goes something like so:

I tried several times to reproduce the issue instantly, assuming that cat/mask changes may not be properly saved or published unless some other change is made elsewhere, unless a "Save All" has been issued, unless the CCBs have been modified so that SB actually marks them as modified. I also cleaned caches and Xcode build folder several times, I pulled the latest SB develop commit and updated my project's cocos2d-iphone folder to the one used by the latest SB. So far I have not been able to reproduce the issue instantly. It just seems like behavior changes only occasionally after some time, or some other changes to the project.

Eventually I considered two options:

Though the second option seemed the probable choice I decided I should at least try and make some kind of project where one of the issues is consistently reproducible. ;)


Here's the project to reproduce an issue where the Categories setting of a sprite node in SpriteBuilder is set to "border" but when logged in the game, the same node reports (null) for the category. Coincidentally it's the last node in the list. https://drive.google.com/file/d/0B0g1SgyD5RH2c2dyN1dlQmFXWWs/edit?usp=sharing

More info about the project:

lower border3 (static): group=(null), type= cats=(null) mask=(null)

Notice that the last node is the one Border3.ccb instance that should have its collisionCategories field set to "border".

I'm guessing this is an off-by-one error or otherwise not correctly handling the last physics body in a CCB because this issue appears to have been shifting around randomly in my project but only after editing unrelated nodes.

LearnCocos2D commented 10 years ago

One more thing I want to mention:

I have observed twice that checking or unchecking the chain joint's "Spring Enabled" property (of all physics nodes in the chain.ccb) can affect whether two instances of Chain.ccb will collide with one another or not. In each instance the behavior was fully reproducible by repeatedly turning Spring Enabled on or off, except that in one case turning on Spring Enabled made the objects collide, in the other case it made them not collide.

This may or may not be related to the above issue.