You are on page 1of 6

Portfolio - About Me - Rsum - Code Samples - Blog - Contact

Starwright
Download
Development Blog

Starwright is a technology and gameplay prototype that is perhaps best described as a cross between the
game SimCity and the TV show Battlestar Galactica. It is a networked-multiplayer spaceship simulator
in which players build spaceships SimCity-style by placing individual parts onto a square grid and then
battle their friends online using the ships that they built. As a prototype it's somewhat rough around the
edges (and the art is all temporary programmer art), but it's fun to both build ships and battle other
players, and I believe that the idea holds a great deal of future promise.
As in SimCity and Battlestar Galactica, it's not the city or spaceship that is the true focus -- the people
inside the ships are the players' most important concern and are the true focus of Starwright. All weapons
and engines on the ships must be crewed by one or more people. Additionally, supplies such as
ammunition must be carried throughout the ship, meaning that the player must be mindful of the ship's
corridor layout and traffic patterns so that the crew don't get congested in tight corridors or have to travel
too far.
Programming Starwright has proven to be a great challenge with several very significant programming
hurdles:
1. Since ships move with realistic physics and the player can place rocket engines anywhere he
likes, I invented an algorithm that intelligently determines the "activation level" of each rocket
given the player's current and desired locations.
2. I wanted parts of ships to be individually damaged and destroyed, meaning that it is very common
for a heavily-damaged ship to break apart into multiple pieces. This meant that not only did I
have implement a localized damage system integrated into the physics system, but that this
system needed to detect when a ship has split apart into what are essentially several smaller ships.
3. Since ship crews are largely autonomous, a robust pathfinding system needed to be developed.
Not only does the pathfinding need to gracefully handle changing ship layouts as parts are
destroyed, but it also needs to route around congested areas of the ship. The algorithm that
handles routing around congestion is inspired partially by ant colonies in which individual ants
layer scented trails for other ants to follow. I turn this idea upside down by having people on
board the ships lay down a "virtual scent" that dissuades others from taking the same route.
4. All of these systems need to work smoothly across a network of two or more computers,
requiring extremely careful planning and ordering of game logic.

Starwright
Blog - TigSource DevLog
Version 2014.03.18:
1. Download and install the Microsoft .Net Framework 4.5.
2. Download and extract Starwright-2014.03.18.zip. (Windows Vista, 7, and 8 only; sorry,
no XP, Mac, or Linux yet.)
There is no goal to the game yet. The only mode of play currently is the "Sandbox Editor",
where you can design new ships or fight against already-designed ships. The sandbox editor also
supports multiplayer.
The game has no in-game tutorial of any sort, so here's a little manual to get you started:
Sandbox Editor: (Access the sandbox by clicking the "Sandbox Editor" or "Load Game"
buttons from the main menu.)
The "Menu" button in the upper-left displays the in-game menu from which the game can
be saved or a new sandbox environment created.
The "Editor" button next to it drops down a menu that lets you change which player's
ships you are currently controlling.
The speed controls in the upper-right allow you to pause or speed up the game.
The three square buttons underneath the "Menu" button allow you to design ships, add
ships to the sandbox, and add miscellaneous objects:
o The top button allows you to create a new ship or modify an existing ship. From
the panel that opens, select the desired "part" and either click into empty space to
create a new ship or click on or near an existing ship to modify that ship.This
panel also has options for rotating the selected part and removing existing parts.
o The middle button allows you to place already-designed ships into the sandbox.
From the panel that opens, simply select the ship and click to place it anywhere in
the sandbox.
o The bottom button contains various non-ship objects that can be placed into the
sandbox. (Currently only asteroids.) Click on the desired object and then click to
place it into the sandbox. Asteroids are good for target practice.
Right-click on an existing ship in the sandbox to open that ship's context menu. From
there you can do things such as rename the ship, save its design to a file, remove it from
the sandbox, or change which player can control the ship.
Gameplay Controls:
The gameplay controls of Starwright are based upon conventions established by existing
real-time strategy games such as Starcraft.
Pan the view using the arrow keys, or click-and-drag the middle mouse button. Use the
mouse wheel or +/- keys to zoom in and out.
Left-click on a ship to select it, or drag a box around multiple ships to select all of them.
Right-click in empty space to order the selected ships to move to that location. Right-
click-and-drag to adjust the orientation.
Right click on an enemy ship (it must be assigned to a different player) to order the
selected ships to attack. Right-click-and-drag to adjust the distance and angle of the
attack.
Hold shift to queue up multiple commands. While holding shift you can also adjust
existing commands, or right-click on an existing command to remove it from the queue.
Hold alt and right-click on a specific part of an enemy ship to target that part. Hold shift
while alt-right-clicking to queue up specific parts to attack.
Press F to focus the camera on the selected ships.
Ship Design Advice:
Every ship must have a "Control Room". Without one you cannot give the ship any
orders.
Ships move realistically according to the position, orientation, and strength of its
thrusters. Place them in various locations around the ship to maximize maneuverability.
Most ship systems require crew to operate. Place "Crew's Quarters" to add crew to your
ship.
Weapons require ammunition to fire. Place an "Ammo Supply" near weapons to provide
them with a steady supply of ammo. Your crew will carry ammo from the ammo supply
to the weapons, so the closer the supply is and the more crew you have, the faster your
weapons will be able to fire.
Many ship systems, such as engines and ammo supplies, require power to operate. Place
a "Reactor Core" somewhere in your ship. Your crew will carry batteries from the reactor
core to the systems that require power.
Your crew move fastest through corridors. An efficient ship will have corridors to
connect distant rooms.
Crew can only move through walls if there's a door. The editor will attempt to
automatically add doors for you, but you can manually add and remove doors the same
way you add and remove parts. If a system isn't operating, make sure that your crew can
access it.
Multiplayer:
The sandbox editor fully supports networked multiplayer, though you may find bugs.
One player should start the sandbox editor. Once started, open the in-game menu and
click "Open For Multiplayer".
The other player(s) should click the "Multiplayer" button on the main menu and then
"J oin Game". Type in the IP address of the player hosting the sandbox.
If playing over the internet (as opposed to on the same LAN), then the host may need to
open port 19485 on their router.
Ship Save Files:
Starwright Ship designs are saved, literally, as PNG image files of the ships inside a folder called
"Ships". The data necessary to load and play with the ship design is stored in the PNG pixel data
itself.
Because of this, do not in any way alter the saved PNG file! Do not resize it or alter its pixels!
Doing so will almost certainly corrupt the file and Starwright will be unable to load the ship
design from the file.
Similarly, many image-hosting websites will down-scale or decrease the quality of images.
Using such websites will also corrupt the file.

You might also like