Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Sprite loading issue  (Read 7005 times)

0 Members and 1 Guest are viewing this topic.

gato salvaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Sprite loading issue
« on: September 24, 2010, 05:40:03 PM »


Hi,

We're having an issue when trying to load character and object sprites on the scene, it takes far too much time to load. When the option "Streaming Animation" is active in the sprites editor, it loads normally but drops on framerate for a few seconds.
The question is if somebody can provide us any alternative to ease the loading time or some kind of preloading option maybe.

Many thanks :)
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sprite loading issue
« Reply #1 on: September 24, 2010, 05:48:34 PM »

what's the sprite / animation size?
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

gato salvaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Sprite loading issue
« Reply #2 on: November 01, 2010, 04:03:16 PM »

Sorry I think I explained myself wrong
For every action of the actor (with their directions) have a number of sprites (each has about 23 frames). When loading the game takes so long and there comes a time when the engine shuts down giving an error memory failure, because when the game is loading comes to use almost 2GB RAM, when the compiled set weight only 250 MB.

The  ".actor" I have it set so (as has been the default):
Code: [Select]
ACTOR
{
  NAME = "Toalla"
  CAPTION=""
  SCALABLE = TRUE
  INTERACTIVE = FALSE
  X = 400
  Y = 460
  SCRIPT="actors\Toalla\Toalla.script"

  FONT = "fonts\outline_red.font"
 
 
 
  ANIMATION
  {
 
 

     NAME = "idle"
LEFT       = "actors\Toalla\ll\stand.sprite"
RIGHT      = "actors\Toalla\rr\stand.sprite"
UP         = "actors\Toalla\uu\stand.sprite"
DOWN       = "actors\Toalla\dd\stand.sprite"

UP_LEFT    = "actors\Toalla\ul\stand.sprite"
UP_RIGHT   = "actors\Toalla\ur\stand.sprite"
DOWN_LEFT  = "actors\Toalla\dl\stand.sprite"
DOWN_RIGHT = "actors\Toalla\dr\stand.sprite"

  } 

  ANIMATION
  {
 
 
   NAME= "walk"
    LEFT       = "actors\Toalla\ll\walk.sprite"
    RIGHT      = "actors\Toalla\rr\walk.sprite"
    UP         = "actors\Toalla\uu\walk.sprite"
    DOWN       = "actors\Toalla\dd\walk.sprite"

    UP_LEFT    = "actors\Toalla\ul\walk.sprite"
    UP_RIGHT   = "actors\Toalla\ur\walk.sprite"
    DOWN_LEFT  = "actors\Toalla\dl\walk.sprite"
    DOWN_RIGHT = "actors\Toalla\dr\walk.sprite"
 

  }

ANIMATION
  {
 
 
   
NAME= "talk"
    LEFT       = "actors\Toalla\ll\talk.sprite"
    RIGHT      = "actors\Toalla\rr\talk.sprite"
    UP         = "actors\Toalla\uu\talk.sprite"
    DOWN       = "actors\Toalla\dd\talk.sprite"

    UP_LEFT    = "actors\Toalla\ul\talk.sprite"
    UP_RIGHT   = "actors\Toalla\ur\talk.sprite"
    DOWN_LEFT  = "actors\Toalla\dl\talk.sprite"
    DOWN_RIGHT = "actors\Toalla\dr\talk.sprite"
 
 
  }

 ANIMATION
  {

NAME= "turnleft"
    LEFT       = "actors\Toalla\ll\turn.sprite"
    RIGHT      = "actors\Toalla\rr\turn.sprite"
    UP         = "actors\Toalla\uu\turn.sprite"
    DOWN       = "actors\Toalla\dd\turn.sprite"

    UP_LEFT    = "actors\Toalla\ul\turn.sprite"
    UP_RIGHT   = "actors\Toalla\ur\turn.sprite"
    DOWN_LEFT  = "actors\Toalla\dl\turn.sprite"
    DOWN_RIGHT = "actors\Toalla\dr\turn.sprite"
 
 
  }
 
  ANIMATION
  {
 


NAME = "turnright" 
    LEFT       = "actors\Toalla\ll\turn.sprite"
    RIGHT      = "actors\Toalla\rr\turn.sprite"
    UP         = "actors\Toalla\uu\turn.sprite"
    DOWN       = "actors\Toalla\dd\turn.sprite"

    UP_LEFT    = "actors\Toalla\ul\turn.sprite"
    UP_RIGHT   = "actors\Toalla\ur\turn.sprite"
    DOWN_LEFT  = "actors\Toalla\dl\turn.sprite"
    DOWN_RIGHT = "actors\Toalla\dr\turn.sprite"
 
 
   
}

Thank you very much for your help
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Sprite loading issue
« Reply #3 on: November 01, 2010, 05:52:16 PM »

And what are the dimensions of those frames?

Generally speaking, hardware is not without limits, and creating games is always about making compromises. You should ask yourself if you really need so many animations frames and/or so large animation frames.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

gato salvaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Sprite loading issue
« Reply #4 on: November 01, 2010, 07:38:14 PM »

Many thanks for responding so quickly,

The size of each .png is about 165KB, wich doesn't seem too excesive IMO. It is necessary for us to have this number of frames for each sprite.
What I cannot understand is the fact that the game takes 2GB RAM to load, I can't really find any explanation for it. I've been reading about the methods "actor.MergeAnims()"
and "actor.UnloadAnim()" but I'm not quite sure about how to use them though.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Sprite loading issue
« Reply #5 on: November 01, 2010, 07:41:45 PM »

Again, what are the dimenstions (width/height) of the frames?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

gato salvaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Sprite loading issue
« Reply #6 on: November 01, 2010, 08:01:55 PM »

Sorry!
width:1280
height:768
Mostly transparency provisionally
Very much thanx!
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Sprite loading issue
« Reply #7 on: November 01, 2010, 09:21:10 PM »

So your character has 40 sprites and with 23 frames each you have 920 HD (1280x768) images that has to be loaded. Keep in mind that the size of the png doesn't matter because in memory images are uncompressed so it's easy to see why you run out of memory. If you want to have super smooth character animations then you should use 3D characters. If you have to use 2D then reduce the frames and the resolution of images.
Logged
fl*p

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Sprite loading issue
« Reply #8 on: November 02, 2010, 01:59:59 PM »

Just for additional Explanation:
The filesize itself doesn't say anything, because it's compressed. If your image is 1280x768, you could calculate for example, that it would take approx 1280x768x4 Bytes of memory, which makes abot 4 MB per frame. If you now tell us, you have 23x8 frames, that single character eats up 4x23x8 MB of Memory, which are already 736 MB ....

So you HAVE to reduce the dimensions of your frames... Make it as small as possible, and crop as much transparency as possible....

Greets,

Spellbreaker.

Sorry!
width:1280
height:768
Mostly transparency provisionally
Very much thanx!
Logged

gato salvaje

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Sprite loading issue
« Reply #9 on: November 02, 2010, 02:07:31 PM »


Thank you very much, we will follow your advice. :)

Another question is whether we can use different actions in each stage, ie, walk, talk... to each scene.
How and where can I define to have them load when I want?Will do much to the engine? ::slug
Logged
 

Page created in 0.041 seconds with 23 queries.