Turn off animations

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
gandalf
Posts: 157
Joined: August 24th, 2003, 4:15 pm
Location: Sweden

Turn off animations

Post by gandalf »

I would really like to do that. But I know some people like it, so perhaps there should be a switch for this? Or perhaps even better, to disable it at compile time?
If this will not be done, I'd be happy to try to do this my self if someone could help me explain what to look for in the code.

The reason for this: Everything should be as fast as possible.

Irrevenant: Subject edited: of->off
Angband, the ultimate FPS game!
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Isn´t that already possible?
First read, then think. Read again, think again. And then post!
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

isn't the turbo enough for you ?????

since you say you are ready to code it, here is a little assignment for you

:twisted:

you should take the display class (in display.hpp and .cpp)
add a member function get_acceleration()

this function should be {return turbo?5:1;}

then look at all calls to "start_animation" and "restart_animation" and edit them to use that new function to have them your new function

submit the patch the usual way (patches.wesnoth.org)

I don't guarentee it will be in 1.2 but I will include it later
Fight key loggers: write some perl using vim
shevegen
Posts: 497
Joined: June 3rd, 2004, 4:35 pm

Post by shevegen »

I too would like to have the option to switch it off.
At least I strongly believe that the animation is in part responsible for a
slight speed delay, and I rather want to focus on the strategical
aspect of the game than on the eye candy.

In the source of display.cpp I only found one line referring to
start_animation:

Code: Select all

147  flags_.back().start_animation(rand()%flags_.back().get_frames_count(), animated<image::locator>::INFINITE_CYCLES);
There was another line which referred to invalidate_animations();

Code: Select all

 817   invalidate_animations();
Then some more lines such as

Code: Select all

2046 void display::invalidate_animations()
and

Code: Select all

2063       if(builder_.update_animation(loc) || (map_.is_village(loc) && animate_flags)) {
Hmm and about two more lines
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

no, I wasn't very clear, I guess

display is a class, which contains a member
bool display::turbo()

I want you to add a int display::acceleration() const member which would return the acceleration to use (currently 5 if turbo and 1 if not)

then, as a second step I want you to check every call to turbo() and look at all the turbo()?5:1 that are spread in the code and replace them by your brand new function

(I guess most of them will be in unit.cpp but probably not all)

and that's it

after that you can play with the actual turbo value (with a value of 10 animations will probably be entirely skipped)

hope this help

moving to coder's corner, BTW it's als public and fits better there
Fight key loggers: write some perl using vim
gandalf
Posts: 157
Joined: August 24th, 2003, 4:15 pm
Location: Sweden

Post by gandalf »

Wouldn't it be better to have the turbo as a value that can be set?
Angband, the ultimate FPS game!
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

probably, but once this is done making it a variable will be easy.

and I won't add it as a n option before 1.2 whereas the patch I described might go in
Fight key loggers: write some perl using vim
gandalf
Posts: 157
Joined: August 24th, 2003, 4:15 pm
Location: Sweden

Post by gandalf »

I think I've changed it now, but it's still very slow. And those annoying animations. If I recruite a lot of units of the same kind, SHIFT+CTRL+R works so very slow. Oh my... very annoying.
Angband, the ultimate FPS game!
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

did you try changing the 5 to 10 and see what it does ?

if your patch is ready, please submit it to patches.wesnoth.org

the freeze for 1.2 is quite strong now, but that will leave us time to proofread it together before 1.3
Fight key loggers: write some perl using vim
Post Reply