Return to “[Archived] Daily Dev Logs, 2012 - 2015”

Post

Week of September 1, 2013

#1
Sunday, September 1, 2013

Summary

Solid day off :) Didn't get to do everything I wanted to today - it rained outside so I couldn't go to the park :(

I gave Skyrim a shot and was pretty excited about it! Unfortunately, after 30 minutes or so of glorious immersion, I fell under attack by a group of city guards who apparently stopped liking me quite suddenly (I seriously did nothing to provoke anyone...). Hmmm. Being of extremely low level, I naturally couldn't stand up to them. Nor could I figure out how to escape without getting killed :cry: Ahh yes, AI. Never been one of the strong suits of the TES games :lol: :roll: Frustrated that these dumb bullies were ruining my immersion, I gave it up. Perhaps Skyrim is a harsher place than Vvardenfell. Ah well. Maybe next time :problem:

After lots of sleep, I actually spent most of the remainder of the day playing Game Dev Story. Yep, a very unusual choice, but probably the only iphone game I've ever actually seriously enjoyed :D It's really an addictive one...I love growing my game company and making better and better games ;) Sadly I never saw a "space" genre :( But made some killer games nonetheless. Great fun, and it inspired me to get back to my own, real-life game dev story!! :clap:

Alrighty, time to see what September has in store for us!!! ;)

(PS ~ Slacking on last week's summary. Ah well, it'll appear sooner or later :D )

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#2
Monday, September 2, 2013

Summary

Off to a good start! :)

I grinded all day on "concrete" abstract simulation! :eh: :crazy: Ehh, I mean working on implementing it, you know ;) Specifically, my current goal is to get the AI to successfully reason about docking at a station. This is a big stepping stone to being able to reason about trade runs. Surprisingly, it's a pretty hard piece of reasoning in technical terms, because it requires not just understanding movement, but also understanding changes of "context," as I call them, which amounts to changing "rooms" in a traditional game. Each system in LT is a different "room," so to speak, as are the interiors of stations and the surfaces of planets. Reasoning about docking requires reasoning about context changes, which requires being able to successfully abstract and then unroll the changes to an entire "room."

To implement it, I had to go in and make some aggressive simplifications to the code governing contexts. This can only be a good thing, as some of the mechanisms are much simpler now :) Unfortunately, I haven't rid the new implementation of all bugs yet - there's still a sour piece of code somewhere causing a crash that's driving me crazy. Naturally it is physics-related :problem: :problem:

But. I think I'm on the home stretch for this little AI scenario, and after that - it's trade run time!! ;)

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#3
Tuesday, September 3, 2013

Summary

Really pleased with the day ;)

The going was rough this morning, as I was investigating the crash caused by yesterday's upgrades. It was some tough debugging, and took several hours. But in the end, I tracked down the issue and wow, it was a sneaky one! :oops: Thankfully, I was rewarded for my perseverance, as it turns out that the issue causing the crash was directly-related to an issue causing asteroids to occasionally blink for a frame (note: this is not the same as the "popping" issue in the last update, but did contribute to some of the ugliness). Now that it's fixed, asteroids are rock-solid (:P) for the duration that they exist :thumbup:

Since the bug was so interesting and sneaky, I feel I must at least honor it with a brief explanation! Incidentally, it all came down to the randomization of asteroid rotations. These rotations induced a non-orthogonal frame momentarily when asteroids were created. This degenerate frame was responsible for both a single-frame-long incorrect rendering of the asteroid, as well as an incorrect representation inside the physics engine. This incorrect representation could end up causing a crash when the asteroid was deleted. But the really sneaky part of it all is that...for most asteroids, the difference between the incorrect and correct frames was small enough to not cause a crash. Only for humongous rocks would it ever be a problem - and those are few and far between!

Anyway, enough of that...with that issue happily vanquished, I was able to finish the implementation of "docking" reasoning! I'm now successfully able to run a hypothetical simulation of docking with no crashing and no damage to the game world ;) Sadly, the AI is failing to recognize itself as being docked but....I'm sure it'll be a quick fix compared to the crashiness of yesterday.

Ah, it always feels really good to have such a critical piece of the engine in better shape :D

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#4
Wednesday, September 4, 2013

Summary

I like that kid. That graphics kid that comes around sometimes to make things look shiny. Whenever he comes to visit, I get to take the day off, kick back, and relax. When I wake up the next day, I get to check out all the cool new stuff that he did. He's a good kid. Sometimes I wish he would come around more often.

Yeah, it was a shiny day alright. An insane one ;) The biggest accomplishment...distant fog. Not just distant fog, but surprisingly-good distant fog. Full-blown volumetric rendering (approximate, of course) - and with hardly any dent whatsoever in FPS! The result is gorgeous, if I do say so myself :D

The solution is remarkably dumb...it's the first solid idea that popped into my head. It's almost as brute-force as you could possibly get. And yet, it's these simple, clean solutions that so often yield the best results. Very coarse eye-space pre-integration of the volume on the CPU (when I say coarse I'm talking 4x4 grid over the screen, 64 or 128 depth samples), then interpolation and blending via 3D lookup texture on the GPU. Super easy, super cheap, surprisingly-convincing. It's not a hack, so it can handle any density function you throw at it - but high-frequency details will alias, as you would expect. That's not at all an issue for space dust, which is very much a low-frequency ordeal. But there's still room to push the quality - I think I'll try moving the pre-integration step to the GPU, which should allow for much higher resolution, and possibly even some medium-frequency detail in the volumes.

But that wasn't the end of the fun! :D I finally implemented "correct" HDR rendering, such that the color blooming reflects (teehee) the true HDR color of the saturated patches. Would you believe that the previous HDR effect was a total hack based on applying some color grading to the bloom? ;) Not anymore! The result is wonderful :thumbup: Still need to implement dynamic exposure for adjusting to light/dark scenes...will get to that someday :monkey:

I honestly wish I had written this log earlier, because right now I'm so tired from all this work that my excitement is waning. But seriously, it was such an awesome day, and the visual quality of LT has realy shot up. I'm so, so happy :)

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#5
Thursday, September 5, 2013

Summary

Great day for AI and abstract simulation. Primary focus was, again, on getting that darn docking event to work in the AI's head.

I spent a good chunk of time extending the entity component system to allow sparse components, such that an entity can now dynamically add or remove components from itself at runtime if need be. The real application of this is for aggregate objects - having sparse components will allow the aggregate to efficiently adapt to suit whatever types of concrete objects it is attempting to represent. This is a pretty great addition to the component system :) I really needed it for aggregation of stations, because stations contain an inner context and that's a pretty hefty chunk of memory inside the component that manages it. Really can't have every abstract object creating it's own context :shock:

Unfortunately, at the end of the day, I am still having a problem with the hypothetical reasoning :( BUT! It's at the very last stage: deleting the abstract world. The AI has already been able to successfully simulate the docking action and recognize itself as docked (meaning the context switch works perfectly!) But there's something wrong somewhere in the reference relocation code, because killing off the hypothetical world is crashing the real world :problem:

Still. It's going well and...so close............ :squirrel:

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#6
Friday, September 6, 2013

Summary

I don't know, not really the day I was looking for. I wanted to be through the first hypothetical reasoning scenario by now...but unrolling the dock event is proving to be more laborious than I expected. Some conceptual issues that I didn't foresee are cropping up (related to the fact that a context change is really a change in the hierarchical structure of the world, which is difficult to undo). I had to spend a lot of time thinking about it today, but didn't ever come to a perfect solution.

Frankly, nothing exciting to report today but...I'm going to make sure that won't be the case for tomorrow! Determined to solve this puppy and move on with my life ;)

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#7
Saturday, September 7, 2013

Summary

Big day!! :D

First of all, hypothetical reasoning involving docking is finally a go! It took some painful mental grinding, and a few more dirty tricks than I would have liked, but it works. I don't feel totally comfortable with the whole thing yet, but I'm sure as I continue to wrap my mind around it all, I'll be able to improve the solution until it's beautiful and clean. What's important right now is that it works ;)

After getting it to run, I was pleasantly surprised with performance. Even in the most basic, naive implementation of everything, I am able to run a single AI's planning algorithm every frame with no visible performance impact. Ok, so what? Well, it's actually pretty impressive if you keep in mind what's going on. That AI is creating an entire world in his head (granted, I've done as much as I can to make sure that it does so effieciently), and then running a simulation on that world. Every frame! I'm sure as I optimize the algorithm it will become even more performant. So things are looking fairly good right now in terms of AI performance.

With that bit of excitement, I put my graphics hat back on and attempted to improve the volumetric fog rendering. The main issue was the screen-space linear interpolation artifacts. So I started thinking that maybe, rather than increasing resolution, it would make more sense to perform a higher-quality reconstruction filter on the sampled data. I went ahead and implemented bicubic filtering on the volumetric fog data........and it completely solved all the artifacts!!! :shock: :shock: :shock: Amazing! A second-order reconstruction filter makes sooooo much of a difference when the sampled data is low-resolution!

Intuitively, the real difference - and what makes this work so well - is that the derivatives of the reconstructed data are now continuous, which, loosely-speaking, means that it looks "smooth" to the eye, whereas the cusps in linear interpolation (which does not yield a continuous derivative) are painfully-visible. From a mathematical standpoint, I think it's really interesting how easily the eye can identify lack of first-order continuity, yet how much more difficult it would be to identify lack of second-order continuity (you will have a really difficult time telling whether the second derivative of a curve is continuous or not). So bicubic, it would seem, is the sweet spot for visual filtering. It really makes me wonder: why do we not have hardware support for it????? We've been stuck with linear interpolation forever....but low-res textures would look so much better if GPUs just supported cubic interpolation.

Now...what about the cost? Well, it requires 4x the texture lookups in a pixel shader. Ouch? No, not really! That was never the bottleneck. The bottleneck is building the volume texture (on the CPU). With this significantly-improved reconstruction, I was able to get away with a volume texture that is 4x smaller AND still achieve drastically-improved visuals. The result is faster since the CPU is doing a lot less work.

In summary, volume rendering in LT is now blindingly-fast AND looks awesome. I am so, so happy with this solution. Never would have imagined it would work out so well :) :D And certainly never would have imagined bicubic would make such an amazing difference.

Really inspired to press forward into new AI territory now that we've got some of the basics working!!!

[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of September 1, 2013

#8
Week Summary

General Sentiment

This week was a really great way to start September, as well as another example of a perfect split between low-level and high-level work. Obviously, the distant fog rendering system is the star of the low-level show. Frankly, it's a lot more than I ever expected to be able to achieve, especially in one week :clap: And then, at the high level, there's the fact that we have our first relatively-involved example of hypothetical reasoning working (docking)!

With both the visuals and the AI looking so promising, I'm getting more and more excited about what the rest of September holds :D

Major Accomplishments
  • Implemented distant fog rendering system
  • Implemented sparse components for the entity component system
  • Improved distsant fog rendering system substantially with fancy filtering (yep, I think this deserves a separate entry!)
  • Fixed engine bug causing asteroid popping and occassional crashing
  • Numerous improvements and simplifications to the engine's handling of "contexts" and context switches
  • First successful hypothetical reasoning involving context switches!!!
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford

Online Now

Users browsing this forum: No registered users and 2 guests

cron