Post news Report RSS New Space Battle Section

One of the new features in G String will be a dogfighting sequence in space. We'd like to show you what's coming up and how we made it all possible!

Posted by on

Hello everybody!

As you might have seen in our recent teaser, the upcoming, overhauled version of G String will feature some proper spaceship action! The player will go into battle with allies to take on enemy vessels of various sizes and perform other tasks. If you didn't see the recent teaser yet, check it out:

We have been working on this for a while already and are now confident enough to present it as a definitive part of the game. Now, let's have a closer look at what's in store:

Gameplay

When designing the gameplay for the space battles, we prioritized making it quick and easy to grasp, because there is neither time nor place for any kind of tutorial or lengthy in-game instructions.

ricepod float 300

The first challenge we faced was designing the spaceship controls. We decided it would be most optimal to only use the key bindings that the player already knows. That includes moving the ship via W A S D in a similar manner as in firstperson mode and using the sprint button to boost the ship's speed. Concluding this, the longitudinal (roll) axis will be locked, which also makes sense storywise: you will be seeing the Earth right beneath you the whole time and the ship's stabilizers will align you to it. Aside from this, the primary weapons can be fired with the left mouse button and an autoaim system will additionally assist you while shooting enemies.

Since the Source engine isn't capable of any kind of open worlds by default, the whole world is scaled down by a factor of one-sixteenth to allow building a larger environment. But ultimately, the player still needs to stay within a predefined playable area. We solved this issue by simply tying its requirement into the story. Should the player still leave the area, they will either die or turn back automatically - something that we still need to finalize.

Visuals

Overall a sturdy and outworn look is prevalent during the space scenes to match the rest of the mod. This includes the interior model of the spaceship and the ship's UI, which flickers a little and has a noise effect.

To make the battle scenes more appropriate for gameplay, we color coded a few crucial elements. The target UI highlights targets in red, yellow and green which represent enemies, neutrals and friendlies respectively. The laser colors from turrets and spaceships match the general color schemes of their models: enemies fire blue lasers while friendlies fire orange ones.

space combat

UI

The ship's UI is made of holograms, which are based on a custom system we have programmed on top of VGUI. Source already offers a facility to render UI in world space (DrawPanelIn3DSpace in IMatSystemSurface for those of you who know their way around the SDK), but frankly it's not too appealing to look at or to use. Our solution renders everything based on dynamic meshes or models. VGUI is still used internally to draw text to a texture atlas which can then be drawn with a dynamic mesh as well.

space hud

Cascaded Shadow Mapping

We implemented a custom solution for cascaded shadow mapping just for the space environment. While most of the mod fares better with blurred, soft shadows due to the polluted air that scatters the light, the space scenes work well with sharper shadows. CSM makes it possible to have a higher quality shadow within the interior model of the spaceship while also allowing for shadows farther away.

shadow interior

Our CSM renders all cascades to a depth texture atlas, using the built-in flashlight depth texture rendering code to profit from all internal engine optimizations. The common world shaders, like LightmappedGeneric and VertexLitGeneric, will then sample one of those cascades to apply the shadow. Selecting a cascade is based on modifying the UVs prior to performing the sampling like in the following example:

// Check whether the projected UVs are outside of bounds of the first cascade.
// 0.0 will sample the far shadow map, 1.0 the close shadow map.
float blendCascades = step(shadowMapUVs.x, 0.49) * step(0.01, shadowMapUVs.x) *
  step(shadowMapUVs.y, 0.99) * step(0.01, shadowMapUVs.y);

// Select the cascade UVs.
shadowMapUVs.xy = lerp(shadowMapUVs.xy * cascadedStepData.x + cascadedStepData.yz, shadowMapUVs.xy,
  blendCascades);

This makes things a lot simpler and more optimized. You only need to worry about a single texture for all shadow maps and you don't need to use branching in the shader, which could potentially lead to way more lookup instructions in the compiled shader code.

While lightmaps won't be used in space, we still implemented support for them. While applying a lightmap, you cannot tell anymore which lights have been aggregated to a specific texture color, like you can easily do when rendering vertex or pixel lights. However, this is very much necessary to render a shadow that belongs to a specific light, like the directional sun light, because you only want to mask that specific light source. A more optimal solution would be producing a mask in VRAD, which could optimally be stored in the alpha channel of the lightmap, but this is simply not possible to implement in the 2013 SDK without access to the engine code.

shadow exterior

Instead, we are approximating the mask by calculating the light deviation from the expected ambient and light colors that were set in Hammer. If there is no deviation, the light will be fully masked, but the more the texture colors deviate, the less shadow will be applied. In the example above, you can see how the orange spotlight is still clearly visible in the shadowed area with this trick.

VR

Since we are planning to support VR in G String, we also made the space environment compatible using an Oculus Rift. While the 2013 SDK already offers a certain support for VR by default, there were still a few special things to consider in our case.

The crosshair hologram, for example, moves with your head in VR and is aligned to the object you are currently aiming at to prevent a cross-eyed appearance. We also project the crosshair back onto the hologram aim panel sphere and align it accordingly, which feels a lot more natural than aligning it to a quad.

There are also a few neat extras to discover in VR when looking around the ship. You can see the jet engines brighten up when you accelerate the ship or the thruster effects at the sides of the ship when you turn or strafe.

If you are interested in checking out our code, you can take a look at our GitHub repository: www.github.com/Biohazard90/g-string_2013.

We are excited about finishing this mod and hope you will enjoy it when it comes out!

Post comment Comments
Gunship_Mark_II
Gunship_Mark_II

I can't believe this is done in a source engine, this is just an insane amount of work, everything about this is amazing, especially VR features, Spaceship interface and Cascaded Shadow Mapping, i am truly speechless. Very, very well done guys, keep up your amazing work!

Reply Good karma Bad karma+20 votes
HEVcrab
HEVcrab

>Very, very well done guys

Guys and at least one girl: Eyaura, the head developer)

Reply Good karma Bad karma+3 votes
Reborn:X
Reborn:X

Source lives again!

Reply Good karma Bad karma+9 votes
Deltaslayer
Deltaslayer

Best mod ever. No doubt about it.

Reply Good karma Bad karma+10 votes
Rakym
Rakym

I dont need to stress how professional this all looks, the level of quality is remarkable. Please do more newsposts like this, so that this game gets the attention it deserves.

Reply Good karma Bad karma+7 votes
biohazardger Author
biohazardger

I think we'll try to have a few more articles like this. Eyaura is just super busy working on the mod itself and anything about, for example, the story or the research she has done for the mod should probably be written by her. I might have some more technical things though I could write myself, we'll see! :)

Reply Good karma+3 votes
Dune_Jumper
Dune_Jumper

Oh my gosh this looks insane.

Reply Good karma Bad karma+3 votes
DevinShadowV
DevinShadowV

Wow is your team once the project is finished going to release this on Steam as an indie title?

Reply Good karma Bad karma+2 votes
biohazardger Author
biohazardger

So far our plans only include releasing it here as a free mod. We'd like to have Greenlight and release it for free on Steam, but we don't have the resources to go through the Greenlight process and PR.

Actually putting it on Steam would be simple enough for me, because I already got some experience with that when I worked on Blade Symphony.

Reply Good karma+2 votes
Rakym
Rakym

What do you mean by resources? What are the obstacles to go on greenlight? There are tons of games on greenlight that dont even deserve to be there in the first place because they are only proof of concept and will never be released. I cant imagine G String not being admitted.

Reply Good karma Bad karma+2 votes
biohazardger Author
biohazardger

I mostly mean Eyaura's time. We could probably put the recent teaser on there with a few screenshots and a brief description, but I think that wouldn't live up to all the stuff she has done so far. Plus I'm not sure if that would really be enough anyway, do you think that would already make a good enough impression?

Anyway, I'd love distributing this through Steam since it just makes everything so much easier. Not to mention all the benefits you get through the community hub. When we eventually start a campaign, we'll announce it here for sure.

Reply Good karma+2 votes
Rakym
Rakym

Yes, I would think that it would be sufficient to be greenlit. Currently 5319 titles have been greenlit, and most of them are very conventional, not to say boring. Compared to them, G String is a real blockbuster. If you throw all the media here on moddb on the greenlight profile and make a newspost here on moddb, asking people to vote for it, Im quite certain that it will be greenlit in no time. The only obstacle could be the $100 submission fee, but even that is no problem if you ask the fans to donate for your project.

Reply Good karma Bad karma+1 vote
Johnathan_Freemond
Johnathan_Freemond

You got that right, even if all the fans following only pitch in. Say each donated $0.10 for refenece and I believe this "game," I consider it a game not a mod at this point, has 1,489 people watching it, that is a total of $148.90. That is more than enough to pay the $100 submission fee, and I know some would possibly donate more.

Reply Good karma Bad karma+1 vote
Ravious
Ravious

Was a long time ago since a Source mod interested me. :D

Reply Good karma Bad karma+2 votes
biohazardger Author
biohazardger

Thank you for your comments, guys!

Reply Good karma+3 votes
psilocibinum
psilocibinum

This ****** epic! )))

Reply Good karma Bad karma+2 votes
Hezus
Hezus

Wow, this is really cool. Very impressed!

Reply Good karma Bad karma+2 votes
SPY-maps
SPY-maps

Thanks for explaining how flying a spaceship works, am glad to hear the player has full control over it. Was already afraid it would be something like a railshooter.

Awesome work!
Leon

Reply Good karma Bad karma+2 votes
RedSlug
RedSlug

More dystopian Bladerunner references!

Reply Good karma Bad karma+2 votes
Astraxis

Two words: Holy ****.

Reply Good karma Bad karma+3 votes
Alternate076
Alternate076

Wow Such WOW :O

Reply Good karma Bad karma+2 votes
Johnathan_Freemond
Johnathan_Freemond

I am speechless, that is why I am typing. This is a massive improvement over the Beta I played about a year back. Though I don't have access to a VR system, this looks amazing. If you aren't hired by some game company yet, you will get job offers shortly after this. Outstanding work done with an the source engine.

Reply Good karma Bad karma+2 votes
id0
id0

Space? Interesting.

Reply Good karma Bad karma+1 vote
RocketSurgery
RocketSurgery

biohazardddd

still pushing source to its limits I see

keep up the good work

Reply Good karma Bad karma+1 vote
Vincent14
Vincent14

Im excited that this mod is still getting worked on. But is it going to be entirely different from the beta? To be honest, I found the original to be very, very beautiful mod.

Reply Good karma Bad karma+1 vote
Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Guest
Guest

why no updates, put mod on steam already, we buy it!

Reply Good karma Bad karma+1 vote
Eyaura
Eyaura

Almost there.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: