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

Post

Week of July 28, 2013

#1
Sunday, July 28, 2013

Summary

Ok, that was seriously some of the most intense debugging sessions that I've done in a long time. An hour is bad enough. But that GL problem took almost 5 hours to solve :oops:

For better or worse, the problem ended up being an exceptionally sneaky one, so at least I don't feel stupid. It was legitimately a difficult issue, and what's worse is that different drivers were behaving differently, so the issue only occurred on certain configurations. Oh wow, who would haved guessed...drivers implementing the spec differently!! I'm certain we've never heard of that before... :roll:

So if you're interested (if not, skip this paragraph), here was the deal: generated textures were being clipped to a certain region when generated at particular times. For example, a 2048 x 2048 plating texture only having plating in a 1620 x 1080 region, the rest being blank (resulting in one heck of an ugly ship). Immediately we deduce that the problem is related to the framebuffer in some way, because 1620 x 1080 is not a coincidence - it's the framebuffer resolution. But what could cause it to clip? 1) depth test? 2) scissor test? 3) stencil test? 4) incorrect viewport? These are all of the things that I immediately think to check when something is failing to render in a framebuffer. But....1) was off, 2) was off, 3) was off, and 4) was absolutely 100% correct :monkey: Five hours later, I now know that there's one more thing that can cause clipping when rendering to a framebuffer, and I didn't realize it before: framebuffer attachments having different resolutions. Ok, I knew that you weren't allowed to attach render targets of different resolutions to the same framebuffer. That's invalid, and should cause everything to fail. Well, guess what? Apparently it's not a problem on most drivers, because everything was working fine on my other setups, even though this issue was indeed occurring. But as if that's not good enough, it appears that another way for the driver to handle the problem is simply to clip to the smallest target. Ugh...really?? Drivers allowing things that shouldn't be allowed....STRIKES AGAIN! :evil:

At this point, I feel like my entire career will be dedicated to learning the nuances of OpenGL framebuffers. They're like Ruffles Cheddar and Sour Cream chips. Every time you think you're done with them, they manage to sneak back into your life. (Nope, I was not paid for that advertisement, I legitimately have an addiction to them. Considering getting help.)

In other news, working on planet surfaces 8-) Secret stuff. Maybe ready in time for the update, maybe not :shifty:

[ 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 July 28, 2013

#2
Monday, July 29, 2013

Summary

Awwww yeah!! Finally getting some of that graphical steam out of my system 8-) It's so strange how I feel great after a day of graphics programming. I guess it's just such a concrete thing..you can really feel the progress and it's easy to see that you're working hard.

An assorted list of exciting things;
  • Polar meshing for terrains! Looking good. In theory I think this is the ideal way to do terrain LOD, as it should yield uniform screen-space detail. Not really practical when you need to actually move around the terrain, but perfect for LT since you can't do that!
  • Fixed my "fractal detail maps" (the secret sauce of which I've spoken before that makes everything look detailed even in the presence of huge scale differences) implementation to be mathematically correct. This is like the third total rewrite, and I'm pretty sure I got the math right this time... :oops: It looks much better, especially on the terrain!
  • Implemented atmospheric environment map generation, which generates the backgrounds (sky, sun) for planets
  • Improved atmospheric scattering to work at surface level - still trying to hammer out a bug though
  • Improved chromatic aberration (again)
Ok what's left to do in 24 hours? Ermm....not much! Just procedural grass, trees, water, clouds, cities, and maybe even polar bears. Pshhh. Too easy :roll:

No but seriously. I don't want to show you a naked terrain for the update. It's disgraceful. Wish me luck with getting it dressed :oops:

PS ~ I ordered a "legit" microphone and it came in today, just in time for the update! That should take care of the annoying pops and such in those videos. Now the other part....getting enough sleep to not sound like a zombie...that's going to be the real trick :shifty:

[ 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 July 28, 2013

#3
Tuesday, July 30, 2013

Summary

Wow. Sometimes you have bad days. Sometimes you have good days. Occasionally, you have days where a lovely warmth just ignites your neurons and you remember what it means to be alive. You know what I mean? That's what today was like :)

I was in the zone today. Me, code, math...just one of those days where you lose yourself :D Here was the schedule that I made for myself last night (at 7am, nonetheless ;) ):
12:00 - 1:00 : Lunch
1:00 - 4:00 : Trees ~ Billboard groups (use static objects!), terrain occlusion
4:00 - 7:00 : Water ~ Planar, reflect env, fractal normals, soft depth?
7:00 - 8:00 : Dinner
8:00 - 10:00 : Clouds ~ Fractal nebulae variant
10:00 - 11:00 : Planet docking
11:00 - 1:00 : Cities ~ Quick & dirty extrusion, road network
It was an absurd list and I knew it from the beginning. 13 hours to build a fully-featured planet, more-or-less. Just a dream. But you know what the great thing about ridiculous dreams is? Even if you only get halfway, you still got a lot farther than if you had never dreamt at all. I guess that's kind of my life philosophy. And here again, I got halfway. But half of a dream is still pretty dream-like, you know :)

Trees, water, and massive improvements to the scattering. Really, an immense amount of progress for one day! I guess I'm happiest with the water. I've never, ever done water before. EVER! So I was really expecting the worst. Instead, I found the result to be totally acceptable!! Here's everything I implemented:
  • Environment map reflections (of course)
  • Fresnel effect (of course)
  • "Secret sauce" normal map technique for great detail and no visible tiling!
  • Subtle scrolling effect makes it look dynamic
  • Depth fading for soft edges on the coast
  • Depth-based color for nice-looking shallow / deep sections
Now, I was on schedule until clouds came along. Two hours simply wasn't enough time to gerrymander the math (you know I love abusing that word :roll: ) into the right place. I've never done proper, perspective-correct skybox clouds before, so it was natural that I should fail on the first attempt. I did get pretty close. I at least got the perspective raytracing part correct, but in the end I couldn't make the clouds appealing enough, and also couldn't figure out how to integrate them with scattering.

Naturally, cities - the farthest of all dreams - never even saw the concepting process, as I scrapped them in favor of continuing to perfect the water and terrain.

Honestly, it was a great day. I still don't have loads to show for the update, but at least I have a pretty planet to fly around on while I talk :) Hopefully you'll find it appealing enough to keep me on for another month while I finish the "real work" :thumbup:

PS ~ The trees are pretty bad - they're just billboards ("3D" sprites) and I still have issues with them not aligning to the terrain properly :oops: Still, it's a nice thought..right?

[ 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 July 28, 2013

#4
Wednesday, July 31, 2013

Summary

Soooo exhausted :shock:

I guess you read "the story" of what happened today..and it's true! Everything was going pretty well this morning and I was in awfully good shape to be filming the video around 5am or so (comparatively speaking, that's doing pretty good :oops: )! Annnnnd of course the Windows build broke in a hundred-and-three different ways (all of them involving templates, go figure). God bless compilers :evil:

After deciding that I really didn't want to get into a fight with Visual Studio at 5am in the morning, I switched back over to Linux and tried to find something to do the job. Two hours later I was both extremely annoyed with this "glc" program, and no closer to having a video in my hands (instead I had some 25gb glc file that refused to give me the video/audio information inside it... :x ). I didn't manage to get the Windows build fixed until 11 am or so, and wasn't recording the audio until about 2pm!! Gah. Talk about a late day :(

All-in-all, I guess you know that I'm pretty disappointed with the video. If it hadn't been for the graphics sprint, I would have almost nothing to show. I barely made 10 minutes even with that... :oops: Yes, it was a conceptual month, and yes, I only had half the work time...but it doesn't excuse that kind of lack of visible progress. Even in times like this, I need to be constantly pushing the visible quality of the game forward. Always. It cannot ever stagnate, not even for a month. We don't have time for that, even if conceptual breakthroughs are being made at the same time.

To solve this problem, I'm going to institute a policy of forcing myself to play LT for at least 30 minutes a day...until halfway through the month, when I will increase it to 60 minutes a day. Why force? It's supposed to be a fun game, right? Yes...but does it look like a fun game to you right now? No AI (because it's being overhauled), nothing going on in the universe (because it's being overhauled), barely any variety in systems (no excuse), many critical systems still "work in progress" or flat-out "broken." I think part of the reason for this is that I got pretty disconnected from the game while I worked on the conceptual. That's not OK! Even when I'm working on the simulation engine, I still need to be in touch with the game. I need to be playing it every day and asking myself, "is this fun?" I think this will force me to get the game back into shape. For the first few days it will be like a punishment, because I won't have much to do for these 30 minutes. Hopefully it will encourage me to fix / re-implement things sooner so that I can start having fun!! I'm eager to see if this strategy works :thumbup:

I was planning to work for the (rather small) remainder of the day and then just take the full day off tomorrow...but somehow my body just totally shut down and I found myself waking up in bed with the whole day being over already :shock: I guess it's telling me I needed some sleep. Looking forward to a day off, though! And maybe I can do just a wee bit of planning to figure out how I'm going to start August off on the right foot ;)

Thanks for all the kind comments on the video today :)

[ 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 July 28, 2013

#5
Thursday, August 1, 2013

Summary

What a wonderful day off!!

There was much eating, coffeeing, guitaring, random chinese romance movie watching (seriously, you should try foreign romance films, they're pretty great), jumping and skipping in fields of grass, and so on.

Twas fun. I am refreshed and ready to roll...

And tomorrow. IT BEGINS.

That is all.

:)

[ 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 July 28, 2013

#6
Friday, August 2, 2013

Summary

Not gonna lie guys, I'm feeling really good about August. I can just feel the energy...the excitement...as I near the end of this conceptual desert, I'm getting charged up and ready to roll. It's a good feeling :D Today I was a bit like an electron orbital. Everywhere all at once but nowhere in particular, yet concentrated in a few regions :wtf:

Sunk a few solid hours into the AI reasoning / event simulation code. I decided that we might as well go big or go home: start with the hardest event - combat! So I started dealing with that fugley beast...we'll see what happens :shifty:

A random but really nice development today was rounded edges for UI widgets! I always wanted it, and I think I gave it one shot before but wasn't in the math zone, so couldn't make it happen. Today I put an hour into this lovely little ordeal and came out with exactly what I wanted! Rounded edges! :D Looks a fair bit classier, I must say :thumbup:

Oh! Chromatic aberration rewrite. Simpler and better :) Maybe a little too aggressive...still not perfect, but less annoying than before!! Slowly but surely...

Also redesigned the launcher for a greater launching experience. Yeah...like I said, everywhere but nowhere in particular :wtf:

PS ~ Yet another nice surprise to boost my excitement: I just realized that it was Friday and not Saturday!!! Here I was thinking the week was over. No sir, not yet my friends 8-)

[ 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 July 28, 2013

#7
Saturday, August 3, 2013

Summary

Strong finish to the week!

Still cracking away at the attack event :geek: Today I tried something a bit radical: collapsed the event to only handle one attacker and one defender :shock: Yes indeed...I am exploring the possibility that this event could actually use the abstraction engine to collapse all participants in the engagement into single entities, such the each "team" becomes just one object. The beauty is unparalleled. But...it's dangerous stuff, I know...there will be at least one cautionary protest thread (am I right? Don't be shy ;) ) but...with great risk comes great reward!

In less dangerous news, I had my first successful test of the "differential rollback" system today! You know I like making up fancy names, right 8-) This is the system that allows an AI to reason about the world (making changes to it), and then roll it back to the "real world" once it is finished. Essentially the mechanism for "hypothetical" reasoning. It's now in place for inventory and health, and working beautifully! It's really a pretty sweet system, I have to admit. Flipping on the rollback system will cause any and all subsequent inventory changes (to any entity in the game) to become undoable at the touch of a function. I think I'm going to like this a lot better than the alternative options, because it means that I literally don't have to change any game logic to handle hypothetical reasoning. I'll steadily be applying this to each subsystem in the near future, so that eventually the entire (or almost entire) game state will become reversible!

>> DANGER: Nerdyboring zone ahead. Take detour if interested in maintaining sanity. <<

Even though it didn't lead me anywhere this time, I want to talk about a cool idea that I had today. I got really excited for a brief moment as the mathy side of me geeked out, but then managed to rein it back to reality, thankfully. One thing with which I've been struggling lately is nondeterminism. For example, a battle is not a deterministic thing. You don't know for sure what's going to happen, ever. Now, only one thing will ever happen, and you know that. But suppose an AI dreams of a hypothetical battle. How does he understand that the outcome is not certain? In the current architecture, this essentially uses MC sampling to give the AI some idea of the distribution. In other words: run many battles, examine many results. Exact same principle as photorealistic rendering via path tracing. BUT, obviously very inefficient.

Then I started thinking about reality. I'm no physicist, so I apologize for how badly I'm about to brutalize some deep physics concepts. I've heard that, in quantum mechanics, states are not deterministic, but rather distributions over possible states. Only under observation does this distribution "collapse" into one state (or appears to?). Terribly sorry if I have totally misunderstood quantum mechanics (hey, bonus points if anyone here has taken advanced physics and would like to explain this to us all :D ). But whether or not this is true, it yields an interesting concept: what if everything in the game state is not a discrete state, but a distribution of potential states? Then you could actually encode a nondeterministic result (for example, of a battle) without using anything more than the world state!

Immediately, normal distributions come to mind. What if, instead of storing a single number for health / DPS / credits / whatever, we store a mean and variance? Ok...so what? Well...the nice thing is that normal distributions are easy to add and subtract. Which means even if you have a nondeterministic world, you can still apply a nondeterministic operation to it and understand the result (probabilistically, of course). I have a ship, it gets fired at by an enemy that has a 50% chance of hitting it with 30 damage. Instead of rolling a die and either subtracting 30 or not, we can simply take the ship's distribution, and subtract N(15, .25), which is the normal distribution for this particular situation if memory serves me correctly. This is a well-defined operation, and results in...another normal distribution! Now, if the AI wants to understand the result at the end, it has much more information to work with. It can see not just a single possibility, but a whole distribution of outcomes that were generated by the real logic!

This sounds pretty theoretically beautiful to me. The problem is, of course: A) It is really complex B) It at least doubles memory requirements and, the biggest concern, C) it is not precise enough for many real-world situations. Even considering the simple example above, you can see why this kind of method falls through. N(15, .25) is already a bad approximation to the real situation. The bullet either hits or it doesn't, but the distribution says something totally different: that, on average, the bullet hits for 15 damage. Totally not true. These kinds of "branches" in the world state are difficult to encode probabilistically, yet they exist all over the place in game logic. Bah. Discontinuities...you always kill the fun :(

Alrighty...sorry for that spew! Just thought some of you might be interested in that little nerdnugget :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 July 28, 2013

#8
Week Summary

General Sentiment

Oh lawdy. That was quite a week!! Planets in two days...definitely brought out the best in me :thumbup: Graphics programming always gets me so excited :D I'm also pretty excited about the rounded edges on the UI - to me it really makes a big difference in sleekness. Overall, probably the best week in a long time!! :D

Major Accomplishments
  • Implemented terrain
  • Implemented water
  • Implemented surface-level scattering
  • Implemented rounded-edged widgets for UI (looks great!)
  • Attempted to implement trees (try again later...)
  • Improved chromatic aberration
  • Fell victim to Yet Another OpenGL Framebuffer Issue™
  • Better fractal detail maps (big difference in texture quality!!)
“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