Pause the game to save the Planet!

General feedback and discussion of the game.

Moderators: Forum Moderators, Developers

neila
Posts: 10
Joined: March 23rd, 2009, 5:01 pm

Pause the game to save the Planet!

Post by neila »

Even while no one on this world really acts, still media (at least in Europe) is full of articles and news about global warming. This is going to be one more.

As potential member of the still to found “wesnothian movement to make wesnot a ‘green product’ “, I first have to tell you that humans tend to ask for technical solution (a car that uses no gasoline) instead of changing their behaviour (don’t take the car to check the letterbox). The reason why people do so is because they are lazy! Since wesnoth is NOT a green product (I will tell later why) the players have to change to save our planet!

Another lesson to learn is that in modern computers “local warming” and global warming are in a direct relation: The more heat your computer makes, the higher your electricity bill gets. CPU and GPU usage stands in a direct relation to energy consumption. On system that are able to dynamically adjust core voltage, even above linear.

The simple solution is to press “ESC”, open a menu, or any other dialog within wesnoth whenever possible, specially in MP when waiting for opponent players to move and in single player when going afk.

My wesnoth friends call this: “Pause the game”. Not to be confused with pausing the replay option for observers in multiplayer, or pausing replay in the replay view mode. Those modes have to be avoided since they might make you forget to “really” pause the game.

By doing so, 10 million wesnoth players can immediately make a whole large power plant dispensable, preventing tons and tons of additional carbon dioxide unleashed to the atmosphere.

So all please support the PAUSE WESNOTH TO SAVE THE PLANET! Campaign by linking to this posting.


In fact building a car that uses less petrol is not an easy task. But making a turn based strategy game, whith every setting that mentions “animation” turned OFF to NOT utilizing nearly a full CPU core running at over 2GHz when idling, should not be that hard.

PS:
Im actually very interested what framerate my hardware is doing on several mp maps.

User avatar
Iris
Site Administrator
Posts: 6692
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Pause the game to save the Planet!

Post by Iris »

neila wrote:PS:
Im actually very interested what framerate my hardware is doing on several mp maps.
Wesnoth’s framerate is capped (AFAICT) at 50 by default. You can see the current framerate in-game by using the :fps command. You should note, however, that this is the framerate of the Wesnoth renderer; in practice, your graphics processor will be swapping pages more often than that, depending on your monitor’s vertical refresh rate, application activity (with either onscreen or offscreen video RAM surfaces), and regardless of whether Wesnoth is running or not. Modern compositing window managers tend to do a lot of work with offscreen surfaces, in particular.

You should also note Wesnoth works only with surfaces allocated in system RAM and manipulated with your CPU, and doesn’t use the graphics processor directly. SDL on Windows probably defaults to using DirectDraw interfaces to render the final framebuffer and that might involve paths using the GPU to accelerate the process, but that’s about it.

EDIT: clarified some information.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14).

User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: Pause the game to save the Planet!

Post by Crow_T »

Just buy a smaller car, really looking to wesnoth for environmental responsibility? What about Wow or everquest servers, etc. There is a bit of nickel and dime- micro management stuff happening here.

User avatar
doofus-01
Art Director
Posts: 3907
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Pause the game to save the Planet!

Post by doofus-01 »

When my laptop is just idling, only background processes running, it uses 37-39 Watts. When I start up wesnoth, it peaks to 52 Watts, then quickly falls back to 38-41 Watts. A newer computer would probably use less power. This is not significant compared to anything else done with electricity, like use the stove or turn on a light.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

User avatar
Zerovirus
Art Contributor
Posts: 1693
Joined: July 8th, 2009, 4:51 pm

Re: Pause the game to save the Planet!

Post by Zerovirus »

I see the joke has gone over the heads of everybody present.

User avatar
enchilado
Posts: 100
Joined: March 25th, 2011, 8:44 pm
Location: Australia

Re: Pause the game to save the Planet!

Post by enchilado »

I gave this a go yesterday evening and was frankly astounded by the results. The temperature dropped from about 25° to 15° in just a few hours. I'd also been to the beach and placed a stick at the waterline and, returning later that night, I found that it had gone down by over a metre. The atmosphere is also noticeably clearer - before trying this I could see just a single star in the sky; now, I can see thousands.

I recommend that everybody do this. It truly makes a difference.
Last edited by enchilado on May 14th, 2012, 2:40 am, edited 2 times in total.

User avatar
doofus-01
Art Director
Posts: 3907
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Pause the game to save the Planet!

Post by doofus-01 »

Zerovirus wrote:I see the joke has gone over the heads of everybody present.
Hrm. Kids these days have a strange sense of humor then.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

neila
Posts: 10
Joined: March 23rd, 2009, 5:01 pm

Re: Pause the game to save the Planet!

Post by neila »

I see that it was maybe not a good idea to combine humour with an actual issue, in this forum.

But let me point out what I complain about.

When having a game with a larger map running the CPU utilization is quite massive to just repaint the screen 50 times a second. This is NOT the case in any of wesnoth’s dialogs, the starting screen or even when a menu is opened, but most of the time it is.

On my Core2Duo based notebook running winXP, the difference of wesnoth being “paused” vs normal idle (by having all animations turned off) is on larger maps 5% vs 45% CPU utilization. (for non winXP users: 50% would mainly mean that 1 of the 2 cores is totally used.) With map and idle animations turned on, the CPU usage is slightly higher.

So why I’m “complaining”?

Wesnoth is opensource software, so higher expectations in some areas (that commercial games would not address at all) are from my point of view valid. A RTS game made by blizzard or whatever, would most likely not feature 6 (!) balanced factions (in a 1v1 game this makes over 20 different setups to balance, to much for a profit oriented company). Similar with wesnoth handling of gender/sex in units, translations and support for multiple platforms. In those aspects commercial games can hardly compete with wesnoth. (respect to everyone who contributed to this!)

But also wesnoth is a turn based game, it focuses more on tactic and strategy, than it does on graphics. Graphics has been getting better and better over the time (good work).
But there is a difference in Graphics and Animation. In a TurnBased game, animations are not only making things better, while no one would complain about better graphics, animations of static things shell not be needed to play the game. I mean if a unit moves or performs an attack, players want to see (and possible hear) this. But when nothing changes, many players don’t want anything to move.

Wesnoth’s options already do great here, since map, units idle and attack animations can be turned on/off separately. Good job!

But, having those animations turned off, the game still redraws the screen in a constant loop, only caped by a fixed framerate of 50fps. People using mobile computers like me, can hear the difference and its annoying.

And of course there really is an increase in power consumption here. Doofu’s test scenario most likely did not included having a real map loaded, since I already explained that there is no relevant CPU usuage in the other cases. This is of course not realy making a global change (unless wesnoth gets millions of players), but the noise of my fan is reason enough to ask for change. Also some people might want to play it on battery power..

A TBS game don’t have to redraw the screen when nothing moves and the player is not scrolling around. This might even speed up AI moves and has many more benefits than “going green”

EDIT: I still want my initial post to be seen as a tip to players, and not only as an sugestion to change the wesnoth core! (that's why its not posted in the otherwise more apropriate forum)

User avatar
Iris
Site Administrator
Posts: 6692
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Pause the game to save the Planet!

Post by Iris »

neila wrote:But, having those animations turned off, the game still redraws the screen in a constant loop, only caped by a fixed framerate of 50fps. People using mobile computers like me, can hear the difference and its annoying.
That the framerate is 50 frames per second does not require each frame to be actually painted all the time. Most of the time, Wesnoth refreshes only parts of the screen that are marked as actually changed between each frame. Whether that is actually implemented as a complete repaint or not with a given platform and backend would be SDL’s decision, not ours. At least here, it isn’t, or CPU usage would be absurdly high while idle.

Taking a look at DW scenario 1 in trunk with animated terrains disabled and with some help from my window manager, it seems non-animated units (which are internally implemented as trivial standing_animations) cause their surroundings to be occasionally invalidated when unit animations are enabled. Still, average CPU usage in this situation stays below 4% (it will never go below 3% for some reason).

Tooltips, chat lines, and map labels seem to cause an absurd number of invalidations of their affected areas all the time, though. Perhaps this is the cause of your problems rather than “large maps”.
neila wrote:Wesnoth is opensource software, so higher expectations in some areas (that commercial games would not address at all) are from my point of view valid.
That’s your point of view as a user who appears to have mistaken open-source for “better QA” — which would be completely wrong. My point of view as a contributor and mainline developer is that we don’t have any experts working constantly on auditing or optimizing whatever new code we produce.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14).

Kamamura
Posts: 112
Joined: January 19th, 2005, 1:04 pm

Re: Pause the game to save the Planet!

Post by Kamamura »

If you really want to save the planet, don't have any children, or, if you can't help it, don't have more than 1, especially if you live in developed world, America or Europe. Each new child in developed countries surrounded by comfort consumes immense amount of resources during his/her life.

Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Pause the game to save the Planet!

Post by Alink »

I often worked on this in the past and added some debug commands which provide useful info about this:
- ':debug' + ':sunset' allow to visualize which part of the map we actively redraw. It also works for dialogs but there are some subtleties about GUI1 and GUI2. Note that we don't redraw the sidebar (to verify: hit escape, wait few seconds, hit escape again)
- ':debug' + ':fps' show the number of hexes redrawn, which is the main indicator of the performance cost of animations. Almost everything triggers hexes invalidations, but the main exception is floating text, which are indeed redrawn every frame (plus we redraw their background). This is probably only relevant for big tooltip, though.
- ':benchmark' to see how much it costs to actually redraw the whole view each frame and what fps you would get.

With these tools you can easily check what triggers redraw. If a map seems slow, use :sunset to locate the culprit (terrain or units animations), use :fps to get some hex numbers, switch the relevant setting and check the number again.

To lower your CPU cost:
- disable animations
- reduce your window size (less hexes to redraw)
- start wesnoth with '--max-fps 30' to overwrite the 50 default. Note that '--max-fps 1000' will refresh the screen as fast at it can (here >300fps) but that doesn't mean that we redraw something each time. Only animation update triggers some redraw.

On a side note, seeing the variation in reported numbers, I always suspected that there is some performance difference due to operating system/driver/library.

[edit: I forget to agreed with the initial post, it's really a good idea to let your CPU rest when AFK or alt-tabbing. I personally use right-click to open the context menu]
[edit2: fixed typo in --max-fps]

User avatar
Iris
Site Administrator
Posts: 6692
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Pause the game to save the Planet!

Post by Iris »

Alink wrote:Almost everything triggers hexes invalidations, but the main exception is floating text, which are indeed redrawn every frame (plus we redraw their background). This is probably only relevant for big tooltip, though.
It can actually get really awful here with the on-map chat backlog lines. You can increase Chat lines in Preferences → Multiplayer and spam :help commands to fill up the screen; the CPU usage should increase considerably while idle until you :clear the backlog, even if all other animations are disabled or there’s nothing to animate whatsoever.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14).

Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Pause the game to save the Planet!

Post by Alink »

shadowmaster wrote: It can actually get really awful here with the on-map chat backlog lines. You can increase Chat lines in Preferences → Multiplayer and spam :help commands to fill up the screen; the CPU usage should increase considerably while idle until you :clear the backlog, even if all other animations are disabled or there’s nothing to animate whatsoever.
Indeed, I often forget about Chat lines (not playing much MP), and it was even worse in the past, I think. At least I remember a time where it was one of the main bottleneck, and probably still is on a static map.

In theory, this could be optimized by incorporating them into the hex invalidation system. It's some work and it needs some care to be a true gain in every cases, mainly because they are much bigger than one hex, and thus it may trigger chain reaction of invalidations. So, less frequent redraw but much more work when it happens.

SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Pause the game to save the Planet!

Post by SlowThinker »

Alink wrote:- ':debug' + ':sunset'
- ':benchmark'
These options are missing in the --help report.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums

Alink
Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: Pause the game to save the Planet!

Post by Alink »

SlowThinker wrote:
Alink wrote:- ':debug' + ':sunset'
- ':benchmark'
These options are missing in the --help report.
Those are in-game console commands, not command-line parameters. They are in the in-game ':help'. But they are indeed not in the manual, not even sure if they need to be, since they are mainly for developers doing debugging/optimization.

Only '--max-fps' is a command-line parameter and thus in the '--help' report

Post Reply