Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

RPG in a Box

Bring your stories and ideas to life! · By Justin Arnold

[0.3.6.1] Random animation problems after compilation

A topic by lectronice created Nov 27, 2016 Views: 95 Replies: 5
Viewing posts 1 to 6

Hi!

Lately I've been animating a bunch of doors and chests, and I have an animation problem I can't figure out.

Sometimes after compiling, when opening a door, the animation plays and the door goes into open position but the "closed" frame stays visible. So the door is both closed and open (Shrödinger's door?) The door still works normally, so you can pass through it when it's supposed to be open. Closing and opening it back and forth a random number of times sometimes make it display properly, but using it again causes the issue to reappear. The behaviour seems to change depending on the animation type. "Clamp" does this, while "Once" works normally except the door seems to open or close twice in a row. Overall it's pretty strange, since half of the time everything works perfectly. Saving the map and compiling after modifying stuff unrelated to doors randomly triggers the issue, so I've no idea what's going on.

Also, is there a difference between "Once" and "Clamp"?

While I'm at it, I've a smaller animation issue with chests. My chests are huge things made of two 16x16 tiles, and a lid in two parts, since it wasn't possible to make a properly centered 32*16 lid due to the way objects are set on the grid. My script works fine (but may do strange stuff like doors). Most of the time I can close or open the lid like a single item, except sometimes one part moves out of sync with the other, causing the lid to appear to be split in two parts.

Cheers!

Hello!

This first issue sounds like the same thing I have ran into recently with the levers in my test game. I think I may have mistakenly introduced the bug in a recent release. I meant to look at this sooner but kept getting sidetracked - I will try to take a look today!

In regards to the difference between the two types, "Once" plays through the animation frames once, then returns back to the start frame. "Clamp" plays through the frames then stops at the last frame and stays on it rather than returning to the start frame. At least that's the way they are supposed to work. :)

Would you mind e-mailing me the chest objects and script you are using to animated the lid? Being two separate objects that have their own processing logic, I'm not sure it's guaranteed that their animations will be triggered at exactly the same time, but I'll mess around with it some and see if I can tell why it's not consistent. When it does occur, how out of sync are the two pieces, time-wise?

(1 edit)

Okay, so "Clamp" was the right setting to keep something open or closed after interacting with it :) And I've emailed you the chest components. About the two parts of the lid, they aren't always out of sync, but when it happens it's no more than one frame, I think. Thanks!

(1 edit)

Yep, "Clamp" would make sense in this case. :) It appears that the first issue is a strange side effect of some changes I made to the script parser - the added complexity (and therefore the time it takes to parse) for some reason causes the engine to "hiccup" and do some weird things. I believe this may go away once I make some optimizations. Going forward, scripts will be pre-parsed during the game export, something I really should have been doing in the first place so there's minimal delay when triggering a script during the game. This may even help the animation sync issue.

Also, I was going to ask if you would be able to just put all 4 components of the chest into one 32x16 object, but then I realized that I think I may have broken object placement in the Map Editor. Theoretically, you should be able to just make your chest into one 32x16 object, and then it would span 2x1 tiles when placing it in the Map Editor. I had it that way at one point, but it seems now that it's just centering on one tile instead of spanning it properly across two tiles width-wise, at least visually. I will get back to you on this one. :)

About object placement, I thought it was intended due to some internal mechanism since the ancient 16*16 / 32*32 update, but now I think about it, a few weeks ago when I started scripting new doors I had to edit the model's offset because newly placed doors weren't aligned with the walls. The problem probably appeared one or two months ago, while I was mostly building and not scripting, so I didn't it notice earlier. Indeed, making chests a single object would be handy, especially for setting up scripts. That's great, thanks :)

(1 edit)

I found a line of code I had commented out to properly offset an object when placing it, but I don't recall why I commented it out or if I even meant to, heh. I uncommented it and tested it with my 32x16 car model and it seems to work correctly again, but let me know if you have any issues with the latest update. One thing to note, which I may have mentioned before, is when you do want an object to span multiple tiles, you'll want to make sure it's at least a multiple of the tile width. So a 32x16 model would be 2 tiles wide, but a 30x16 would only cover one tile since it's less than double the tile width.

Also, let me know if you continue to see that first animation issue after the latest update. My levers don't seem to be having that issue anymore, so hopefully that takes care of it. :)