Monday, August 26, 2013

Trail Effects in Galactose

Hey Everyone!

Sorry about the lack of a post last week, anyways, this week I will be talking about trail effects in Galactose.

Trails are important!
Overall, Trails are one of the effects that most expresses the visual style in Galactose. We use trails for projectiles and behind ships. They are also something that has gone through a large number of revisions. This week I'll take you through their history and explain a bit about their implementation.

Some History
Originally the trail effect started as a quick modification of the "wake" effect from a game called "Poultry Pirates", which we wrote for a 3d games course. Poultry Pirates became the initial tech base for Galactose (then called Star Chronicles), and initially, I used a slightly modified wake effect for the trails. It wasn't great, but it was very quick to (ab)use the old effect for this purpose:

Humble beginnings...
As a side note, I always thought the orange shot effect looked pretty cool. Anyways, this was the state of the trail effects on January 28, 2011. It should be noted that this is long before many game systems such as .obj file loading were implemented.

Those old trails were pretty buggy, and had a lot of visual artifacts and were generally pretty slow, however. Thus, they were revised...

An allied ship's trail ~(March 10, 2012)

The next iteration of trails looked a fair bit better, though you can still see quite a few visual artifacts here. In fact, it had additional artifacts when looking at it from behind the player's ship:
The player ship's trail ~(March 10, 2012)
But, here, you can see the genesis of how we implement our trails. Basically, we abuse additive blending and the geometry shader.

The coloring is based on a cool strategy I implemented in a homework assignment for a computer graphics class, in order to make my particle system much cooler.

Basically, I use a 4th degree polynomial to decide the color at a given point along the trail. I use the position along the trail with some scaling and tweaking as the x term, and have 5 coefficents for each of the red, green, and blue components. For the effect seen on the dinner ships, the terms I use are

             //a        b         c        d          e
             0.00f, -0.00f,  0.03f, 0.16f,  0.00f, //red
             0.00f,  0.01f, -0.03f, 0.03f, -0.00f, //green
             0.00f,  0.02f, -0.13f, 0.15f,  0.13f  //blue

Trail Particles
The Individual particles of the trails are pretty simple to render. First, we decide their color with the coloring strategy above, then, per-pixel, we decide on the opacity based on how far the pixel is from the center of the particle. We could have done this last part with a texture lookup, but I've found that it also works pretty nicely to just use the distance formula and pick their opacity procedurally, which was a strategy I came to like after taking Procedural Shading.

Additive Blending
Anyways, basically additive blending works, is that you make things "brighter" when you additively blend atop them. This has a number of useful properties, first of all, its great for "energy" type effects which want to make things "brighter", and secondly, since addition is communitive, the order that additive things are blended does not matter. Both of these properties are important for trails, if you break them you get things like this:
A Trail Rendering Bug
Clearly, this is not what you want to do. (In this case, iirc, it was actually that it wasn't applying blending)

Anyways, the other part of our trail system is that we keep track of a series of points where the trail emitter has been recently, and use the geometry shader to interpolate a number of small quads between those points, which are then additively blended together to produce the trail visual.

Low End Graphics Cards
For different trail quality levels, I adjust the number of trail particles, so if you turn down the quality, you might start to see the individual particles more, and the gaps between them, which will tend to look something like the "Player ship's trail" image above.

 But isn't this expensive to render, you ask?
Well, that actually depends. On decent discrete modern graphics cards, it runs pretty smoothly, but for something like a really old integrated Intel graphics card, it is kinda a problem, so we use a slightly different approach for our "ultra low graphics" mode.

Ultra-low-quality Graphics mode
Normally, you probably wouldn't notice the distortions visible above, it took me a few minutes to find the right direction to view it from; Anyways, for ultra-low-graphics mode, we "cheat" for distant trails, and render the trail with 3 polygons - two at a cross-section to give the length of the trail, and two cross-sectional slices which help hide the effect from the front and the back (you can see those cross-sectional slices as the two "bumps" in the above image). Overall, this actually comes pretty close visually to the most important cues about trails, but it creates trails that are very "rigid" and which can't express trajectory at all, instead, they stiffly point right behind the "emitter", in a straight line.

Ultra-Low-Quality Graphics Mode + no glow
Its perhaps easier to see whats going on with the broccoli bombers and the glow effect turned off. Notice the cross shaped sections above. The reason you can notice the trails on these ships is because the cross sectional slice is occluded by the back of the broccoli ship, and with the glow off, its also much easier to see. Anyways, if you don't look too closely, it looks like a very similar effect to the "nice" trails, but at a much lower rendering cost.

Glow and Polish
Large Trails
With a few more months of tweaking and minor improvements trails began to look event better.

Almost surprisingly, this works across a fairly large range of trail sizes. In the above image, you can see a fairly recent change to trail rendering in Galactose, where we added a "glow" effect to them (along with many other effects in Galactose), which makes them look significantly cooler
Glow (Left)                 and        Without Glow (Right)

Anyways, for the "glow" effect, we basically render to a lower-resolution off-screen buffer, then blur that a few times and then blend it back into the final image. We use an approach probably not all that different from the one described in GPU Gems 2. Instead of a glow texture, we render the effects which want a glow effect normally and then use that. We also use a somewhat different implementation since we're not as constrained by the shader language as they were back then.

Future Work
Concept Art from the Start Screen

More Concept Art
There are always things to improve. What I'd like to improve the most is to make the trails look less smooth and more chunky, like you see on the background of the start screen. I haven't quite figured out how to do this yet, but I think it would really take the visual polish to the next level.

Probably my favorite trails
I still think the trails on the enemy ships are probably my favorite trails, I really like the "fiery" impression they give off.

Thanks for reading my long winded post about trails.

Also, since we are demoing our latest build tomorrow, be on the lookout for a new build soon. (sadly, it won't be a huge change in things, but it will have some improvements)

Tuesday, August 13, 2013

Hello there fellow pilots

Hello there fellow pilots, Gamers, and food lovers alike. My name is Rob Summerhays and I am your fellow 3D Designer for this grand scrumptious game we call Galactose. I have been working on this game for half a year now coming up with concepts that the whole team discusses. I have worked on the carrot missals that you see on the salad turrets along with the salad turrets themselves. We currently are working on new ship designs and classes that will enhance and strengthen the space combat experience. I am currently working on a support class ship for the dessert side. This ship will be vital in your battles ahead. Protecting you from the dinner with a shield or healing your units on the battle field. I really cant wait to see how our game further develops and grows with our new upcoming ships and our RTS system being worked on by the whole team. We look forward to your amazing feedback everyday and strive to make an experience that is both fun and unique to our fellow space explorers. Thats all I have for now but will come at you with another update next week. In the meantime keep gaming and keep baking!    

Monday, August 12, 2013

August Demo Night

Hey Everyone!

We're gonna demo our current build of Galactose at the NYC Games Forum's August Demo Night.

The event is at 6:15 PM, on Tuesday, August 27, 2013, located at 1290 Avenue of the Americas, 6th Floor, New York, NY. 

If you want to attend, you need to RSVP here.

Its not a long event, but there will be a couple of other games by other developers at the demo night, so if you are in the area it might be interesting to attend.

Monday, August 5, 2013

Hello again! Matthew Pablo here, composer and sound designer for Galactose!

It's been quite a while since my last post and frankly, quite a while since I've delved into creating new material for Galactose. That's not necessarily a bad thing since usually music and audio is usually part of the final steps of game production. I do have some thoughts and some interesting things to say about some of the work that I have done for Galactose. First off, I did briefly explain how I came to be part of this development team through John finding me on which is an open-source art website for developers to use whatever material they want from that site for free basically. I bring this up because initially they were looking for a good music track to back the cupcake-dog-fighting action and it was this piece I made for an RTS that is no longer in production. To me, it was to "organic" and "tribal" sounding considering the use of only orchestral instruments. Laser slinging cupcakes in space is no where near that sort of sound, so since they felt this track musically fit really well I decided to give this orchestral track an electronica makeover making it more fitting to the gameplay and art style.

You can hear the comparison here on my website:

Now one might assume that video game tracks are usually no longer than a minute, and commonly they are just short loops. This track had a different purpose; to be thematic and to complement a longer and slower paced style gameplay of a a strategy game. Sure, I could've used loops but in a slower paced game, I'm sure you don't want to hear the same thing over and over again for about 30 minutes or longer... Instead I went with a pretty varying musical track with memorable leitmotifs that stays interesting for about 7 minutes. Having this on repeat should have a better effect on the player who is emerged in a 30+ minute strategy mission. For Galactose, it still works well since it has a pretty good feel to complement the gameplay. Though it is still on the longside, I'm sure that players won't notice. There is room to shorten, but for now I think it still works. We have discussed a more interactive approach to the soundtrack where the music can evolve and adapt depending on the course of the mission or level which might be very interesting, but it might not be necessary since missions or levels might be executed in a simpler fashion. We'll just have to wait and see what we bring to the dinner table.

"But hey Matthew, this track and a lot of your other game music is pretty cinematic at times. How do you find a balance between the similarities and the contrasting differences of film and game music?"

Well, this could be a whole set of lectures on how to compare and contrast these two types of music production. For me, it's all about complementing the media no matter if it is a film, commercial or video game. Yes, there are many technical, musical, compositional, and conceptual aspects of this sort of music production one must know to be able to properly produce effective music for certain types of media, but since there is a common goal to best complement the media there are definitely many similarities. Basically I'd ask myself these basic questions:

-Does it fit the media?
-Is it effective?
-Does it make my producer/director happy?

That last one is probably the most important since they have the last say in everything you do regardless if you or others think it is the most effective piece of music for this project. Some projects may require a lot of music or maybe even none at all. Working with this development team I feel that I am sort of my own producer/director in the audio department as I am probably the most experienced in this field to know what works best and what doesn't, but I do know that the game itself is king. If it doesn't effectively complement the game then it is not right. Much of this is pretty subjective in a way but those of us with a lot of gaming experience should have a very good opinion in the matter.

"So Matthew, what is your goal musically for Galactose?"

Like I have previously mention, I want to help create the most effective and immersive experience for the player. Which means exciting music and sounds to really give that "Galactose" vibe of colorful treats shooting each other down with lasers into a tasty oblivion in space. But no, seriously I think that the electronica synth sound with a lot of "bright" and "colorful" overtones added will definitely give that deliciously sweet sci-fi shooter vibe. I am hoping to create a soundscape for this game that will leave the players hungry for yummy treats and hungry for more Galactose.

Okay sorry guys I'm done with the puns.

Anyways, we all have a lot to do in the next coming phases and I will surely keep you guys updated on my side of things.

Again, if you'd like to hear more of my music you can find it on my website:

If you'd like, please send me any of your questions and/or comments you may have for me on my website here:

See you guys later!