Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place Random Tile does not work for animations? #57677

Closed
rakkarage opened this issue Feb 5, 2022 · 2 comments
Closed

Place Random Tile does not work for animations? #57677

rakkarage opened this issue Feb 5, 2022 · 2 comments

Comments

@rakkarage
Copy link
Contributor

rakkarage commented Feb 5, 2022

Godot version

v4.0.alpha1.official [31a7ddb]

System information

Windows 10

Issue description

Animation
Shader

TileSet animations all start at frame 0? This is fine for water tiles which all have to sync up but sometimes you want to start each animation at a random frame. In Godot 3 (and 4), one can animate tiles with a shader which can use the Place Random Tile check and Probability to either start animations at frame 0 or at a random frame.

shader_type canvas_item;
render_mode unshaded;

uniform sampler2D frames: hint_albedo;
uniform float count;
uniform float duration;
uniform float width;
uniform float startX = 0;

void fragment() {
	float frame = floor(mod(TIME, count * duration) / duration);
	float offset = floor((UV.x - startX) / width);
	COLOR = texture(frames, UV + vec2((mod(offset + frame, count) - offset) * width, 0));
}

To get the shader to work in 4 I had to put it on each frame and select each frame when painting.

I guess the frames could access to a Probability property? Then the Place Random Tile check could be used to indicate if u want a Random Tile based on the probability or not?

Edit: or probability does not even matter when choosing the first frame of an animation.? It is just the mechanism that allows for selecting a random start frame in the shader? This may already be being worked on since check is usable but does nothing when animation selected. thanks

Thanks.

Steps to reproduce

  1. Open TileSetShader.tscn, select all Banner1 frames in TileMap window, check Place Random Tile and draw random animated banners
  2. Open TileSetAnimation.tscn select Banner1 animation in TileMap window, check Place Random Tile and draw same animated banners

Minimal reproduction project

https://github.com/rakkarage/NewTileMapTest

@Calinou Calinou added this to the 4.0 milestone Feb 5, 2022
@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 24, 2023
@rakkarage
Copy link
Contributor Author

rakkarage commented May 8, 2023

i think the problem is that once u make an animation, you can only select the first tile from the animation, so the Place Random Tile button does nothing since you must have multiple tiles selected

the fact that this button does nothing when an animation is selected, and this feature (random animation starting tile) is missing is not a coincidence?

you can set probability for each for each frame in animation and then it is just ignored when Place Random Tile button is checked? seems like a bug... sorry idk

@Calinou
Copy link
Member

Calinou commented May 19, 2023

Closing in favor of godotengine/godot-proposals#6856, as feature proposals are now tracked on the Godot proposals repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants