A downloadable game for Windows

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 source code for this project can be found here on GitHub.

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!

StatusReleased
PlatformsWindows
Rating
Rated 5.0 out of 5 stars
(5 total ratings)
AuthorWhy485
GenreSimulation

Download

Download
TinyXWingv1.0.1.zip 20 MB

Comments

Log in with itch.io to leave a comment.

Bro, you're the best! Your ''tiny combat area'' is simple, but really cool

excellent, well done ! and thanks

(1 edit)

hello Why485 cant wait to play the game! excpecially after playing tiny combat arena/flight model games, keep up the great work! 

EDIT: mouse aim could be nice

Hi Why485 cool game bro... cant wait to mess around in it

Hi, here from PI Labs YouTube channel. Nice project buddy. Hope you release linux binaries , also x86 ones so we can emulate them with box86 on rpi4. Unity does not support linux ARM for now.

This was built in x86.

(2 edits)

thats great, but no linux binaries whatsoever :(

I wouldn't say it's contrary to the way Unity works - Unity provides some nice stuff to get things done quickly, but also allows you to forgo it all and do things more directly. There's no issue at all with dropping a dummy object in the scene, assigning it a script called "Main.cs" and just take over from there. No problem with using C# System library to read and write files, and no problem drawing things without GameObjects by using Graphics.DrawMesh. It's how I build my 2D games (eg. HopSquash! on Steam)

So glad you're doing this though, it's always been a dream of mine to make a low poly Star Wars game, but it would have to be for free and I have never been able to justify the time.  Looking forward to trying it out.

(3 edits)

Everything you describes is exactly contrary to how it's meant to be used. Yes you can, but that's not how you're supposed to. If it was, then all the Unity tutorials, documentation, and features would be working towards that kind of workflow and they absolutely do not. The whole point of having an Editor is so that you don't have to do what you're describing.

I have to wonder, if you're going to such an extreme as to not even use GameObjects, why you would use Unity at all and not a simpler engine, or write your own?

(5 edits) (+2)

Before I explain, I just want to say - I'm just sharing how awesome Unity is, you've chosen a good engine for this project.

So, the tutorials and manual are all written for easiest path, because this is where someone new to Unity will start.  It's true - Unity team has put a lot of work into the GameObject side of things to make it easy to use. 

But when you have a lot of experience with different engines, you start to ask questions like "How do I just draw to the screen myself?" and you look for the lowest level functionality to do that.  There are multiple reasons to sidestep the high level "easy to use" stuff - performance being one, and avoiding the problems or limitations that come with such high level systems.

So you begin browsing the API for the answers, instead of starting with the manual.  Simple engine will not give you these answers. But I can tell you, Unity's API for generating your own meshes and textures straight from code is the best of any engine I've ever used.  

I see multiple cranky posts on the Unity forums about problems with the high level part of the new InputSystem (because it's new), which I have completely sidestepped and got on with the rest of my game by taking the more lower level route (because I don't need the high level stuff) - and still get the benefit of the unified gamepad system, where, say, "left thumbstick" will always be "left thumbstick" no matter what controller the user is using  on any system - Playstation 3/4, Wii, Nintendo Switch, random USB controllers on desktop, etc. etc. and I can track individual gamepads which the old InputSystem doesn't do.

The amazing thing about Unity is it's the most incredible balance between ease of use and power, for both new developers and old developers.  For contrast, try getting into mesh generation in UE4, yeah you can do it, but it's not nearly as fun, and even UE4 devs say the back end API is not sensible at all!

So to answer your question "Why use Unity if you're skipping GameObjects?" - because Unity provides so much more over other engines than just GameObjects. I'm porting my game over from Godot and re-creating it in Unity purely to get Unity's multi-platform support, because I want to release on the consoles (Nintendo Switch, Playstation, Xbox).  Unity has the best multiplatform support of any engine out there.  It's pretty much one-click, so long as you also check the download box for the relevant platform in Unity hub.  This is something you can easily do for your Star Wars game - you can upload a build for Linux and Mac!

Thanks for the detailed response! You're giving me very dangerous ideas.

(1 edit)

Just remember, with great power comes great responsibility!  You have to release your resources manually or you'll get memory leaks! So without GameObjects, you do things like "mymesh = new Mesh()" and then when your ship is destroyed, you need to call "Mesh.Destroy(mymesh)"  Fortunately Unity has an AWESOME built in profiler to catch this very sort of problem!

And no problem - consider my time spent writing as my "donation" to see Tiny X-Wing continue to be developed further... ;)

P.S. There's no need to be a "low level purist" either - you can do as much low or high level to get your game done in the best way possible.

This won't be developed any further since it already served its purpose as a technology test bed. I'm already working on a game. I can't work on two!

Very interesting, but it raises the question: Will Tiny Combat Arena have gamepad support?

Yes. I do most of my testing with a gamepad.

Not sure how to get it controlled with keyboard / mouse, please?

I'm realizing now that the game doesn't actually have any mouse controls outside of the spectator camera. I didn't put any effort into making the controls work nicely since that wasn't the point of this. In theory a basic joystick should also work, or you can play with just the keyboard and arrow keys.

So good, so nostalgyc. Love this

sick

Awesome

Really fun to play even though its very basic, though I wish you could fly the X-wing to blast away some TIE Fighters.