ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sun Aug 20, 2017 5:52 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Tile animations/bumps
PostPosted: Fri Jun 08, 2012 3:46 pm 
Offline
Loremaster

Joined: Thu Sep 23, 2010 10:18 pm
Posts: 3516
Location: London, England
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


Top
 Profile  
 
PostPosted: Fri Jun 08, 2012 11:19 pm 
Offline

Joined: Fri Jun 08, 2012 11:13 pm
Posts: 1
Would love to see animations being implemented, especially since I'm planning a realtime module :D.


Top
 Profile  
 
PostPosted: Mon Jun 11, 2012 12:45 am 
Offline
Halfling

Joined: Fri Jun 08, 2012 12:18 am
Posts: 106
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.


Top
 Profile  
 
PostPosted: Tue Sep 11, 2012 8:20 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10125
Location: Angolwen
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 ;)


Top
 Profile  
 
PostPosted: Tue Sep 11, 2012 9:40 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10125
Location: Angolwen
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 ;)


Top
 Profile  
 
PostPosted: Tue Sep 11, 2012 11:12 am 
Offline
Loremaster

Joined: Thu Sep 23, 2010 10:18 pm
Posts: 3516
Location: London, England
You are too awesome, DG :D

_________________
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes


Top
 Profile  
 
PostPosted: Tue Sep 11, 2012 11:26 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10125
Location: Angolwen
/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 ;)


Top
 Profile  
 
PostPosted: Sat Sep 15, 2012 7:59 am 
Offline
Higher

Joined: Thu Aug 16, 2012 10:52 pm
Posts: 54
Location: Philadelphia, Pennsylvania, USA
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.


Top
 Profile  
 
PostPosted: Sun Sep 16, 2012 11:38 pm 
Offline
Higher

Joined: Thu Aug 16, 2012 10:52 pm
Posts: 54
Location: Philadelphia, Pennsylvania, USA
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!


Top
 Profile  
 
PostPosted: Mon Sep 17, 2012 5:32 pm 
Offline
Higher

Joined: Thu Aug 16, 2012 10:52 pm
Posts: 54
Location: Philadelphia, Pennsylvania, USA
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.


Top
 Profile  
 
PostPosted: Fri Nov 16, 2012 12:25 am 
Offline
Loremaster

Joined: Thu Sep 23, 2010 10:18 pm
Posts: 3516
Location: London, England
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


Top
 Profile  
 
PostPosted: Fri Nov 16, 2012 1:11 am 
Offline
Cornac

Joined: Thu Nov 08, 2012 6:28 pm
Posts: 30
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.


Top
 Profile  
 
PostPosted: Mon Dec 10, 2012 6:23 pm 
Offline
Perspiring Physicist

Joined: Thu Feb 17, 2011 5:20 am
Posts: 888
Just wondering... is it possible to select the start frame for animations?

_________________
darkgod wrote:
OMFG tiger eye you are my hero!


Top
 Profile  
 
PostPosted: Tue Feb 05, 2013 5:10 pm 
Offline
Higher

Joined: Thu Aug 16, 2012 10:52 pm
Posts: 54
Location: Philadelphia, Pennsylvania, USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group