Monday, February 18, 2013

StarWright - Better Commands

Players have for a while now been able to give both move commands and attack commands to ships, but until now haven't been able to queue up multiple commands or tweak commands already-given. These two new features really help make commands more flexible and useful.

Queuing up multiple commands to be executed in sequence is easy. Simply give the first command and then hold the shift key while giving each additional command. It looks like this:


Adjusting an already-queued command is also pretty easy. While holding shift, rotator and mover widgets will be displayed. Simply click and drag on one of the four arrows to rotate the ship, or click and drag the center widget to move the ship.


This also of course works for attack commands too. Clicking and dragging the center widget will adjust the distance and direction of attack. Clicking and dragging one of the four arrows allows you to choose what flank your ship will fire from, which was previously not able to be manually set.


Sunday, December 23, 2012

StarWright - A Slicker Sandbox

A few posts ago I talked about the new "modeless sandbox" user interface. It was nice because it didn't require the player to manually switch modes between building ships and playing the game. Unfortunately, as I pointed out at the time, having on the screen at the same time the full U.I. for everything you might want to do made the screen feel quite crowded, and it has become apparent to me that, unless I reorganize the user interface for the sandbox, it will only continue to become more and more crowded.

What I'm presenting here is what I think is a visually clean, usable compromise between not having modes and not having everything on the screen at once.

You could certainly argue that what I've done here has simply re-introduced distinct modes (and added 2 more), and from a strict word-definition standpoint you'd be right. (You could also rightly say that I never really eliminated modes entirely in the first place. You'd be right there too.)

But the new mode interface is different from the old mode interface in presentation, organization, and efficiency. I steal shamelessly from games like Sim City and software like Photoshop that organize tools into a handful of high-level categories and then show the individual tools in the category once the player opens the category. So in a sense, these new modes feel just like tools in Sim City or photoshop. And this re-categorization really allowed me to minimize the amount of U.I. on the screen during normal play, which keeps the game from feeling claustrophobic.

In the screenshot below there are four buttons stacked vertically on the left, each activating a single "category" or "mode". The first button, highlighted below, is the default mode. It's called the Command Tool, but it serves exactly the same purpose as the Play mode did previously -- when selected, you can click on and command ships like normal. As the default tool, clicking the right mouse button while using any other tool will return you to the command tool. This is an important feature borrowed from the modeless sandbox version, because it eliminates half the nuisance of switching modes.


In this next screenshot, the Build Tool is selected. While selected, a sub-menu is displayed from which the specific desired part can be selected. While the Build Tool is selected, it works just like the old Build mode from the original sandbox U.I.


Here I show a brand new tool, the Ships Tool. In prior versions of the sandbox, if you wanted to add a previously-designed ship into the sandbox, you had to open the Ship menu, click the Load button, and then select the ship from a dialog. In this new version, all of the previously-saved ships are put into the Ships Tool. Simply select the Ships Tool, select the ship you want to add, and click where you want it to go.


And lastly we have the Doodads Tool. Right now the only objects it contains are the asteroids, but eventually it could contain other objects such as worm holes, salvageable resources, or gas fields.


Friday, December 21, 2012

StarWright - Multiplayer! (and saved games too!)

WOW, it has been a very long time since I last posted about StarWright! To a great extent my new job has been keeping me quite busy, but also I've been working on the biggest new feature yet...



Multiplayer.

Adding multiplayer play to StarWright has been a huge task, as anyone who has ever added multiplayer networking to a previously-singleplayer game can tell you. Every core mechanic of the game, from damage and destruction to crew pathfinding to command and control, had to be overhauled to be multiplayer-capable. Add to this the creation of a custom UDP communications protocol and a programming library for "remote procedure call", both of which are critical to the multiplayer capabilities of StarWright.

To make matters even more difficult, my belief is that ever single mode of play in StarWright should be multiplayer-capable. That even includes the sandbox mode, which is the only real way to play the game right now. Making the sandbox multiplayer-capable as well meant that all the systems related to designing ships, such as adding and removing ships, adding and removing parts, and undo/redo, had to work over the network as well.

Oh yeah, I also want other players to be able to drop in and out of the game whenever they want. No pre-game lobbies, except for certain kinds of competitive matches. The host just starts a game, checks a box allowing other players to join, and then other players can hop right in. This means that the host computer must be able to send the entire current state of the game whenever a new player joins, which is its own big system unto itself.

On the bright side, sending the state of the game to another player essentially amounts to creating a save file of the game and sending it to the other player. So even though drop-in-anytime was a big feature to implement, I basically got a save-game feature almost for free. The code that handles networked state sending is about 95% shared with the code that handles game saving, even though networked state sending and game saving write the data to different formats (networked state sending uses a compact binary format to reduce bandwidth usage, while game saving uses a custom text format which is more tolerant of game version changes). This is thanks to a robust multi-format serialization library that I developed for my game engine, Halfling.

Sunday, November 18, 2012

Friday, August 24, 2012

StarWright - Weapon Ammunition

As in the original prototype, weapons now require ammunition in order to fire. Each weapon can store a small amount of ammunition for itself, but once it runs out, additional ammunition must be delivered by the ship's crew. Individual crew hand-carry ammo bullets from a nearby ammo supply to the weapon.


Notice how in the above screenshot, some of the crew are carrying ammo to the weapons.

The purpose of this mechanic is to further emphasis the importance and role of the crew on the ship, and to make designing a ship for maximum crew efficiency a priority. If the closest ammo supply is too far from the weapon, then the weapon won't be able to fire as often. It will also be important to prevent narrow corridors from getting congested with too much foot traffic. Wider corridors and/or more ammo supplies may help if foot traffic becomes an issue.

Friday, June 29, 2012

StarWright - Attacking

For a very long time it has been possible to command a ship to move to a particular destination by right-clicking into empty space, but there has been no way to command a ship to approach and attack another ship. That has now changed!


This screenshot probably requires a bit of explanation:
  • In their simplest form, attack commands are very simple to use and work almost exactly like move commands. Simply left-click on one of your own ships, and then right-click on an enemy ship to command your own ship to fly to the enemy ship and attack it. The computer will automatically determine the ideal distance from the enemy ship as well as the ideal flank to attack from (that is, whether to fire from the bow, stern, port, or starboard sides of your ship). A red circle will display the distance from the enemy ship, and a red ghost of your ship will show you exactly where your ship will station itself relative to the enemy ship.
  • As an advanced "power player" feature, it is also possible to right-click on an enemy ship and then, without releasing the right mouse button, drag away from the enemy ship. Doing so allows you to adjust both the attack distance and the direction to attack from. Thin red lines show which weapons can hit the enemy ship. The screenshot above shows an in-progress right-click-and-drag away from an enemy ship.
It is currently not possible to manually adjust which flank your ship will fire from. This feature is hopefully coming soon.

Wednesday, June 27, 2012

StarWright - Modeless Sandbox

This is just a quick update to show off a refinement I made to the sandbox user interface.

If you remember from my previous blog post about the sandbox, I lamented the separation between the two separate Build and Play modes -- one mode for modifying ships, the other for playing the game. As simple and as easy as it was to toggle between the two modes, it was still annoying to have to toggle between them, and the separation discouraged making very quick design iterations.

My refinement is to eliminate those two distinct modes and instead display the toolboxes for ship parts and asteroids on the screen at all times by default. (They can be hidden by clicking the X and re-shown from the Panels menu.) Ordinarily, if you have no part or asteroid selected, then you can select and command ships like normal. If you want to modify a ship, simply select your desired part on the left and add it to your ship. Likewise if you want to have fun with an asteroid, select it from the toolbox on the right. Once you're done either building ships or placing asteroids, simply right-click to get rid of whatever you had selected and you'll be able to command your ships again, just like normal.


The elimination of the two distinct modes is definitely less annoying and more intuitive too. The few people who I've had playtest the game seem to agree. My only real lament now is that the presence of both toolboxes on the left and right can crowd the screen. It's not too bad on large monitors, and you can hide either or both of them if you want, so it's not a big deal, but I still wish the user interface was less crowded.

I also recently made another important refinement to the sandbox, which is the elimination of "ship grids". Previously, in order to build a new ship, you first had to place an empty "grid" into space, and only then could you put parts and rooms on the grid. In this latest version I streamline the process by allowing you to place a part directly into empty space, without requiring a grid first. To further extend your new ship, simply select a new part and when the mouse cursor is near the ship, the selected part will snap into position.