Website powered by

Developing Games for Devices with Batteries

Article / 19 May 2025

As someone who travels by train frequently, the best purchase I made in 2024 was a Steam Deck for playing games on the go. Being able to play PC games whenever I want still feels like a luxury to me because, for a long time, laptops couldn't handle modern games. Well, they could, but only if you were willing to spend a lot of money and endure the discomfort of a laptop burning your thighs.
However, hardware has evolved, and there is no shortage of laptops and handhelds that can handle the latest games with ease. Laptops have replaced desktops as the dominant form factor, and the Nintendo Switch has outsold the Xbox Series X and PlayStation 5 by a wide margin.
This means that if you're a game developer, there's a good chance your game is being played on a device that's not currently plugged in.
Unfortunately, most devices don't have great battery life. When playing very demanding games, both the Steam Deck and the Switch batteries last about two hours. That battery life only deteriorates over time. 
In fact, Valve is currently experimenting with limiting the Steam Deck's battery charge to 80% to reduce degradation. While this will help extend the device's life, it will further reduce the maximum length of battery-powered sessions.
If you're planning to play a game on a three-hour train ride, make sure you have your charger and sit next to an electrical outlet. Otherwise, your gaming session may end sooner than you'd like. As a game developer, this means that if you want people to play your game, it's important to ensure that your game doesn't use too much power. However, I don't often see power consumption mentioned when it comes to game optimization. It's a shame because there are often simple ways to improve the situation significantly.
So, I began researching the topic myself. Below, you'll find several techniques to improve your game's energy efficiency. They vary in effectiveness and the amount of effort needed. Not every approach works for every game, so think of this more as a list of ideas than a comprehensive checklist.

Measurements

Obviously, the first thing you need to optimize your game's power consumption is a power meter. I just ordered the cheapest one I could find:Although it doesn't offer any fancy extra features, it provides enough to confirm or disprove basic assumptions. Look at the display and enable the option in your game that you think will improve battery life. Wait a few seconds for the consumption to drop and stabilize. Then, note the new consumption rate. Since power consumption fluctuates greatly, repeat this process a few times to get an average.
Since the measurements aren't very precise, this approach only works for optimizing large differences in power consumption. To measure the impact of smaller adjustments, you need a device that allows you to track and average consumption over several minutes

Setup Notes

Before you begin, ensure your laptop's battery is fully charged so you're not measuring its charging throughput. Close any other software and disconnect your laptop from the internet to ensure your measurements aren't affected by background tasks. Note that power consumption can vary depending on factors such as room temperature or the surface on which the laptop is placed, so results from different days or locations aren't necessarily comparable.

Dark Mode

We're used to seeing dark modes on apps and websites. However, they are a rare exception in games. This is unfortunate, and not just for aesthetic reasons. OLED screens use different amounts of power depending on how bright each pixel is. Therefore, if your game has a lot of user interface elements, offering a dark mode can extend your battery life. This test shows that switching from a white to a black screen can save up to 15 watts.
Therefore, if your game has many full-screen menus, offering a dark mode can significantly extend the battery life.

Frame Limits

If you take only one piece of advice from this article, let it be this: Add a configurable frame limit to your game. While it's possible to limit the frame rate using tools like the Nvidia control panel or AMD Software: Adrenalin Edition, most users don't have these tools installed or even know they exist. Even if they did, it's much more convenient to have these settings in the game.
It's just good practice, not to mention that it can reduce your game's power consumption. Many modern monitors support refresh rates of up to 240 Hz. While that makes for a smooth image in office applications, most games won't ever reach those frame rates.
If you run a game without a frame limit on a screen with such a high refresh rate, the GPU will try to reach that high number. This will cause it to heat up and produce an inconsistent frame rate. Even if an uncapped frame rate is higher on average than a capped one, it won't necessarily feel smoother because it's so inconsistent.

This is especially problematic when neither the CPU nor the GPU has much to do. In these situations, the GPU isn't held back by the CPU and can render far more frames than necessary. On laptops, you may notice that the fans get louder when the menu is open because menu screens are an example of this scenario: The game wastes a lot of energy rendering static menus at an insanely high frame rate when the actual in-game frame rate is much lower.
Ironically, an uncapped frame rate can even reduce the effective frame rate because the GPU can overheat, causing the driver to reduce the clock speed. 
Even on 60 Hz displays, a frame limit is a valuable option because many people are happy to run their games at 30 fps, especially if it increases their battery life. Depending on the game, even lower fps may be acceptable.

VSync

It's impossible to discuss frame rate limits without also talking about Vsync. It often serves as a basic frame rate limiter because it caps the frame rate at the screen's refresh rate. However, some games don't even meet this standard and don't offer players a Vsync option. The first Witcher game is guilty of that sin:

It probably wasn't that noticeable back then, but on a modern PC, it's easy to reach several hundred fps during gameplay. Consequently, this game's power consumption may be higher than that of recent games like Baldur's Gate 3.
It would be a mistake, though, to think of VSync as a frame rate replacement. Since it causes additional input lag, many players prefer not to use VSync in fast-paced action games. If your game relies on VSync to limit the frame rate, players may choose not to use it. The screenshot below shows Tabletop Simulator running at over 600 fps with VSync disabled:

(I know the Tabletop Simulator isn't a game where input lag matters much, but bear with me. It's just an example.)

Profiling Results

First, I lowered my laptop's refresh rate from 240 Hz to 60 Hz to test the basic assumption that fewer frames means less energy consumption. This reduced its power consumption from approximately 45 watts to approximately 40 watts when displaying the Windows desktop. Not bad, but how does it perform with actual games?
Baldur's Gate 3 used 149 watts with an unlimited frame rate and achieved ~150 fps. Limiting the fps to 60 reduced power consumption to 112 watts, and limiting it to 30 fps reduced it to 93 watts. That's an impressive 38% less than without the frame limit. However, further reducing the frame rate only yielded a slight decrease in power consumption, dropping to 86 watts.

Optimize your Game

This section is different from the others because, even though it's technically plausible, I don't actually recommend this approach. The idea is simple. The less work you give the CPU and GPU, the less power they use. Therefore, reducing the workload and eliminating unnecessary calculations makes the game use less energy. However, this approach is naive and ineffective. Most games are already highly optimized. Optimizing for power consumption means optimizing everything, rather than focusing on the game's bottlenecks as you would when optimizing for frame rate.
There probably isn't much potential left anyway because the game code is usually well optimized to begin with. Further optimizing the game would require a lot of effort and wouldn't be worth it.
However, there are exceptions to this rule. One of them is menus:

Optimize your Menu Screens

Menu screens are often overlooked when optimizing games. As mentioned above, the goal is to optimize bottlenecks and problematic situations, and menu screens are typically not an issue. The gameplay is paused, and no new assets need to be streamed in. If it's the main menu at the start of the game, then most things that could cause performance issues haven't been loaded yet. Therefore, menu screens are often not optimized very well. However, when optimizing the game's power consumption, menu screens offer significant potential savings with minimal effort. If you expect your players to spend a significant amount of time in the menus, it may be worth your time to optimize them.

Example Implementation in Unreal

The Lyra Starter Game project, provided by Epic for Unreal users, is a good test case for this. This is what the settings menu looks like in this game:

Technically, the game world is still visible, but it's so dark and blurry that it might as well not be. Let's replace the background blur widget with a tiling texture:

Visually, the result doesn't look very different, but the actual game world is no longer visible. However, the game isn't paused, and the game world is still rendered even though it's not visible. The game still uses as much energy as during gameplay: around 91 watts in my tests. This can be easily fixed by stopping the rendering as soon as the menu is opened using the Set Enable World Rendering node:

(Remember to call this node again when closing the menu to ensure the world is rendered again.)
Opening the same menu with world rendering disabled results in a 35% decrease in power consumption, from 93 to 59 watts. You could save even more energy by pausing the gameplay logic while in the menu.

If you really want to keep the transparent menus, you can take a screenshot when you open the menu and display that while the menu is open. If you don't want to pause the game or change the background, you can reduce the rendering resolution instead. Since the game is blurred anyway, even ridiculously low resolutions are fine:In this screenshot, the screen percentage is reduced to just 10%. In case you are not familiar with how screen percentage works in Unreal: It scales the internal resolution used to render the image. For example, if the output resolution is 2560x1440 and the screen percentage is 10%, then the internal resolution is 256x144 pixels. This means the number of pixels rendered drops by 99%!
Such a low resolution would be unacceptable in any other situation but is perfectly fine for a blurred menu background. It's not as efficient as disabling the rendering completely, but in my tests, the power consumption was just slightly >60 watts.


One might argue that most players don't spend much time in the settings menu, so this change has an insignificant impact. While this may be true for the settings menu alone, the impact adds up when applied to other full-screen menus. In multiplayer shooters, a significant portion of every game session is spent in the main menu, server browser, map selection, loadout customization, lobby, and so on. In other genres, such as RPGs, simulations, and strategy games, large portions of the gameplay often occur in separate menus that hide the game world completely, making this an even more effective optimization.

Add more Scalability Settings

Similar to the frame limit, this tip is a no-brainer. Scalability settings allow users to decide how much battery life they are willing to sacrifice for better graphics. It's important for more than just that, though. Many developers forget how many old PCs and laptops are still in use. So, even if you have low, medium, and high settings, take a step back and think about how much time it would take to implement a very low setting. Not that much, right? Don't worry if things look ugly; it's better than not being able to play the game at all. If the game looks too bad on the lowest settings, people can choose not to play it with those settings. Without them, however, they might not have that choice.
When it comes to power consumption, pay special attention to the upsampling options. On small handhelds like the Steam Deck, for example, the effective resolution can be quite low yet still acceptable.

Profiling Results

In Baldur's Gate 3, using DLSS Performance instead of Quality reduced power consumption from 112 to 101 watts. To ensure that the performance savings actually saved energy and didn't just increase the fps, I limited the frame rate to 60 fps when testing this.

Save Energy when no one is watching

Obviously, the worst way to use your battery charge is to render a game that isn't currently being played. Perhaps the player put their laptop down to get coffee, use the restroom, talk to their seat neighbor, check their phone, or fell asleep. Still, the game is running, completely unfazed. The solution is surprisingly simple: Measure the time since the last player input and enable energy-saving options once a threshold is reached. This doesn't have to be as invasive as turning off the screen, like on mobile phones. You could just reduce the resolution or the maximum frame rate. If you're interested in this approach, this white paper from Epic about Fortnite's power-saving options is a good starting point and also goes into some Unreal-specific implementation details.

In Fortnite, the resolution only changes in front-end screens, such as the lobby. However, nothing is stopping you from doing this during gameplay. That being said, this works better for some games than for others. In a simulation game like The Sims, for example, if the player isn't touching the controls, it could mean that they're observing the simulation to see how it unfolds. In games with lengthy cut scenes, you may want to pause this feature whenever a cut scene starts. In a shooter or racing game, though, you can safely assume that the player isn't playing after just a few seconds of inactivity.
The whitepaper also covers focus detection. When running on Windows, focus detection allows you to enable energy-saving settings when the game window is in the background. While we all want our game to be the sole focus, many players have their browser open while gaming to look at walkthroughs, check mails, and do other things. For these players, this optimization can make a real difference.

Detect whether you're running on Battery

One of the most obvious steps you can take to reduce your game's impact on battery life is to determine whether your game is running on a battery-powered device. This allows you to automatically adjust settings when the device is unplugged.

Unreal

In Unreal, you can use the IsRunningOnBattery() function. This function is implemented for each platform. For Windows it looks like this:

The function only returns a bool, to be consistent with the corresponding functions for other platforms, but internally, it also has information about the currently available capacity, so you could implement your own function that returns that instead.
Pro tip: When playing a game, it's easy to overlook Windows' low battery warnings. Perhaps your game could take over the responsibility of warning the user when the battery is about to run out.

Unity

In Unity, you can get the current battery status from the System Info.

Closing Thoughts

I'm not sure how each of the mentioned techniques applies to your game, but I'm confident that using them will improve its energy efficiency.
Although this article focuses on improving battery life, I want to emphasize that creating energy-efficient games has many benefits beyond battery life.
Even if you expect all your players to use PCs or consoles connected to the grid, overheating GPUs and loud fans didn't exist, and all players got their power from renewable energy, improving energy efficiency would still be worthwhile.
When you develop a game, you create something that potentially thousands of people will play. Therefore, every time you change something in your game to consume less energy, the cumulative effect across thousands of devices adds up. While I'm aware that video games' contribution to climate change is minimal, I hope you take pride in ensuring that they don't contribute more than necessary.




If you enjoyed this article or found it useful, please share it with others! If you have any comments, questions, or feedback, please post them below. To get informed about new articles, follow me on Artstation, on Mastodon or Bluesky.

You can also find this article on my WordPress blog.

File Size doesn't matter (unless it does)

Article / 25 October 2024

When discussing optimization goals for games, the two key goals are usually higher fps and staying within the memory budget. These goals then inform subsequent decisions about what rendering features to use, how many assets to place in levels, etc.
One metric that isn't usually considered a priority is the size of the game on the player's hard drive. And that makes sense: hard drives are getting bigger, most people have reasonably fast Internet connections these days, and once the game is running, the size of the game files usually doesn't have a noticeable impact on the gameplay experience. Especially for smaller indie developers, reducing the size of their game isn't worth the effort. But as always, there are exceptions to the rule, and depending on the game you're developing and the audience you're targeting, keeping the size in check can be a good idea. This article is meant as a reminder to check if your game could benefit from shrinking.
Disclaimer: I'm mixing several things here. While related, the size of a game installed on a hard drive can differ from the download size, because the game is often compressed for the download, or the game creates additional files during the installation. And the size of the game files during development is an entirely different topic, depending on how many of the files you're using during development actually end up in your packaged game. Still, for the purpose of the article, I'm not differentiating between these sizes.

During Development

Especially for teams working remotely, keeping the size of not only the game under control, but also the files used during development, can really help. Even if your QA team only has to wait a few minutes every time they want to download a new build, it can add up quickly. And the rest of the team is probably also not too keen on having to take a coffee break every time they update their workspace in the morning. Smaller files reduce iteration time, make it easier to maintain multiple builds, and help people stay productive even when they have slow or unreliable Internet connections.

Bigger Target Group

The cheapest Steam Deck has only 128 GB of internal storage. A significant portion of that is reserved for the operating system. Therefore, big games like the latest Call of Duty games can't be played on the deck, even if no other game is installed, unless the user buys an SD card to expand the storage.
The Nintendo Switch has even less internal storage, only 32GB (64 for the OLED version)! While Nintendo Switch games tend to be smaller due to reduced texture resolutions and lower poly count meshes, it's easy for big games to exceed this size. NBA 2K23, for example, is 56GB, making it impossible to play on the original Switch without an additional SD card.
So if your game is that big, you might want to ask yourself if it's attractive enough for people to buy the extra storage just to be able to play it. It's also safe to assume that you're not the only game competing for users' storage space, and most players want to play more than one game on their device. So ideally, your game should be small enough that it doesn't take up most of the available storage space, so people don't have to choose between your game and other games they already have installed.

First time user experience

Especially when developing free-to-play games, the initial user experience is critical to success. When a potential player decides to try your game, you want the experience to be as smooth as possible. Downloading and installing the game should be as quick as possible so that people don't have time to get bored and abandon the game. This is especially important for free-to-play games because there is no buy-in from the player. People who have already spent money on your game will probably be patient enough to endure a lengthy download to see if the game is worth the cost, but with free-to-play games, people tend to quit at the first inconvenience. This is especially true for mobile games, where people are more likely to try new games on the spur of the moment.

Player retention

Because multiplayer and live service games are updated frequently, players are not done with downloading the game once. Call of Duty: Warzone Live Operations Lead Josh Bridge even admitted that the game loses players every time a new, big update comes out because people don't want to wait for hours while the game updates.  The problem is so bad that Sledgehammer Games even started implementing a system to stream in textures at runtime for Modern Warfare 2.

Distribution Cost

At least on consoles, physical media is still widely used. So it's a good idea to make sure that your game fits on a single disc, since every disc that needs to be pressed adds to the cost of distribution. On top of that, you need to figure out how to split the game into two parts, which may require some effort depending on the structure of the game.
The XBox Series X can handle double-layer Blu-rays (50GB), so if the packaged game exceeds that, you need a second disc and a case that can hold 2 discs. The PS5 can handle triple-layer and quad-layer discs, but these are more expensive than the double-layer version.
It's not very common these days for games to be delivered on multiple discs, and only the biggest and most ambitious games are delivered this way (The Last of Us 2 and Final Fantasy Rebirth, for example, were delivered on 2 Blu-rays).
The more popular option these days is to put only part of the game on the disc and require the user to download additional files before starting the game, at the cost of alienating at least part of your audience. 

Impact on other Metrics

While having a large game does not necessarily mean that your game will have long load times (loading strategies, game structure, etc. have a much bigger influence on this), it's safe to say that having fewer/smaller files overall can give you a better starting point for optimizing your load times. The same goes for optimizing your game's memory usage. And even your performance can improve if the game is not constantly streaming in new assets. However, your mileage may vary.

How to reduce you Game's Size

Although not the focus of this article, it would feel strange to end it without mentioning at least a few ways to actually reduce the size of your game.
In general, this is a very broad topic, and since every game is different, there is no one-size-fits-all approach. A dialog-heavy RPG will probably benefit most from choosing a more aggressive sound compression, while a photo-realistic racing game's size will probably be most affected by its texture sizes. However, I would like to list a few methods/strategies.

Mip Flooding

Mip flooding is a technique for adjusting textures so that they can be compressed more effectively by removing details from unused areas. I have already written an article explaining how to implement this technique in Substance Designer.

Localization

Your localization strategy can greatly affect the size of your game. If your game has voiced dialog and supports multiple languages, each additional language can add several gigabytes. It may make sense to create multiple versions of your game, with each version containing only one audio language. In general, you want to keep the number of localized assets as small as possible. What you definitely don't want is to have several completely separate versions of the game installed side-by-side, one per language, with all non-localized files duplicated as well, which was done for the game pass version of Fallout 3.
If you want to have only one version of your game with all supported languages, make sure you use the same videos for all languages and only change the audio track used. Depending on the length and resolution, this can make a big difference.

Compression

A big topic in itself, but finding efficient compression algorithms for your game assets is one of the most effective ways to keep your install size in check. When Epic introduced Nanite, they also integrated Oodle into Unreal to help keep ballooning file sizes in check. Along with Bink for video, it's relatively easy to keep your file sizes small, especially if you're willing to spend some time looking at the compression settings and tweaking them as needed.

Modular Assets

While keeping the size of your game small shouldn't be your primary motivation, being smart about building asset kits for your game can drastically reduce the size of your game. For example, Skyrim, one of the largest open-world RPGs of its time, is approximately 6GB in size and was released on a single DVD. Wolfenstein: The New Order, a linear shooter released on the same console generation, is ~47GB and was released on 4 DVDs.
The difference in size is largely due to the way Wolfenstein's levels were constructed. Instead of relying on modular, reusable assets like Skyrim, the levels in Wolfenstein use many unique assets, and even when assets are reused, the textures are often unique per instance. Using idTech's virtual texture technology called MegaTextures, most surfaces in the game contain unique hand-painted details or baked-in decals. This gives the game a very detailed and unique look, but results in an unusually large size.

Procedural Creation

Most people probably don't know this, but when Allegorithmic introduced Substance Designer, one of the initial USPs was not only efficient texture creation, but also the ability to ship just the substances and a barebones version of Substance Designer to the end user and let them create the textures on their own machine, thus reducing the download size of the game. This approach has not proven to be very popular, as it requires some effort and is only really effective if you use Substance Designer for the majority of your textures, but it may be useful for your game.
Similarly, there are often situations where generating content on the fly can save space compared to creating it in advance.
In Unreal, for example, you can use Nanite tesselation to add geometric detail to low-poly meshes at runtime. This can save a lot of disk space because you can build your level with relatively simple geometry and then use tile displacement textures to add geometric detail.

Split up your Game

If all else fails and your game is still bigger than you want it to be, it can help to allow your players to install only parts of the game. Recent Call of Duty games allow you to install single-player, multiplayer, and Warzone separately, and Gears 5 put its high-resolution textures in a free DLC, so players who don't need them don't have to spend hours downloading them anyway. MMOs and multiplayer games often download assets on an as-needed basis. For games like Fortnite, this is crucial, as the sheer number of skins and customization options would otherwise cause the install size to balloon.