Tiny X-Wing

Add to
My games
Add to
Wishlist
Save to
Collection
No reviews
Exceptional
Meh
Skip

About

This mini-game was made to experiment with some concepts I've been wanting to investigate. Namely, these four things:

  • Data-driven gameplay elements, i.e. a method for modding
  • Rendering a game at a fixed resolution, despite the resolution the user sets.
  • What happens if you tie as much of the game as possible to a fixed framerate?
  • "Real world" testbed for Shapes in gameplay and Editor

Before I dive into my devlog-like write up on the technical aspects, here's some quick info on what this little mini-game actually is.

There will be no further development on this as it has more than served its purpose.

The Gameplay!

Fly your TIE Fighter against a squadron of X-Wings! Fight alongside your allies, with both sides backed by a Lancer anti-fighter frigate.

The feel and gameplay are inspired by the classic X-Wing PC games of the 90s, though this is much simpler than those games were.

Controls

Gamepad is the preferred method of play, but the game can be played with keyboard only as well, using the arrow keys and W/S. All flight controls are listed on screen.

Spectator Camera

After the player is killed, either by gunfire or by pressing the Self Destruct key (K), they are put into a spectator camera and can freely fly around the area to observe the battle.

To control the spectator camera, hold down the right mouse button and use the WASD keys to move around.

Spawning New Fighters

At any point during the game, new AI fighter squadrons can be spawned in. This was mostly just a debug feature, but it's fun to spawn in more fighters and see what happens. 

The Lancer frigates cannot be respawned once they are destroyed.

Installation

The game can be downloaded and installed manually, or installed via the itch.io app. The official itch app provides a Steam like launcher for downloading and installing games and is the most self-explanatory way to play the game. Simply navigate to this game's page, then click the Install button.

If downloading manually, follow these steps:

  1. Download the zip file from this page
  2. Open the zip file and extract the "TinyXWing" to a location on your hard drive.
  3. Inside the extracted "TinyXWing" folder, double click "TinyXWing.exe"

To uninstall the game:

  1. Delete the extracted "TinyXWing" folder.Data Driven Gameplay, a.k.a. "Mod Support"
Data-Driven Gameplay a.k.a "Mod Support"

This was the driving factor behind this game, and is related to something of a long-standing chip of my shoulder with modern game development. First, some backstory.

How games used to be made

Traditionally when you set out to make a video game, you would write the game from scratch. "Engine" and game were often synonymous, and since you were writing it all yourself, it also meant you often had to write your own tools to develop the game with. Making it so a game reads from files stored in the computer, that are easily accessible and editable by game designers, makes development of the game faster and easier than if everything were hard-coded into the game's code.

A fortunate side effect of this practice meant that players could often open these very same files and edit them to build mods and customize their experience. This wasn't always intended by developers, but it was more often than not a welcome feature and many of the biggest games in the world have their roots in video game modding.

How (many) games are made now

Fast forwarding to today, game developers now have ready access to off the shelf engines such as Unreal and Unity. A peculiar feature of these engines is that they have built in Editors. Instead of having to write your own model importers, your own animation tools, your own level creators, and so on, you now have this awesome development environment where you can do it all! 

This is fantastic. Never before has making a game been so easy, accessible, and intuitive. You no longer require the specialized knowledge in many disparate disciplines to write your own technology stack. You can start from something that already works, and focus on building the game

However, something was lost with this approach. In order for development and games to be optimized for the Editor experience, this necessarily means that a lot what used to be easily editable and readable game data now resides within these Editor tools. Instead of setting the parameters for what makes an X-Wing in a text file that then gets loaded, you can just set up an X-Wing inside the editor and see your changes immediately. While this vastly speeds up iteration time, it comes the trade off of easily accessible game data from the user's standpoint. For most developers and games, this is a trade off that is well worth it

Making a Unity Game Moddable

This brings us back to the original point. My main goal with this project was to get rudimentary elements of the game to be driven by easily accessible files on the hard drive. This is completely counter to how Unity (and Unreal) are designed to operate. In many ways, you are making your own life far more difficult for little to no practical gain in terms of the development process.

* At this point I feel I must point out that there are exceptional circumstances where it makes sense to build your game like this, but for the vast majority, it would only be a hindrance.

To that end, many of the ship's properties in this game are loaded from a handful of files that reside in "TinyXWing_Data\StreamingAssets\Ships". I recommend taking a peek at these files, modifying them, and reloading the game to experiment.

From a developer standpoint it's quite irritating to design a Unity game around this kind of methodology, but it was something I really wanted to try. There's a certain satisfaction I get, as an old modder, of seeing game data laid out so plainly and accessible. It also had some very interesting side effects in terms of how I had to lay out and structure the game code in order for it to be flexible enough to handle this sort of thing. 

This is far from the only way to achieve modding in Unity, but that's a topic far bigger in scope than this game/post. I will say though that in my experience, Kerbal Space Program is the golden standard for how far a data driven approach can be pushed in Unity. It really is something to behold.

Running at a Fixed Resolution (640x480)

Not too much to say about this one, I just thought it would be fun to go for the "authentic experience" and try to mimic some of the old games' quirks just to see where that takes me. 640x480 was a very common resolution back in the later DOS years, so I wanted to see what I could do to force, and its aspect ratio, this regardless of what resolution the game is running at.

I don't know if there's a better way, but I achieved it by rendering the entire game to a render texture of fixed size (640x480) and then stretching it to fill the screen, while maintaining aspect ratio. Pretty straightforward stuff.

Running All Logic at a Fixed Update Rate of 30hz

As a developer there is quite the allure to running all (or at least as much as possible) of a game's logic at a fixed rate, especially if it's a relatively low one like 30hz. I would even say it's a luxury. The main benefit this has is that it makes the game far more predictable, stable, and consistent. For certain kinds of games, having these kinds of guarantees can make things tremendously easier to work with.

I also noticed that it reframed how I thought about adding features. Whereas typically I think about features in terms of "how much of an FPS hit is this going to result in?", with a fixed framerate it instead becomes "how many things can I add in before it starts to impact performance?"

Using "Shapes" in a Practical Environment

I've long been annoyed at the difficulty that Unity has with drawing clean and pixel perfect lines. Freya Holmer has developed the plugin of my dreams, Shapes. It was just released and having used it only in demo environments I was curious to trial it in a simple standalone and practical project before taking the plunge and attempting to integrate it into Tiny Combat.

In this project, I used it for debug visuals (seen above), the stars in the skybox, and as an aid in drawing the lasers so that lasers always appeared as continuous pixel lines even when far from the camera. It's a joy to work with and I highly recommend it!

Platforms
Release date
Developer
Why485
Age rating
Not rated

System requirements for PC

Read more...
Edit the game info
Last Modified: Jul 6, 2020

Where to buy

itch.io