Latest Posts

Topic: idle animation

Dwarik

Topic Opener
Joined: 2009-05-11, 17:50
Posts: 42
Ranking
Pry about Widelands
Posted at: 2010-04-05, 23:36

SirVer, once we have multithreading in place i expect it will be fairly easy to launch a dummy thread at startup that just prefetches all data. might not work on systems with low ram but should work miracles on more powerful systems


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1440
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2010-04-06, 00:00

Dwarik, while testing I mostly launch directly into the editor or a scenario. I would therefore not benefit much by this. I would benefit from faster graphics loading ;).


Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-04-06, 17:28

It's true that the characteristics of 0A.D. are somewhat different, but they still have to deal with many small files that affect seeking. So it's even possible that we might get a larger speedup from using their techniques.

(I've worked with Jan for a short while on 0A.D., but we've never met in person. I wrote an e-mail to him, let's wait and see.)


Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-04-08, 23:27

The thesis is available in the 0ad SVN repository, see here: http://trac.wildfiregames.com/browser/ps/trunk/docs/io_thesis.pdf

I have not looked into the technical details of hooking this up into Widelands, but I'm sure it shouldn't be too hard.


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1440
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2010-04-09, 10:29

I had a quick look at the thesis. The proposed techniques are packings things up into zip archives in which files are ordered by access, so that they can be read sequentially. The compression reduces file size and the archive reduces seeks and stats(). The loss would be that the files are readily available and viewable without unpacking. We already have this implemented in a way via our ZipFile system; i think it is likely that zipping the tribes and worlds directory up would already improve performance. The loss is too big though.

The idea to order these zip archives by access is appealing, but without archives, this won't work.

I guess the thesis has not too much for us.


Top Quote
Dwarik

Topic Opener
Joined: 2009-05-11, 17:50
Posts: 42
Ranking
Pry about Widelands
Posted at: 2010-04-09, 11:08

converting to mng should gain us some of the benefits already.

After that we can try zip/tar/other archives

Might also be worthwhile to look at a discussion about different compression formats for the linux kernel. as well.

But to return to the discussion about idle animation. what do people think about the other parts about idle animations?


Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-04-09, 21:17

Well, 0ad obviously also work on the individual files for development. The point is that the zipping up is done automatically and transparently, based on some profiling information (though it's not clear how much the profiling actually helps). So you have the benefits of the zip file speedups without any of the development-related drawbacks.

Of course, if the artists find MNG easy to work with, there's nothing to say against it (considering that it might have benefits like more intelligent compression across frames), and just adopting MNG might be somewhat easier. My point is that there are ways to do this that don't mess with the artists' workflow. If the artists are happy with MNG, then of course MNG should be used (though the two things are of course not mutually exclusive, considering we'd still load a significant number of MNGs given all those different walking animations).

Idle animations: I like the idea of having idle animations for the carriers. I would implement them slightly differently though; I believe that we should just define a program called "idle", and then this program determines whatever the carrier does. Usually it should just have an animate command, or some randomized selection of animate commands. I don't think savegame compatibility is going to be a problem in that case, unless you want to remove an existing idle animation. But a) I don't think we want to do that, and b) even in that case, savegame compatibility shouldn't be a problem.


Top Quote
Astuur
Avatar
Joined: 2009-02-28, 10:08
Posts: 733
Ranking
One Elder of Players
Location: Frankfurt / Germany
Posted at: 2010-04-19, 08:12

Just an idea, maybe slightly off topic and no idea, whether it's worth the work --IANOP (I am not a programmer)

One of the things you will certainly take care of, is that these idle animations do not appear to be synchronized - like the new (R15) animated flags easily do, and in the case of CTRL+S created flags indeed are. (http://wl.widelands.org/forum/topic/432/) I wonder if such a system that plays these animations at random intervalls would not be a nice alternative for the animated flags as well? Instead of playing any animation continuously looped)


Being no programmer, I apologize for all my suggestions that imply undue workload and for other misjudgements due to lack of expertise or relevant skills.
I am on Win32, have no means to compile, and rely on prefabricated distributions (Thanks to Tino).

Top Quote
chuckw
Avatar
Joined: 2010-03-15, 16:23
Posts: 945
Ranking
One Elder of Players
Location: New York - USA
Posted at: 2010-04-23, 15:44

Questions

Regarding the size (i.e. # of frames) of the individual animations:

1) Does it make any great difference in memory usage (and/or performance) if an animation is portrayed, for example, in one 150-frame segment versus 3 50-frame segments that were always run contiguously in the same order? Which approach would be preferred?

2) Would that change if using mng format?


Regarding animation control:

Pardon my ignorance of the entire potentials of the conf files as they now stand.

1) Is there currently the capability to define an arbitrary animation sequence in the conf file without deeper coding changes given the appropriate trigger(s) and graphics are in place?

2) What are the drawbacks of providing the ability to spawn new animation cycles solely via the conf file?

3) Could the rate of travel in walk cycles be controlled via conf file parameter(s)?

4) Could a sequence of multiple animations be "scripted" either in the conf or some other vehicle? And the execution of those scripts be controlled from the conf file?


I see little people.

Top Quote
ixprefect

Joined: 2009-02-27, 14:28
Posts: 367
Ranking
Tribe Member
Posted at: 2010-04-23, 19:24

chuckw wrote: Questions Regarding the size (i.e. # of frames) of the individual animations: 1) Does it make any great difference in memory usage (and/or performance) if an animation is portrayed, for example, in one 150-frame segment versus 3 50-frame segments that were always run contiguously in the same order? Which approach would be preferred? 2) Would that change if using mng format?

The number of frames shouldn't make a difference, and using one single contiguous 150-frame animation would be preferred, as it is both logically consistent and involves slightly less overhead. The situation changes only if some of those 50-frame segments could be used in more than one idle animation.

Regarding animation control: Pardon my ignorance of the entire potentials of the conf files as they now stand. 1) Is there currently the capability to define an arbitrary animation sequence in the conf file without deeper coding changes given the appropriate trigger(s) and graphics are in place?

I don't think so.

2) What are the drawbacks of providing the ability to spawn new animation cycles solely via the conf file?

3) Could the rate of travel in walk cycles be controlled via conf file parameter(s)? 4) Could a sequence of multiple animations be "scripted" either in the conf or some other vehicle? And the execution of those scripts be controlled from the conf file?

Walking speed cannot be adjusted at the moment. Sequences of animations can be scripted inside the bob programs. E.g. when you have a lumberjack, it contains a program that describes how the lumberjack goes to a tree and cuts it etc. In this program, you can of course also specify multiple animations directly after one another.


Top Quote