if (Vector3.Dot(t.normal, bdir) > 0)
In spite of XNA’s attempt to build a vector library that even orangutans could use (in turn in spite of the irredeemable clumsiness of .NET’s type system), I find myself doing high school trigonometry by hand more often than seems necessary. On the other hand, if I didn’t stop to think that cos(±π/2) = 0, this condition check would have been much more inefficient:
if (Math.Acos(Vector3.Dot(t.normal, bdir)) < Math.PI / 2)
This is also what a built-in Vector3.AngleBetween() function would have done, if there was one. The fewer trig calls the better…
Vector3.AngleBetween()
Anyway, this is all part of a new collision routine specifically for platforms, designed to support one-way, bouncy, and moving platforms (in any combination).
The rest of my time during the past week was spent practicing video game cosmetology: removing the most unsightly bugs and temporary assets, touching up colors, and even adding a nifty new, fluid “chase” camera, which drew much attention during our industry demo. Sometimes the little things really count!
b = Vector3.Cross(a, Vector3.Cross(a, p));
Let’s go sailing a × c and ocean… 6 across, 12 letters: disgruntled commodity Don’t you just love my hot cross puns?
a × c
(Honestly, though. I hate writing math code in C#.)
Many apologies for the stagnancy. Shall I summarize my efforts for the past month?
That last one hints at the fact that a sizable percentage of my time has been spent attending to my teammates’ difficulties with Git. GitEx has smoothed the learning curve greatly for many, but it has taken time for the paradigm of distributed version control to sink in. After a month of gentle nudges and hand-holding, though, at least half of the team are into the flow now, and the rest are beginning to learn from them. We even have de-facto mini-teams forming again, working within a single fork to complete complex tasks and merging regularly with the main branch (although not at the same time, yet). All this means I might finally have more time of my own to work on gameplay!
currentEntity.velocity += acceleration * (float)gameTime.ElapsedGameTime.TotalSeconds
The simplest ideas are often the best.
Gravity is one line of code. Wind resistance is two. Updrafts…probably 30.
In any case, it seems that my most valuable contributions are those that happen without premeditation. More than half of my “stories” for this project were never formally planned, and more than half of those that were have been rescheduled, reassigned, or reinterpreted. It has become obvious to me that agile development needs to be agile in every sense: it’s neither possible nor practical to limit each mind to a “shopping list” of tasks. An efficient agile developer is like a figure skater: able to spin on a dime and turn from one maneuver to the next without breaking stride. Time spent changing direction is time saved running against the plastic barriers of a design made from limited information.
Anyway, aside from some interesting additions to physics, I’ve also built a few world objects, such as chests that deliver gifts of headwear. Actual gameplay is coagulating swiftly!
triggerLinks[trig] = Regex.Split(root.Element("Links").Value, @"\s*,\s*")
Yes, we’re using CSV inside XML. OgreMax exports scenes as XML based on input from a range of configured widgets, which doesn’t include one for supplying arbitrary lists. CSV the closest we can get to “user-friendly” for our less geeky level designers to link their triggers to multiple targets.
You may wonder what any of this has to do with spline-tracked cameras. We’ve in fact decided to set aside that project, whether only for this year or for good, leaving me to pick up the slack wherever I find. Shadows are still on the plate, but are now largely under the care of our expert in animations, and at a lower precedence than implementing said animations or game logic.
callbacks(this, other, time)
We’ve finally come to realize that there’s only so much we can do in two months, especially now that we’re down to two weeks before alpha. Our minimum scope has been pared down to the size of a single level with no curvature. However, due to popular demand, we have not simply shelved it until next year when we’ll be sure to have the time to finish dealing with the complexities of multiplayer camera tracking along a Catmull spline. No sir: instead, I have been volunteered (or more accurately, dragged away from my volunteer position in the [much more important] domain of shadow rendering) to help the camera “specialist” hack together the entire caboodle of attractive, curvy features in the space of one week, after which we will decide whether to integrate our work into the alpha release.
I do recognize the appeal and novelty of this feature, and will give my all to see it completed, but I’m afraid that this is yet another case of misprioritization based on the loudest voice in the room. We have no functional applications for a camera spline track as of yet, nor do we even have a working prototype of the rotational transformations necessary to support multiple viewing angles. I can only hope our efforts will prove worthwhile.
BoundingBox.CreateFromPoints(originalBB.GetCorners().Select(c => Vector3.Transform(c, transform)))
That must be the ugliest and most naive way to generate AABBs ever. LINQ is wonderful, but my method-chaining habits from Ruby don’t exactly translate elegantly to C#.
Since Thursday I’ve been on double duty, first patching a bounding box rotation bug with the above eyesore, then being asked to integrate object interfaces, class hierarchies and even entire branches together, all while cleaning up math errors and making optimizations. Even now my plate remains unclean with the stains of a thousand lines of unmerged code.
As a bonus, due to issues in deployment logistics with the lab machines, we’ve decided to abandon Git for this semester, practically invalidating my work of the past two weeks. Not to be discouraged, however, I’ve already prepared a tutorial for my teammates to use Git alongside our existing SVN repository, so that they’ll each have a chance to wet their feet before taking the dive next year. I do think most of my teammates are convinced of the necessity of change, what with frequent (and avoidable!) merge conflicts and our ever-growing bramble of pointless branches, but the final hurdle will be weaning them off of a flawed system for which they were not aware alternatives even existed.
git svn fetch animation -r 146
A CADE operator finally bothered to take the time to read my massive email (after I coaxed him in person). Amazing! Now that we have an actual GID, I can spend my time migrating our project instead of writing half-assed Git tutorials. After consultation with our fearless leader and various experts, I believe I should be able to move everything without halting the dev cycle, even with our ridiculous pile of branch spaghetti.
If that goes well, all that would remain is for the opers to install our needed tools, and for my teammates to trip on the doorstep of their scary neighbor Git.
git init --bare --shared=0660 heroes.git
That’s got it.
After a few hours of R&D I’ve found a setup that should suffice. Most of the lab’s git tools are still intact, and I’m hoping the ones that aren’t are only for end users. All we need is a place to push.
I’ll still need to collect the team’s handles and coerce the admins into adding another group…and while they’re at it, maybe install gitextensions on their Windows boxes. Of course, being currently the only git user in the class, I get the feeling I’ll need to write a book on it just to get them up to speed.
git init
First, an apology. My conflicting interests in other classes has led me to be lax in my documentary habits. However, with the most pressing obligations out of the way I’ll should stay current with this development log from now on.
Second, a lament. The past two weeks also have been full of obstacles aside from schoolwork, and I’ve spent most of my time attempting to clear them. For example, the condition of the SVN repository, now with almost a dozen poorly maintained branches, is so deplorable that, last week, I took it upon myself to rally a complete migration to Git. Unfortunately, I recently discovered that key components of the CADE lab’s Git installation are non-functional. In addition, the Windows machines lack Git tools completely, making it difficult to ensure a ubiquitous working environment for our team.
Meanwhile, the SVN-related problems continue to accumulate. Having used both SVN and Git, I can easily recognize when and where each tool has its purpose, of which ours is most assuredly aligned with Git’s. I am now too invested in my current plan to retreat, despite the setbacks.
More updates will come within the week.
((CollidableEntity) e1).OnCollide((CollidableEntity) e2)
It was pretty predictable.
Our project was simply too ambitious—too ambiguous—to deserve a year’s supply of BS&T squeezed fresh from a dozen undergrads. We needed something with a vision.
Heroes of Hat is an upcoming (yes, we have a release schedule already) belt-scrolling action game with hat-powered abilities. The story is a complete contrivance, but its “Press X to join” couch co-op and unique ability system should make it at least a few Saturday evenings’ worth of fun.
Jon (the brainparent of the game) has us programmers at the point of a taser, rushing to get something playtestable before we’re even assigned the task. Already we’ve laid down the bare, unbleached bones of a game engine, which have sadly formed a macabre cage around my creative heart:
public static void detectCollisions(Tile tile) { foreach (var e1 in tile.containedEntities) if (e1 is CollidableEntity) foreach (var e2 in tile.containedEntities) if (e1 != e2 && e2 is CollidableEntity) if (((CollidableEntity)e1).collides((CollidableEntity)e2)) ((CollidableEntity)e1).OnCollide((CollidableEntity)e2); }
Utterly revolting to anyone with a coding conscience, and yet this is the only truly correct implementation given the current structure of Tile and CollidableEntity. Disregarding the inefficiency, the ambiguous ordering of the many and possibly redundant calls to OnCollides makes this code’s behavior very unpredictable. Jon and I are still evolving the collision framework, but alas, I forsee a swath of future monkey patches.
Tile
CollidableEntity
OnCollides