Site wide search powered by YaCy*

Exit: Computer Graphics

When it rains, it pours, and pours and pours

September 19th, 2015 by Holy at www.swordofmoonlight.net

Every time I have to pen this blog post I wish I could think of another new way to announce that there’s a new SomEx release, hot off the presses. It’s a kind of hell in miniature. Nevertheless I guess, without further ado, there is — once again — a new release. This round there’s a lot to cover, and it’s all about graphics. So get comfortable, but be sure that you keep one eye on the graphics at all times!!

So kidding aside, it all started out innocently enough. I’d wanted to at last do something for the little-halos-underfoot shadows the non-player characters ride around on. Visibly they are fine, just the way they are, only I need Sword of Moonlight to be a rugged implement, and these spot shadows that stick out into thin air and slice into uneven terrain just aren’t cutting it. Of course if there were always ample, level, standing room, then this wouldn’t be a problem. That is, as long as you don’t look closely, you won’t notice them hovering a millimeter off the ground in the same airspace as the soles of their characters’ feet!

So, I thought I was owed a break and these spotty, little shadows look like as good a distraction as any. That was more than a month-and-a-litany-of-graphics-extensions ago. Not the least among them is the freak accident of history that you can read about in last month’s blog post. For reasons I decided it would be a good idea and side project to first reform Sword of Moonlight’s relationship with the “z-buffer” with a mind to make it act like a regular computer game, or at least make it more maintainable and more predictable — frame rate wise. It was an open-and-shut-case except for little niggling details that kept coming up all throughout this release.

This ground laying work got me thinking about the sky-domes, how they are very similar to the shadows in a big way, and how it’s a shame that the skies are filled in … only to then be covered up by obstructions. All of this takes time, so it would be better if the sky were filled in afterward, behind the obstructions. Again, at first this was easy to do — too easy. It turned out that transparent elements posed problems — deep problems. But I knew I was onto something, even if “something” meant another super release…

By now I’ve grown accustomed to this. You learn fast to roll with the punches. The last super release dove into the clipper’s programming. A clipper keeps the characters from falling through the floor, and other things we take for granted in “real life”. This super release would be diving into the scene’s programming. The scene is everything you see when you look out into the video world. They are two major pillars of any video game’s inner workings. And so far SomEx has only scratched the surface of either.

Where similar the skies would involve half of the same work as the shadows, so a diversion was in order. Funnily it took before I realized how intimately the skies and shadows were already related, since the same family of extensions had long addressed the blending the two, and other transparent things into them, including the fog. The real reason I was especially interested in the skies is a long held desire to perfect the extension that blends them into the back of the world, so that this can be done automatically (by default) without objection. Here again the sky and shadows are similar since without blending the skies in this way they slice into the back of the world no differently from how the shadows slice into their surroundings.

From behind the “scene” I also seized the opportunity to remedy a problem to do with the lamp lights. Sword of Moonlight’s player cannot be trusted to keep track of these, and I’ve yet to devise a fix that gets to the heart of the problem. But there’s long been a fix to takeover management of its lighting. For all of that time selecting the lights was not straightforward. The measurements of each element in the scene had to be determined in the game, and plans to put those determinations aside for reuse were not pursued because it was always a makeshift solution at best. Stopping to take measurements of 3D models in real-time could cause hiccups that I wanted to be over with by now. So I endeavored to do this better, and also to disable the built in programming for selecting lights so that no double work is done. I stopped short of developing a scheme to handle lots and lots of lights on a per map basis; it was just one of many things left on the cutting room floor.

Amid all of this some tinkering I’d been doing on the side, to explore no-cost “anti-aliasing” had come to a head. I’d made it a long way but had all but resolved to let the hardest cases be. I had a hairbrained scheme one evening that didn’t pan out, but in its aftermath I was seized by a second wind of desire, or desperation, that pushed me into no man’s territory. I think I discovered there something completely new to real-time graphics, because I think if it had existed it would be a well regarded technique with much written about it, and much work done to implement it in hardware. Needless to say my results exceeded my expectations, and then proceeded to exceed itself several times over, over the course of a week or two; by the end of which I was left completely hollowed out. I expect it will take me a year or two to fully recover from this. The results speak for themselves and are enabled in this release, even though there needs to be some work done on the models that From Software prepared for Sword of Moonlight to make them fully compatible. Mainly the tiling level elements are replete with cracks that make them very much resemble the PlayStation King’s Field games, but these cracks will be repaired before long, before the next release. Hopefully I will have some help in this. The “textures” are already full of holes, so this will be part of the artwork renovation project that I’ve planned to pursue this year, and frankly I’m relieved that I hadn’t already pursued it so that this can hopefully all be taken care of at once together.

But neither would this be the final surprise, because in just the last week, having completed the shadows and proceeded to applying the final touches, elsewhere I began noticing distortions, really for the first time in my career. I think people who play lots of 3D computer games are probably familiar with this, and I was too, but I didn’t think Sword of Moonlight would be so affected. The distortions have to do with the focal length, or the angle of view, and I was surprised that this figure was as high as it was, set at 50 degrees measured vertically, and upward of 90! horizontally at 16:9 aspect ratio…

In truth I’d been taking notice of the distortion for some time. But it wasn’t until I was surveying a project’s statue one day I began to notice ripples up close even, that I decided to do something about it then and there. And so I began to experiment with “FOV”. By day two or three I’d arrived at the same conclusions and observed, literally, the same findings published in Wikipedia’s “Perspective projection distortion” article. I’ve taken the liberty to add a new zoom setting to the configuration file that defaults to 30 and can be increased up to the original 50. I’ve done so first and foremost to minimize severe distortion taking without making the situation untenable. Frankly I’m surprised the bedrock of 3D video games can be this shaky. 30 is still very distorted, and it’s only around 10 that the image evens out. 10 is not allowed, as it is unplayable. This is the limit of playing games on a flat screen that cannot react to where you are looking at the on the screen and from where. Future screens will have to be very private things, or perhaps they will offer holographic visions in all directions. Filmmakers must struggle to work around these limitations of projective media.

And last but not least! *holding my breath* The player character now gets a shadow of their own, and it works really, really well, and can even come in handy in more ways than one. And it just so happens that the new 30 degree recommended zoom level is close enough to the shadow that it fills up just the right amount of space onscreen. In my opinion the new zoom configuration makes for a much better experience in some other ways. I’ve written about this in the forums and will try to write some more about it in the forum version of this blog post. It’s as important a piece to true visual fidelity as my harrowing anti-aliasing-like discovery — all in one month’s time — it’s just not something that no one has ever heard of or thought of before. Still I’m embarrassed I hadn’t taken notice of the distortion sooner…

It’s one of those things that you can never “unsee” once you know what you are looking at. I’m hopeful that the new wave of Virtual Reality products can be of service where I’m convinced flat screens cannot.

Forum Discussion

Leave a response



Exit | Forum | Sitemap | Main Index | Ex | Top