[SUGESSTION] Animated Tiles in Tilemap

Discussion and feedback on Construct 2

Post » Thu Nov 21, 2013 10:56 am

I think animated tiles is quite possible when if we have 3 tiles of 32x32 as 3 frames in horizontal, then use Tile X offset on specificed index of tiles in runtime.

Is possible?
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Thu Nov 21, 2013 10:04 pm

Since we can set collision on each tile now, it would be neat to enable animation to them aswell.
Eather way, iam for animated tiles :D
B
47
S
10
G
5
Posts: 232
Reputation: 7,561

Post » Sat Nov 23, 2013 2:23 am

Well seeing how the tilemap object spawns a bunch of tiledBG and other objects for placement of tiles while ripping from a tilesheet, I don't think it wouldn't be too hard to impliment

I know some people have used "Load from URL" on "TiledBG" to make it emulate being animated. If we use this then the object would have to have a behavior that animated only certain tiles. There could be instance variables that determine which tiles animate and have their frames progress at a fixed interval to the end, and start over from the beginning. (Although with the introduction of tile-collisionboxes, probably up to the user to make sure all tiles have the hitbox they want it to have)

Would probably be tricky to code it and have it check for it, or even use unnecessary processing power even though you may not use the animation feature. (if that is the case, an option to enable animations in the object properties)
B
21
S
8
G
6
Posts: 346
Reputation: 4,891

Post » Sat Nov 23, 2013 2:48 am

Why you guys need it animated? For stuff like water I'm guessing? Well here's a technique I was using back in my rpgmaker days. Lets say we're making water. So First I would draw the ground around it. Stuff for water I would leave transparent. Then I would use 3 or more layers of background image, each with bit different water texture, and for each I would set transparency ( up to your own preferences). Also I would use eraser brush to make it bit more transparent in some places. The last texture would be the bottom of the lake that I would keep solid. Then you put them all together, and in construct you could use that technique of looped tiled background, for each of the water textures to move in different direction. Effect is really cool. You can also add sky reflection to it etc.

[email protected] Simple one that would imitate oldschool animated tileset would be to make several Tiled Backgrounds, each with different animation frame, call them something like Water1, Water2, Water3 etc, place Water1 backgrounds where you want them to be, and then make animation with events.

EDIT2 Example of oldschool water. WATER.CAPXmegatronx2013-11-23 03:16:32
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,981
Reputation: 19,316

Post » Sat Nov 23, 2013 3:36 am

+1 on this. Say we have an area in the tileset that shows a set of water frames. Then you Select an Animation Marque tool to click and drag an area of tiles, to form the animation. Taking the first tile from the 0,0 position of the animation marque, to drop on the map.
B
50
S
11
G
7
Posts: 274
Reputation: 8,146

Post » Sat Nov 23, 2013 4:38 am

@megatronx

I've tried this method before but I don't trust multiple tiled backgrounds for some reasons, too much explain about the practices and performance, but this is ideal workaround if Ashley will say Tilemap doesn't use requestAnimationFrame. Why shouldn't we use only ONE OBJECT as one tilemap?

This tilemap, represents animated water in bottom.

http://opengameart.org/sites/default/files/lpc-art/water.png

Offset antimation to targeted tiles would work, we have no actions like Offset in runtime.Joannesalfa2013-11-23 04:40:10
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sat Nov 23, 2013 4:49 am

If I remember correctly Offset is not supported in html5 that's why you can't set offset to Tiled Backgrounds. Thought That was some time ago and maybe things had changed. I haven't tried the tileset object yet. Why not to try replacing it like i did with water? You can possibly save tiles positions as json, then load that json to other two tilemaps, and switch them every second. Since tilemaps are fairly small it shouldn't have much impact on performance.

[email protected] Also keep in mind that on running the game tiles are changed in to Tiled Backgrounds.megatronx2013-11-23 04:50:42
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,981
Reputation: 19,316

Post » Sat Nov 23, 2013 11:33 am

@megatronx I literally talk about "offset" method which is not true offset function. It's just a theory.

Basically, look it's possible to be animated in some coordenates of tiles, not the full by one object.

https://dl.dropboxusercontent.com/u/76227787/watertilesani.capx
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sat Nov 23, 2013 4:59 pm

Can't check it out as not using 151 yet.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,981
Reputation: 19,316

Post » Sat Nov 23, 2013 5:57 pm

Actually another way is to do the coding yourself, and have your events check tile numbers for each tile

If tilenumber=4 then wait 1sec and set tilenumber at tilelocation to 5

and etc,
B
21
S
8
G
6
Posts: 346
Reputation: 4,891

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests