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

Post

Week of April 7, 2013

#1
Sunday, April 7, 2013

Summary

This week, my goal is to transcend single-tasking. So far, I am off to a good start. You might call it the quantum week, wherein "Josh" no longer refers to a single state, but rather, a linear superposition of infinitely many possible states. There is the guy that is lining up distribution, the guy that is working on the EULA and legal side of such an early release, the guy that is tending the command interface's rather demanding needs, the guy that is trying desperately to mend all of the minor bugs that have worked their way into the game over the months, and, of course, there's the guy that just wants you all to have some fun with this darn thing :D The current Josh cannot be adequately described by any of the aforementioned, but must be understood to be a probabilistic melange of each, only confined to a single activity by the act of observing and measuring him, but in reality, is strung out among millions of simultaneous tasks. I guess this boils down to a hopefully-entertaining way of saying that I am stretched very thin :) But it's all coming together, and I'm as excited as you are to share LT's first breaths with the public! And nervous. I hope you like the result of the past many months of my life :shock:

Among the various tasks of the day, whose details I will refrain from boring you with in entirety, I did start giving a little love to that thing that they call commanding. There's a startling amount of work left to be done on the RTS side of the game. I guess you couldn't expect me to have that perfected at this stage though. But I have implemented a basic formation selector in the command interface today, and am working to get the formation system back into shape. I had already implemented formations in the most basic sense, but now it's time to really get them right. It's actually very, very difficult to do correctly without cheating the physics. To make the AI capable of maintaining a precise formation while restricting it to using only the same thrust / maneuvering facilities as the player (i.e., only what the ship is capable of) is definitely a tough problem to crack. Actually, this is also the hardest part of combat AI. In general, AI maneuvering is difficult when doing it the "right" way. I feel that I still haven't found the right insight/simplification that I need to make it simple. I need to think about the math of it a little more, because the problem really just comes back to math, and nothing else. The problem that I am running into is not a problem with AI, it is a problem with the mathematics of a damped spring system. A spring system that is not damped enough will overshoot its target, and possibly oscillate several times before finding equilibrium. This is a problem with any damped system driven by a restorative force. It's not totally clear to me yet how I can avoid oscillation in all cases, which is something I need to do to produce realistic AI behavior.

Speaking of mathy things, I think I finally solved the 'target lead' equation today. Embarrassingly, I am currently only using an approximation to determine where the player needs to shoot in order to hit the target. Not cool. But I tried several times to solve the problem of "where do I shoot to make sure that my projectile collides with that target" and failed. Which is sad, because it seems like a very easy problem to solve. Finally I was able to grind out what I believe to be a correct solution today, and it ended up being a little more complicated than I thought. It is a quadratic equation, which I guessed from the start, but it involves some trigonometric fun that I was not expecting. Maybe I have formulated it poorly, because trigonometric fun can usually be expressed more elegantly in terms of vector math...but I am having trouble seeing the simplifications here. Still, this is a promising result, and I hope that I can implement it soon to improve the accuracy of both the AI, the targeting computer, and the lead indicators!

Let's hope for some more progress on fleet command tomorrow :)

Also, let's hope that I get a chance to, one of these days, write a dev log that is actually interesting in some way again :cry:

Hour Tally

Coding: 6.86
Internet: 1.77
Testing: 1.59
Thinking: 0.69
Total Logged Time: 10.91
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#2
Monday, April 8, 2013

Summary

Picking up speed, and feeling mighty jolly about a few things today! :geek:

First of all, let's talk about formation flying. I said last time that it's hard. Yes, it's hard when you're an idiot. But when you're clever, it's very easy. Today, I switched from being an idiot to being clever. As usual, it just took some math :P But really, a very small change to the way the AI works has completely stabilized the oscillations and pretty much all of my other problems with "real physics" AI formation flying!! Woo!!! What was the trick? Instead of thinking about where you are, you need to think about where you're going to be! Simple. And how do you figure out where you're going to be? It turns out that this is extraordinarily easy to do in a system that is using linear drag (like the LT aerodynamics uses). All it takes is a very slight amount of calculus, and the answer that you come up with is remarkably simple: you take your current position, and add your velocity divided by the drag constant. Wow. It's deceptively easy. You would never even know that there's serious thought behind that line of code, because it's only one line: p = self->GetPos() + self->GetVelocity() / kLinearDamping. And you would never know that I had to write out and solve an infinite (indefinite) integral using the drag equation to get that. But it's so beautiful and simple!!! This isn't an approximation, either: it tells you exactly where you're going to be when you stop moving (i.e., when the drag slows you to a complete stop). Now, when you use this position in your formation calculations, you go from being very sloppy to being extraordinarily precise. Instead of overshooting your target, you hit it exactly, because you aren't thinking about your exact position, you're thinking about where you're going to end up!

Quite a lot of excitement, right? But on top of that, I basically finished the main menu today. I'm very happy with it, actually a lot happier than I thought I would be. It's probably going to get a lot better for the final release, but already, it is quite stylish and appealing. Definitely more than I was hoping to have for the prototype :) And it's nice to know that, if I were to run out of time and never got a chance to work on it again before release, I would still be OK..I would be fine shipping the game with this menu (although I would need to add a few things like settings and credits). Although it's been a really stressful few weeks getting ready for the prototype, I know that I'm going to thank myself countless times in the coming months for having ground out so much work and for having already started and even completed a lot of important aspects of the game. I really think LT development is going very well :) Already much better than the trainwreck that some of the cynics out there were predicting ;)

I worked a bit on the installer as well today. Another logistic issue that needs to be done before launch, as I want to package this thing in a legitimate way, not just a zip file. It's just going to take time, as I've never used installer-making software before, but it's turning out to be easy enough. This time was split tagged between 'business' and 'internet.'

Finally, worked a lot more on the load/save interface today, including getting some code in place to read directory structures to enable listing of savegames. I was dreading this, because, as simple as it seems, manipulating directories is (oddly) not part of the c++ standard. I don't really understand why c++ includes standard file stream capabilities, the c library even includes the ability to remove or rename a file, yet directory listing / creation / removal is totally missing. This means that you have to resort to platform-specific solutions, or to an external library. Boost is the common choice, I believe, but since I've already removed Boost from LT once, I'm not looking to add it again. I ended up just writing a small amount of platform-specific code, which will add a few hours to the porting process, but I don't think it will be a big deal. To be honest, the UNIX file / directory manipulation functions are (IMO) nicer than windows, so it really shouldn't be a problem.

Hour Tally

Business: 0.21
Coding: 6.42
Internet: 2.87
Testing: 1.89
Thinking: 1.53
Total Logged Time: 12.92
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#3
Tuesday, April 9, 2013

Summary

Didn't get in quite as much time as I would have liked today. A relatively close family member of mine passed away last week, and the funeral was today, so I spent a solid half of the day at that. Life happens, I guess?

I spend loads of time online today figuring out more things about installers, and also getting everything lined up with Desura. I looks like Desura is going to come through for me, so I think that will actually be the way to go for the Prototype! And, of course, one less thing to worry about at release, since we now have one distribution platform ready to go :) GOG and Steam coming up eventually, I hope!

Almost finished the installer today. I know, I know. You don't care about installers. But it's the small details that count, right? If there's one thing I know, being a graphics programmer, it's that...appearance matters! Which is going to give you a better first-impression of the game: unzipping LTPrototype.zip and getting the whole directory structure right there on your desktop, or sailing through a smooth installer while the progress bar teases you and the background images work up the excitement? :)

Plenty of command interface improvements, too. I'm really hoping that this thing shapes up in time for the Prototype...which probably means no sleep tonight. We'll see!

At any rate, too many scattered thoughts and too little time to make anything coherent out of myself tonight :)

PS ~ I'm finally scheduled to get internet. Next Monday. GREAT. Yeah. Well, at least I'm getting it. Was starting to get worried. I gotta say, it's pretty tough trying to stick to only 100MB or so a day :? It'll sure be nice to have that good old cable 350GB / month limit back :D

Hour Tally

Business: 0.85
Coding: 4.68
Internet: 3.55
Testing: 0.97
Thinking: 0.74
Total Logged Time: 10.80
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#4
Wednesday, April 10, 2013

Summary

Accidentally fell asleep too early last night, resulting in a real temporal rip-off :cry: Hopefully I will not make the same mistake tonight.

I'm really in a rush here since the official "nonstop grind until prototype completion" has begun. So I'll only talk about one little snippet of excitement today, which I thought was quite nice: when I went to go get a printer today, I also somewhat spontaneously bought a gamepad. I've never used one for the PC before, but it seems a common enough request to have gamepad support in LT. Well, it actually only took an hour or two to make it happen! I wasn't really expecting to have that for a long time...but I liked the feel of the gamepad in my hands, so I just had to go ahead and make it work in game :) I must admit, I have greatly underestimated the appeal of flying a spaceship with one of these. It's so fun!!! With the recently-added target assistance, it's also perfectly feasible to aim and shoot with the thumbstick as well! Combat with one of these just feels more tactile, slamming those thumbsticks to make a hard turn, pulling the trigger to open fire. It does make a difference, and I'm surprised I never tried it before.

I also didn't realize until today that gamepad and joystick support are the same thing! So the game also supports joysticks now, although I haven't tried one yet. I'll pick one up next time :)

All this hardware support is getting me excited. While I'm on this roll, should probably go ahead and order an Oculus Rift kit too :D

Tomorrow is going to be big. There's no question about it. See you then!

Hour Tally

Coding: 7.12
Internet: 1.55
Testing: 1.59
Thinking: 1.28
Total Logged Time: 11.54
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#5
Thursday, April 11, 2013

Summary

Yeah!! Another one of those bittersweet days where there was too much code to remember it all :D

I guess the biggest achievement of the day was finally having saving and loading working legitimately, fully, and for reals. The reason I add so many qualifiers is because I'm pretty sure I talked at length about "almost" finishing it a few days ago...but it's not over until the fat lady can open a menu, hit save, and come back to her fleet later, after she's done some singing. And today, I was that fat lady, and I happily invaded my hard drive with dozens of useless savegames...and I even-more-happily came back to them later! I guess what I'm trying to say here is that we have a functional load/save menu!

I worked a good bit on the core procedural modeling technology today, upgrading the memory handling of that subsystem, as well as extending it with a few new features and improving the robustness of existing ones. As a result of my work, I'm able to create more interesting shapes now, and I'm pretty pleased with some of the neat ships that have come out of it. They're not a huge change from the lego blocks that we all know and love from the dev updates, but it's amazing how much appeal a very simple bend operation can add. Giving the hull some curvature definitely does aesthetic wonders!

Finally got shields back into the game today...I'm not sure if you noticed, but they disappeared in the last update :D Certain features tend to do that when I don't touch them for a while. It is a side-effect of my habit of ripping out code all the time :oops: Anyway, they're back, and they can be bought and equipped now. Cool stuff. I haven't figured out exactly how the mechanics of them are going to work yet, but I guess it's going to be continuous recharge during normal operation, but "restart" period that takes longer if they get fully knocked out. Standard way of handling shields I think. What about power, though? I guess it just boosts recharge rate. Maybe even shortens restart period. We'll see.

Believe it or not, I actually am making serious headway with my "todo before prototype release" list, to the point that I think a few more days of intense code should suffice!

Hour Tally

Coding: 8.36
Internet: 1.17
Testing: 2.41
Thinking: 1.11
Total Logged Time: 13.04
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#6
Friday, April 12, 2013

Summary

Another fantastic day! So much done, yet so much left to do...so much excitement, yet so much anxiety...so much Limit Theory, but still not enough! :D

I started on and finished (yeah!! You know it's a good day when you hear that phrase) the "new game" menu. There's not much to it, just a text field to edit your pilot's name (a nice little bonus is that the default name is procedurally-generated, although I was very tempted to put Edison Trent instead ;) ), and a grid of tiled image buttons to select your starting system. I've decided on 4, so you get a choice of 4 systems to explore / fight in / whatever for the prototype. Should definitely give you a few hours of fun! :) I hand-picked some of the nicer systems that I could find, but also tried to include some variety, especially with colors. One of them is also dusty. But they're all very beautiful, IMO! The configuration will be roughly the same for all of them though, nothing exciting: a few asteroid stations and some asteroid fields, with acceleration lanes to connect the stations. Very basic, but gets the point across. But still...I'm excited about this. A new game menu...save/load game menu...sounds like a game, no?!

Still working very hard on the command interface, and it's looking better all the time - almost functional, I think! Fleet control is going to be very basic for the prototype, pretty much what you would expect from an RTS, perhaps a little bit less. Definitely not full-fledged LT-style yet. But this is basically the trade-off that I have decided to make with the prototype: I have changed it from being a "combat prototype" to being just a "prototype," i.e., a much more holistic thing. I like it much better this way. True, we won't be able to completely hammer out all the details of combat, but I would much rather you have some real fun with it, get a feel for what the bigger picture is going to be like, and give me feedback on other things, not just combat. So I have decided to rename it to just the "LT Prototype," it's no longer the "LT Combat Prototype." Hope everyone's cool with that :) Like I said, it's so much more than I ever imagined delivering at this stage. And yet...so much less than I want it to be :twisted:

I mentioned shields working again yesterday, and today I implemented the mechanics as I said I would yesterday. Shields are just recharging armor. Simple! And they come back after a while if they get destroyed. I tied both of these functions into the energy system, so routing power to shields means faster recharge as well as faster restore when they go all the way down.

PS ~ I NEED TO TELL SOMEONE about this. It's worth mentioning. I bought a cheap keyboard that had a trackpad the other day. Wasn't expecting much considering the pricetag. BUT. It has quickly become my favorite thing ever. I like it even better than the old $70 fancy one :shock: This thing is amazing, because I'm totally mobile now while coding...with the keyboard and mouse in the same device, it's just too easy to code from wherever you like! Sitting on the couch, sitting at the table, sitting in a rocking chair...this keyboard is really the greatest thing ever. STAY WAY. It's mine. :ugeek:

Hour Tally

Coding: 7.09
Internet: 1.11
Testing: 3.52
Thinking: 1.70
Total Logged Time: 13.42
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#7
Saturday, April 13, 2013

Summary

This isn't the Saturday I was looking for (move along, move along), unfortunately...but that's the way it goes. Two really productive days, one mediocre day. How to increase this ratio? Still searching for the secret... :geek:

I think my problem is that, at this point, the only thing standing between me and releasing the prototype is a thousand tiny details. I seem to be pretty bad at those. Give me a large system to implement, like serialization, or a new interface engine, and I'm a happy camper. But tweaking / fixing / improving thousands of small things is definitely not my favorite. And yet, it's all those tiny details that really make the game a game :D

On the bright side, I'm happily commanding fleets from the command interface! What's more, they're doing semi-intelligent things :) I rewrote the AI's collision avoidance today, scrapping my clever, advanced system in favor of a simple and clean solution that's more reliable. It's not as precise, but I'm finding more and more that success in game programming is about doing things simply, as it tends to pay off in a lot of ways. Indeed, it's noticeably more robust now, and I was impressed today as a cruiser managed to maneuver its way in between a large asteroid and my tiny little fighter, managing to hit neither of them! Both the asteroid and my fighter's hull were thankful for this impressive feat of coordination.

Amidst all of these boring little polishing tasks, I managed to find an exciting stroke of inspiration today concerning AI. I figured out a way to unify all AI maneuvering - collision avoidance, formations, specific maneuvers, etc. Guess what the answer is? Luke, search your feelings...

..scalar fields...

("THAT'S NOT TRUE! THAT'S IMPOSSIBLE!!! NOOOOOOO")

Indeed. You know it to be true. It occurred to me that it is useful to think of AI maneuvering as the act of optimizing a function f(x, y, z). You can frame the problem as one of "finding the correct location in space" where the AI should be, and this can be thought of as a scalar field, where the field value represents how favorable a given position is. At first I wrote a really long explanation of why it's awesome, but then decided not to bore you :P I'll skip straight to the punch line: using fields gives you a completely natural way to interpolate the AI behavior when it's performing a bunch of actions/goals at once. I.e., you've got a ship that's trying to maintain a formation, but also trying to avoid an asteroid, while simultaneously trying to move to a certain point. If you start thinking about all of these together and how you're going to write an AI to handle the composition of these, you'll give yourself a serious aneurysm. But with fields, all you do is define a field for each goal, and then take the sum :) The result is a natural interpolation of the AI behavior for each action. If you need certain actions to have precedence, then you just increase the coefficient of the field! Then, to actually compute where the AI should go, you just take the gradient of the field, and move in that direction (think of gradient descent/ascent algorithms, this is exactly what we're doing!) Math strikes again!!!

Well, I was very happy with this insight, until I realized that the best way to implement it was to actually define the gradients directly rather than define a field for each action. And then, I realized that this is exactly equivalent to the way the AI already works :oops: Yep, I didn't realize why it was a good solution at the time, but I intuitively implemented something that's equivalent to performing gradient optimization on the sum of fields...! So it turns out that I didn't gain anything from this insight. But at least I feel better about the AI's maneuvering implementation, and understand the theory / why it works well!

So, for anyone who's lost count, here's a list of all the ways in which the game uses scalar fields:
  • Models
  • Textures
  • Icons and other UI graphics
  • AI maneuvering, including collision avoidance
I hope by now everyone is convinced that math is the magical solution to everything :D

Hour Tally

Coding: 6.43
Composing: 0.66
Internet: 2.52
Testing: 3.26
Thinking: 0.75
Total Logged Time: 13.61
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of April 7, 2013

#8
Week Summary

General Sentiment

It was certainly a great week, and even though Saturday's log was a bit morose, I can't deny that these seven days have brought a whole lot of improvements to the game! In just a few weeks I have gone from feeling depressed about releasing the prototype to the world, to actually feeling excited about it! I think I've managed to bring it to a polished-enough stage that people will be able to say "I'm proud to have backed LT" :) Of course, I hope people will be saying that even more when the game is released. I think this is going to be a pretty darn good game :D

Major Accomplishments
  • Implemented "new game" interface + all the necessary infrastructure for handling game switching
  • Implemented main menu (!!!)
  • Implemented gamepad & joystick support
  • Finished serialization, including load/save interface
  • Significantly improved the settings menu
  • Significantly improved AI maneuvering (formations, collision avoidance)
  • Started on the installer
  • Found yet another way to bore people with talk of scalar fields
Combined Hour Tally

Business: 1.06
Coding: 46.97
Composing: 0.66
Internet: 14.54
Testing: 15.22
Thinking: 7.80
Total Logged Time: 86.25
“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 4 guests

cron