Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Delay when changing sprites  (Read 2865 times)

0 Members and 1 Guest are viewing this topic.

Art

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 54
    • View Profile
Delay when changing sprites
« on: October 13, 2004, 12:44:19 PM »

Hallo.
I've got a problem
I have got several sprites for one character, which should be changed in some different sequences.
For example i play first sprite, then second, then again first and after that - third
So after first sprite i can play second or third.
I use entity.PlayAnim method to choose next animation
There is a very annoying delay before staring new sprite

Is there any possibilite for preloading sprite into the game before first playing it?  ???

Thank you
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Delay when changing sprites
« Reply #1 on: October 13, 2004, 12:57:45 PM »

I suppose the sprites have lots of frames? Usually the loading time is fast enough...

Anyway, to preload the images, you can create a hidden entity in a given scene and attach a temporary animation to it. This animation would contain all the frames you want to preload. That way the images are loaded at scene startup and the sprite switching should be ok then.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Art

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 54
    • View Profile
Re: Delay when changing sprites
« Reply #2 on: October 13, 2004, 03:00:42 PM »

I see delay every time new sprite should begin, even when i don't leave scene.
Actually sprites are really big enough (about 2-3 Mb in 30 frames)
I plan to reduce size by converting them from 32 bit tgas to 8bit compressed bmps. I think this should help
BUT, why delay is seen even after sprite is loaded (after it has been played once)? It's seems to be strange...
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Delay when changing sprites
« Reply #3 on: October 13, 2004, 03:04:29 PM »

BUT, why delay is seen even after sprite is loaded (after it has been played once)? It's seems to be strange...
If the sprite is executed by PlayAnim only, it's unloaded from memory once it's finished. So in your case it needs to be loaded again from disk, hence the delay. If you use the method I described above, it should stay in memory all the time.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.036 seconds with 21 queries.