tag:blogger.com,1999:blog-71108626270180014332024-03-13T11:12:24.538-07:00Walt Writes GamesI write about games and programming, with some time travel thrown in.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.comBlogger109125tag:blogger.com,1999:blog-7110862627018001433.post-69361511883363335692017-04-06T21:33:00.002-07:002017-04-06T21:36:06.591-07:00Cosmoteer news has moved...Cosmoteer now has its own dedicated <a href="http://blog.cosmoteer.net/">development blog</a>. Most Cosmoteer-related news will be posted there instead of here.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-23296567908142451362017-04-06T18:44:00.000-07:002017-04-06T18:44:58.846-07:00Cosmoteer 0.11.0 -- Fog of War & U.I. ImprovementsLast week I released <a href="https://cosmoteer.net/history.html">version 0.11.0</a> of Cosmoteer. It, and version 0.10.7 before it, add some significant new features and improvements to the game's user interface.<br />
<br />
The most important new feature in 0.11.0 is the<b> "Fog of War"</b>:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimKzKFxIQSs06meN7vQhNkH36flBeNf2HRvDSwFyYd_M6Hd1dcRMa92-d0nT50M_64WqnZG3g2f2eAilvlZNDlUDAAAhkY_XfGEhrRqxHNCvAZAXNAwy_mCVX0evbv3sXlrykgCKWEz_I/s1600/2017-04-06+18-16-05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimKzKFxIQSs06meN7vQhNkH36flBeNf2HRvDSwFyYd_M6Hd1dcRMa92-d0nT50M_64WqnZG3g2f2eAilvlZNDlUDAAAhkY_XfGEhrRqxHNCvAZAXNAwy_mCVX0evbv3sXlrykgCKWEz_I/s400/2017-04-06+18-16-05.png" width="400" /></a></div>
<br />
If you play RTS games, you are likely already familiar with the basic concept. You ships can only "see" so far away, and anything farther than your ships' sight range is hidden in the "fog of war". In the above screenshot, the darkened areas of the background indicate areas that are too far from your ships to see.<br />
<br />
Currently, the locations enemy ships that are outside of your own ships' sight will still be indicated with pulsing red dots, which you can see in the lower-right corner. These tell you where you need to go to find something to fight, but offer no additional details such as the size or armaments of the enemy.<br />
<br />
The Fog of War changes gameplay, because now there's some risk involved in choosing to fight an enemy. It may turn out that the enemy is too powerful for you to defeat, and you'll need to run away. Occasionally needing to run away also has the added effect of making fast and maneuverable ships more important.<br />
<br />
Version 0.10.7 also added a <b>"Minimap"</b>:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9VLyTX7SpZyB4AqQGEDjHvrRpW9tZRIzT2Q2vtar5KgzMFStJ6YbsMUD0Ij8reIgUGl_t2ycnRpYv00pdZC2dbquooO_Hk7gpPJuO2Ur-Nh5X6uhfKCP7j4lpdo2uW2b6__i4B4CoPa8/s1600/2017-04-06+18-23-32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9VLyTX7SpZyB4AqQGEDjHvrRpW9tZRIzT2Q2vtar5KgzMFStJ6YbsMUD0Ij8reIgUGl_t2ycnRpYv00pdZC2dbquooO_Hk7gpPJuO2Ur-Nh5X6uhfKCP7j4lpdo2uW2b6__i4B4CoPa8/s1600/2017-04-06+18-23-32.png" /></a></div>
<br />
The minimap is a long-requested feature that provides a simple overview of the locations of friendly and enemy ships. Unlike most RTS games which are played on a fixed-size battlefield, the playing area in Cosmoteer has no walls or borders and is infinite for all practical purposes. Therefore, the minimap automatically adjusts to show an area containing all of the ships in the game. The grid in the background always maintains the same spatial distance between lines, and so you can use the grid to estimate distances between ships.<br />
<br />
Version 0.10.7 also added what I call the <b>"Miniview"</b>:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHMqBpMBE0uIrdlZ-DMywuCTQHE5uZm6vODk7uebZwg9tM3z9sUIAC3uqwQLE-3UydHl0I_WFXynCdjoqnk7R1Rjvp6XP2RsYe3BnIAIxpeAuOUVrjZul9VfH8t1oHaNcDMs85YcJQB8I/s1600/2017-04-06+18-29-35.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHMqBpMBE0uIrdlZ-DMywuCTQHE5uZm6vODk7uebZwg9tM3z9sUIAC3uqwQLE-3UydHl0I_WFXynCdjoqnk7R1Rjvp6XP2RsYe3BnIAIxpeAuOUVrjZul9VfH8t1oHaNcDMs85YcJQB8I/s400/2017-04-06+18-29-35.png" width="400" /></a></div>
<br />
The miniview is basically a "picture-in-picture" view of a single ship, allowing you to view one ship in the main view and another ship in the miniview at the same time. My hope is that it solves one of the biggest usability problems that Cosmoteer has had up to now, which is that during combat you can't watch both your ship and the enemy ship at the same time without zooming out and losing a lot of the important simulation details.<br />
<br />
The miniview also isn't just for show, either -- you can also hover the mouse cursor over ship parts to see their health and right-click on them to target, all without having to move the main camera.<br />
<br />
The miniview is customizable, but by default, it is automatically displayed during combat and will show either your ship or the enemy ship -- whichever one you're not looking at in the main view. When displayed, the miniview replaces the minimap, which is generally less useful during combat anyway. Both the miniview and the minimap can be resized as desired to take up more or less space on your screen.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-63084847557667524802017-04-03T17:26:00.000-07:002017-04-03T17:26:02.597-07:00Cosmoteer Gameplay TrailerToday I made a little gameplay trailer for Cosmoteer! Pretty much my first time putting together a trailer, so the editing and footage is a little rough.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/j-mBFEA8W1k/0.jpg" src="https://www.youtube.com/embed/j-mBFEA8W1k?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br />Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-45014566010046617952017-02-26T14:08:00.000-08:002017-03-01T14:34:47.221-08:00Cosmoteer 0.10.5 -- User Interface Refresh<a href="https://cosmoteer.net/history.html">Cosmoteer 0.10.5</a> is out! While there aren't any major new <i>gameplay</i> features per se, the changelist is still among the longest to date!<br />
<br />
The biggest and most obvious change is that the user interface has received a complete visual overhaul -- gone are the boring gray boxes, replaced with a spacey blue-and-green theme complete with sound effects and animations.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiRMMetURaNg2kp_8knnX7GTQB4EjPB8li4fO4fBdmfSqvXE0sAWMdfXlc6812JGGIdJEiFuK_Vj6tZin_b_nhXHgWxkLxW8tADn2fZzqJyQwRMk3OpgWKa7TeCL5kbgEbNvCdjAdYnlc/s1600/2017-03-01+14-14-23.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="301" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiRMMetURaNg2kp_8knnX7GTQB4EjPB8li4fO4fBdmfSqvXE0sAWMdfXlc6812JGGIdJEiFuK_Vj6tZin_b_nhXHgWxkLxW8tADn2fZzqJyQwRMk3OpgWKa7TeCL5kbgEbNvCdjAdYnlc/s400/2017-03-01+14-14-23.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDfHT6oR-ZjCv8D-eXh5EV9Ghr5aeI5sidLB8fP-dPbXRNrB7UBHU2IMwHsivuUuaUk3tgcDZtTxWf5Zt1H3panG56DF2RyxXBwXjTig7mIb4PLcvCsDkQ3ERMDQPA-EdtObF5-K5SsmU/s1600/2017-03-01+14-15-22.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="301" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDfHT6oR-ZjCv8D-eXh5EV9Ghr5aeI5sidLB8fP-dPbXRNrB7UBHU2IMwHsivuUuaUk3tgcDZtTxWf5Zt1H3panG56DF2RyxXBwXjTig7mIb4PLcvCsDkQ3ERMDQPA-EdtObF5-K5SsmU/s400/2017-03-01+14-15-22.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">After</td></tr>
</tbody></table>
Aside from the visual changes, there are also some small-but-important changes to the actual functionality of the user interface.<br />
<br />
First, the player can no longer (by default, although this can be reverted in the settings) simply click on or drag a box around specific parts to select them -- the player must now hold the Ctrl key while clicking. This is because my playtesting showed that many new players would accidentally click on parts of their ship and then be unable to give their ship orders, which was confusing and frustrating for them. By requiring the Ctrl key be held, it's now almost impossible to accidentally select parts without meaning to.<br />
<br />
Second, because you can't upgrade your ship until you repair it, the game now only shows <i>either</i> the repair button <i>or </i>the build button, never both at the same time. (When your ship needs repairs, the repair button is shown in the place of the build button.) In some playtests, players got confused about why they couldn't press the build button, and so this change should hopefully make that more obvious.<br />
<br />
Lastly, turning on "blueprints mode" is no longer a strange toggle that appears next to the build button after pressing it -- it is now a simple checkbox item in the '...' menu, and the game now remembers your preference.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-62365185181228787312017-01-28T13:09:00.000-08:002017-03-01T14:03:56.069-08:00Cosmoteer 0.10.0 -- Bounty Hunter 2.0 and FTL DrivesYesterday, I released <a href="https://cosmoteer.net/history.html">Cosmoteer 0.10.0</a>.<br />
<br />
This is a big release, and it features a ton of little improvements along with two big, related features: a revamped "2.0" Bounty Hunter game mode, and F.T.L. Drives for ships.<br />
<br />
<b>Bounty Hunter 2.0</b><br />
<b><br /></b>
For about the past year, the standard mode of play, "Bounty Hunter", has been pretty simplistic. You, the player, start with a single ship and destroy enemy ships in the immediate vicinity to earn money which can then be used to upgrade your own ship or purchase additional ships. As you destroy enemy ships, additional enemies spawn nearby, and as your own ship or fleet increases in power, the larger, more powerful enemies swill spawn as well.<br />
<br />
This simple kill-reward-upgrade-repeat loop has been fine for testing and iterating on the core ship construction and combat gameplay mechanics, but it honestly wasn't very engaging for the player. Killing an endless stream of ships over-and-over again in the same location with little choice gets repetitive really fast.<br />
<br />
Bounty Hunter 2.0, while not solving all of the issues of Bounty Hunter 1.0, seeks to create a much stronger foundation upon which further improvements can be built. Instead of playing in a single location with an unlimited supply of respawning enemies, the game is now played across a large galactic map:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFqrt9hkNW2KF3hYbeIYT3e2w6Oj7KsLNWeP1HQLIq_70YOyrSiXGOGgBYEKvBmMf829oB_n7ii7mTcrKj09qRvEq3WwDToX_EEqYLb_487Tu3Uxqd2CzG5Og-ccZrhTD6Mw0ruNdwunc/s1600/2017-03-01+13-23-19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFqrt9hkNW2KF3hYbeIYT3e2w6Oj7KsLNWeP1HQLIq_70YOyrSiXGOGgBYEKvBmMf829oB_n7ii7mTcrKj09qRvEq3WwDToX_EEqYLb_487Tu3Uxqd2CzG5Og-ccZrhTD6Mw0ruNdwunc/s400/2017-03-01+13-23-19.png" width="400" /></a></div>
<br />
Each location in the galaxy map (the green icons) has only a handful of enemies, and they don't respawn as you destroy them. Instead, once the player destroys all of the enemies in a location, they must move on to another location. Each location has a small colored "shield" icon that indicates the strength of enemies present there:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdvn26zqsHF00Tx4OAvYKYH49HufncAHlv9kgKYmCpWPoYMpxu4rILCiHb8fFvsiQvYQ_WudY4OwdADRPJzulBkwQS6gEHbzzuZRxaP2WnDVJTv8Rg9MOQTbgQsStXca7y6pDq4WBASYY/s1600/Capture.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdvn26zqsHF00Tx4OAvYKYH49HufncAHlv9kgKYmCpWPoYMpxu4rILCiHb8fFvsiQvYQ_WudY4OwdADRPJzulBkwQS6gEHbzzuZRxaP2WnDVJTv8Rg9MOQTbgQsStXca7y6pDq4WBASYY/s400/Capture.PNG" width="400" /></a></div>
<br />
In Bounty Hunter 1.0, the game itself determined the difficulty of enemies that the player would face, which meant that for many players the enemies were either too easy or too difficult. This new system gives the player a degree of choice in what strengths of enemies they will face, and lets the player pace their own difficulty curve.<br />
<br />
More importantly, this new galaxy map now provides a strong foundation on which more gameplay can be added. In the future, as the player explores the galaxy, they will encounter space stations to trade with, pirate bases, asteroids to mine, vessels in distress, and more. These features will be added to the game over time as they are developed.<br />
<br />
The galaxy map itself is procedurally generated, usually with 4-6 solar systems full of planets and moons. Each location is "attached" to a nearby planet or moon, which then appears in the background during gameplay to give visual variety and a better sense of location. The planets, moons, and stars themselves are procedurally generated using <a href="https://en.wikipedia.org/wiki/Perlin_noise">Perlin Noise</a>. Blue, red, and yellow nebulas also abound in the galaxies, which determine the color of the background during gameplay.<br />
<br />
<b>F.T.L. Drives</b><br />
<b><br /></b>
In order to move from location to location within the galaxy, the player must construct at least one F.T.L. (Faster Than Light) Drive on their ship. Once constructed, the FTL drive allows the player to perform jumps to other locations.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTPzZDYROUb4-ahQkQOni6iamG01LrGgJU4ksCh9kfVYQHnJrsna2BYn5qrMT41bFcDtwxTHuvEdvCOk2DHhb47vpVfi1JqTVAJI8lk3mZ8Lv97UC8aZ8S24NhhAELsrso6U4B96uyToI/s1600/Capture2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTPzZDYROUb4-ahQkQOni6iamG01LrGgJU4ksCh9kfVYQHnJrsna2BYn5qrMT41bFcDtwxTHuvEdvCOk2DHhb47vpVfi1JqTVAJI8lk3mZ8Lv97UC8aZ8S24NhhAELsrso6U4B96uyToI/s320/Capture2.PNG" width="246" /></a></div>
<br />
<br />
Jumping, however, is not free. F.T.L. Drives use a new kind of "fuel" resource. Like credits, fuel is earned from destroying enemy ships, and then it is spent to perform an F.T.L. jump. The amount of fuel spent is determined by the distance of the jump, the size of the ship(s) making the jump, and the <i>efficiency</i> of the ship's F.T.L. Drives.<br />
<br />
<i>Efficiency</i> is a new concept in Cosmoteer that determines how much fuel is used when an F.T.L. jump is performed, and its gameplay purpose is to make the number and placement of F.T.L. Drives on a ship a strategically important decision. When adding an F.T.L. drive to a ship, the game displays a green/yellow/red overlay indicating which areas of the ship are <i>close</i> to an F.T.L. drive (green) compared to which areas are <i>far</i> from one (red).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg69Bu71m-D-9CHZbiEIywVFG1L0mWW3YpIHSiIIqGZaDAmxAGKquWyH_CgsYritf2kJw1yX6dCdd1UF0CE1v-lNRgjXYGBKhsRdgQPEqNXtIgI0b7MrVzFnvPflbck3bCVypVrNvE7PGg/s1600/2017-03-01+13-50-47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg69Bu71m-D-9CHZbiEIywVFG1L0mWW3YpIHSiIIqGZaDAmxAGKquWyH_CgsYritf2kJw1yX6dCdd1UF0CE1v-lNRgjXYGBKhsRdgQPEqNXtIgI0b7MrVzFnvPflbck3bCVypVrNvE7PGg/s400/2017-03-01+13-50-47.png" width="375" /></a></div>
<br />
The farther (more red) areas greatly increase the amount of fuel need to perform an F.T.L. jump. And so to minimize the amount of fuel used, the player will want to place multiple F.T.L. drives around their ship in a variety of locations, making as much of the ship green as possible.<br />
<br />
If the player ever runs out of F.T.L. fuel, they can purchase additional fuel for credits, but doing so is extremely expensive, and so it is almost always preferable to improve the efficiency of one's ship.<br />
<br />
Because the amount of F.T.L. fuel earned from destroying enemies depends on the size of the enemy ship, as your own ship(s) grow in size, it becomes much less cost-effective to battle enemies that are smaller and weaker than yourself. (If you spend fuel to jump a very large ship to a location with small enemies, it is unlikely that you will earn enough fuel to recoup the fuel that you spent getting there.) My intent when balancing fuel costs vs rewards is that a ship with 75+% efficiency that fights ships its own size will generally break even on fuel.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com1tag:blogger.com,1999:blog-7110862627018001433.post-73125802330151245972016-08-20T14:22:00.000-07:002016-12-27T20:21:35.127-08:00Cosmoteer 0.9.7 - Customizable Controls & More!Yesterday I released <a href="http://cosmoteer.net/history.html">Cosmoteer 0.9.7</a>. There's not much super exciting in this release, but it still has a couple notable improvements worth talking about. (Don't worry, I'm hard at work on some big gameplay improvements, but I'm not ready to talk about those yet because I'm still figuring out what exactly those will be!)<br />
<br />
<b>Customizable Controls</b><br />
<b><br /></b>
I <i>love</i> PC games, and one of the reasons that I love PC games is because, at their best, they're very customizable. But it really bothers me when a PC game (frequently ports of console games) lack what IMHO are pretty standard PC gaming features; things like borderless window mode, support for computers with multiple monitors, support for high-resolution displays, triple-buffering, and good alt-tab handling, all of which Cosmoteer does well. But there's one standard PC gaming feature that Cosmoteer hasn't had (which I've been a bit ashamed about, as an avid PC gamer), and that is customize keyboard controls.<br />
<br />
Until now!<br />
<br />
Cosmoteer now lets you customize pretty much every control in the game. Want to change the hotkey for opening build mode to Shift-B? You can do that! Want to set Q as a shortcut to select the Crew's Quarters in build mode? You can do that! Want to make shift-tilde-apostrophe act as a left mouse click? Well, you're insane, but you can do that! There are currently <i>134</i> different actions that can be assigned to keyboard keys or mouse buttons, and each action can have <i>two</i> different key/mouse button combinations set to it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9AIr4oA-LsgVkPctzK3mah2mlxdIPoID_fvMIS6SVT690E5pZrhCFgR1XaX8GsOGTjcqe68RPLVWcQa46UmEaEfPLQ_-onFmDh_IBYxv7_NOQ62tAKYpLh9iYKVJ3d_LpcdJ8JfODLXo/s1600/2016-08-18+16-05-36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9AIr4oA-LsgVkPctzK3mah2mlxdIPoID_fvMIS6SVT690E5pZrhCFgR1XaX8GsOGTjcqe68RPLVWcQa46UmEaEfPLQ_-onFmDh_IBYxv7_NOQ62tAKYpLh9iYKVJ3d_LpcdJ8JfODLXo/s400/2016-08-18+16-05-36.png" width="400" /></a></div>
<br />
Customizable controls are great for those of us who really like to personalize our gaming experiences, but they're also really important for making the game accessible to people who have physical disabilities; customizable controls allow them to tailor the game's controls to their own abilities so that they can still play and enjoy the game, even if the default setup doesn't work for them.<br />
<br />
Oh, and also, by popular demand, WASD is now supported by default (in addition to the arrow keys) as a way of panning the game view. (And some existing shortcut keys got moved as a result.)<br />
<br />
<b>New Main Menu Design & Layout</b><br />
<b><br /></b>
The Main Menu has received a bit of an overhaul:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeSW0LRzw_nqJhYX5PSiA24ME3BjDJBUfocpFcd6_tq1h2q4ORHgY4U_33jkQVp6SVLHkIOLhCp2YfwH5yfSTmQu14GJPM4Tj3BkX7G_0mdKRaQWddzZ0XzDjjl1jjzT4_KRLaNEGtNIw/s1600/2016-08-20+14-09-33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeSW0LRzw_nqJhYX5PSiA24ME3BjDJBUfocpFcd6_tq1h2q4ORHgY4U_33jkQVp6SVLHkIOLhCp2YfwH5yfSTmQu14GJPM4Tj3BkX7G_0mdKRaQWddzZ0XzDjjl1jjzT4_KRLaNEGtNIw/s400/2016-08-20+14-09-33.png" width="400" /></a></div>
<br />
Now, the most-commonly-used options (New Game, Load Game, and Exit) are at the top of the screen, while lesser-used options are at the bottom. The primary purpose of this change is to create more room for options to be added as the game expands. I've already used this newfound room to add a "Community" button, which takes you directly to the <a href="http://forum.cosmoteer.net/">online forum</a>. Eventually I may add more options, such as multiplayer and mod settings.<br />
<br />
<b>Multi-Language Technology</b><br />
<b><br /></b>
Until this release, most of the text displayed by the game was written directly into the game's source code. This worked fine while the game was in the prototype stage, but it made it impossible to translate ("localize") the game into other languages. So I spent a couple days building a system to allow all of the game's text to be loaded from an external file, which can then be translated into other languages. While currently the only included language is English, it's now possible to translate the "en.txt" file into other languages and simply drop them into the "Data/Strings" directory. The game will automatically detect the additional languages and allow the player to switch between them in the Settings menu.<br />
<br />
Here's an example of what the "en.txt" file looks like:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0h-D1Y6iYz4mRK1iRxCXrhF0TPy96Fdccmx8iTjsvs3yJB0sUxrsuKH1E_n2gvxFp7bu0CFz7WYGykzxvQzE2sou4a1A8vOMbvqaRk3w7Xgvn2UIbmgrthE9WkgkA14Ambe_cIBd0_Mg/s1600/localization.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0h-D1Y6iYz4mRK1iRxCXrhF0TPy96Fdccmx8iTjsvs3yJB0sUxrsuKH1E_n2gvxFp7bu0CFz7WYGykzxvQzE2sou4a1A8vOMbvqaRk3w7Xgvn2UIbmgrthE9WkgkA14Ambe_cIBd0_Mg/s400/localization.png" width="400" /></a></div>
<br />Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com2tag:blogger.com,1999:blog-7110862627018001433.post-2326989890456590742016-07-21T15:36:00.000-07:002016-08-18T15:49:22.055-07:00Cosmoteer 0.9.6 - Part MicromanagementI just released <a href="http://cosmoteer.net/history.html">Cosmoteer 0.9.6</a>, which adds the ability to micromanage individual parts, letting you give them individual targets, turn them off or back on, or tell them to hold fire.<br />
<br />
To control the individual parts on your ship, first select your ship if it isn't already selected. Then, click on a specific part or drag a box around the parts you want to select:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxXY0CADXf8T7xrndVdearrXcDEtCDHRpxtVo88QLa9Pl41IWsuIQcnvSR2hKXekY8bJWseEv6EmMnNYJQAftiDcHX9PSS4bdFsACyVm8ix64jXeswroBRlLDq68IWrHp4nk-cWmk87nk/s1600/2016-08-18+15-40-43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxXY0CADXf8T7xrndVdearrXcDEtCDHRpxtVo88QLa9Pl41IWsuIQcnvSR2hKXekY8bJWseEv6EmMnNYJQAftiDcHX9PSS4bdFsACyVm8ix64jXeswroBRlLDq68IWrHp4nk-cWmk87nk/s400/2016-08-18+15-40-43.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCjHZcC0kpxc_6_JlCfWmb0uVwaIOYQLQU6X5yNMTYg-9pRRkBPq_SB7dMROW4J-oMCT2C-s5txsVkZ_ZG_UFbANtUxIg-IjxbByYaECVT0TQRymjfNj3jWzh1ESTqQG_W5LuNk-Btojk/s1600/2016-08-18+15-40-54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCjHZcC0kpxc_6_JlCfWmb0uVwaIOYQLQU6X5yNMTYg-9pRRkBPq_SB7dMROW4J-oMCT2C-s5txsVkZ_ZG_UFbANtUxIg-IjxbByYaECVT0TQRymjfNj3jWzh1ESTqQG_W5LuNk-Btojk/s400/2016-08-18+15-40-54.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The user interface in the bottom-left will change to give you some options pertaining to the parts you have selected. Most parts that consume power or ammo can be turned off, causing their crew to go perform any other jobs that need doing. And weapons can be told to "hold fire", which will prevent them from shooting unless you've given them a specific target, which you can do by right-clicking on a part of an enemy ship.<br />
<br />
Additionally, this release also adds "control groups" like those found in most conventional RTS games. To put the selected ships into a control group, press Ctrl-F1 through Ctrl-F8, and then press F1 through F8 to select the ships in that control group. To put the selected parts into a control group, press Ctrl-0 through Ctrl-9, and then press 0 through 9 to select the parts (of the currently-selected ships) in that control group.<br />
<br />
This release also adds some other minor but still nice improvements, such as being able to see health bars for your own parts without going into repair mode, and being able to focus the camera on specific parts (alt-click to focus on the ship, and then alt-click again to focus on a specific part).<br />
<br />
Enjoy!Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com4tag:blogger.com,1999:blog-7110862627018001433.post-40660922450100964622016-07-10T14:49:00.000-07:002016-08-18T15:35:02.606-07:00Cosmoteer 0.9.4 - Copy & PasteToday I released <a href="http://cosmoteer.net/history.html">Cosmoteer 0.9.4</a>. This is a release light on exciting new gameplay, but it still contains one very useful feature that's worth a blog post:<br />
<br />
<b>Copy & Paste</b><br />
<b><br /></b>
I'm generally very happy with how intuitive ship design has become. When I watch new players play the game, rarely do they have much trouble figuring out how to modify and expand their ship, thanks to many iterations and <a href="http://blog.waltdestler.com/2016/04/starwright-080-user-interface-revamp.html">improvements</a> to the user interface<br />
<br />
But many players, myself included, found the process of designing larger ships (especially in Creative Mode) with repeated sections (possibly rotated and/or flipped) to be very tedious, since every part on the ship had to be added individually, even if a whole section of the ship was merely a copy of another section.<br />
<br />
Let's say that you want to build a symmetrical ship with a center fuselage and mirrored wings on each side. So you start by designing the center fuselage and one of the wings. Prior to this release, you'd have to manually design the other wing as well, being very careful to exactly mirror the original wing. But now, you can use the new "copy and paste" tool, first selecting all the parts on the left wing...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNAyZA3S9QUrLnLE8N2Xgw69MYwInmiiYTdlvg_pVIqS9EORVhO6y9e1-RYp47iZjUf9-FtjZpVnmFzPxgCNUmc7saYqlsljI7gxu0YdsfhQH6WG7MEWn0Dy02haHU0q2bYK_6KlYkJZI/s1600/2016-08-18+15-09-20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNAyZA3S9QUrLnLE8N2Xgw69MYwInmiiYTdlvg_pVIqS9EORVhO6y9e1-RYp47iZjUf9-FtjZpVnmFzPxgCNUmc7saYqlsljI7gxu0YdsfhQH6WG7MEWn0Dy02haHU0q2bYK_6KlYkJZI/s400/2016-08-18+15-09-20.png" width="400" /></a></div>
<br />
... then clicking the "copy" button (ctrl-c works, too), followed by the "paste" (ctrl-v) button, which will load the copied parts as blueprints on your mouse cursor. Once in paste mode, you can choose to rotate and/or flip the blueprints before pasting them onto your ship...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFkSeRMnhc7wxCE2kmYcOOXN2K-hcrIf2_ww8XJlgF2VUC9plA0XOxedsWyBBR0_AaML8jdZEJdb5fExWXm8HrAX8MS1BwNzlUvp5mSq5pl5T_iNUqtUUpbBytwA9L9Jvw-EFYGftNt_M/s1600/2016-08-18+15-09-47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFkSeRMnhc7wxCE2kmYcOOXN2K-hcrIf2_ww8XJlgF2VUC9plA0XOxedsWyBBR0_AaML8jdZEJdb5fExWXm8HrAX8MS1BwNzlUvp5mSq5pl5T_iNUqtUUpbBytwA9L9Jvw-EFYGftNt_M/s400/2016-08-18+15-09-47.png" width="400" /></a></div>
<br />
... and then you simply click to add those parts to your ship, giving us the final result:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiAGyrBI2alXpoDtV4GqYRsuriOh7y_-74gQaYCWzCCLyAod3cGEpPyLjdxxFFNxsjdLYoWXIhCcmamL2OXicnDiRc8-dU1XfFvlk0oVVl0nwdgTuKOA5tjWacBLUo3JLMVAgGIQ3foU0/s1600/2016-08-18+15-10-03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiAGyrBI2alXpoDtV4GqYRsuriOh7y_-74gQaYCWzCCLyAod3cGEpPyLjdxxFFNxsjdLYoWXIhCcmamL2OXicnDiRc8-dU1XfFvlk0oVVl0nwdgTuKOA5tjWacBLUo3JLMVAgGIQ3foU0/s400/2016-08-18+15-10-03.png" width="400" /></a></div>
<br />
I'm very hopeful that this will make designing large, interesting ships much easier. Indeed, I can already find myself being more creative in my own ship designs, knowing that I won't have to duplicate any designs that I want to repeat elsewhere. (It's also worth noting that the copy & paste tool can be used to copy <i>between</i> ships as well.)<br />
<br />
While this may seem like a pretty basic feature, it was actually a very serious technical undertaking to get this working. Ever since I (re)introduced the now-default "live design" mode, I've had code logic to determine whether adding a single part to a particular location was legal, but there was no code to determine whether adding <i>multiple</i> parts in arbitrary locations was legal, which is a far harder problem to solve, because some of those new parts may only be legal because of <i>other</i> parts that are also being added or may be illegal because of <i>other</i> added parts.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-33180863870678781932016-06-29T12:44:00.004-07:002016-06-29T12:44:28.925-07:00Cosmoteer 0.9.0 - Name Change, Exterior Customization, and more!On Friday I released <a href="http://cosmoteer.net/history.html">version 0.9.0</a> of StarWr--er, I mean <i>Cosmoteer</i>. Here's the big-ticket improvements since my last post...<br />
<br />
<b>New Name</b> (version 0.9.0)<br />
<br />
Yes, the name has changed! "StarWright" was always intended to be a temporary name. The full name is now <i>Cosmoteer: Starship Architect & Commander</i>. But I imagine most people will just say "Cosmoteer".<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXrLNF7X46az7LSOx8K2saLLHFal5dGZwF5rwWowTsftGuG1q0NWlMWgBbFVFJ8ZaVKcWIpiMRNFwR8ptKClQWtkCVs6-NN34Gzd_UEGOWbsp-vwCLCDP5C2XzWGPxpFLPTvtHJ5Yr8CY/s1600/logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXrLNF7X46az7LSOx8K2saLLHFal5dGZwF5rwWowTsftGuG1q0NWlMWgBbFVFJ8ZaVKcWIpiMRNFwR8ptKClQWtkCVs6-NN34Gzd_UEGOWbsp-vwCLCDP5C2XzWGPxpFLPTvtHJ5Yr8CY/s400/logo.png" width="400" /></a></div>
<br />
Choosing names is hard, and coming up with a name for this game was no different. (And it could still change again!) An ideal name is short, easy to remember, evocative, descriptive, and not used by another game. In my opinion, "Cosmoteer" is short, pretty easy to remember, and evocative. It's also, somewhat shockingly, not used by any existing game I could find. It's not, however, very descriptive of what you actually do in the game (build ships and fight other ships), and so that's where the <i>Starship Architect & Commander</i> subtitle comes in. Ideally, someone seeing the game's page or logo for the first time will read the subtitle and understand the basic premise of the game, but can still use the much shorter <i>Cosmoteer</i> when actually referring the game in conversation.<br />
<br />
<b>Performance Improvements</b> (version 0.8.1)<br />
<b><br /></b>
I spent a good couple of weeks improving the game's overall framerate, especially when there are lots of large ships in the game at once. This involved using a performance profiler to find which functions were taking so much time and finding ways to do less CPU work in those functions. There ended up being two big areas where performance was greatly improved:<br />
<br />
<u>Rendering</u>. While Cosmoteer/StarWright has never pushed the video card particularly hard, the CPU side of rendering (that is, the code that sends commands and data to the GPU) was using a considerable amount of CPU time. By finding particularly slow functions and rewriting them, I reduced the amount of time the CPU spends rendering each from from over 50% to about 20%.<br />
<div>
<br />
<u>Crew</u>. Large ships can have hundreds and sometimes even more than a thousand individual crew on them. Most of these crew are constantly running around the ship carrying ammo and batteries. Each of these crew needs to decide what job to do, figure out how to get there (pathfinding), and then actually move to their destination.</div>
<div>
<br /></div>
<div>
The pathfinding code was already pretty well-optimized, so I didn't improve that much. But the algorithm that assigns crew to jobs was rewritten from scratch and is now both much faster <i>and</i> does a better job of assigning crew to all jobs on large ships.</div>
<div>
<br /></div>
<div>
Additionally, in previous versions of the game, every single crewperson on every ship was "updated" every single frame, moving a tiny bit towards their destination. But updating thousands of crew every frame was very expensive, and so the current version of the game only updates crew every 1/8 of a second and moves them a greater distance every update. In more practical terms, this means that, if the game is running at 60 FPS, it can update about 7-8 <i>times</i> as many crew as it could before! And if you're wondering why they still <i>look</i> silky-smooth, that's because their movement is smoothed out by the GPU.</div>
<div>
<br /></div>
<div>
<b>Tutorials</b> (version 0.8.4)</div>
<div>
<b><br /></b></div>
<div>
I've always known I would need some sort of in-game guide or tutorial to help players understand how to play. While I've tried to make the user interface and controls as intuitive as possible, there's frankly no way that most players will be able to figure out everything in a game this complex. I was originally planning to create the tutorials much later when the game was much closer to completion, but I got frustrated knowing that any friends of acquaintances I told to go download the game would probably not be able to figure it out without me standing over their shoulders.</div>
<div>
<br /></div>
<div>
So I decided to bite the bullet and create a simple tutorial system. As I was designing the system, I had a few goals in mind:</div>
<div>
<ol>
<li>It needed to be clear and descriptive. Duh.</li>
<li>I didn't want to have to create any kind of special missions or in-game content for it, since that content takes a lot of work to make and would likely have to be thrown out and recreated multiple times as the game evolves. The tutorials needed to work with the existing game content.</li>
<li>I wanted players to be able to go through the tutorials at their own pace or even ignore them entirely. This means that access to game features and content can't be blocked simply because the player hasn't done a tutorial. It also means that the player should be able to be able to experiment and play with what they've just learned from a tutorial without being forced to move on to the next one before they are ready.</li>
</ol>
<div>
(Notice that I had no explicit goal to make tutorials "fun", since that would likely require special content to be made for the tutorials.)</div>
</div>
<div>
<br /></div>
<div>
Here's a brief description and explanation of the tutorial system I came up with that I think satisfies these three conditions:</div>
<div>
<br /></div>
<div>
When the player loads Cosmoteer for the first time and starts a new game, they are given the standard Model-1 starting ship and full access to the user interface. In addition to that, there's a small "How to Play" section in the upper-left corner, underneath of which there are one or more tutorial topics that the player can access.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9xXtq3LHW8WMX0l4iGS7XtNdVVT2NgLaIaXcouI-4gQgOf7jJh7K61ChO0djAnqFINkL35Zcxcn1K1dqZTebNe9Wfujnqw0kOB-JYbRETe26zGo03R4ibuio_6Ym9IQWJGtFK6LYMqi4/s1600/2016-06-28+13-21-51.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9xXtq3LHW8WMX0l4iGS7XtNdVVT2NgLaIaXcouI-4gQgOf7jJh7K61ChO0djAnqFINkL35Zcxcn1K1dqZTebNe9Wfujnqw0kOB-JYbRETe26zGo03R4ibuio_6Ym9IQWJGtFK6LYMqi4/s400/2016-06-28+13-21-51.png" width="400" /></a></div>
<div>
<br /></div>
<div>
The player can completely ignore or dismiss (by clicking the X) a tutorial if they don't want to view it. But clicking on one of the topics will expand it, showing (hopefully) clear and concise instructions with some accompanying informational graphics.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjik1neg8y2BQchNQAJwMPGqjCF2qWfxtzvqh-BGrTej3DqR-qQfH1lJ_q2xIlQqbQqfXJ4nPmlPH9NCTUIiAk8GD-xUfp3v6F0bOVgPfvTY5Rwh_ydBM-mjldPtooOR4wMVHZBgeXGJZc/s1600/2016-06-28+12-57-04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjik1neg8y2BQchNQAJwMPGqjCF2qWfxtzvqh-BGrTej3DqR-qQfH1lJ_q2xIlQqbQqfXJ4nPmlPH9NCTUIiAk8GD-xUfp3v6F0bOVgPfvTY5Rwh_ydBM-mjldPtooOR4wMVHZBgeXGJZc/s400/2016-06-28+12-57-04.png" width="367" /></a></div>
<div>
<br /></div>
<div>
The tutorial never actually asks or requires the player to do anything. It simply trusts that the player will read the tutorial and experiment with the controls until they are comfortable and ready to move on. When they are, clicking the "Got it!" button will hide the tutorial.</div>
<div>
<br /></div>
<div>
As players play the game, certain actions (such as defeating an enemy or opening a particular interface panel) will cause a new topic to be offered to the player to read at their leisure.</div>
<div>
<br /></div>
<div>
By creating a tutorial that can be experienced at the player's pace, I hope that it will adapt to the individual preferences of many kinds of players.</div>
<div>
<br /></div>
<div>
<b>New Backgrounds</b> (version 0.8.5)</div>
<div>
<b><br /></b></div>
<div>
The original starry blue background (which was a a public domain image from NASA) was fine for telling you that you were in space, but because it was a single static image that never changed from game to game or as you played, it was ultimately pretty boring and repetitive.</div>
<div>
<br /></div>
<div>
I have replaced that original background with three different styles of dynamically-generated backgrounds: Blue, Red, and Gold. These three styles add some game-to-game variety, and even within a style the background will change game-to-game.</div>
<div>
<br /></div>
<div>
Additionally, these backgrounds feel more alive and dynamic thanks to a subtle twinkling of stars (yes, I know that stars only appear to twinkle because of Earth's atmosphere, but I thought it looked nice). There's also a small amount of parallax as you pan the view that makes some stars and nebula appear farther away than others, giving a nice sense of depth.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyA4n-TmopAWLrP9jfr_T5kJ0SoqVN-MnMD1d1aCL4rp9MeorIZUwPhwcVTU89xOVnDZOZFPhkdYaFYZd9VhEjPcmGmirVpPmk9Q6ucnYxNkPTUI17L3V2ihEVCOJx2GUVRbbp_mGO7v8/s1600/2016-06-28+13-37-20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyA4n-TmopAWLrP9jfr_T5kJ0SoqVN-MnMD1d1aCL4rp9MeorIZUwPhwcVTU89xOVnDZOZFPhkdYaFYZd9VhEjPcmGmirVpPmk9Q6ucnYxNkPTUI17L3V2ihEVCOJx2GUVRbbp_mGO7v8/s320/2016-06-28+13-37-20.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPEYGDyiU1XSkLw1F373mZMcII4iH-nx-1u2vhQHMOMEUxMzY1QE_CVQGjzMp_uNPFZdwNk0GKvb7B8Ew0AXlDDWymY-JoXoOiTEaYtp5ysPyYa3xJqqEM151c0MXqv1w4rfWZkAKc21o/s1600/2016-06-28+13-37-25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPEYGDyiU1XSkLw1F373mZMcII4iH-nx-1u2vhQHMOMEUxMzY1QE_CVQGjzMp_uNPFZdwNk0GKvb7B8Ew0AXlDDWymY-JoXoOiTEaYtp5ysPyYa3xJqqEM151c0MXqv1w4rfWZkAKc21o/s320/2016-06-28+13-37-25.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_p3hFRtV9WGevmxzt3brn8jgPFGr0LJM6rN8hvzVRu5xleRXik3zcuWyemykiZ0petlpmJrfM-ULn6xgdkdmRQ2z0JD9KuChZkKO5nJw8K3zalcf86ljDE4qQIvqiijOoPzeUDNIP4DU/s1600/2016-06-28+13-37-13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_p3hFRtV9WGevmxzt3brn8jgPFGr0LJM6rN8hvzVRu5xleRXik3zcuWyemykiZ0petlpmJrfM-ULn6xgdkdmRQ2z0JD9KuChZkKO5nJw8K3zalcf86ljDE4qQIvqiijOoPzeUDNIP4DU/s320/2016-06-28+13-37-13.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
A potentially nice thing about having computer-generated backgrounds is that I now have the ability to generate as much background as I need. For example, until now I haven't wanted to ever rotate the camera because then the player would have seen the edges of the background image, but now I can rotate the camera because more background can be generated as-needed.</div>
<div>
<br /></div>
<div>
<b>Purchasing Additional Ships in Standard Mode</b> (version 0.8.7)</div>
<div>
<br /></div>
<div>
It's always been possible to control multiple ships in Creative Mode, and while it has also always been <i>technically</i> possible to own multiple ships in Standard (Bounty) Mode, doing so involved getting a piece of your ship blown off and then building onto the blown-off piece. I've always intended to let the player control multiple ships at the same time, but now you can simply buy any ship whose design you've previously saved as long as you have enough money.</div>
<div>
<br /></div>
<div>
<b>DirectX 11</b> (version 0.8.9)</div>
<div>
<br /></div>
<div>
StarWright used to be written on top of Microsoft DirectX 9.0c, which is now about 12 years old and no longer has great support from graphics hardware manufacturers. Indeed, some players were getting frequent crashes that I was unable to reproduce and had no way of figuring out how to fix.</div>
<div>
<br /></div>
<div>
I made a decision to upgrade to DirectX 11, hopeful that doing so would solve those crashes and make the game a lot more stable. Thankfully, the two weeks I spent upgrading the code to use DirectX 11 proved worthwhile, because all of those crashes have stopped.</div>
<div>
<br /></div>
<div>
There are a couple other improvements as well, besides the better stability:</div>
<div>
<ol>
<li>The player can now change what monitor the game runs on without restarting the application.</li>
<li>DirectX 11 is a more efficient graphics API, and I saw framerate improvements of up to 50% compared to DirectX 9.</li>
</ol>
<div>
Note that the game doesn't actually require a DirectX 11 graphics card and should still work fine on older DirectX 9.0c+ graphics cards.</div>
</div>
<div>
<br /></div>
<div>
<b>Customizable Ship Exteriors</b> (version 0.9.0)</div>
<div>
<b><br /></b></div>
<div>
And lastly, we have the biggest new feature in months: Ship exterior views with aesthetic customization.</div>
<div>
<br /></div>
<div>
I had two big goals with this update:</div>
<div>
<ol>
<li>Make ships feel more tangible and real.</li>
<li>Let players customize their ship's appearance.</li>
</ol>
<div>
<u>Make ships feel more tangible and real.</u> Until now, ships have been these strange flying floorplans in space that shoot each other. Because of this, ships didn't really feel like physical, tangible objects flying through space:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQrbdY403eOJV49KrQMeBN2VZsOnwbL92G01HQ7UfJ38gXe4QYeT8cmOYb4VdBAZ4kEsGOAWMFd4H5Ibhbh82hyphenhyphenupL69fL49u1OPQaJPNpy9pcWNdONtLggd7UsCssQzdf3ANvvDKb3Q/s1600/2016-06-29+11-55-28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQrbdY403eOJV49KrQMeBN2VZsOnwbL92G01HQ7UfJ38gXe4QYeT8cmOYb4VdBAZ4kEsGOAWMFd4H5Ibhbh82hyphenhyphenupL69fL49u1OPQaJPNpy9pcWNdONtLggd7UsCssQzdf3ANvvDKb3Q/s400/2016-06-29+11-55-28.png" width="400" /></a></div>
<div>
<br /></div>
<div>
And so I added an "exterior view" that is shown by default but can be toggled on & off by the player:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQhOIJoZ_YYr_p3689VWKQ46k3cKYdm6jOsTnUo3EsU4uyyTRrUAakm6FX9KIGi7HbdG969KgalZ0WqFZXiDbkwNZE6lh57hBqgUS2WUA7JWztZrcE9k5bvHgW0oJZJI7J22WLRUEoeHk/s1600/2016-06-29+11-55-33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQhOIJoZ_YYr_p3689VWKQ46k3cKYdm6jOsTnUo3EsU4uyyTRrUAakm6FX9KIGi7HbdG969KgalZ0WqFZXiDbkwNZE6lh57hBqgUS2WUA7JWztZrcE9k5bvHgW0oJZJI7J22WLRUEoeHk/s400/2016-06-29+11-55-33.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Already this helps the ship feel more present, physical, and tangible, even though its appearance is rather plain. My original prototype for exteriors didn't have any windows, which made ships feel much less alive and uninteresting, so I added windows to most parts which give you glimpses of the activity going on inside.</div>
<div>
<br /></div>
<div>
<u>Let players customize their ship's appearance.</u> Adding exteriors to ships also created a great opportunity to allow players to customize those exteriors. But the question then became, in what way can players customize their ship's appearance? I wanted to give players as much control over painting their ship as they have over building their ship, but not so much control that players would feel like they have to nitpick over every pixel or that less-artistic players would be intimidated. I also wanted to make sure that players who weren't interested in going deep into appearance customization could still make cool-looking ships with just a few clicks.</div>
<div>
<br /></div>
<div>
So I first added the ability to set a base paint color and "wallpaper" pattern, which already provided a good amount of aesthetic options:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2dTTlUe2EuF4xTNyQLegyC4TUB9aPpsLdqicBrQCzmTK1_L0qItLe8sp_b_pWJ1dlTXvVwPcl0NbdWj7TOPncfsbfdHKclYukdeHvJMEM2V2_j7PRrHbc6WjtvpoQlK5pQp00MX2NE2Q/s1600/2016-06-29+12-09-58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2dTTlUe2EuF4xTNyQLegyC4TUB9aPpsLdqicBrQCzmTK1_L0qItLe8sp_b_pWJ1dlTXvVwPcl0NbdWj7TOPncfsbfdHKclYukdeHvJMEM2V2_j7PRrHbc6WjtvpoQlK5pQp00MX2NE2Q/s400/2016-06-29+12-09-58.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Players who didn't want to go deeper into customization could just pick a color and pattern they like. But for players who wanted more fine-grained control, I added what I call "decals":</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx784S3le8iYXCHfqCqnXIQPB4uOMKmD17RDjiETg8_hyibWjPLEv8W7e9wSK46pH622Wh9lrna_LpcgwWzKkpTA55Enezr1tM4yqhZuMuEsWz002V1Zj-n5UBbdySja-tZtMctBmpMS4/s1600/2016-06-29+12-12-14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx784S3le8iYXCHfqCqnXIQPB4uOMKmD17RDjiETg8_hyibWjPLEv8W7e9wSK46pH622Wh9lrna_LpcgwWzKkpTA55Enezr1tM4yqhZuMuEsWz002V1Zj-n5UBbdySja-tZtMctBmpMS4/s400/2016-06-29+12-12-14.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Decals are small shapes, icons, letters, numbers, and symbols that the player can stamp onto their ship. There are actually two "layers" of decals (Decals 2 is on top of Decals 1), and each layer has its own color that can also be chosen by the player (all decals in a layer have the same color).</div>
<div>
<br /></div>
<div>
Most decals are only the size of a single tile, and many of the decals are basic shapes that can be combined into larger designs however the player wants.</div>
<div>
<br /></div>
<div>
With the base paint color and two decal colors, the player can pick three colors for their ship, which allows for a good but not overwhelming amount of flexibility.</div>
<div>
<br /></div>
<div>
Another advantage of this system is that it's easy to save and swap "paint schemes", allowing multiple ships with the same decal layout to still look radically different:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjohVk1AZ5Hitja2oIWYouWH4ixReZqY8ejtYShDfHV5OqdEoeZ8zH9XGvZ8ZURqOCVBmNCMVMk0k28sXyDyqcjGa7lNxVLP5PFNrSzjQMQuJiqDeDt2tr3BUcfjpMYjxVYlJgkwUUAUOo/s1600/2016-06-29+12-24-59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjohVk1AZ5Hitja2oIWYouWH4ixReZqY8ejtYShDfHV5OqdEoeZ8zH9XGvZ8ZURqOCVBmNCMVMk0k28sXyDyqcjGa7lNxVLP5PFNrSzjQMQuJiqDeDt2tr3BUcfjpMYjxVYlJgkwUUAUOo/s400/2016-06-29+12-24-59.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU8aUyqMgKcg1hUDYt540JGOM8SLZDoXkTUgIiEi1D5pabG_6G4C4UsRAkJQCDydL1b2rbg61DpDQ7B5D9eyQYhSyZSceM_ifMvVSdT9SCdHsmHD2lWOJhqtwuU5YDRljBJhONj3oWygU/s1600/2016-06-29+12-24-21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU8aUyqMgKcg1hUDYt540JGOM8SLZDoXkTUgIiEi1D5pabG_6G4C4UsRAkJQCDydL1b2rbg61DpDQ7B5D9eyQYhSyZSceM_ifMvVSdT9SCdHsmHD2lWOJhqtwuU5YDRljBJhONj3oWygU/s400/2016-06-29+12-24-21.png" width="400" /></a></div>
<div>
<br /></div>
<div>
A downside of allowing this level of appearance customization is that it's very possible to make ships that just look really ugly. But I think that this downside is a small price to pay in a game that's all about player customization.<br />
<br />
Overall, I'm quite happy with how customizable ship exteriors turned out. As always, I welcome your feedback!</div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-70891093487168930462016-04-12T14:51:00.000-07:002016-06-24T11:10:50.701-07:00StarWright 0.8.0 - User Interface RevampYesterday I released <a href="http://starwright.waltdestler.com/">StarWright 0.8.0</a>. The main focus of this release was to greatly improve the user interface (or "user experience" to use the trendy modern term) for designing and constructing ships. This is the culmination of the U.I. work that started with 0.7.1 (the ship "info card" in the corner) and 0.7.2 (the separate repair and crew management U.I.s), which I will also talk about in this post.<br />
<br />
Let's back way up first, and talk about the original U.I. for constructing ships: At the beginning of time (StarWright's lifetime, anyway), designing starships was done using a user interface that was completely separate from the gameplay:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7lk03trr_bSatefyPnf6v4dEP_p3M1djfmeSQTTMhd_AXow6s4zI4wlXkeoBTyLB5W_9nhDpoVq9dywSZqyHb9mADQQjVokWVuSOdNE-lS1ygVIsVOr1hFBr05HSO46SpMuaNGuTVAcs/s1600/blueprint.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7lk03trr_bSatefyPnf6v4dEP_p3M1djfmeSQTTMhd_AXow6s4zI4wlXkeoBTyLB5W_9nhDpoVq9dywSZqyHb9mADQQjVokWVuSOdNE-lS1ygVIsVOr1hFBr05HSO46SpMuaNGuTVAcs/s400/blueprint.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
You'd hop into the "Builder" and design your ship on a grid. When you were happy with your design and wanted to test it, you'd press the "Save & Test" button, which would switch you to a testing game environment where you could spawn enemy ships to test your ship's combat prowess against.<br />
<br />
And then I watched <a href="https://vimeo.com/36579366">a talk by Bret Victor</a> in which he persuasively argued that user interfaces are hampered when the user makes a choice but the <i>feedback</i> from the user interface about that choice is delayed. I realized that StarWright (called "ShipBuilder" at the time) suffered from the same delay in that the player didn't see the <i>effects</i> of their design changes until they actually hit the "Save & Test" button. This was unlike most other "construction" games such as SimCity in which you can immediately see how placing a building effects things like power, water, and roads. And so I decided to merge the ship editor and gameplay environment into a new environment that I called the "Sandbox":<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ4I6NDOmsq0kP0nw9mTsOrfxxVv7hCEpD-ZygKOf5OIzVhr3HWFtAR_EOZaGxvZ_EhzRwlINYOkczSMHhg044qAYLZuvc8Ie_1qafB54R1iz6uFcObcGOi14rjmuxir7fkRYkIfGd4fM/s1600/sandbox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ4I6NDOmsq0kP0nw9mTsOrfxxVv7hCEpD-ZygKOf5OIzVhr3HWFtAR_EOZaGxvZ_EhzRwlINYOkczSMHhg044qAYLZuvc8Ie_1qafB54R1iz6uFcObcGOi14rjmuxir7fkRYkIfGd4fM/s400/sandbox.png" width="400" /></a></div>
<br />
In this new environment you could add a part to your ship (like a cannon) and very quickly see how that new part interacts with the simulation of your ship as a whole (crew running over to operate it) and any problems that it has (crew can't get any ammo to it). (I wrote about this change more extensively in <a href="http://blog.waltdestler.com/2012/04/starwright-sandbox.html">a blog post</a> from way back in 2012.)<br />
<br />
This was a really big improvement! Being able to watch a ship operate <i>as</i> it was designed really made learning the rules of the ship simulation much more intuitive, and players felt like they were making much more informed (and successful) ship design decisions.<br />
<br />
Now let's fast forward again by a few years (I had a job, okay?) to late 2015, as I was beginning to ramp development on StarWright back up to full speed. Up to this point, there was no real <i>challenge</i> or <i>economy</i> in the game; it was just a free-form sandbox mode where you could build whatever you want. And while creative/sandbox modes in these kinds of games are great (yes, I plan on keeping the "Creative Mode" forever and ever), my ultimate vision for the game was that the player would start with a small ship, earn money by going on missions and defeating enemy ships, and expand their own ship over time.<br />
<br />
But this caused a couple of conflicts with how ships were built:<br />
<br />
<ul>
<li>Adding parts to ships needed to cost <i>money</i>, but the player shouldn't be forced to waste money when they accidentally place a part in the wrong location or if they change their mind halfway through an in-progress design.</li>
<li>It needed to be easy and convenient for the player to restore a partially-destroyed ship back to its intended design.</li>
</ul>
<div>
My solution to these two problems was to introduce the "Blueprint" mode, which separated a ship's <i>design</i> (i.e., its blueprints) from its current physical condition:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVX1HZTvujb_iW5ps6MKBHZqTppOa8jeSLojhWPe9CkXBzaGUw6pko7JpxkJKoqXRRxIVr6uhCa1K1LG6RGTwXRQ6RidAJ5tfYB7n9Iqo8hhr6DiA45fR_Ggr8bPRiocBGq9ZO8pBxubU/s1600/blueprints.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVX1HZTvujb_iW5ps6MKBHZqTppOa8jeSLojhWPe9CkXBzaGUw6pko7JpxkJKoqXRRxIVr6uhCa1K1LG6RGTwXRQ6RidAJ5tfYB7n9Iqo8hhr6DiA45fR_Ggr8bPRiocBGq9ZO8pBxubU/s400/blueprints.jpg" width="400" /></a></div>
<div>
<br /></div>
<div>
I talk more about the Blueprint mode in <a href="http://blog.waltdestler.com/2015/11/starwright-010-bounties-blueprints.html">another blog post</a>, but to summarize how it solved these two problems:</div>
<div>
<ul>
<li>Players would make modifications to the ship's blueprints instead of the ship itself. The player could freely modify the blueprints without being charged any money. Once the player was satisfied with their design, they pressed the big "MAKE IT SO" button on the right, and -- voila! -- their ship was updated to match their blueprint design and the appropriate amount of money was subtracted from their funds. (If you're thinking, "But Walt, wasn't being able to <i>immediately</i> see the results of design changes a good thing? Why get rid of that?", then my only response to you is, I wish you were there to remind me of that in Nov. 2015!)</li>
<li>While a ship could take damage and have parts of it completely destroyed, its <i>blueprints</i> would remain unaffected. If the player wanted to repair their ship back to its intended design, they could just open up the Blueprints mode and click "MAKE IT SO" again.</li>
</ul>
<div>
The first problem I realized that blueprints had was with repairing: While it was definitely A Good Thing that players were able to easily repair their ship back to its original state, I quickly discovered that players (including me) would often do the following:</div>
</div>
<div>
<ol>
<li>Fight and defeat an enemy, taking some damage and earning some bounty money.</li>
<li>Open up the Blueprint mode and design some awesome additions for their ship.</li>
<li>Realize they can't afford their new awesome design, and so decide to go earn another bounty.</li>
<li>Want to repair their ship, but realize they can't without undoing all their glorious design work!</li>
<li>Get really angry.</li>
</ol>
<div>
And so I decided to add a "Repair" option. When this option was selected, pressing the "MAKE IT SO" button, instead of making your ship's physical condition match its blueprints, would make your ship match how it was the <i>last</i> time you pressed that button.</div>
</div>
<div>
<br /></div>
<div>
And this is how it's worked for the past few months. All problems solved?</div>
<div>
<br /></div>
<div>
Of course not:</div>
<div>
<ul>
<li>I realized (again) that players were having a harder time designing their ships because they weren't getting immediate feedback from the game simulation on their design changes. Somehow, in my excitement to make Bounty Mode work, I had forgotten that immediate feedback was A Really Good Thing.</li>
<li>The "Repair" option next to the "MAKE IT SO" button was both confusing and limiting. Confusing because it was a very important feature that was buried as an option inside the Blueprint mode user interface despite having, literally, nothing to do with blueprints. And limiting because it was an all-or-nothing choice; there was no option to selectively repair only certain parts of your ship.</li>
</ul>
<div>
And so I embarked on my weeks-long journey to fix these two problems...</div>
</div>
<div>
<br /></div>
<div>
First up, I decided to dedicate a separate user interface to repairing ships; a U.I. which would be accessed by its own "Repair" button sitting co-equally right next to the "Build" button.</div>
<div>
<br /></div>
<div>
And so I started to work on-- screeeech, halt! ... Nevermind. Instead, I decided to first implement <i>another</i> U.I. feature that I'd been wanting for a while. Even though that feature wasn't really necessary to solve the above problems, its code would be very intertwined with the code for solving the above problems, and it'd take less time to implement it <i>before</i> solving those problems than <i>after</i>. This feature was the Ship Hub:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHgtQyUwrGX9fUU79btNasIi8S9QCcuMRABEgyNhXzdiD2TJwxViO_4RwW4d42Ja1d-7_phdBYRepIav_l52EtdpcH1YJFLEYwFXWzEbHN7t2bjOu3xGdUdhfGhkwQQZb4o2p8JdU5Y5k/s1600/2016-04-12+13-18-19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHgtQyUwrGX9fUU79btNasIi8S9QCcuMRABEgyNhXzdiD2TJwxViO_4RwW4d42Ja1d-7_phdBYRepIav_l52EtdpcH1YJFLEYwFXWzEbHN7t2bjOu3xGdUdhfGhkwQQZb4o2p8JdU5Y5k/s320/2016-04-12+13-18-19.png" width="320" /></a></div>
<div>
<br /></div>
<div>
The general idea behind the Ship Hub was that it'd be the place on the screen where the player would go to interact with their ship in any way. The dark rectangular card shows a silhouette icon of the ship, it's name, and some other basic information. (And the '...' button exposes some lesser-used options that used to be in the super-awkward alt-right-click menu.) Above the informational card would be all the buttons to access various ship features, such as the ship design U.I. and, eventually, repairs and crew. The Ship Hub was released in version 0.7.1.</div>
<div>
<br /></div>
<div>
With the Ship Hub completed and out-of-the-way, I did, finally, implement the new repairing U.I.:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6QMqXzeB-sZ7gvEuJKbi4w6WxbcyDIq3D5EBoDtDl0GhkEdOxkVxpqq4ERmH67HUtpzQXwrBCPsqv6TyI6ceObdmIzHhqE3EuGL-_W-YI2aIDfKSBBrcISUe1X6vzfGrGAz_j0VN9XeI/s1600/2016-04-12+13-32-32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6QMqXzeB-sZ7gvEuJKbi4w6WxbcyDIq3D5EBoDtDl0GhkEdOxkVxpqq4ERmH67HUtpzQXwrBCPsqv6TyI6ceObdmIzHhqE3EuGL-_W-YI2aIDfKSBBrcISUe1X6vzfGrGAz_j0VN9XeI/s400/2016-04-12+13-32-32.png" width="400" /></a></div>
<div>
<br /></div>
<div>
The "Repair Mode" is accessed by clicking the green wrench icon next to the Build button.</div>
<div>
<br /></div>
<div>
The cool thing about Repair Mode is that it shows you exactly which parts are damaged or destroyed with a red wrench icon for damaged parts or a red overlay for missing destroyed parts. Clicking on a damaged or missing part will repair that specific part. Or you can simply click the big "REPAIR ALL" button to fix everything at once!</div>
<div>
<br /></div>
<div>
I'm pretty happy with this new Repair Mode user interface. It's much more easily accessed and prominently displayed, and it is also much more flexible since you can, optionally, pick individual parts to be repaired. Repair Mode was released in version 0.7.2.</div>
<div>
<br /></div>
<div>
Also released in 0.7.2 was a little U.I. for managing your ship's crew:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAnFfCeIvfEAJal9Gom19c3UNhmAPfO8iC4qUTNKS37U3oUbfETmBoUQQQdLAWoWJJcWq7ztCBygNxDu1AEjgys3Gznkat1MyV0S_g0AgMA8lBVZNfxuYH0nUNSqZSkyQLptrSbfYMlH4/s1600/2016-04-12+13-39-18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAnFfCeIvfEAJal9Gom19c3UNhmAPfO8iC4qUTNKS37U3oUbfETmBoUQQQdLAWoWJJcWq7ztCBygNxDu1AEjgys3Gznkat1MyV0S_g0AgMA8lBVZNfxuYH0nUNSqZSkyQLptrSbfYMlH4/s400/2016-04-12+13-39-18.png" width="400" /></a></div>
<div>
<br /></div>
<div>
This shows you your current number of crew relative to the number of crew your ship can carry. And it has three buttons for adjusting the number of crew: The first button adds one crew, the second button fills your ship up to its maximum crew capacity (or as many crew as you can afford to hire), and the third button fires one crew. That's it!</div>
<div>
<br /></div>
<div>
This also wasn't strictly necessary for solving those two big problems, but it was easy to implement and is nice to have. Eventually I plan on having individual crew members with different ranks and abilities, and this user interface will be fleshed out to manage them.</div>
<div>
<br /></div>
<div>
0.7.3 and 0.7.4 were interim bugfix released that I put out while I was working on revamping the user interface for designing ships.</div>
<div>
<br /></div>
<div>
With repairing ships handled via a completely separate interface, I realized that the only major design impediment to letting the player directly add and remove parts from their ship was the risk of them wasting money by making accidental mistakes or backtracking on their design. And then I realized that the only reason this was actually a problem was that <i>removing</i> a part didn't refund the full cost of adding that part in the first place (it refunded 75%). And so I made the decision to refund the player the full original cost when removing a part, and now the player can undo any design change they make without having wasted any money. (I had originally added the 25% "deconstruction" tax as a way to incentivize picking a design and sticking with it, but I think being able to directly modify your ship and freely experiment is worth getting rid of the tax.)</div>
<div>
<br /></div>
<div>
And so with that last design hurdle out-of-the-way, I split ship designing into two separate modes: Direct Edit mode and Blueprint mode...</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiViOG7eN-hvnkKtg041ybV71Dng5TBsZTW1WcAil-JW9U9XwCFhfgtXwzNZh9SRHXlWjLKLaQtAwR6wZaKn-9A56MuqxTC7YlxyrEb_ZovaIPLYM2ms9pdpBrP_QKNj_svJAJ9B2wwan0/s1600/2016-04-12+14-07-56.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiViOG7eN-hvnkKtg041ybV71Dng5TBsZTW1WcAil-JW9U9XwCFhfgtXwzNZh9SRHXlWjLKLaQtAwR6wZaKn-9A56MuqxTC7YlxyrEb_ZovaIPLYM2ms9pdpBrP_QKNj_svJAJ9B2wwan0/s400/2016-04-12+14-07-56.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Blueprint mode</td></tr>
</tbody></table>
<div>
Blueprint mode isn't much changed from how it worked these past few months: You can freely make modifications to your ship's blueprints without regard for cost, and then when you're happy with them, you press the "MAKE IT SO" button. In fact, Blueprint mode has gotten even better, because now it will let you temporarily place blueprints in illegal locations as you plan things out, so long as you fix any problems before clicking "MAKE IT SO".</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7_0V3sC7HYHak_VzAmUywgRuroykcMFvKPOKHGdkVd47K5v1n3nzECDwhSdNCiotx4QzVtUjQY_314KkINQzFiWPjfZpu6MuTfPAQyG9Cpg0JB6YNFgsBVy90-zmmlGKhbFNiBuYvgo8/s1600/2016-04-12+14-07-41.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7_0V3sC7HYHak_VzAmUywgRuroykcMFvKPOKHGdkVd47K5v1n3nzECDwhSdNCiotx4QzVtUjQY_314KkINQzFiWPjfZpu6MuTfPAQyG9Cpg0JB6YNFgsBVy90-zmmlGKhbFNiBuYvgo8/s400/2016-04-12+14-07-41.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Direct Edit mode</td></tr>
</tbody></table>
<div>
Direct Edit mode on the other hand is brand new. In this mode you directly add and remove parts to and from your ship, being charged or refunded as you go. (And behind-the-scenes, the blueprints will be kept up-to-date with your changes as well.) It's somewhat more restrictive than Blueprint mode in that you can't make any change that would put your ship into an illegal configuration. But on the flip side, you can see the immediate effects or problems of any changes you make, such as whether crew can access a room or whether a laser cannon has power.</div>
<div>
<br /></div>
<div>
Both modes are accessed by clicking the "Build" button in the lower-left above the ship information card. The Direct Edit mode will be shown by default (although if you prefer Blueprint mode, you can make it the default in the settings), and you can then switch to Blueprint mode by clicking the blue blueprints button that expands out from the build button.</div>
<div>
<br /></div>
<div>
There are some restrictions to <i>when</i> you can use Direct Edit mode that don't apply to Blueprint mode. In particular, you can't use Direct Edit mode during combat or while in debt. In addition, if your ship has any destroyed parts, those parts must be repaired before entering Direct Edit. And if you've made any modifications in blueprint mode, those modifications must be either committed or discarded before returning to Direct Edit mode. (If you open the ship designer and Direct Edit mode is unavailable for any reason, Blueprint mode will be shown instead.) These restrictions are necessary to make sure that you can't make any changes in Direct Edit mode that would break either the Blueprint or Repair modes.</div>
<div>
<br /></div>
<div>
I also took the opportunity to improve the design experience of both Direct Edit and Blueprint modes in some nice ways:</div>
<div>
<ul>
<li>While in either Direct Edit or Blueprint modes, the background is dimmed and a build grid is displayed underneath your ship. This should make it easier to eyeball distances and also make it more obvious when you're in design mode instead of being able to control your ship.</li>
<li>The cost (or refund) of making any changes to your ship is shown underneath the mouse cursor.</li>
<li>The logic that determines where to automatically add doors between parts has been greatly improved, especially when the "Overwrite Existing Parts" option is turned on (as it is now by default). It will no longer remove any doors that didn't actually need to be removed, and it's much smarter and more aggressive about adding doors as new parts are placed. This is the kind of improvement that, if it works well, you won't notice it at all!</li>
<li>Adding a Crew's Quarters or Crew's Bunk in Direct Edit mode will, by default, automatically hire crew to go along with it.</li>
<li>And lots of other little improvements that you can read about in the <a href="http://starwright.waltdestler.com/history.html">version history</a>.</li>
</ul>
<div>
As always, thanks for playing! And please post whatever feedback you have!</div>
</div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com10tag:blogger.com,1999:blog-7110862627018001433.post-29968714896000090822016-03-20T22:35:00.000-07:002016-06-24T11:10:50.617-07:00StarWright 0.7.0 - Ion Beams!Today I released <a href="http://starwright.waltdestler.com/history.html">StarWright 0.7.0</a>!<br />
<br />
This latest major release adds the 'Ion Beam Emitter' weapon:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSGN4d-iEdnpVVqfWcrhGoDrgDyvQh2DjkynpA7pa7HP06T7Ko8xm-vvfhZV5EfEk_tAAQWUCLA6De5dIQSDuByCTKW6r-h2N6UtJpFVPDZhe5Nq7SnEv-aytzyfBdddRpLtT7P9MRwY/s1600/ion+beam.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSGN4d-iEdnpVVqfWcrhGoDrgDyvQh2DjkynpA7pa7HP06T7Ko8xm-vvfhZV5EfEk_tAAQWUCLA6De5dIQSDuByCTKW6r-h2N6UtJpFVPDZhe5Nq7SnEv-aytzyfBdddRpLtT7P9MRwY/s400/ion+beam.png" width="400" /></a></div>
<br />
<br />
The Ion Beam shoots an extremely powerful (and power-hungry) beam of ion energy that will quickly rip holes in enemy ships. It is currently the most powerful weapon in the game in terms of how much damage it can do every second, and it's particularly effective at sawing ships into pieces.<br />
<br />
But as powerful as the Ion Beam is, it does have some key weaknesses:<br />
<br />
<ol>
<li>Unlike the other weapons currently in the game, the Ion Beam Emitter is so heavy that it can't be mounted on a turret and thus must be fixed directly to the ship's hull. This means that the ion beam can only shoot in a straight line (as determined by which way the ship is facing), and thus is very difficult to aim with any precision.</li>
<li>Firing the ion beam uses a lot of power <i>very</i> fast. If you want to keep the ion beam active for more than a few seconds, you'll need a lot of power being constantly delivered to it.</li>
<li>Unlike the other weapons, the Ion Beam Emitter is very weakly armored, making it a potential Achilles' heel through which enemy fire can reach the inside of your ship.</li>
<li>While the Ion Beam Emitter is only two spaces wide, it is <i>four</i> spaces deep, three of which cannot be traveled by crew. This may force you to re-think your ship's layout and cause issues with ammo and power delivery to other systems.</li>
</ol>
<div>
Please feel free to <a href="http://starwright.waltdestler.com/">download</a> the game and post your feedback!</div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com1tag:blogger.com,1999:blog-7110862627018001433.post-16420596823821355602016-03-06T19:58:00.001-08:002016-03-06T19:58:35.850-08:00StarWright 0.6.0 - Shields!Today I released <a href="http://starwright.waltdestler.com/">StarWright 0.6.0</a>, which (in addition to a handful of other improvements) features the game's first <i>active</i> defensive system: the Shield Generator!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS0j4-4K88-JnAhCPdowJzdOqSLvuzBv0qAdE0xHGtEk8OJMuwIponUn0mnurA9lybdli3AkT-uypYciOuQ83uoi2bOTKoiJumvGN80bMsdyioh8u3uIL41hZWTHeKBhszDJE4NK_lzZs/s1600/shields.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="326" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS0j4-4K88-JnAhCPdowJzdOqSLvuzBv0qAdE0xHGtEk8OJMuwIponUn0mnurA9lybdli3AkT-uypYciOuQ83uoi2bOTKoiJumvGN80bMsdyioh8u3uIL41hZWTHeKBhszDJE4NK_lzZs/s400/shields.png" width="400" /></a></div>
<br />
Until today, the only defensive additions you could make to your ship were the lowly armor tiles. Armor tiles are useful for protecting the innards of your ship from enemy fire (and especially from penetrating cannon rounds), but, since weapons and thrusters have to be placed on the exterior of your ship, armor was a limited use in protecting those kinds of systems.<br />
<br />
The Shield Generator changes that, providing protection for your ship's exterior, but at a hefty cost in credits and power. As you can see in the above screenshot, the shield generator (the purple room next to the big cannon) projects a curved force field in a 90-degree arc in front of your ship. This force field blocks all incoming enemy fire attempting to pass through the arc, while allowing your own shots to pass through unimpeded.<br />
<br />
Of course, as powerful as the shield generator is, it's not without some serious drawbacks to prevent it from being imbalanced:<br />
<br />
<ul>
<li>The shield only protects against shots passing through its limited 90-degree arc, meaning that, without extra shield generators, you could be flanked from the side where the shield won't protect you.</li>
</ul>
<ul>
<li>While the shield blocks incoming weapons fire, it does not actually prevent enemy ships themselves from passing through. So if an enemy ship gets close enough that its weapons fire from <i>within</i> the shield's arc, then the shield will do nothing to protect you.</li>
</ul>
<ul>
<li>Shields use a <i>lot</i> of power while operating. Not only is there a substantial per-second power drain just to keep the shield operating, the shield also loses power quickly as it absorbs enemy fire. And once a shield generator runs out of power, its protective force field will shutdown until the generator can be <i>fully</i> re-powered, leaving a sizable window of opportunity for the enemy to destroy the shield generator or the other systems it was protecting. Keeping a single shield generator powered during an an enemy attack can require many crew working hard to carry power from a nearby reactor or power storage.</li>
</ul>
<ul>
<li>The shield generator itself is very weak and is easily destroyed once its force field shuts down. This leaves a potential weak point in the perimeter of your ship through which enemy rounds can penetrate and damage your internal systems.</li>
</ul>
<div>
<br /></div>
<div>
One mechanic not yet implemented that I'm <i>considering</i> adding is heat buildup. The potential reason for this mechanic is that it's theoretically possible for a ship to have so many shields and enough crew and power to keep them active that you'll never be able to bust through; and if <i>your</i> ship <i>also</i> has impenetrable shields, that could cause a stalemate. A potential solution to this kind of stalemate is to, as the shield takes enemy fire, have it build up more and more heat until, eventually, the shield generator either deactivates or maybe even explodes.</div>
<div>
<br /></div>
<div>
I have not added this heat-buildup mechanic because I don't want to make the rules for shield generators unnecessarily complex and less intuitive unless I'm absolutely sure that they're needed. If you find that you're getting into these kinds of stalemates while playing, then please let me know!</div>
<div>
<br /></div>
<div>
As always, I encourage you to <a href="http://starwright.waltdestler.com/">download</a> StarWright and post your feedback!</div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com6tag:blogger.com,1999:blog-7110862627018001433.post-24993594885655620232016-02-23T18:02:00.000-08:002016-06-24T11:10:50.605-07:00StarWright 0.5.0 - Sounds!I'm a bit ashamed to say this, but until today no version of StarWright has ever had even a single sound effect. Well it took me a lot longer than I anticipated, but sounds are finally here! (Or should I say hear?) I just released <a href="http://starwright.waltdestler.com/">StarWright 0.5.0</a> which you can download, play, <i>and hear</i> right now!<br />
<br />
I had told myself for the longest time that sounds were a lower priority than getting in core gameplay features. I guess that might be true to an extent, but now that I'm playing the game with sounds, I'm really regretting not adding audio months ago, because the game feels <i>much</i> better with sound effects. (And also some accompanying screen-shake effects, which really help to give the sounds some added punch.)<br />
<br />
<h3>
Sound Design</h3>
<br />
Sounds in StarWright can be grouped broadly into two categories: <i>User interface</i> sounds and <i>gameplay </i>sounds. User interface sounds are easy because they never vary in volume or pitch and always get played whenever the user interacts with the interface. Gameplay sounds on the other hand are much trickier to design and implement because whether they're played, their volume, and sometimes even their pitch depend on what's happening in the gameplay.<br />
<br />
Designing gameplay sounds for <i>any</i> game is hard, but StarWright has proven to be by far the hardest sound design challenge I've yet tackled. There are two primary reasons for this challenge:<br />
<br />
First, unlike most games where the area that the player can see is relatively constant, in StarWright the <b><u>scale of the player's view</u></b> can change dramatically as the player zooms in and out; the player's view can scale from a dozen meters across to a kilometer across or more in a second. What the player hears when zoomed in at 10 meters (the loading of ammo and beeps of controls and charging of lasers) is not what the player should hear at 100 meters (the muted, distant reverb of cannons and thrusters) nor what the player should hear at 1000 meters (the almost-empty yet strangely-beautiful resonance of space).<br />
<br />
Many of the more-detailed gameplay sounds (such as beeping controls, loading ammo, and charging weapons) are only audible when zoomed-in near the 10-meter scale; they quickly fade out as the player zooms away. But the louder sounds (such as firing cannons, projectile impacts, and explosions) can be hard at the 100-meter scale as well. However, I wanted these louder sounds to sound more muted and distant when the player is zoomed out, and so each of these sounds is actually authored as <i>two</i> separate sounds; one containing higher-frequency elements that fade out quickly as the player zooms out, and one containing lower-frequency elements that fade out much more slowly. Eventually though, near the 1000-meter scale, no gameplay sounds are audible and the only sound left is the eerie sound of space itself. (Yes, I know space IRL has no sound, but in StarWright it does!)<br />
<br />
Sounds don't just fade out as the player zooms out; they also fade out as their point-of-origin moves farther away from the center of the player's view. This works like most games in that more distant sounds are quieter (an enemy shooting you from ten meters away is a lot louder than one shooting at you from a hundred), with the added wrinkle that the distance that a sound can travel <i>increases</i> as the player zooms out the camera. This may seem unnatural, but if the distance <i>didn't</i> scale then the player would either (when zoomed in) be able to hear loudly a lot of sounds from objects they can't see or (when zoomed out) not hear sounds from objects that they <i>can</i> see.<br />
<br />
The effect of fading sounds as the player zooms out while simultaneously increasing their audible distance leads to a nice "level of detail" -- that is, when zoomed in, the player hears a relatively small number of higher-pitched, high-details sounds; whereas when zoomed out, the player hears a large number of more muted, less-detailed sounds.<br />
<br />
The other big challenge to designing sounds for StarWright is the <b><u>sheer number of objects</u></b> that can make sounds. While a typical side-scroller or action game might have a few dozen sound-emitting objects (on screen or near the player) at once, StarWright can have hundreds or even thousands since every weapon, thruster, projectile, explosion, and crew member could be making a sound. And the problem with so many sounds at once (aside from being computationally expensive) is that when they all combine together, too many sounds will start to be like gray noise and the individual details will get lost in the chaos; that's neither pleasant to listen to nor useful information for the player.<br />
<br />
My solution is conceptually simple enough: limit the number of gameplay sounds of any single type that can be played at once; the theory being that there should be enough simultaneous sounds that the player won't notice when some don't play while also not having so many sounds that they just create unrecognizable noise.<br />
<br />
Gameplay sounds in StarWright can be subdivided into two general groups: <i>One-shot</i> sounds and <i>continuous </i>sounds. One-shot sounds are those that are tied to a particular event happening in the game (such as a cannon firing or a battery being delivered) and are over within a few seconds. Continuous sounds loop indefinitely for as long as some state is true (such as while the control room is powered). The ways in which each of these two groups of sounds is limited differs significantly:<br />
<br />
For one-shot sounds, there is a simple limit to the number of sounds of any particular type (such as the sound of the regular cannon firing) that can be played simultaneously. (Usually around 3-5 simultaneous sounds, which seems to be about the point at which players will stop noticing when some don't play.) When a one-shot sound is about to be played, the game checks how many other sounds of the same type are playing, and if the maximum number is already reached, it simply doesn't play the sound.<br />
<br />
Continuous sounds are a bit more complicated. Any particular type of continuous sound is typically limited to only <i>1</i> playing at once. But unlike one-shot sounds, once the limit is reached, any additional continuous sounds will increase the volume of the currently-playing sound. For example, two thruster rumble sounds playing at 0.5 volume will get combined into one thruster rumble sound playing at 1.0 volume.<br />
<br />
<h3>
Sound Implementation</h3>
<div>
<br /></div>
<div>
One of the biggest reasons that it took me so long to release 0.5.0 is that I almost completely rewrote my audio-playing code.</div>
<div>
<br /></div>
<div>
StarWright is based on the same codebase that I originally created for my game <a href="http://www.waltdestler.com/tankytank.html">Tanky-Tank</a> almost a decade ago. At the time, the best API for playing sounds on Windows was <a href="https://en.wikipedia.org/wiki/DirectSound">DirectSound</a>. However, in the many years since, DirectSound has been obsoleted by the much-more-modern and well-maintained <a href="https://en.wikipedia.org/wiki/XAudio2">XAudio2</a> (and on newer systems, DirectSound is actually emulated on top of XAudio2).</div>
<div>
<br /></div>
<div>
When I started working on sounds for StarWright, I started with my old DirectSound-based code, but I quickly ran into some nasty <a href="https://en.wikipedia.org/wiki/Race_condition">race conditions</a> that would cause crashes in the above-discussed sound-limiting code. These race conditions were going to be very difficult if not impossible to work around, and so I chose to spend a few days rewriting all of my audio code to use XAudio2 instead of DirectSound.</div>
<div>
<br /></div>
<div>
This rewrite went relatively smoothly, except that I found a few bugs in <a href="http://sharpdx.org/">SharpDX</a>, the <a href="https://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>-language <a href="https://en.wikipedia.org/wiki/DirectX">DirectX</a> wrapper I use. I spent at least a day tracking down and then fixing those bugs in SharpDX. (But on the bright side, I had my first-ever GitHub pull request accepted to fix those bugs!)</div>
<div>
<br /></div>
<h3>
Screen Shake!</h3>
<div>
<br /></div>
<div>
The greatest lesson I've learned in my years as a game developer is that every game is made better by adding screen shake!</div>
<div>
<br /></div>
<div>
While this may be a bit of an exaggeration, it's true enough for StarWright.</div>
<div>
<br /></div>
<div>
You may notice while playing that a lot of explosions and firing sounds are accompanied by a subtle (or not-so-subtle) screen shake effect. They started as kind of a silly experiment but they really added a great sense of weight and power to the louder, more explosion-y sounds. When you get hit by a Large Cannon, it feels quite impactful, and a lot of that has to do with the accompanying screen shake.</div>
<div>
<br /></div>
<div>
Screen shakes work a lot like sounds in the sense that they get weaker as the player zooms out or as the origin gets farther from the center of the screen. (And yes, that distance-to-center is scaled by the zoom, just like sounds.) But unlike sounds, there is only one <i>type</i> of screen shake, and so the magnitudes of all the currently-in-effect screen shakes get added together to determine the final amount by which the screen is actually shaking.</div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com2tag:blogger.com,1999:blog-7110862627018001433.post-39287247734258104542016-01-16T12:53:00.000-08:002016-06-24T11:10:50.645-07:00StarWright 0.4.0 - Laser Blasters!Today I released <a href="http://starwright.waltdestler.com/history.html">version 0.4.0</a> of StarWright. The big feature of this release is a new weapon: the Small Laser Blaster!<br />
<br />
The Small Laser Blaster is an energy weapon that fires pulses of raw energy. Unlike the cannons, the laser blaster draws its power from plasma batteries instead of using ammo that has to be manufactured elsewhere. Compared to the cannons, the laser blaster deals less damage but has a higher rate of fire and is considerably more accurate. Its rounds also cannot penetrate inside enemy ships, unlike the cannons, making it more effective at destroying perimeter systems than interior systems.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg93lDF06NwbEFTw8Dpl1PjW1nQ1BIlq1t6AWgMarNSCLk-s1vexVWralYImWPn1lrk4aW8jqUCvSsYnRXnSQl1kZKvN5meQcWq3od2QzYP06uolBJD9w5QS2jUKHqxzPRKbYXisE_UidU/s1600/small-laser.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg93lDF06NwbEFTw8Dpl1PjW1nQ1BIlq1t6AWgMarNSCLk-s1vexVWralYImWPn1lrk4aW8jqUCvSsYnRXnSQl1kZKvN5meQcWq3od2QzYP06uolBJD9w5QS2jUKHqxzPRKbYXisE_UidU/s1600/small-laser.gif" /></a></div>
<br />
Related to the addition of laser blasters, the player now starts with a new class of ship, which I dubbed the <i>Model-1</i>. The <i>Model-1</i> is a bit smaller than the previous starting-ship, and instead of having two Regular Cannons it has two Small Laser Blasters. I made this change to reduce the number of game mechanics that the player has to learn and understand at the beginning of the game; laser blasters use no ammo, and so the player only has to understand the power mechanic instead of both the power and ammo mechanics. Also, because laser blasters are more accurate than the cannons, new players will be frustrated less by missed shots.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVwIAtVwmb9JentwmffNut9HwBirg9tKNP1iiq0rWbSPiqeWbDBDt-iKypFD7150lzNoj6B8AvuJ-Z41HOxOsYRrExyQ8T9-9QiVoTNLiSdxL2rqW927FBYmtFggW_t1L3qgQxmtyuXhw/s1600/starter_ship.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVwIAtVwmb9JentwmffNut9HwBirg9tKNP1iiq0rWbSPiqeWbDBDt-iKypFD7150lzNoj6B8AvuJ-Z41HOxOsYRrExyQ8T9-9QiVoTNLiSdxL2rqW927FBYmtFggW_t1L3qgQxmtyuXhw/s400/starter_ship.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I have also made some major balance & pacing adjustments in this release. First of all, the damage dealt by all weapons has been greatly increased (cannons do more than twice as much damage); a change I made to increase the pace of combat, which I felt was feeling sluggish. Also, the thrusters and the Ammo Factory both use power much more rapidly, which, combined with the power-consuming new laser blasters, makes balancing power usage and providing sufficient reactors & power supplies much more important.<br />
<br />
Go ahead and <a href="http://starwright.waltdestler.com/">download</a> it now! I welcome all of your feedback!Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com23tag:blogger.com,1999:blog-7110862627018001433.post-72655920973512289402016-01-11T17:48:00.001-08:002016-06-24T11:10:50.706-07:00StarWright 0.3.0 - New Art!Which much relief, I've finally released version 0.3.0 of StarWright! (Which you can download <a href="http://starwright.waltdestler.com/">here</a>.) This release contains a handful of balance changes and, much more exciting, completely revamped art for the ship interiors.<br />
<br />
The new art is much more detailed and attractive than the old "art" (which was really just quick "programmer art" sketches). Most of it is even animated! While I don't consider this art to be "final" and I intend to eventually have it replaced by a professional artist, I think it's good enough for (what is currently) a free game. Even so, I welcome your feedback on it if you have any!<br />
<br />
Here's a (rather rough) gameplay video featuring the new art:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/H0nHOH7mmrQ/0.jpg" src="https://www.youtube.com/embed/H0nHOH7mmrQ?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br />
And a handful of screenshots as well:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSow5PixUPgopALlfuEbKWnoZHo5rO5Gn3oSmFtkKD3lOCbpTmP5nBh8HVEcLCSxut2Rg2Vt7_VLjC-qswZB0sSdi_M9CiUeNSf09hwW0xPkkAo_z1mjukcYEojJwhKTSf2qpvyMWkt1g/s1600/2016-01-11+15-03-46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSow5PixUPgopALlfuEbKWnoZHo5rO5Gn3oSmFtkKD3lOCbpTmP5nBh8HVEcLCSxut2Rg2Vt7_VLjC-qswZB0sSdi_M9CiUeNSf09hwW0xPkkAo_z1mjukcYEojJwhKTSf2qpvyMWkt1g/s400/2016-01-11+15-03-46.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfivG1iA5yoPQwaLN1VEv-U5FMMwBrP12l2MYiXpaXjrENr2ScKmKWzS2WAoYet_-GFyCMeVtXMHtJlgZJghWewcV-v4ug-T-_NzDaUZ7AVgOSaF_XdZswOSXznIxD0UeBpAL6JSyJZGg/s1600/2016-01-11+15-04-25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfivG1iA5yoPQwaLN1VEv-U5FMMwBrP12l2MYiXpaXjrENr2ScKmKWzS2WAoYet_-GFyCMeVtXMHtJlgZJghWewcV-v4ug-T-_NzDaUZ7AVgOSaF_XdZswOSXznIxD0UeBpAL6JSyJZGg/s400/2016-01-11+15-04-25.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikRshuecqYJBt-rL9NJvi6jeVeYwkH9wzwjtCXfwi3JfUYWA8-8G302G1LaLgR-Mm_vDETmthjMM5SiSD8Z9NBxHrm13YQEFNmawTiGwKkfUwrVF7zoGHszJuki0rnYhbhUTUODplIz_w/s1600/2016-01-11+15-06-01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikRshuecqYJBt-rL9NJvi6jeVeYwkH9wzwjtCXfwi3JfUYWA8-8G302G1LaLgR-Mm_vDETmthjMM5SiSD8Z9NBxHrm13YQEFNmawTiGwKkfUwrVF7zoGHszJuki0rnYhbhUTUODplIz_w/s400/2016-01-11+15-06-01.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8jMIDrzPWpJAvMRuVcdymSyipLbN6Nm_5ycjtzr-Nv2Uk4FAn5ME0GApaBr-W69hWCNpWsT71_M2jcHSfQBcrNJOB7obdzwIcbObnwaIKaM0-lGBOV5Ka8YPMUtPDAtOY7-RmOpgoYhc/s1600/2016-01-11+15-08-40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8jMIDrzPWpJAvMRuVcdymSyipLbN6Nm_5ycjtzr-Nv2Uk4FAn5ME0GApaBr-W69hWCNpWsT71_M2jcHSfQBcrNJOB7obdzwIcbObnwaIKaM0-lGBOV5Ka8YPMUtPDAtOY7-RmOpgoYhc/s400/2016-01-11+15-08-40.png" width="400" /></a></div>
<br />Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-2005703353644215102015-12-06T18:55:00.000-08:002016-06-24T11:10:50.595-07:00StarWright 0.2.0 seriesSince I <a href="http://blog.waltdestler.com/2015/11/starwright-010-bounties-blueprints.html">last posted</a>, I have released not one, not two, but <a href="http://starwright.waltdestler.com/history.html"><i>nine</i> new builds</a> of StarWright!<br />
<br />
Most of these updates have been to fix bugs that people have found. (Indeed, the game is feeling *much* more stable than 0.1.0 did; there are, literally, no known bugs right now.)<br />
<br />
One of those nine new builds was 0.2.0, which includes not just bug fixes but also a handful of other improvements. Here's a summary of the juiciest bits:<br />
<br />
<ul>
<li>When a part is destroyed, it no longer spawns one structure piece occupying the entire area of the destroyed part. It now spawns one structure piece per tile, each of which can be destroyed individually. This looks better than stretching the structure graphic over the entire area of the original part, and it feels less weird as well. It also paves the way for some future features I want to add that relate to being able to watch a ship build to your specifications rather than it updating instantly.</li>
</ul>
<ul>
<li>Probably the biggest usability issue of the previous versions was that, in order to target a specific part of an enemy ship, you had to hold the alt key while right-clicking on the part you wanted to target. This was not intuitive, and the only way you could figure it out was either accidentally or reading the online bullet points that substitute for not having a manual. So now you no longer have to hold the 'alt' key to target a specific part. Simply right-click to target an enemy ship, and then right-click again on a specific part to target that part.</li>
</ul>
<ul>
<li>In order to destroy an enemy ship in the regular Bounty mode, you now only have to destroy its Reactor instead of both the Reactor and Control Room. I think that it was confusing having to destroy both, and players have told me that they find the reactor a more naturally explosive target. Plus, only having to destroy the reactor makes taking out the control room first a more interesting decision.</li>
</ul>
<div>
<br /></div>
<div>
There's <i>tons</i> more changes and fixes, almost all of which I list in the <a href="http://starwright.waltdestler.com/history.html">patch notes</a>.</div>
<div>
<br /></div>
<div>
I'll leave you with this screenshot of one of my favorite ships I've made:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_67pOtgU3ssdHOscGWZCTqStEnNVMMwKnWmpZ3cEL9YFVuSRxmrdlvdijehb_y6em3D9pmRLgaIsO3cVEtUSPAnruV4EWmJbQNk5eY4-ew1wuMTZcnxYwW5Y0e8wG1uLtOn9g-QHzSvY/s1600/2015-12-06+18-51-15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_67pOtgU3ssdHOscGWZCTqStEnNVMMwKnWmpZ3cEL9YFVuSRxmrdlvdijehb_y6em3D9pmRLgaIsO3cVEtUSPAnruV4EWmJbQNk5eY4-ew1wuMTZcnxYwW5Y0e8wG1uLtOn9g-QHzSvY/s400/2015-12-06+18-51-15.png" width="400" /></a></div>
<div>
<br /></div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com10tag:blogger.com,1999:blog-7110862627018001433.post-50009059001641829862015-11-24T14:12:00.000-08:002016-06-24T11:10:50.668-07:00StarWright 0.1.0 - Bounties & Blueprints!At long last (more than a year and a half!) I finally have a brand-new version of StarWright available for you to download and (hopefully!) enjoy, and it's a doozy of an update: <a href="http://starwright.waltdestler.com/">StarWright 0.1.0</a>. I consider this the first "non-prototype" version of the game, since it now has some amount of actual challenge and progression.<br />
<br />
The <a href="http://starwright.waltdestler.com/history.html">changelog</a> lists most of the improvements since the last prototype version, but I'll outline here the biggest new features...<br />
<br />
The first big feature is what I call <b>Bounty Mode</b>. Just start up the game and hit the New Game button. You'll start the game with a small ship just like this one:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIcedPBV2dITCx-IQwsLSo521ZcwG1crB6Yx7ujzzajkiXNinkobNMr8SuYHdkca45YFcj8yzM9ueyIk9eVf3Xtb3F7e9C88sYsKR3houXHBlWAHUxJGHtiv1lE96SkcJ3Zl-oQYQvGlo/s1600/starter_ship.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIcedPBV2dITCx-IQwsLSo521ZcwG1crB6Yx7ujzzajkiXNinkobNMr8SuYHdkca45YFcj8yzM9ueyIk9eVf3Xtb3F7e9C88sYsKR3houXHBlWAHUxJGHtiv1lE96SkcJ3Zl-oQYQvGlo/s400/starter_ship.jpg" width="400" /></a></div>
<br />
You start the game with 5000 credits, which if you want you can immediately use to make some upgrades to your ship, though you won't be able to afford much more than a cannon and another couple crew.<br />
<br />
In order to earn more credits, you'll need to fight and defeat enemy ships. They're listed under the BOUNTIES in the top-right along with the reward for defeating each ship, and there will also be an arrow pointing in the direction of any enemy ship off-screen. Many of the bounties you may see will be too difficult to defeat without upgrading your ship first.<br />
<br />
Once you defeat an enemy ship (specifically, by destroying its Control Room and Reactor), you'll earn a substantial credit reward, which you should use to repair any damage to your ship and, if you have any credits left over, make further improvements to your ship such as adding more cannons, thrusters, and crew.<br />
<br />
In order to make upgrades to your ship (or even repair it), you'll utilize the other big feature: <b>Blueprints</b>. Click on the "Blueprints" button in the bottom-left corner, and you'll be presented with a U.I. that looks something like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnw41TUGMKnbvCaIt7Dgtb4kbTdGTUSDDY8cjoIRMIzmBQDV5jHtzdPbE-YE5t1IANTXMDsTIwbWpQIqEwq6m_QMpP1BY49cxvEj2S0K6h5H4AFN0Jm4nQLGyNxWj6jEMu7PX1zLdtljg/s1600/blueprints.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnw41TUGMKnbvCaIt7Dgtb4kbTdGTUSDDY8cjoIRMIzmBQDV5jHtzdPbE-YE5t1IANTXMDsTIwbWpQIqEwq6m_QMpP1BY49cxvEj2S0K6h5H4AFN0Jm4nQLGyNxWj6jEMu7PX1zLdtljg/s400/blueprints.jpg" width="400" /></a></div>
<br />
(This screenshot is from much later in the game after the playing has already upgraded their ship many times.)<br />
<br />
When this U.I. is displayed, you're not actually modifying your ship <i>itself</i>; you're modifying its <i>blueprints</i>. The cool thing about blueprints is that you can edit and tweak them as much as you want at no cost, only paying the required credits once you're actually happy with your design and want to commit to it. And the <i>other</i> cool thing about blueprints is that, if your ship takes damage and has parts of it destroyed, the <i>blueprints</i> are unaffected, making it easy to restore your ship to its intended design.<br />
<br />
When you're satisfied with your design and want to commit to it, simply press the MAKE IT SO button in the bottom right. As long as you have enough credits, your ship will be updated to match the blueprints, and the required funds will be deducted from your account.<br />
<br />
Once you've upgraded your ship, you can fly off and attempt to defeat one of the enemy bounties:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhICOEKtc3_4yFUp_Z0Q9sTZ441TIgvT5cNOYPBv_opv6y4QDlckt37SzpYsPB36GEkwDU_AJt765610DBJty5xfvL5Ck2RJ4DN9wMEdHFZo1GZk0n5FHZtNa4jloJ9qjC5YqC_ktgAUcQ/s1600/battle.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhICOEKtc3_4yFUp_Z0Q9sTZ441TIgvT5cNOYPBv_opv6y4QDlckt37SzpYsPB36GEkwDU_AJt765610DBJty5xfvL5Ck2RJ4DN9wMEdHFZo1GZk0n5FHZtNa4jloJ9qjC5YqC_ktgAUcQ/s400/battle.jpg" width="400" /></a></div>
<br />
Simply right-click on the enemy ship to attack it. Hold the alt key and right-click on a specific part of an enemy ship to concentrate fire on that specific part. (I recommend usually taking out the weapons and ammo supplies first, unless its Control Room or Reactor is especially vulnerable.)<br />
<br />
The enemy ships will try their best to shoot you from their best side and will occasionally maneuver to hit you from another position. If you disarm them, then they'll try to run away, so you may want to consider taking out their engines or Control Room to prevent that.<br />
<br />
And lastly, we have to say a sad goodbye to an old feature that I have decided to remove to make developing the rest of the game easier.... <b>Goodbye, multiplayer. :(</b> I removed multiplayer because its presence was making the game's code far more complicated than it otherwise would be and was greatly slowing down the development of the primary singleplayer mode of play. It's possible that some sort of multiplayer "my ship versus your ship" mode will return in the future, but for now I've decided to remove multiplayer from StarWright.<br />
<br />
Please feel free to <a href="http://starwright.waltdestler.com/">download</a> the game. I welcome all of your feedback!Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com10tag:blogger.com,1999:blog-7110862627018001433.post-2170206520908492992014-04-18T15:07:00.003-07:002016-06-24T11:10:50.602-07:00Procedurally Generated Starships in StarWrightI've been working on the main singleplayer (& co-op) "explorable universe" mode for <i>StarWright</i>. This mode is still a ways off, but in the meantime I'd like to share something with you that I think is pretty neat: the "random starship generator" that the singleplayer mode will use to generate an unlimited variety of enemy starships for you to fight. (You can play with these procedurally-generated starships in the "sandbox" mode of the latest version of StarWright.)<br />
<br />
Here's a screenshot of just one of the practically-unlimited number of starships that the game can generate:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47qhgsKCngiuKQtwDWgZEvAnM2Skm7MC_cyAEtKOy0HSNFeD4ihpmrFPF82XnpxOFYAqODXbx_DUS3GPZ0q6_InaqhHTcjUhDM0mlvFNRsXfKTtLHXPxP-CW0k88iqU76fMQ-DZuaD2I/s1600/2014-03-02+13-00-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47qhgsKCngiuKQtwDWgZEvAnM2Skm7MC_cyAEtKOy0HSNFeD4ihpmrFPF82XnpxOFYAqODXbx_DUS3GPZ0q6_InaqhHTcjUhDM0mlvFNRsXfKTtLHXPxP-CW0k88iqU76fMQ-DZuaD2I/s1600/2014-03-02+13-00-11.png" width="320" /></a></div>
<br />
This is a fully-functional and heavily-armed starship, complete with thrusters, weapons, a cockpit, a reactor, ammo storage, power storage, and crew's quarters.<br />
<br />
On the left you can see (click on the screenshot to get a bigger view) a user interface that gives a great amount of power and control over the underlying algorithm that generates the starships. I've included it in these screenshots to help you understand the underlying algorithm.<br />
<br />
At a high level, the algorithm works by creating a starship in "stages", which you can see listed on the left with names like "Shape", "Fill Gaps", and "Cockpit". The algorithm starts at the top of the list and processes each stage in sequence. Each stage adds to what was generated by the previous stages, except for of course the first stage which starts from scratch.<br />
<br />
Let's walk through each stage in sequence so we can see how the ship gets created stage-by-stage:<br />
<br />
<b>Stage 1: "Shape"</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_31xg_LbBCJUt9vLtIDxSMaue_YcKf7bUjQDmlEZSupx5zpNFYsTT0L2Yaq9VFDEuucdXCzHdx5uVM5uz84rt6iFdnVBTOCYSkngsiyZZaw0FdlLTMmwtl12V2qZqJH6Q5v0PyKGM110/s1600/2014-03-02+13-01-31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_31xg_LbBCJUt9vLtIDxSMaue_YcKf7bUjQDmlEZSupx5zpNFYsTT0L2Yaq9VFDEuucdXCzHdx5uVM5uz84rt6iFdnVBTOCYSkngsiyZZaw0FdlLTMmwtl12V2qZqJH6Q5v0PyKGM110/s1600/2014-03-02+13-01-31.png" width="320" /></a></div>
<br />
In the above screenshot, I've turned off all of the stages except for the very first: the "Shape" stage. On the right you see what the ship looks like (in this case a rough outline of a ship composed entirely of empty "corridor" tiles), and on the left you can see that I've expanded the user interface for this "Shape" stage to give a better view of the inner-workings of this stage.<br />
<br />
The sole purpose of this stage is to give a rough outline to the general shape of the ship. Most subsequent stages will obey the shape given by this stage and only place additional parts ("part" being my technical term for discrete rooms, systems, and corridor/armor tiles) within this outline.<br />
<br />
The "Shape" stage is actually unlike all the later stages in that it itself is comprised of some number of "shape modules". You can almost think of a shape module as a "brush" from a paint program such as Photoshop in that it defines a "shape" of 1x1 corridor tiles to add to the ship. The two shape modules you can see here are "CircleModule" (which places a blocky circle-like shape of tiles) and "RectangleModule" (which places a rectangular area of tiles).<br />
<br />
The "Shape" stage adds somewhere between "MinModules" and "MaxModules" number of random modules (in this case it's always 8 modules), where the chance of any given module being added is determined by its "RandomWeight". Once the modules are chosen, the stage then joins them together in a random configuration and "paints" the resulting shape as corridor tiles.<br />
<br />
<b>Stage 2: "Fill Gaps"</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9pVzHcYekFvhawq-CwbJk5N47Lds9axCQ7aYhtBFl0CI-Iuo3K3QuM3PTgiopwqWJ_vUGZlJIL543om1zMdKDRrt2aJwVDvYWRJDuNMC1GK5RrWjxyYSC8TpuJIosKhRcOP4jHF_FJy4/s1600/2014-03-02+13-02-02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9pVzHcYekFvhawq-CwbJk5N47Lds9axCQ7aYhtBFl0CI-Iuo3K3QuM3PTgiopwqWJ_vUGZlJIL543om1zMdKDRrt2aJwVDvYWRJDuNMC1GK5RrWjxyYSC8TpuJIosKhRcOP4jHF_FJy4/s1600/2014-03-02+13-02-02.png" width="320" /></a></div>
<b><br /></b>
Notice that the result of the first stage left some small gaps and rough edges in the ship. The purpose of this second stage is to fill in those gaps and "even out" the rough edges to give the ship a more solid appearance. While the desire to have ships appear more solid is largely an aesthetic preference (it's perfectly legal to have a ship with holes in it), it <i>does</i> make it easier for the later stages to place new rooms and systems inside the ship. For other styles of ships I may choose to leave out this stage entirely, or even replace it with a stage that <i>carves away</i> bits of the ship in order to make it appear more "stick-like".<br />
<br />
The actual logic behind this stage is pretty simple: It simply looks at each empty tile, checks to see if it's surrounded on 2 or more sides by tiles no more than "ScanRange" units away, and if so, fills that empty tile in with another corridor tile. Then it repeats itself (up to "Iterations" number of times) to fill in any more tiles that are newly-eligible to be filled.<br />
<br />
<b>Stages 3 & 4: "Cockpit" and "Reactor"</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfD8Ii3JjsvLIcKOFsQiE4DjRpoTWnHU0fYbEJonuCQa-yoVv9_xdGLZeNQhWRMBVU-laQRc388vszEIEqcZWpxzf_C6QT3NvD5N3xwFXxDKBnXT0t5XJnckbgcFzumtQEOh4ZULe5GHg/s1600/2014-03-02+13-03-32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfD8Ii3JjsvLIcKOFsQiE4DjRpoTWnHU0fYbEJonuCQa-yoVv9_xdGLZeNQhWRMBVU-laQRc388vszEIEqcZWpxzf_C6QT3NvD5N3xwFXxDKBnXT0t5XJnckbgcFzumtQEOh4ZULe5GHg/s1600/2014-03-02+13-03-32.png" width="320" /></a></div>
<b><br /></b>
The two most important rooms/systems on any starship are the cockpit and the reactor, so we add those before we add any others. While both the cockpit and the reactor have their own stages, the actual logic of the stages are very similar, so I'll talk about them both at once.<br />
<br />
Each of these stages works by iterating through <i>every possible</i> location for the cockpit or reactor and picking the single "best" location for it.<br />
<br />
The only difference between the Cockpit and the Reactor stages are in how they define "best". You can see in the user interface that each stage defines a "PlacementStrategy" that is used to determine the best location.<br />
<br />
The cockpit uses a "Protected" placement strategy, which simply means that the "best" location for the cockpit is the one that is <i>farthest</i> from the perimeter of the ship. This makes sense since the actual location of the cockpit doesn't affect how well the ship functions, and so we just want to place it in the most difficult-to-destroy location possible.<br />
<br />
The reactor uses a "Centralized" placement strategy, which simply means that the reactor will be placed as close to the ship's center of mass as possible. This makes sense since the reactor is most effective when it's in a relatively central and accessible location.<br />
<br />
As you can see here, the "best" locations for the cockpit and reactor are often very close or even overlapping. In that case, the cockpit's location preference gets priority simply by virtue of being before the reactor in the list of stages. This explains why the reactor in the above screenshot is somewhat offset from the ship's actual center of mass -- the reactor couldn't be placed in the ideal location because the cockpit was already there, and so it picked the next-best location.<br />
<br />
<b>Stages 5 & 6: "Cockpit Armor" and "Reactor Armor":</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUJTaHf6UAW4TNiSQodS4F24WkebVXj7TwO-ICpJl7WSsJ3VIyj68kDrt20rLhbYF4HrNCCbJ5OLk03gnBhPYyA8I-BDxko3OsVo0TAQGelnUbvIpO1cVH53P61XfjgP6FEcZwnuMeBtM/s1600/2014-03-02+13-04-04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUJTaHf6UAW4TNiSQodS4F24WkebVXj7TwO-ICpJl7WSsJ3VIyj68kDrt20rLhbYF4HrNCCbJ5OLk03gnBhPYyA8I-BDxko3OsVo0TAQGelnUbvIpO1cVH53P61XfjgP6FEcZwnuMeBtM/s1600/2014-03-02+13-04-04.png" width="320" /></a></div>
<b><br /></b>
Since the cockpit and reactor are so important, its usually a good idea to surround them with added protection in the form of armor tiles. These two stages do just that by each finding a part of a specific type and then surrounding that part with one or more layers of armor tiles.<br />
<br />
But as you can see in the above screenshot, these stages will usually leave gaps and paths around the parts that they are protecting so that access by the crew to any room or section of the ship isn't cut off. The logic that handles this is crucial to how this and almost every other stage works, so let's talk about...<br />
<br />
<b>Path Contiguity Checking</b><br />
<b><br /></b>
Before any stage picks a location for a new part, it first does what I call a "path contiguity check", which essentially asks the question, "If I place a part here, will I be forcing crew to go too far out of their way to get around me?"<br />
<br />
To perform this check, the stage picks any open tile adjacent to the proposed location, and does a quick <a href="http://en.wikipedia.org/wiki/Dijkstra's_algorithm">Dijkstra</a> search to each of the other adjacent tiles. As long as the search finds a path to each other tile no longer than, for example, 5 tiles, then the path contiguity check it considered a success and the part is allowed to be placed there. But if the path fails, then adding a new part to that location would either force the crew to go too far out of their way or would cut off a path entirely, and so the stage will exclude that possible location when deciding where a new part should go.<br />
<br />
We can see the practical implications of this check in the above screenshot for stages 5 & 6. Look at, for example, the gap in the armor directly underneath the cockpit where the cockpit's door is located. The "Cockpit Armor" stage didn't place an armor tile there because doing so would have cut off access from the surrounding corridor tiles to the cockpit itself. And the corridor running between the cockpit and the reactor exists because adding an armor tile there would have forced crew to walk all the way around both the cockpit and the reactor to get to the other side.<br />
<br />
<b>Stage 7: "Thrusters"</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL2ujznG4jHuwnqmb_tL9VBxJDrLDmt2QBgU9OrvDCGD4MiHD7WVWv5Cko2cBlGlLYeKUw6ujb9kePDZ6dI2Z4D5esaAZ4DTUMnnXlF-OgkYTM_kq6pnu3HpW5HTdJj1eU_-3NyC0SfO8/s1600/2014-03-02+13-04-59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL2ujznG4jHuwnqmb_tL9VBxJDrLDmt2QBgU9OrvDCGD4MiHD7WVWv5Cko2cBlGlLYeKUw6ujb9kePDZ6dI2Z4D5esaAZ4DTUMnnXlF-OgkYTM_kq6pnu3HpW5HTdJj1eU_-3NyC0SfO8/s1600/2014-03-02+13-04-59.png" width="320" /></a></div>
<b><br /></b>
After the Cockpit and Reactor are placed, along with their surrounding armor, the thrusters are placed. There are three sizes of thrusters (small, medium, and big), and this stage is responsible for placing all three.<br />
<br />
If you take a look at the U.I. for this stage above, you can see that each size of thruster has a different "score" (1 for small, 2 for medium, and 4 for large), and the stage as a whole can place between 35-45 points worth of thrusters. In addition each size of thruster has a different random "weight", meaning that about 1/6 of the thrusters will be small, 2/6 will be medium, and 3/6 will be large.<br />
<br />
The directions of the thrusters are also weighted randomly, so that 5/8 are placed pointing backwards and 1/8 are pointing in each of the other three directions.<br />
<br />
Aside from those random weights, there is currently no additional logic (besides randomness) to determine where the thrusters are placed. Even so, randomly-generated ships usually have reasonably well-balanced thruster placements simply by virtue of random probabilities.<br />
<b><br /></b>
<b>Stage 8: "Weapons"</b><br />
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggSUXJScd24dco4BDnmrojRPKoBc2IGMk8kVYemb1dXO5q_M3-4HEY4LY6ZrvKaoGVfnmSE-XA5lu990X22ilNEOZn9v9xIBHaV9MmOj-IJ3xJs8xffa2e0cSUXYVo0APJrKTM2shwEac/s1600/2014-03-02+13-07-06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggSUXJScd24dco4BDnmrojRPKoBc2IGMk8kVYemb1dXO5q_M3-4HEY4LY6ZrvKaoGVfnmSE-XA5lu990X22ilNEOZn9v9xIBHaV9MmOj-IJ3xJs8xffa2e0cSUXYVo0APJrKTM2shwEac/s1600/2014-03-02+13-07-06.png" width="320" /></a></div>
<br />
The placement of weapons works almost identically to the placement of thrusters, but with different sizes, scores, and random distributions. (In this case, there are only two sizes of weapons, and their rotations are distributed more evenly around the ship while still favoring weapons that face forward.)<br />
<br />
The one algorithmic difference between thrusters and weapons is that, when choosing a location for a weapon, the algorithm will choose the location that is farthest away from the center of the ship in the direction that the weapon is facing.<br />
<br />
<b>Stage 9: "Exterior Armor"</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQpj_a2_hylx18qt59SjG-sTegXvcpTustyp9XtVcg9filNODhM4ThzcOimwtZCArteJLhlcuIn0OqwGDu3Q7LveV02lwTFDkiH5RvvLSbtpEL7PBOc4oZicWf02YedT_hjVjS_gyNnNc/s1600/2014-03-02+13-07-36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQpj_a2_hylx18qt59SjG-sTegXvcpTustyp9XtVcg9filNODhM4ThzcOimwtZCArteJLhlcuIn0OqwGDu3Q7LveV02lwTFDkiH5RvvLSbtpEL7PBOc4oZicWf02YedT_hjVjS_gyNnNc/s1600/2014-03-02+13-07-36.png" width="320" /></a></div>
<br />
Once all the exterior systems (weapons and armor) are placed, a single layer of armor is placed around the perimeter of the ship on any tiles that are already occupied by a weapon or thruster, so long as placing an armor tile there will not block and crew paths according to the above "Path Contiguity Checking" algorithm.<br />
<br />
<b>Stages 10 & 11: "Ammo Supplies" and "Power Storage"</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYIlk7__iCzx3pMomdwxuipbjU6NYf3pVdQRYblQVr4ooShE3pb6xr1_9l3o7ge3pFt3GaLsfPHDhMOY_F4WRSGeG3B5U27k8W_6CvzpWcyEqoAJ758XtTfB1l1ofXSmrmL0YBjotynY4/s1600/2014-03-02+13-09-44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYIlk7__iCzx3pMomdwxuipbjU6NYf3pVdQRYblQVr4ooShE3pb6xr1_9l3o7ge3pFt3GaLsfPHDhMOY_F4WRSGeG3B5U27k8W_6CvzpWcyEqoAJ758XtTfB1l1ofXSmrmL0YBjotynY4/s1600/2014-03-02+13-09-44.png" width="320" /></a></div>
<br />
Next, Ammo Supply and Power Storage parts are placed. In this case, between 2-3 ammo supplies and 1-2 power supplies are added to the ship.<br />
<br />
The algorithm that places these parts attempts to place them in locations that are nearby as many ammo-consuming or power-consuming parts as possible. In the case of ammo supplies, the algorithm will attempt to place them near as many weapons as possible, so long as those weapons aren't already near other ammo supplies. And in the case of power supplies, it places them near thrusters and ammo supplies (which use power to create ammo), so long as those thrusters and ammo supplies aren't near other power supplies or the reactor.<br />
<br />
<b>Stage 12: "Crew"</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0P_6R2KUCDUOjbJ6A1dx4HaFzZN7cCnnOMBAg7G2yClaZJLaRyyVyi31_zW4vnrfQ_8_339IbVXDRQf4BpfTcz_0QJuYzQ8I0YHlB0WeQQu7JT20lYKQuTaZ7tCIa5DDAflhep78rcoA/s1600/2014-03-02+13-11-08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0P_6R2KUCDUOjbJ6A1dx4HaFzZN7cCnnOMBAg7G2yClaZJLaRyyVyi31_zW4vnrfQ_8_339IbVXDRQf4BpfTcz_0QJuYzQ8I0YHlB0WeQQu7JT20lYKQuTaZ7tCIa5DDAflhep78rcoA/s1600/2014-03-02+13-11-08.png" width="320" /></a></div>
<br />
Finally, crew's quarters and bunk rooms are placed in the remaining empty areas. Their placement is completely random, except that the algorithm tries to line up the edges of the rooms if possible, which tends to cause crew's quarters and bunks to be placed adjacent to each other.<br />
<br />
<b>Stage 13: "Fill With Armor"</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGJtmIlRhXjeQ1GoP9dlJPPK8rnh79OxH6VZMYEUIV5jxhTriIU2QzGhK4N7-fmwW2rOIu-KePquEU1KGGJlOJz0inmvrTFKkS8s5LxRx2lsndJtuyCwg2To8tPFv-OZIVNzQm-EDU8dk/s1600/2014-03-02+13-12-20.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGJtmIlRhXjeQ1GoP9dlJPPK8rnh79OxH6VZMYEUIV5jxhTriIU2QzGhK4N7-fmwW2rOIu-KePquEU1KGGJlOJz0inmvrTFKkS8s5LxRx2lsndJtuyCwg2To8tPFv-OZIVNzQm-EDU8dk/s1600/2014-03-02+13-12-20.png" width="320" /></a></div>
<br />
Once all of the crucial rooms and systems have been placed, the almost-final step is to fill any remaining space with armor tiles, because having armor throughout a ship makes it generally harder to destroy.<br />
<br />
In order accomplish this, every single empty tile is scanned using the above "Path Contiguity Checking" algorithm to determine whether placing armor there will block any crew paths. If no crew paths will be blocked, then an armor tile is placed.<br />
<br />
The neat side-effect of placing armor in this way is that corridors, like the ones you see above, are naturally "created" as a simple by-product not placing armor in locations that would block crew paths!<br />
<br />
<b>Stage 14: "Add Extra Doors"</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz7t_r1y1M57xnvE9bWYEROH0asSqR5psp188SzOdqHduZDWxHCH2DcXqC6BhQUUKH3NT68YeTE52Gl3CCUYQERGzxmAd2LZ3AWHqNglCu8auP1qtAfMo-MS0E3gnmIi8eLVIhY5uQxMo/s1600/2014-03-02+13-13-00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="249" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz7t_r1y1M57xnvE9bWYEROH0asSqR5psp188SzOdqHduZDWxHCH2DcXqC6BhQUUKH3NT68YeTE52Gl3CCUYQERGzxmAd2LZ3AWHqNglCu8auP1qtAfMo-MS0E3gnmIi8eLVIhY5uQxMo/s1600/2014-03-02+13-13-00.png" width="320" /></a></div>
<br />
The one final-final step is to place any extra doors in locations that would make crew access significantly more convenient. This is accomplished by scanning every wall location where a door could be placed (but isn't already there) and doing a path search from one side of the wall to the other. If the resulting path is over a certain distance (in this case 10 tiles), then a door is placed to make the path shorter.<br />
<br />
In the above screenshot, I can only spot one additional door that was added -- in this case, on the right side of the medium-sized thruster on the bottom of the ship.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com26tag:blogger.com,1999:blog-7110862627018001433.post-31347826760254863962014-04-05T18:01:00.000-07:002014-04-05T18:01:00.030-07:00Threesus!A couple months back I wrote an "A.I" computer program that knows how to play the brilliant iOS/Android game <a href="http://asherv.com/threes/">Threes</a> -- and play it <i>much </i>better than most humans can! While I was happy with the quality of the A.I., the problem was that it used a text-based interface in which a human had to type in the state of the board, wait for a couple seconds for the A.I. to think, and then swipe in the direction that the A.I. tells the human to swipe. Repeat hundreds of times, and the process of playing even a single game can take several hours. It was incredibly tedious, and I myself only had the patience to play a couple of games with the A.I., getting a high score of 178,926.<br />
<br />
Then, yesterday, <a href="https://twitter.com/mwegner">Matthew Wegner</a> debuted <a href="http://www.twitch.tv/teamcolorblind/b/517126107">live on twitch</a> a real, working robot that plays Threes on a real iPad. In no way has the actual game of Threes on the iPad been hacked, and the A.I. has no information that a human doesn't have or couldn't keep track of. Already, this robot, dubbed <i>Threesus</i> by the Twitch chat room, has achieved a whopping high score of 248,403 -- and I'm confident that it can score much, much higher than that!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://pbs.twimg.com/media/BkcR9woCcAEnog9.png:large" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="277" src="https://pbs.twimg.com/media/BkcR9woCcAEnog9.png:large" width="400" /></a></div>
<br />
The underlying A.I. logic code of Matthew's robot is based on my original A.I. code. This morning, in an effort to encourage collaboration and to create the best Threes-playing robot possible, I released the <a href="https://github.com/waltdestler/Threesus">source code for the A.I. logic on Github</a>. If you're interested in improving Threesus, then please check it out!<br />
<br />
The rest of this post will talk about how the A.I. actually "thinks" and chooses what move to make next. I'll try to keep it high-level so that non-coders can understand, but if you're a programmer then I encourage you to take a look at the actual source code.<br />
<br />
First of all, you should understand how Threes works under the hood -- specifically, how the game chooses what cards to add to the board and where. The best description I know of (and the one I used while writing Threesus) is <a href="http://forums.toucharcade.com/showpost.php?p=3140044&postcount=522">this writeup on the Touch Arcade forum</a>. Knowing how the game works under the hood isn't just useful for understanding the A.I. -- it will make you a better player too!<br />
<br />
Fundamentally, Threesus works by looking 6 moves ahead into the future and then evaluating the potential future game board to determine its "quality". (I'll get to what "quality" means in a bit.) It does this look-ahead for <i>every</i> possible move in addition to many of the possible locations and new values of cards that might be added to the game board. Multiply all of these possibilities together, and Threesus will often examine <i>millions</i> of possible game states to decide just a single swipe. Once Threesus has calculated the quality of all of those game states, it simply swipes in the direction that is most likely to produce the highest-quality game state. (For you game-theory types, this is basically the <a href="http://en.wikipedia.org/wiki/Expectiminimax_tree">expectimax</a> algorithm.)<br />
<br />
In addition to examining every possible move, Threesus also "counts cards" to determine the probabilities of what value a new card might be, just like how a blackjack player can count cards to beat a casino. Threesus knows that the game starts with a deck of 12 cards (4 ones, 4 twos, and 4 threes) and draws cards from the deck until the deck is empty, at which point the deck is re-created and re-shuffled with another 12 cards. So as the number of cards in the deck decreases, Threesus can better predict, often with very high accuracy, what new cards will be well into the future. This is why sometimes Threesus seems to know the future!<br />
<br />
So how is the "quality" of a future game state calculated? Well, the naive way to evaluate the quality of the board is to simply count up the number of points on the board and try to maximize that. This works okay (in my tests it can score a little over 30,000 points on average), but it's actually far from the best way to evaluate a potential board. The problem with evaluating a board using only its score is that then Threesus will always be optimizing the game <i>assuming that it will end in 6 turns</i>, which is usually not the case!<br />
<br />
A much better way to evaluate the quality of a future game board is to calculate a quality number that represents how much <i>longevity</i> a board has -- that is, for how much longer Threesus is likely to be able to play the game (<i>after</i> the six-move look-ahead) before finally losing.<br />
<br />
Currently, Threesus attempts to calculate the longevity of a board using a fairly simple scoring calculation. The scoring calculation used in yesterday's live streams worked like this:<br />
<br />
<ul>
<li>Every empty space is worth 2 points.</li>
<li>Every matching pair of adjacent cards is worth 2 points.</li>
<li>A card next to another card twice its value is worth 1 point.</li>
<li>A card trapped between two other cards of higher value, or between a wall and a card of higher value, is <i>penalized</i> 1 point.</li>
</ul>
<div>
<br /></div>
<div>
That's it! This simple calculation was able to achieve a high score of 248,403, <i>without ever actually trying to directly increase its score!</i> And so if there's a single lesson to be learned from Threesus that you can apply yourself as you play Threes, it's this: Be patient. Don't play to increase your score; play to keep playing.</div>
<div>
<br /></div>
<div>
Running Threesus for 100 simulated games, here are the results it achieved:</div>
<blockquote class="tr_bq">
100 games completed!<br />Total time: 02:13:08.2477053<br />Low Score: 10041<br />Median Score: 88653<br />High Score: 774996<br />% of games with at least a 384: 100%<br />% of games with at least a 768: 98%<br />% of games with at least a 1536: 92%<br />% of games with at least a 3072: 27%<br /> % of games with at least a 6144: 3%</blockquote>
<div>
Since yesterday, Matthew has been working on tweaking the above scoring calculation, and already he's made significant improvements. Besides tweaking some of the point scores (including increasing the trapped penalty to 5), he also added bonus points if the highest-numbered card is on an edge or in a corner. With these improvements, Threesus is even better:</div>
<blockquote class="tr_bq">
100 games completed!<br />Total time: 03:03:22.0262799<br />Low Score: 30126<br />Median Score: 89436<br />High Score: 717960<br />% of games with at least a 384: 100%<br />% of games with at least a 768: 100%<br />% of games with at least a 1536: 94%<br />% of games with at least a 3072: 41%<br />% of games with at least a 6144: 1%</blockquote>
<div>
<br /><div>
(Don't read too much into the decrease in % of 6144. The difference between 1 game and 3 games is statistically insignificant.)</div>
<div>
<br /></div>
<div>
So in a nutshell, that's how Threesus works! But there's still a lot of room for improvement. Some ideas that come to mind are or have been suggested to me are:</div>
<div>
<ul>
<li>More refinements and testing of the board evaluator.</li>
<li>Better handling of the end-game -- right now Threesus doesn't realize when he's almost certainly going to lose, and so he doesn't do anything to maximize score.</li>
<li>Rewrite code in C or C++. The C# code that exists right now is very well optimized for C# code, but I think C or C++ could potentially be an order of magnitude faster, which should allow Threesus to look at least one more move ahead into the future in the same amount of time.</li>
<li>Using a <a href="http://en.wikipedia.org/wiki/Monte_Carlo_method">Monte Carlo</a> algorithm to look ahead further without exploding computation times.</li>
<li>Using a traditional reinforcement-learning method such as <a href="http://en.wikipedia.org/wiki/Q-learning">Q-Learning</a>.</li>
</ul>
<div>
So please, if you think you can make Threesus even better, <a href="https://github.com/waltdestler/Threesus">download the source code</a> now!</div>
</div>
</div>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com3tag:blogger.com,1999:blog-7110862627018001433.post-35307349469925474702013-09-01T13:19:00.004-07:002016-06-24T11:10:50.628-07:00StarWright build 2013.09.01No major new <i>StarWright </i>news, other than that I have just posted a new build of the game that shows off the starship designer, ship combat, and multiplayer!<br />
<br />
Download it from here: <a href="http://starwright.waltdestler.com/">http://starwright.waltdestler.com/</a>Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com43tag:blogger.com,1999:blog-7110862627018001433.post-16369378523600586562013-06-16T11:01:00.000-07:002016-06-24T11:10:50.591-07:00StarWright - PowerOver the past couple of weeks I implemented one of the last remaining starship simulation mechanics that I had planned to create. This mechanic has to do with providing power to all the various ship systems.<br />
<br />
The power mechanic works very similarly to the existing ammo mechanic. <a href="http://blog.waltdestler.com/2012/08/starwright-weapon-ammunition.html">If you don't recall</a>, the purpose of the ammo mechanic is to require the player to carefully balance weapons (which consume ammo) with ammo supplies. The closer the ammo supply is to a weapon, the faster the ammo can be delivered, and the faster the weapon can shoot, so the player has to think carefully about where they place weapons and ammo supplies relative to each other. While I've found that this mechanic is successful in giving greater depth to the design of small, localized areas of ships, it adds little depth to the overall design of larger ships since ammo rarely needs to be transported more than short distances.<br />
<br />
The power mechanic is intended to complement the ammo mechanic by providing greater depth to the overall design of larger ships. Power works similarly to ammo in that many ship systems (currently thrusters, ammo supplies, and the cockpit) require power to operate. And just like ammo, power "batteries" (for lack of a better word) must be hand-delivered by the ship's crew to the systems that need power. But power is different from ammo in the distance that batteries travel, the rate at which batteries are consumed, and the cost of creating batteries. Ammo is consumed very quickly during combat, but ammo typically travels only short distances, since ammo supplies are cheap enough that any well-designed ship will have one for every few weapons. Producing batteries, on the other hand, is extremely expensive due to the very high dollar cost of the "reactor core", a new ship part that produces batteries. The reactor core is so expensive that most any medium-size ship will only have one. Thankfully, power-consuming systems need fresh batteries fairly infrequently, so the potentially longer distances between the power core and power-consuming systems is not as big a deal as it would be for ammo. However, the distance that power has to travel is still a major consideration when designing a ship, so choosing a relatively central and protected location for the reactor core and keeping <a href="http://blog.waltdestler.com/2011/03/starship-builder-crew-congestion-more.html">traffic congestion</a> low is very important.<br />
<br />
Here's a screenshot showing a power core and glowing batteries being carried to some nearby systems:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ_JCdieK6M-tQvbHfFBrOssp6ME36r9WBkBxEY0P81NfBs6Hk0CUYOSgbNm_BqJQ3qYq24miB5-ewlKJ7C4CwJnB9t1kj3y8lGG8DtCtdrbna6KZDa6T3BU7gLF1ToiD2EpM1I0EKpi0/s1600/power+core.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ_JCdieK6M-tQvbHfFBrOssp6ME36r9WBkBxEY0P81NfBs6Hk0CUYOSgbNm_BqJQ3qYq24miB5-ewlKJ7C4CwJnB9t1kj3y8lGG8DtCtdrbna6KZDa6T3BU7gLF1ToiD2EpM1I0EKpi0/s400/power+core.png" width="400" /></a></div>
<br />
As I mentioned above, the ammo supply now requires power to operate. You can see the new redesigned ammo supply and thruster artwork in the above screenshot, which clearly shows how many batteries the thrusters and ammo supplies have remaining. Since producing ammo now requires power, power is now the most important resource on any ship. Without it all your systems will eventually become non-functional.<br />
<br />
Reactor cores are very expensive, but they can produce an unlimited amount of power. Sometimes when designing a ship, you may find it beneficial to have a closer source of batteries, but you don't want the huge added expensive of another reactor core. The compromise solution is a "battery storage" which can be seen in this screenshot:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirXo_0_-D2mxx43YwUv9ODb-iZ0c12WDrTHitytuDKArF66RrGuCqoDps1UmPiyS75ziY2vKxFy9hX7wmhFzTExAMICVpZqIUjPw3GPmFQPTfMvP0y214NHk2ZFEBM8C6vLsTLX2thPdc/s1600/batteries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirXo_0_-D2mxx43YwUv9ODb-iZ0c12WDrTHitytuDKArF66RrGuCqoDps1UmPiyS75ziY2vKxFy9hX7wmhFzTExAMICVpZqIUjPw3GPmFQPTfMvP0y214NHk2ZFEBM8C6vLsTLX2thPdc/s400/batteries.png" width="400" /></a></div>
<br />
A battery storage room does not itself produce batteries, but it can store up to 15 batteries in case of an urgent spike in local demand for power. When all 15 batteries are used up, then any additional batteries must come directly from the reactor core, or the battery storage must be re-filled from the reactor.<br />
<br />
If you think it's weird that power must be carried by hand instead of over wires, then I admit you're right. This is a design decision where I have deliberately compromised realism for the sake of deeper ship design and a more transparent simulation. The ship design is deeper because batteries make large-scale ship design decisions and corridor layouts more meaningful. And the simulation is more transparent and understandable because, rather than having some abstracted representation or numbers for power levels, you can actually see how power travels throughout the ship as it is being carried around by the crew.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com3tag:blogger.com,1999:blog-7110862627018001433.post-50464328261962408852013-05-11T20:32:00.000-07:002016-06-24T11:10:50.671-07:00StarWright - Doors, Doors, DoorsRecently I finished an artistic <a href="http://blog.waltdestler.com/2013/04/starwright-better-art.html">revamp</a> to StarWright's visuals. One of the most important improvements is the addition of a separate layer of walls that is rendered <i>above</i> the crew on the ship. This gave the feeling of actually viewing a cross-sectional floor plan of the ship, which was sorely missing in earlier versions. But the one big oddity with that revamp was that the crew could still <i>walk between</i> the walls, which was definitely weird.<br />
<br />
Now, finally, ships in StarWright have walls that crew can't move through, and of course by necessity, doors in the walls!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJjSl7I40hm1vKMx8EtgwlhEJhBBR7s9mYJvE07XKTGIUOgXyb7kxwdVQ3CSyDQhyiWEXnYtbS95pEie12rkY81g-pvWzXER519uDUI0wilH1lQLOQOXNYF6BJb2SKx6A9EQ4orA4anBo/s1600/doors.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJjSl7I40hm1vKMx8EtgwlhEJhBBR7s9mYJvE07XKTGIUOgXyb7kxwdVQ3CSyDQhyiWEXnYtbS95pEie12rkY81g-pvWzXER519uDUI0wilH1lQLOQOXNYF6BJb2SKx6A9EQ4orA4anBo/s400/doors.png" width="400" /></a></div>
<br />
The player may place those white double-sliding doors in any legal wall locations (some are blocked). Once a wall has a door in it, crew may freely move through the wall. As in a lot of space fiction (Star Trek in particular), when a crew member walks up to a door, the door will automatically slide open to let them through.<br />
<br />
From a technical standpoint, implementing doors and walls was much trickier than you might initially suspect, for a handful of reasons:<br />
<br />
<ul>
<li>The pathfinding system was previously unaware of the presence of walls between rooms, and making it "wall-aware" required a significant retrofit.</li>
<li>The pathfinding system previously assumed that the entire ship was contiguous -- that is, it assumed that it was possible to get from any location of the ship to any other location of the ship. Additional fixes were required to remove this assumption.</li>
<li>I didn't want to have to update every wall sprite with every possible door location, because that would have added many times as many wall sprites. Instead, I had to devise a way for the doors to "replace" the particular section of wall that they occupy, but no other parts of the wall. To do this, I render a rectangle representing the door sprites to a special off-screen "stencil" buffer. Then when I render the walls themselves, ever pixel of the wall gets checked against that stencil buffer to make sure there's no door at that pixel.</li>
<li>Every door sprite has animations to open and close as crew walk through. Unfortunately, doing potentially hundreds of simultaneous sprite animations on the CPU can be slow, so instead I devised a special <a href="http://en.wikipedia.org/wiki/Shader#Vertex_shaders">vertex shader</a> to handle the sprite animation on the GPU. When an animation is triggered, such as the door is opened or closed, the CPU sends the vertex shader the information it needs to render the door animation, and then the CPU never has to worry about the animation again until a new animation is triggered.</li>
</ul>
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com2tag:blogger.com,1999:blog-7110862627018001433.post-44837279628602968032013-05-04T10:55:00.000-07:002016-06-24T11:10:50.661-07:00StarWright LogoI made a logo for <i>StarWright</i> using the in-game ship editor, mostly just to show off how flexible the ship editor is.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiegyFxiDahUvhCQKRr30IfHeZ7R9liSseYAEAp1oxHPVHxjBc9aqVK1UySU-znpwd-QWdGM-DQe2GvRkDeRRxBo6uwM6EKaAaJCk2LniN6v-Hael2dR3gbMO2o0y9_U7qlGYNJhsON2OM/s1600/starwright.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiegyFxiDahUvhCQKRr30IfHeZ7R9liSseYAEAp1oxHPVHxjBc9aqVK1UySU-znpwd-QWdGM-DQe2GvRkDeRRxBo6uwM6EKaAaJCk2LniN6v-Hael2dR3gbMO2o0y9_U7qlGYNJhsON2OM/s400/starwright.jpg" width="400" /></a></div>
<br />Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-76104847053878288832013-04-23T18:26:00.000-07:002016-06-24T11:10:50.715-07:00StarWright - Better ArtI've been working for a while to revamp most of the ship art in <i>StarWright</i>. While I'm certainly no great artist, or even a good one, this new art is definitely much better than before, primarily because it gives the sense that you're looking <b>into</b> a cross-section of a ship as the people run around inside. This was a feeling that was missing from the old art, and the game is much better for having that feeling.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVQdkkmzLgYQCYzvACbBLV5Uta1FfCY-qeSTZAMNlPkCXtBbDDS_IsIzE7KdNsq6uusMbR_6fC1uuqiUMgLMDLai8nsp3CX0UBF93yuyRb-_AJjUMTGlVwHjpwTazHW3nU-GBXy8paZKo/s1600/art+revamp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVQdkkmzLgYQCYzvACbBLV5Uta1FfCY-qeSTZAMNlPkCXtBbDDS_IsIzE7KdNsq6uusMbR_6fC1uuqiUMgLMDLai8nsp3CX0UBF93yuyRb-_AJjUMTGlVwHjpwTazHW3nU-GBXy8paZKo/s400/art+revamp.png" width="400" /></a></div>
<br />
A key part of the new art is having clearly visible walls that separate the various rooms. There are no doors yet, but when crew walk from room to room they walk <b>underneath</b> the walls, which gives a much better sense that they're <b>inside</b> the ship.<br />
<br />
The new art is not just aesthetic, though. It serves some practical purposes too. The lighting color lets you know at-a-glance what kinds of systems you're looking at, even when zoomed out (red for weapons, orange for thrusters, tan for hallways and crew). The presence or not of colored lighting also indicates whether that room is operational (a dark gray cannon tells you that it doesn't have any crew operating it). And the number of ammo bullets loaded into a cannon tells you how many bullets that cannon needs to fire.Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0tag:blogger.com,1999:blog-7110862627018001433.post-6527017291508987502013-04-18T18:45:00.000-07:002013-05-05T18:48:12.888-07:00Garbage Collection<br />
Programmers who are opposed to garbage collection because manual memory management is easy completely miss the point of GC.<br />
<br />
Regardless of whether manual memory management is easy (if you're experienced then it's mostly routine), the greatest strength of GC is not that it makes memory management a bit easier (true in most cases, but non-deterministic deallocation can occasionally complicate things), or even that it's safer and more secure (almost always true), but that it eliminates the need to track which object is responsible for deallocating another object, thus greatly simplifying program structure, increasing brevity of code, and enabling a handful of language features like closures, asynchronous methods, LINQ (C#), etc... that would be much more awkward if not impossible to use.<br />
<br />
In short, GC enables programming languages to be more expressive and concise, and the code written in them to be cleaner and simpler, thus greatly improving flexibility, understandability, and maintainability of code. Whether that's worth the tradeoff of reduced performance and occasional added complexity is a matter of application domain and personal preference.<br />
Walt Destlerhttp://www.blogger.com/profile/09992341815994604747noreply@blogger.com0