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

Post

Week of February 17, 2013

#1
Sunday, February 17, 2013

Summary

Heh, well, you may or may not be excited to know that today was yet another day of battles...sadly, I haven't the time to write in as much dramatic detail as yesterday :D

For the greater part of the day, I worked on memory. I've been too lax about deallocation of memory for a while now. Part of this is a result of the fact that, often times, deallocation is not necessary. An interesting - albeit not necessarily popular - fact is that there's really no reason to clean up systems that last for the span of the program. In fact, doing so is actually wasting CPU time. Ever closed a game and had to wait for many seconds while the game closed? Yeah, probably because they were very careful to deallocate memory. Strictly speaking, it is purely a waste of time, and the game would do just as well to print a message that says "wasting your time" and make a call to Sleep(). All modern OSs will free the memory allocated by the program regardless of whether the program deallocates it. Still, there are advantages to performing strict deallocation. If you do so, then you can easily find leaks, because you can just find anything that wasn't deallocated by the time the program terminated, and that qualifies as a leak. It took a long time to re-work the memory system into something stricter, and it's still not done, but I've already got a better handle on the game's memory usage.

Other than that, I'm still working toward this unified ship interface. Today I was able to leverage some of the "generic programming" functionality won in yesterday's battle to do some neat things, like properly tie the opacity of rendered views to the opacity of the widget containing them. With the new functionality, it takes no effort to do so in an automatic way. The result is that things like the command interface can smoothly fade in and out rather than just appearing and disappearing sharply. I like for things to be smooth, and I think you will find that most such transitions in LT are smooth :)

Speaking of the user interface, I am still uneasy about it. Not the visual design/organization style that it uses, which I do like, as I've laboriously described in previous logs - it's very dynamic and intuitive. But the code structure makes me uneasy. There is no clear design pattern that is being leveraged. This is probably a result of the fact that I went for a traditional inheritance hierarchy (ew.) for the UI rather than a component design (which the rest of the engine uses). I realize now that, even for seemingly-smaller tasks like a UI, it probably still pays to ditch inheritance altogether and go with the more elegant component option. I can see a lot of things that would become more beautiful under this system. Sadly, I'm not sure that I'm up for a total rewrite at the moment.

Sorry for the lack of linguistic excitement in this log. I'm sure medieval Josh will come around again someday ;)

Hour Tally

Coding: 5.21
Composing: 1.30
Internet: 3.05
Testing: 0.93
Total Logged Time: 10.48
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#2
Monday, February 18, 2013

Summary

Wow. If I weren't so tired, I would have to write another medieval-style record, because today was at least 10x as epic as the previous embellished log. When you see the hours, you will understand why I am tired, and why my language is not quite as exuberant as it should be given the circumstances!

I guess, if you've been reading these logs, you'll probably already know me well enough to guess what I did today. After all, I mentioned being uneasy about a piece of code at the end of my last log...and what do I do when I'm uneasy about code? Of course, I take a bulldozer to it! :D

It was a crazy idea, no doubt, but after I wrote last night's dev log, I knew what I needed to do. The interface code was not beautiful. But if I were to rewrite it, that would be my fourth complete rewrite of the user interface. But just because I failed to nail it three times before doesn't mean that I would fail again, and, in my opinion, it is always worth rewriting in the hopes of getting it right. Besides, the further into development I get, the harder it will be to rewrite systems. It is already much harder than it used to be, but still completely trivial compared to what it will be like in half a year. By then, I will simply not be able to change the interface, because doing so would probably break hundreds of code files, since I would have written so many systems on top of the interface by then. As I've said before, now is the time to get it perfect. I need to get it perfect.

And that's what I did today.

There's no question in my mind about it. For the first time, I feel 100% like the interface code is a sunshine-laden meadow of beautiful flowers! This time I went with a component-based design, as I should have from the beginning. The result is incredible. Wow!!! It only strengthens what I already knew: component paradigms blow the @#$* out of object hierarchies/inheritance paradigms. This is most definitely the strongest lesson that I've learned since embarking on LT, and it seems that the message strengthens with every new line of code. Systems that I write in component style consistently outperform my expectations in terms of robustness, extensibility, and cleanliness. Systems that I write with inheritance consistently underperform in the same areas. Take, for example, the entity system (the thing that manages all game world objects like ships, planets, etc, and provides a way of accessing/modifying them). It was one of the first systems that I wrote, and, by some crazy inspiration, I realized from the start that I needed to write it in component style. To this day, the entity system remains one of the most clean and stable pieces of code in the engine, and has gone through remarkably few changes compared to other systems. I extend it every week without problem, because it is clean, easy to understand, and it just works. And now, finally, the interface is no different! Next time I start to write a big system, slap me and remind me, "Josh, go with components from the beginning, else we will have to listen to way too many logs of you complaining that your code is unclean, and those are very boring compared to your medieval stories."

So, what do we get for all this? Basically, nothing :P The interface looks the same as before. Well, actually, I haven't quite finished re-implementing all the widget types yet, so it's a little more basic than before. But please, don't tar and feather me just yet! Seriously, I feel so much better about it now, and good feelings translate to good code, which translates to a good game ;) I have never felt this good about LT's interface engine!!! It's going to be so fast and easy to create powerful interfaces. Exciting just to think about!!!

Wonder if I can hit this kind of hour mark two days in a row?? That'd be crazy... :geek:

Hour Tally

Coding: 9.24
Internet: 3.36
Testing: 0.87
Thinking: 1.23
Total Logged Time: 14.69
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#3
Tuesday, February 19, 2013

Summary

Good news and bad news. First, the bad news. Today I discovered that there was a mistake in my hour logging program that was causing a testing application to be tagged as both testing and coding, which had yielded inflated coding hours for yesterday, unbeknownst to me :( Turns out I actually didn't make my goal...I just missed it by a hair (I'll update the numbers to be correct once I finish posting this log) :cry:

The good news? Today I actually achieved it, which means yes, I worked longer and coded more today than yesterday!!! :D Two record-breaking days in a row...awesome!

Since I wasn't able to finish the entire UI overhaul yesterday, I wrapped it up today. Well, actually, I wish I could say that I wrapped it all up...let's say 90% finished, though. Basically the only remaining step left is to replace all of the old creation code with new, so that it builds the interface using the new system. I now have support for just about everything that I used to have (I'm working on that last 10% as we speak). But, of course, overall, there's way more functionality, since the replacement widgets are 10x more powerful than the old ones. And cleaner :)

I'm a little sad that this process took so much coding time...but, as always, it's a worthwhile investment in the future, and now that everything is component-based, I'm confident that I'll be thanking myself for putting in these hours for months to come!

Another large chunk of time today went toward splitting up the engine library into smaller pieces. Before, it was compiled as a monolithic DLL (which the game executables linked to). Now, I've split it up according to my directories, so I build separate libraries for AI, Core, PCG, UI, etc. I did this because compilation time (well, actually, linking time) was getting a little rough. 12 or so seconds. Not bad for a large project, but too long to wait to see the result of small changes. Splitting the library into pieces yields significantly faster compilation; I'm now around 4 to 5 seconds. Much better! :) In this process of splitting, however, I had to make a number of significant low-level changes, including rewriting the way that the procedural engine handles delegation of tasks.

It's pretty scary how fast this month has gone by. Can you believe there's only 1 week left??? Yeah, me neither. I hope I have something to show for the video :? I'm hoping to wrap up this UI overhaul entirely by the time I go to bed, and then start building some serious stuff with it tomorrow. Gah, so much to do!!! Better get back to coding :oops:

Hour Tally

Coding: 10.27
Internet: 2.54
Testing: 1.22
Thinking: 0.77
Total Logged Time: 14.80
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#4
Wednesday, February 20, 2013

Summary

Three days in a row?? Nah, sorry! ;)

Well, I might have been able to do it, but today I had to go take care of the business side of LT, which replaced my usual afternoon coding jam. The good news is that we're doing it right, which hopefully means that I'm not going to end up living in a gutter on the side of the road, which is what the lawyers said would happen if I didn't hire them... (I jest, of course ... :? ). The bad news is that it takes time out of coding. But LT is getting closer to being a real, bona fide product every day :)

Aside from that, I did manage to finish 100% of the UI conversion before I went to bed! My last action before going to sleep was deleting the entirety of the old UI. Man, I love hitting that delete key with lots of code files selected. Probably one of my favorite things. Hearing myself say that is a little scary...it's like..how is there any code left at all :shock:

I also implemented some new things that weren't in the old UI, and reinvented the current interfaces using this new stuff. Man I'm enjoying it. There's no doubt about it: I made the right move! I can already feel a massive difference in the power of the UI. It's even easier than it used to be to make cool interfaces! And I'm just getting started. I was hitting a conceptual roadblock before as I tried to figure out how dragging & dropping and all the fancy stuff was going to play with existing widgets. In this new world, there's no question, it's completely trivial. The components that handle dragging and dropping, for example, both have code files of less than 100 lines! Better still, they can handle any type of widget. I'm not sure why you'd want to be able to drag a color wheel and drop it onto a slider...but hey, in theory... :)

Sorry, can't spare a lot of time for the dev log today, I'm really trying to crunch right now to prepare some cool stuff for the monthly update! Only one week left...!!! :)

PS ~ "Business" is the tag that I will use to tag my hours for meetings concerning LT business. Also, in the future, I will tag responding to interviews under this. Basically anything that isn't directly related to the production of LT, but is still legitimate work time.

Hour Tally

Business: 3.99
Coding: 6.01
Composing: 0.10
Internet: 2.09
Testing: 0.95
Total Logged Time: 13.14
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#5
Thursday, February 21, 2013

Summary

Today I let my graphics coder side have a fun day in the playground, since he's been kind of suppressed with all this non-graphics work in February. In the morning, I implemented sun shafts / God rays. It was a fun little experience, but in the end, I was not satisfied with the quality/cost ratio. Then again, since it's my first time implementing this effect, I guess it's natural not to get it perfect the first time. I'll continue to play around with faster/better ways of doing it, and hopefully it will improve...if not, I can leave it in as an "advanced" graphics option for those with heavy machines. I then allowed myself to play around with something that I've been wanting to try for a long time, but knew would lead nowhere: real volumetric fog. When I say that, I mean actually performing volumetric integration inside the pixel shader...yeah, like I said, I knew it would lead nowhere, as current hardware is not ready for this kind of math. Still, I got some pretty sweet clouds running at 2 fps :D Ok, actually, they weren't even that sweet. Whatever. I was excited. But then I came back to reality and resumed useful work.

In the course of playing with these effects, I realized that I really needed a better mechanism for watching performance. For as fancy of an engine as I supposedly have (well, fancy for a 1 guy studio, I guess?), sometimes my performance profiling consisted of watching an FPS counter. Yikes! This was particularly true for graphics effects, where external profilers are of little use. A while back, I implemented my own in-engine sampling profiler, but found it to be too inaccurate for use. Today I fixed that! :)

It took a little longer than I would have liked, but I now have a really nice in-engine profiler that can give me a detailed breakdown of what is consuming resources, including graphics effects. I improved the accuracy a lot, and I'm now getting good/sensible readouts on everything! It also gave me a chance to break out the new interface system. It only took a few minutes to code a lovely (IMO) interface for the profiler. Now all I have to do is press a button, and the engine will automatically instrument itself, record a 1-second profiling session, and then bring up a window with the results sorted and organized in a very clear way. It's so easy to keep track of things now!!!

I think this is going to have a really amazing effect on my ability to build a performant game. I have found that it's amazing how performant you can make things when you watch them closely - conversely, it's amazing how quickly you can build a pile of slow junk if you're not in tune with the performance. This is, for example, why I am actually still developing on my laptop, even though my desktop is far more powerful. It's much easier to stay in tune with the performance on my laptop. I can feel it straining when I do something wrong. With my desktop, I could make a "fatal" mistake in the graphics code, I might never even know, because that darn 560GTX would just keep screaming along. Perfect example - I once accidentally made a massive error in part of the rendering code, which was resulting in every model in the game being re-uploaded to the GPU every single frame, meaning the GPU memory was basically not being taken advantage of at all, because I would replace it every single frame. Naturally, it was only a one-line typo that caused this. But I didn't even realize it until I switched back to my laptop - because the desktop was just blowing through the work as if I had never made a mistake. Ok, sorry, I think I got a little side-tracked there...my point is, today I made a profiler, and I think it will result in a faster game :)

In addition to all that performance excitement, I finally finished everything necessary to convert the main rendered view of the world into a UI widget. This means that the primary display that you see is now actually a piece of the UI, just like anything else. There's no special code at all for rendering it, everything is completely general, and could just as easily be applied to a rear-view mirror camera window, for example. If you've been reading, you know that I've been working up to this change for a week or two now, so it was an exciting moment today when it happened! Just another step toward a clean, simple way of doing things.

You'll see that I spent an awful lot of time testing today...part of it was because I needed to test the profiler a lot. But the other part was because I was having fun exploring a new system, so I apologize for my laziness :D

Hour Tally

Coding: 6.58
Internet: 1.49
Testing: 2.82
Thinking: 0.70
Total Logged Time: 11.59
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#6
Friday, February 22, 2013

Summary

Phew, with these hours, it's been getting pretty hard to remember exactly what i did in the day :shock: Especially now that I am nocturnal, days really seem to blur together. But being nocturnal has worked out well for me so far, so I think I'll keep that up :)

In the morning, I fixed the sun shafts of which I spoke yesterday. Not surprisingly, I had implemented them incorrectly. Basically the inverse of what you're supposed to do :P But that's fixed now, and they actually look pretty good! I managed to bring performance into check as well, so this effect may just make an appearance in the upcoming video.

My big focus today was building stuff with this shiny new interface system. In the process, I continued to implement some new, fancier widget types. I revamped the "configuration" panel, which I imagine will become the primary settings menu for the game. It looks and feels great! Changing the color of the command interface has never been so fun. I hope you'll like it when you see it :) Speaking of the command interface, however, the biggest technical challenge of the day was related to performance. The command interface is a full-screen widget, so it completely covers anything beneath it. This means that any widgets beneath the command interface don't need to be drawn. Usually, I would say "meh" to this kind of performance concern. But now that the main render view is a widget, this means that we *really* need a formal system for culling occluded widgets, otherwise the main render view will be drawn even when the command interface is active, which would be a huge waste of performance (roughly cutting framerate in half).

Previously, I handled this problem by giving the command interface special instructions to suppress the main renderer when it was active. Kinda the obvious thing to do, yes? But it's not clean. Why should there be such a specialized optimization? Moreover, now that the main renderer is no different from any other widget, how is the command interface to know who to suppress? Should it have to store a pointer to the main rendering widget, just for the sake of being able to disable it? Unclean. Too much of a special case. The elegant and powerful solution is to implement a full-blown, general widget culling scheme. Not exactly a walk in the park, and I really didn't think I could do it without a lot of pain...but, once again, the universe has proven to me that complex things can come in very simple packages :) It only took maybe 100 lines of code to implement! The result is that widgets are now very smart. They will *never* draw themselves if it would result in no visual difference. Not only does the command interface now correctly suppress the main rendered view (without any special code), but it also suppresses all other menus/widgets that might have been active and got covered up by it! I'm really happy about this :geek:

More excitingly, perhaps, is the fact that I also implemented a cargo/inventory interface today. It only took about an hour to come up with something that looks pretty good (in my opinion), again thanks to the cleanliness of the new UI engine :) I wanted to have refitting (equipping weapons, etc.) done by the end of today, but hopefully I'll nail it tomorrow!

PS ~ I know, I really need to get better at reducing testing time. It's getting harder and harder, as things get better looking and the game becomes more fun to play with...a one-minute feature check can turn into a 10-minute excursion :( I need to work on restraining myself, because it's only going to get worse (well, better for players, worse for testing quickly!)

Hour Tally

Coding: 6.80
Composing: 0.03
Internet: 3.16
Testing: 2.79
Thinking: 0.45
Total Logged Time: 13.23
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#7
Saturday, February 23, 2013

Summary

Another very fun and productive day! :D

The main accomplishment of the day was implementing the ability to equip weaponry from the cargo bay! Using the cargo interface implemented yesterday, I can now drag a weapon from the inventory to a hardpoint slot, and the engine will create and mount the weapon appropriately. Now, this isn't actually something that will be possible while flying around in the game - you'll need to land (be it on a station, planet, or carrier), in order to swap out equipment. But for now, I'm leaving it open, as it makes testing extremely convenient. I can easily test any weapon type by just equipping it! Great fun indeed :) Yet again, a large number of testing hours indicates that I was having a bit too much fun testing :(

A lot of other small things happened today, but I won't bore you. I'm continuing to dress up this interface with all the bells and whistles that you'd expect. Maybe I've become biased, or maybe I haven't played enough games recently - but I think it's quite good, at least from a functionality perspective. But I'll be interested to get lots of second opinions when I release the monthly progress video this week!

Ah, finally, I realize now that I'm going to have to support two types of graphical looks for the command interface - the classic holographic look, as well as a real rendered look. The reason for this is that, out of curiosity, I changed the command interface to use a normal rendering style today (which is only a one-line change, courtesy of all the UI improvements from this and last week). I realized that...it's far too beautiful when rendered in the normal style to not allow players the option! I will probably demonstrate both looks in the video. I imagine some people (more tactically-oriented) will want the holographic style, because it gives a cleaner view of the world and is better for quickly understanding the scene. On the other hand, eye-candy lovers like myself will probably want the non-holographic style. I added some post-effects to this, so that it looks a bit dream-like (hence separating it somewhat from the look of the normal view of the world).

From now until Wednesday, it's just going to be a codegrind to see how much stuff I can get done to show you for February! Wish me luck! :geek:

Hour Tally

Coding: 6.38
Composing: 0.17
Internet: 2.94
Testing: 2.18
Total Logged Time: 11.67
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of February 17, 2013

#8
Week Summary

General Sentiment

As the hours indicate, it was an intense week of work, to say the least!! Taking coding + thinking time into consideration, I logged about 10 more hours than I've been averaging. Looks like I'm finally getting into the swing of things :)

Even if nothing else had happened this week, the UI overhaul would have been enough to make it a tremendous leap forward. But there were loads of other accomplishments! Sadly, I really need to start writing down the things I do, because I'm finding it harder and harder to recount them in my logs! I'm sure I've missed a lot of things in the list below :?

I'm really looking forward to this week. I'd like to continue this massive burst of productivity right up to the release of the February video, which I hope will be to your liking! :)

Major Accomplishments
  • Fourth and final rewrite of the user interface, this time using an extremely clean and powerful component design
  • Implemented cargo and hardpoint interfaces
  • Implemented hardpoint swapping functionality (drag/drop)
  • Implemented sun shafts
  • Re-wrote the in-engine profiler, resulting in much more accurate profiling abilities
Combined Hour Tally

Business: 3.99
Coding: 50.49
Composing: 1.61
Internet: 18.63
Testing: 11.76
Thinking: 3.14
Total Logged Time: 89.60
“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 1 guest

cron