Author Topic: stupid question  (Read 6570 times)

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
stupid question
« on: 2006-01-16, 02:08:44 AM »
the animation speed (in the sprite editor) is just fps for the sprite right? also, the delay in a path is 60's of a second?

[ assuming both, FramesInAnimation / AnimationSpeed x 60 = PeriodOfAnimation(Delay) would be correct to find the length of one cycle of a sprite animation ]
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: stupid question
« Reply #1 on: 2006-01-16, 06:13:50 AM »
Actually no, the animation speed isn't quite so simple to calculate.  The highest value (is it 20? whatever it is...) represents a sprite that advances to the next frame for each frame that the game advances (faster if you have animation speed corellated with velocity -- it will skip frames.).  Each step slower represents 1 delay added to each frame of the sprite. Max-1 represents a sprite where each frame has an added delay of 1, Max-2 represents a sprite where each frame has an added delay of 2, and so forth.

The delay values aren't exactly 60ths of a second.  They are tied to the speed of the game.  If the game runs at 60 FPS, then yes, the delay will be 60ths of a second.  If the game runs at 30 FPS, then the delay will be 30ths of a second.  So the delay is actually in frames.  It represents how many game frames a particular tile repeats the same image before advancing to the next.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
Re: stupid question
« Reply #2 on: 2006-01-16, 10:07:39 AM »
25 is the max animation speed.., hmmm so then would it be

(1 + (25 - AnimationSpeed) ) x FramesInAnimation = AnimationLength(Delay) ?



--edit--
it should be that, im pretty sure that should work, but it doesnt, its close, but off by an incredibly small amount
hmm.. heh i shouldnt be this difficult to figure out

ok, i did a little experimenting, and if you use the above formula with a little change

[(1 + (25 - AnimationSpeed)) x FramesInAnimation] - 1 = AnimationLength(Delay)

im not sure why that 1 frame makes a difference, but it works.
« Last Edit: 2006-01-16, 10:42:48 AM by billybob884 »
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
Re: stupid question
« Reply #3 on: 2006-01-16, 01:20:05 PM »
also, how is the sprite speed measured? is a speed of 1 1pixil-per-frame?
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

cbass

  • Expert
  • Regular
  • *****
  • Posts: 97
  • script this
    • View Profile
    • Squest RPG
Re: stupid question
« Reply #4 on: 2006-01-16, 05:57:58 PM »
Yes speed is pixel's per frame.


Edit,

Ahhh, let me guess what you're doing.  you must be creating a path with a certain frame delay that delays exactly one animation sequence and then does something (Deletes spite or raises an event at end of path)  Hense you need the exact length of an animation in frames.  I think we determined this formula once before and its pretty helpful to have, and lots of games use or could use this.  Thanks for figuring it out.

Speaking of which, Bluemonk, if you ever make another 1.4x version I have a few suggestions about sprites.
you should have this as one of the autodelete options "Delete sprite after 1 animation sequence"
Also, let us activate special functions or raise events on any of these autodelete options.  I have found this a very hard thing to do with script.  (We have a "OnCreateSprite", why not an "OnRemoveSprite"?
There are also several bugs I found dealing with the IDE, but I haven't had time to try to reproduce them.  One of them was pretty nasty and closed the application  without letting me save my work.  If you want me to try to reproduce these before you release another version, give me a buzz.
« Last Edit: 2006-01-16, 06:21:32 PM by cbass »

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
Re: stupid question
« Reply #5 on: 2006-01-16, 08:21:28 PM »
heh, yea i know you did, but i couldnt find it and i've asked for it on like 3 seperate occasions but keep forgetting it.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: stupid question
« Reply #6 on: 2006-01-16, 10:05:02 PM »
I know that the IDE bugs would be simple to fix (relatively, anyway).  In comparison, the changes of activating special functions on auto-delete and deleting the sprite after 1 animation sequence would require a change in the GDP file format and the engine itself (respectively), which I'm not so sure BlueMonk would be entirely keen to do.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: stupid question
« Reply #7 on: 2006-01-17, 06:41:00 AM »
My intention of not releasing any more 1.x versions will probably stick this time.  As for the IDE bugs, anybody with VB6 could fix those locally (just an idea, not an excuse).  For that matter thay could change the behavior however they want and distribute their own GDPlay.  I believe SourceForge has a "Patches" section for every project and I could post others' updates there, but 1.4.6 will be the last official 1.x release.  Any further GameDev 1.x updates will probably have to make their way around on the "black free-for-all" (as opposed to the black market) ;).

cbass

  • Expert
  • Regular
  • *****
  • Posts: 97
  • script this
    • View Profile
    • Squest RPG
Re: stupid question
« Reply #8 on: 2006-01-17, 06:20:55 PM »
Yeah, both the sprite additions and/or adding another event would destroy any hope for backwards compatibility.  If i ever find the motivation to do it I probably will, although my solution might not be as elegant and i may not even attempt to offer backwards compatibility.

I couldn't recreate the "overflow" hard crash, which occurred when adding tiles to a tile animation.  I did recreate a slight problem when renaming a special function it won't auto update the name in the "If save exists" list-box of the Save/Load Game option if the renamed function was selected before.  Pretty minor problem as I don't think this particular special function is used that often, let alone its target renamed.