Tile animations/bumps

Moderator: Moderator

Post Reply
Message
Author
Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Tile animations/bumps

#1 Post by Grey »

I'm not too interested in proper framed animations, but I'm curious if the T-Engine can make the tiles do little hops? Like you might have the @ (or a sprite) move up 1/10th of a tile and then drop down again when hit. Or perhaps move towards a certain direction and then back again when attacking, Cardinal Quest style. Is this possible?
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

celane
Posts: 1
Joined: Fri Jun 08, 2012 11:13 pm

Re: Tile animations/bumps

#2 Post by celane »

Would love to see animations being implemented, especially since I'm planning a realtime module :D.

azrael
Thalore
Posts: 122
Joined: Fri Jun 08, 2012 12:18 am

Re: Tile animations/bumps

#3 Post by azrael »

I actually like this idea. As it stands, I sometimes have trouble telling whether or not I hit an enemy when they are in a large group, and having to repeatedly check their health and determine whether or not it decreased is a little annoying.
Step One: Redux
Step Two: Paradox Clone
Step Three: Watch game go insane.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Tile animations/bumps

#4 Post by darkgod »

Tile animation support is in svn now!
Set the image to an image with all the frames left to right; set an anim property on the entity like that:
anim = {speed=1, loop=-1, max=10}

And voila!

I'll go check bumps :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Tile animations/bumps

#5 Post by darkgod »

Bumps implemented!

when you do setMoveAnim() in your actor:move code, you can add two new parameters after the blur one:
foo:setMoveAnim(ox, oy, smooth_move, blur, twitch_dir, twitch_force)

twitch_dir is one of 1/2/3/4/6/7/8/9
twitch_force is how much to twitch for (1 == one full tile)

This is easily usable to twitch attacks too; just do a move anim without moving:
self:setMoveAnim(self.x, self.y, 3, nil, util.getDir(x, y, self.x, self.y), 0.2)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Tile animations/bumps

#6 Post by Grey »

You are too awesome, DG :D
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Tile animations/bumps

#7 Post by darkgod »

/bows
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

chezzo
Higher
Posts: 55
Joined: Thu Aug 16, 2012 10:52 pm
Location: Philadelphia, Pennsylvania, USA
Contact:

Re: Tile animations/bumps

#8 Post by chezzo »

Awesome! Can't wait to get anim working. It's gonna take my game to the next level.

So, I made a 640x64 image with a couple different fires that I use as walls in Hellfire.

Image

I changed data/general/grids.lua to reflect:

newEntity{
define_as = "WALL",
name = "wall",
image="terrain/tree1.png",
display = '', color_r=160, color_g=160, color_b=160, back_color=colors.BLACK,
always_remember = true,
does_block_move = true,
can_pass = {pass_wall=1},
block_sight = true,
air_level = -20,
dig = "FLOOR",
anim = {speed=1, loop=-1, max=10},
}

I'm assuming max=10 equals ten frames? Anyways, when I try to load a new game, it never loads. I'm using the nightly build .exe, dlls from 42 and the svn code.

chezzo
Higher
Posts: 55
Joined: Thu Aug 16, 2012 10:52 pm
Location: Philadelphia, Pennsylvania, USA
Contact:

Re: Tile animations/bumps

#9 Post by chezzo »

I didn't have the right code:

https://gitorious.org/te4

The nightly build from here:

http://www.sendspace.com/file/81dlsx

And the dlls from 42a.

Thanks to Darkgod and _Graziel for setting me straight on IRC.

Happy animating!

chezzo
Higher
Posts: 55
Joined: Thu Aug 16, 2012 10:52 pm
Location: Philadelphia, Pennsylvania, USA
Contact:

Re: Tile animations/bumps

#10 Post by chezzo »

After four frames (256px), I couldn't get anything to work until 16 frames (1024px). The frames would be selected off center, so the animation would slide around like looking at someone on a merry-go-round. Sometimes there would even be pieces of words that were not even in the image.

This isn't a request for it to be fixed, just a heads up to future animators. If I can't do it in 4 frames I can totally do it in 16 frames.

I bet math has something to do with why it's not working, though. Those numbers are too pretty to be coincidental.

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Tile animations/bumps

#11 Post by Grey »

Just got this running in my jam-based action RPG and it looks FANTASTIC! So, next challenge DG, should you choose to accept it: rotating sprites! As in you kill an enemy and it rotates and disappears. Or perhaps just does a twirl in a combat move.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

andar_b
Cornac
Posts: 30
Joined: Thu Nov 08, 2012 6:28 pm

Re: Tile animations/bumps

#12 Post by andar_b »

Another use would be to use a single tile of, let's say, grass, and rotate it 90, 180, or 270 for a little more variation. If using a true overhead tileset, walls and doors could use one tile instead of several, as well.

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Tile animations/bumps

#13 Post by tiger_eye »

Just wondering... is it possible to select the start frame for animations?
darkgod wrote:OMFG tiger eye you are my hero!

chezzo
Higher
Posts: 55
Joined: Thu Aug 16, 2012 10:52 pm
Location: Philadelphia, Pennsylvania, USA
Contact:

Re: Tile animations/bumps

#14 Post by chezzo »

Yeah, rotation would be pretty cool! I can see a lot of applications for that.

I found some more information on how many frames you can use. You can use 2, 4, 8, 16, 32, and 64 frames. And probably all the other powers of two.

Post Reply