Player's interaction with animated custom empty spaces

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Player's interaction with animated custom empty spaces

Post by Eizzoux »

A while ago I made a weird maze concept which had walls and empty space as walkable CE flashing red and black and it worked out as intended, but then as the game now has custom empty spaces I decided to try them out for maze space instead. They work almost fine, but just one problem. When player walks on that empty space, the animation is just slightly off for some reason, despite it's sprite having global animation sync set as true. Like, it plays the animation just by one frame after or before the global animation.
Here's a video demonstrating what I mean (I hope it is visible enough)
[link]
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Player's interaction with animated custom empty spaces

Post by Holger »

I understand what you mean. That's strange, as the custom empty elements use the same global frame counter to select animation frames as the normal custom elements when using the "global sync" animation mode (but apparently I made a mistake).

Could you send me a minimal level set which demonstrates the problem? That would be easiest for debugging and (hopefully) fixing the problem. (But I should also be able to create one myself.)
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: Player's interaction with animated custom empty spaces

Post by Eizzoux »

Sure, here it is.
this.zip
(2.38 KiB) Downloaded 60 times
One more thing, I just checked how it works with enemies and you can see that the spaces they occupy are also using different frame. And also... Are they supposed to be purely opaque?
kufdbfkasd.png
kufdbfkasd.png (485.1 KiB) Viewed 2238 times
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Player's interaction with animated custom empty spaces

Post by Holger »

I have found out two things:

First of all, yes, the enemies are indeed supposed to be purely opaque -- that's how the R'n'D graphics engine usually works: Draw everything non-masked on black background, with game elements usually having a black background themselves, so everything looks fine, as long as it is drawn on black background. However, with "empty space elements", this is usually not the case (after all, that's what they are made for). Therefore, add the following to your "graphicsinfo.conf":

game.use_masked_elements: true

This will automatically be set to "true" by the game engine if there are empty space elements found in the playfield with checkbox "[x] use graphic of element" checked. I don't know at the moment why the pure existence of empty space elements in the playfield is not sufficient enough to set this flag, but I remember that there was a reason for it. So just add that flag explicitly, and enemies will be drawn with transparency over empty space elements.

To also fill the starting tile position of the enemies (yamyams here) with your custom empty space element, just set "[x] use graphic of element [<your empty space element>]" for the default "empty space" element. Interestingly, this also fixes the delayed empty space element animation. At the moment, I don't know why this is the case... :shock:

So I still have to check what's really going on here. :?
Post Reply