2061 - FPS in a Retro Environment

During the 'A Game By Its Cover Contest' held by TigSource.com, I sort of fell in love with Allen's contribution : 2061 (codenamed Vector Planet). As a longtime fan of TigSource's Contests, I sometimes have regrets when finishing one, because there usually are hundreds of rad ideas going out of this amazing community. Find the original thread of Allen's game here.

Allen's game was made with Unity3D, and the result was so stunning (both on a visual and audio point of view), that I wanted to remake it with my fav' tool (Gamestart :)). There are really a few line of codes of my own in this mockup (70 lines of code, max), as most of it is handled by the Builtin scripts and/or the engine.

Typically, here, this game relies on:

  • A FPS controller, that handled the camera motions, target, with mouse & keyboard, and the collisions.
  • A lens flare, made with a builtin as well.
  • The platforms are scripted with a simple switch to move them back & forth.
  • The audio is a builtin too, fading (or not) the volume according to the distance.
  • The rendering was achieved with a mix of flat shaded polygons & wireframe on the top of it. A Bloom post-process added the final touch.

The lens flare above the pyramid.


A Lens Flare, according to Wikipedia, is "the light scattered in lens systems (...) such as internal reflection and scattering". Despite its common and usual aspect, the lens flare is always useful when it comes to build a convincing atmosphere.

To add a Lens Flare to your scene, there's no need for a light source. However, it will sometimes be more visually consistent to attach a flare to a light source. In this case, we only need an item, set on top of the pyramid, so that its mass won't occlude the features of the flare. The only thing to do is to select the 'Lens Flare' builtin script.

lensflare0
Adding a builtin script to an item.

The settings of the Lens Flare are straightforward.
This effect will split into :

  • the flare itself
  • the inner lens reflections.

Both can be enabled or disabled independently, and their respective size and intensity can be easily defined.

lensflare1
The lens flare builtin properties.

And the result always looks ace. As mentioned above, a lens flare can be occluded by any other object, as long as a collision shape was set for this element.

lensflare2

The Jetpack sound FX


To add this to the existing FPS builtin, I used the inheritance feature, that derives the original builtin into a new script.


                          
  1. class JetPack extends BuiltinCharacterController
  2. {
  3. vel = 0.0
  4. chan = 0
  5. sfx = 0
  6. vol = 0.0
  7.  
  8. function OnUpdate(item)
  9. {
  10.  
  11. base.OnUpdate(item)
  12.  
  13. if (KeyboardSeekFunction(DeviceKeyPress, KeySpace))
  14. vol += g_dt_frame
  15. else
  16. vol -= (2.0 * g_dt_frame)
  17.  
  18. vol = Clamp(vol, 0.0, 1.0)
  19.  
  20. MixerChannelSetGain(g_mixer, chan, vol)
  21. }
  22.  
  23. function OnSetup(item)
  24. {
  25. base.OnSetup(item)
  26.  
  27. chan = MixerChannelLock(g_mixer)
  28. sfx = EngineLoadSound(g_engine, "sfx/sfx_jet.wav")
  29. MixerChannelStart(g_mixer, chan, sfx)
  30. MixerChannelSetGain(g_mixer, chan, 0.0)
  31. MixerChannelSetLoopMode(g_mixer, chan, LoopRepeat)
  32. }
  33. }

                        

I'm quite happy of the result. Here's a screenshot below.


vectorplanet

Project files


Feel free to download both the 'game' itself and the sources (see the links below).
You will probably need the Beta5 at least to run the sources.

A huge thanks to Allen that kindly accepted to share his original sources, and let me made this version available to the community.