





Dev blog 107 - Porting Fun, Vol. 3
Code optimization
Good ol' profiling your code, looking for bottlenecks. Rewriting slow functions, getting a few FPS here, a few FPS there. Consoles helped here because they amplify problems. What might be a tad slower on PC, ended up being noticeably slower on consoles.
The hottest topic here was probably AI, which on most PCs would take no more than a few seconds, maybe five at most, per enemy. On consoles, you'd be waiting up to 15 seconds per enemy!
Through careful optimization, both in code and in AI config, we were able to reduce AI think times by 50-70%, so again, even on PC/Mac, it should feel much faster and smoother.
Texture optimization
Oversized textures mostly have to do with wasting precious memory, but they also affect performance. By "oversized", I mean using textures which have too many pixels for the size of the object on the screen.
Imagine a small rock, which uses up a small area on the screen, say 100x75 pixels. It makes no sense to apply a 2048x2048 texture to it, right? You can't even see those pixels.
So, I created a tool in our Editor to visualize texture density in shades of gray. The lighter the image, the higher the density. That made it easy to spot light (dense) spots in any scene, at a glance.

Mesh optimization
With meshes, it's a similar story. Why waste thousands of vertices on an object which only takes up a small area on the screen? Also, excessively dense meshes affect performance more so than memory, so there were big gains to be made.
However, decimating a mesh is not as simple as downsampling a texture. Luckily, our Editor already had a powerful QEM (Quadric Error Metric) mesh decimator built-in.
But - we have upwards of 800 unique meshes in the game. How do we process them all, making sure we decimate each one just enough, but not too much to introduce visible artifacts? Well - we write a tool, of course. :) And so, I wrote an automated tool which tries to guess an appropriate decimation factor, applies the decimation, and takes screenshots of the mesh from all six cardinal directions (north, south, east, west, up, down). If the before and after screenshots don't differ by more than some percentage of pixels (say, 3%) - the decimation factor is accepted.

Then it's a simple matter of trying an increasingly or decreasingly aggressive decimation factor until a sweet spot is found. Voila! You let the tool run for a day, and you have meshes guaranteed to use up as few vertices as possible without visible artifacts. This gave us FPS boosts of up to +50% on lower end hardware. Shader optimization
We have a custom terrain system which allows level designers to directly paint layered materials on the terrain, such as grass, mud or rock, via a special mask texture. The shader then applies these materials and the transitions between them, using the mask.
We were able to reduce memory usage quite a bit by compressing the mask, and optimizing the shader itself. This also made loading times faster, not to mention rendering itself.
Misc optimizations
Finally, there's lots of things which don't fit any of the big categories. For example: destruction effects! We noticed these can cause performance drops, and identified the issue to be physics-engine-related, due to spawning large numbers of inter-colliding physics-driven objects. Rather than just reducing the number of said objects (which would make the effects look flat), we found ways to reduce the impact on physics computations without sacrificing the number of visible object parts. So much so, that performance drops due to destruction FX are now negligible on any platform.
[/olist]
Phew, that was a lot! Hope you enjoyed this overview. For any questions, feel free to join our Discord server.
Robert
[ 2022-02-23 12:00:25 CET ] [ Original post ]
This post was written by Robert, one of our programmers. Hi again! Robert here, programmer at & founder of Room-C. At long last, it's my turn to write a blog post again! A while back, I wrote about porting the game to Linux and macOS. In the meantime, we decided to expand into consoles as well. But rather than talk about consoles themselves, I wanted to make an overview of all the great things that came out of the console porting efforts that made the PC/Mac version better, too! So, here goes:
- Gamepad support Well, duh! :) Can't have a console port without them. But I daresay, after several iterations, we got the gamepad controls to a point where it's quite nice to play with a controller even on PC/Mac.
- UI improvements There's a couple of big things that happened here. [olist]
- Dynamic UI scaling We knew we wanted to support resolutions like 1080p and 4K. So instead of just keeping the UI tiny and small on 4K, or scaling it up naively to cause blurry text, we made sure to support this properly and deliver crisp, legible UI and fonts on any resolution.
- TV mode But what if you play the game on a TV? For me at least, my TV is a lot further away from my eyes than my PC monitor. So even though the TV is bigger, the picture still seems smaller. And that means we had to upscale the UI even further, to make sure our text-and-UI heavy game is legible even when played from the couch. How does this benefit PC players, you ask? Well, there's Steam's Big Picture mode, which we were able to add support for easily.
- UI clutter reduction Last but not least, simply scaling the UI up revealed design problems. We had a lot of stuff on our tooltips! Too much for it all to fit, in fact. It took some creative thinking to reorganize and simplify, to reduce clutter while still being informative. That alone was a major improvement for all players anywhere! [/olist]
- Optimizations Now, this is a huge topic. In short, we were able to get pretty big gains in performance, while also reducing memory usage quite a bit. On top of that, we made sure there are no performance swings - all areas of the game, even during spell casting and wrecking the destructible environment - retain consistently good frame rates. This means the game now runs better and smoother than ever, even on older PC/Mac hardware.


Then it's a simple matter of trying an increasingly or decreasingly aggressive decimation factor until a sweet spot is found. Voila! You let the tool run for a day, and you have meshes guaranteed to use up as few vertices as possible without visible artifacts. This gave us FPS boosts of up to +50% on lower end hardware.
[ 2022-02-23 12:00:25 CET ] [ Original post ]
The Hand of Merlin
Room-C Games
Developer
Versus Evil
Publisher
2021-05-11
Release
Game News Posts:
132
🎹🖱️Keyboard + Mouse
Mostly Positive
(291 reviews)
Public Linux Depots:
- GameBin_Linux [91.57 M]
- Common_Linux [23.65 M]
The Hand of Merlin is a turn-based rogue-lite RPG in which Arthurian legend clashes with cosmic horror. Recruit a company of up to three mortal heroes and guide them in spirit on a desperate journey from Albion to Jerusalem. Explore a richly-imagined medieval setting on the brink of apocalypse. Trade with merchants, improve your heroes and unearth ancient relics. Search for the lost fragments of your soul, scattered across the multiverse - and save as many worlds as you can.
Enjoy a compelling story inspired by Arthurian legend, the Matter of France, and the history of Al-Andalus - with an unusual twist. Make choices in interactive encounters that change every time you play. Written by Jonas Kyratzes (The Talos Principle, Serious Sam 4) and Verena Kyratzes (The Lands of Dream, Serious Sam 4).
Master the tactics of squad-based and turn-based combat to conquer both human and demonic foes. Your enemies will be tough and ruthless; make use of cover, set up ambushes and coordinated attacks, harness synergies between different Hero classes and skills.
Carve a path across the lands of Albion, Marca Hispanica and Al-Andalus. Will you take a dangerous route, risking life and limb in pursuit of a legendary relic? Or will you choose a safer path? Plan and prepare. Negotiate, barter, fight. Tackle challenges. Suffer losses. Recruit new Heroes. Earn Gold, Supplies and Renown. Be careful: your choices are permanent, as is death. But don't tarry - evil never rests.
Use Renown to level up your Heroes, and choose between a randomized set of new skills or improved attributes. But choose wisely! Select skills with great synergy and balance your party for the road ahead.
As you jump from one parallel dimension to the next, history is reshaped. Different kings rule the land, changing the encounters, characters, and events. No two worlds are ever quite the same, and each journey will be unique. And should your heroes fall, remember: defeat is not the end, only a new beginning.
Seek out towns to improve your arms and armor, or stumble upon hermit artisans in the wild. With every day that passes, the world plunges deeper into darkness, and you will need all the equipment gold can buy.
From a peasant's humble luck charm to the legendary sword wielded by Arthur himself, items imbued with magical power are scattered about the world. Some you will be able to purchase from merchants and collectors, but others will have to be earned through acts of heroism - or displays of wit.
Rain thunder and brimstone upon your foes! Seek out and gather Soulstones to restore your power and unlock new Spells. Even if defeated, your spirit will retain all of your collected arcane knowledge as you jump into the next dimension.
There are as many worlds as there are stars in the sky. In each stands Camelot; in each there is a Grail. But there is only one Merlin, and his eternal burden is to stand against the horror from beyond. Each world that is saved is saved forever; each world that is lost is lost for good.
https://store.steampowered.com/app/600610/The_Hand_of_Merlin/
MINIMAL SETUP
- OS: Linux SteamOS 3.0 or Ubuntu 18.04 LTS
- OS: Linux SteamOS 3.0 or Ubuntu 18.04 LTS
GAMEBILLET
[ 5963 ]
GAMERSGATE
[ 2701 ]
MacGamestore
[ 3956 ]
FANATICAL BUNDLES
HUMBLE BUNDLES
by buying games/dlcs from affiliate links you are supporting tuxDB