Monday, February 19, 2018

Cosmoteer 0.13.6 - Explosive Charges, Multiplayer A.I., and more!

Cosmoteer 0.13.6 was released today! This update has a ton of small-to-medium sized features and improvements. Here are some of the most notable:

Explosive Charges

For a while now, Cosmoteer has supported a feature allowing you to self-destruct literally any module on your ship at any time. To be honest, I've always thought this was pretty strange, and in multiplayer it's especially exploitable. So I decided to remove arbitrary self-destruct of individual modules. However, players were using the self-destruct to execute some pretty creative strategies (such as splitting ships into multiple distinct ships), and I didn't want to lose those creative strategies altogether -- I just wanted a way to balance them and make them feel less strange.

Thus, the Explosive Charge was born! The Explosive Charge is a new 1x1 module that can be manually detonated by the player, destroying itself and almost everything else within a small radius around it:

While fairly cheap, the Explosive Charge is still much more expensive than a single structure tile (which is what players would usually use to self-destruct in previous versions) and so you must balance its cost against other modules. Additionally, since the Explosive Charge will also destroy almost everything else around it, you'll need to position it carefully to make sure that its explosion won't damage other important parts of your ship.

A.I. Player in Multiplayer Games

In order to round-out uneven teams in multiplayer or play co-op against the computer, the host of a multiplayer game can now add A.I. players.

These are just like regular players, except that their ships are controlled by the computer. The host is able to select the difficulty level of the A.I. and what ships it will use.

Multiplayer Quality-of-Life Improvements

This update also has a plethora of quality-of-life improvements to make multiplayer more playable and stable.

First of all, the networking code has been significantly optimized and should now have fewer disconnects, fewer server crashes, lower latency, and use less bandwidth. That's a win all-around!

Second, the lobby screen has been revamped to show the details of the selected game, so that you know what kind of game you're joining before you hop in:

Notice that there's also a little latency meter displayed for every game that should give you a rough indication of how laggy the game will be.

Third, due to past problems with spam, this update now limits chat messages in the public lobby to 5 every 50 seconds. You can also mute individual players and ban them altogether from joining your games.

Lastly, this update adds a toggle to the in-game chat that lets you send messages that can be seen by only your teammates, so you can strategize without informing the enemy of your plans!

And More!

This update has a ton more improvements and bug fixes. Check out the full changelog for all the details!

Saturday, January 27, 2018

Cosmoteer 0.13.5 - Improved Multiplayer Stability

Cosmoteer 0.13.5 has been released! This is a minor update that should significantly improve the stability of multiplayer games and also fixes a handful of other bugs. Enjoy!

Sunday, January 21, 2018

Cosmoteer 0.13.4 - Online Multiplayer

Cosmoteer 0.13.4 has been released! The new-and-notable improvements are online multiplayer, increased weapon range, and better ship flight A.I.

Online Multiplayer

Until now, to play multiplayer with someone else you had to either be on the same Local Area Network as them, or send them your I.P. address and have them join your game. This made playing with other people online problematic because the host had to first setup port forwarding on their router (which can be a little complicated for someone who hasn't done it before) and then send everyone else their I.P. address (which can be potentially risky).

But now 0.13.4 adds "online multiplayer", which allows players to play with others online without having to share their I.P. addresses or setup port forwarding. This works thanks to what's called the "Cosmoteer Lobby Server" (or CosmoServer for short), which is a little program that players can connect to and join an online "lobby" where they can then host games and play with anyone else in that lobby, just as if they were on the same LAN. There's currently one official server called "Official U.S. East" (located in New York, NY, USA), but you can also run your own server if you want.

Unlike the servers for most other games, CosmoServer does not actually run any gameplay logic; it merely acts as a communication relay between all the connected players, letting the players themselves run the gameplay logic. The advantages of this approach are that it uses far less CPU than a conventional game server, and even more importantly, it is fully compatible with all mods. (Individual players playing games together must still have the same mods, but those mods do not need to be installed on the server.) The primary disadvantage is that it increases latency (not a huge deal in an RTS-style game like Cosmoteer). And if you know anything about multiplayer game programming, you may think that not running gameplay logic on the server would expose the game to cheating, but this is actually not true thanks to its deterministic lock-step multiplayer implementation.

Increased Weapon Range

Cosmoteer is a game about building pretty much any kind of starship you want, from tiny fighters to huge motherships or anywhere in between. This is great for player creativity, but it turns out to be really hard to design gameplay mechanics that work well for ships of any size. In fact, the single biggest challenge when designing Cosmoteer is figuring out how to deal with the sheer differences in scale between ships.

One of the ways in which scale can be a prickly challenge is when choosing the "range" for each weapon (how far it can shoot). The goal is to pick a range that is close enough so that two ships fighting can both be seen on the screen at the same time (without zooming so far out that you can't tell what's going on) while not so close that it feels like the ships are sumo-wrestling. The big problem here is that the ideal range for small ships is much closer than the ideal range for large ships.

Until now, Cosmoteer has leaned towards picking weapon ranges that are ideal for small ships because that made the game more understandable for new players, but that of course meant that large ships would tend to fight more closely than felt comfortable or intuitive.

But the 0.13.4 update changes that in a way that makes combat between large ships happen at a more ideal range, while still keeping combat between small ships relatively close. This change has two parts:

  1. The range of all weapons has been increased, most by about 50% (the missile launcher being the most notable exception that got a much smaller buff). These increases makes large capital ships choose longer default attack distances.
  2. The range at which a ship will choose to attack (the default attack distance when given an order by the player, and the attack distance when chosen by the A.I.) now depends on the size of the target, such that a closer range will be chosen when attacking smaller targets and a longer range will be chosen when attacking larger targets. This means that two small fighter-sized ships attacking each other will still engage at relatively close range, while two capital ships fighting each other will stand off at longer range. (And if a small, fast ship is attacking a large, slow ship, then the small ship will try to stay at a longer range than the large ship wants, which could give the smaller ship more of an advantage so long as it is fast enough to stay away from the big ship.)
Better Ship Flight A.I.

The last change I want to mention in this post is that the flight A.I. for ships has been improved in several different ways that when combine together should make ships less "dumb" and annoying:
  1. The collision avoidance algorithm has been overhauled (again) to fix a bunch of problems it had when detecting potential collisions and evading them.
  2. When a ship is commanded to attack an enemy from a specific angle, the ship will now approach the enemy straight-on until it reaches attack range and only then attempt to move to the correct angle. This change prevents ships from entering combat facing the wrong direction, which was frustrating for many players.
  3. Lastly, the thruster calculation algorithm now prioritizes lateral thrust 50% more than it does forward/reverse thrust, meaning that ships will now try to eliminate most lateral motion before thrusting forward towards their intended destination. This has the practical effect of preventing most cases where ships would "orbit" around their destination without ever actually arriving at it.

Saturday, January 6, 2018

Cosmoteer 0.13.3 - Bug fixes & restored mod compatibility

Cosmoteer 0.13.3 has been released! When I released 0.13.2, I made a mistake which made many existing mods incompatible with Cosmoteer, much to everyone's dismay. This update restores compatibility with those mods and also fixes a handful of bugs.

Wednesday, January 3, 2018

Cosmoteer 0.13.2 - Miscellaneous Improvements

Cosmoteer 0.13.2 has been released! This is a relatively minor update that fixes bugs, reduces RAM usage, and adds some quality-of-life improvements and modding tools.

The reduction in RAM (and VRAM) usage is largely because Cosmoteer now uses "texture compression" to reduce the size of almost all of the graphics textures by 75%. This saves a couple hundred MB of RAM in the vanilla game, and it makes an enormous impact for some mods: "Abh Mod" for example has gone from using more than 4 GB of ram to around 1.2 GB of RAM.

Most games use texture compression and package already-compressed textures as part of the game installation. But Cosmoteer is a bit different in that it compresses textures on the fly from the raw PNG files during loading. It does this primarily to keep the game very easy to mod (most paint programs are unable to save textures using GPU-compatible texture compression formats, and none can generate the texture atlases that Cosmoteer uses for its ship graphics). The downside is that it takes much longer to compress a texture than it does to load an uncompressed texture, and so after compressing a texture for the first time, Cosmoteer caches the compressed texture on your hard drive and only re-compresses it if the original PNG file has changed.

This update also adds a "Developer Mode" to Cosmoteer, which makes available a number of development tools and features that should hopefully make mods easier and more convenient to create. These tools include a particle effect editor, a planet editor, and the ability to "cheat" by giving yourself money and fuel.