Wednesday, February 12, 2020

Ship Fire Mechanic

For 0.8.7 I'm now almost done with implementing the ship fire mechanic.  Primarily fires are started by shooting ships with the Heated Shot ammunition type, which was added in the current 0.8.6 build.  Similar to creating a leak on impact or injuring crew, the chance of creating a fire is based on the stats of the ammunition fired.  Larger heated shot have a higher chance of causing a fire, but even the smallest has a pretty good chance.  Some other ammunition types also have a very small chance of starting a fire as well.

A ship can have up to 3 fires at the same time.  A fire at the bow, midship, or the stern.  To fight fires you assign crew to the firefighting role, which functions similarly to the other damage control roles.  work is applied to fighting a fire every few seconds automatically.  Similar to fixing leaks, your crew focuses on fighting 1 fire at a time, working on them in the order that they appear.  Fire pumps can be installed in your ship's equipment slots to improve the efficiency of your crew fighting fires (competing currently with the bilge pump equipment, which is used for improving efficiency of pumping out water from leaks)

While leaks start at a specific size, where larger leaks take more crew effort to fix than smaller ones, fires instead all start off small.  Fires though grow in size, requiring more crew effort to put them out.  This means that while your crew is fighting the first fire, if a second fire is started it will grow in size unchecked until the first fire is put out.  You will find it is important to quickly put out fires. 

Fires randomly spawn additional damage to your ship, with worse damage the larger the fire.  At launch of the feature with 0.8.7 this will be limited to spawning new ship leaks, but it is planned to also destroy equipment and cannons installed in the ship when that feature is eventually implemented.  It is not yet decided if fires will result in crew injuries, but that is a possibility as well in the future.

Your ship will only have up to 1 fire for each of the 3 locations, so unlike leaks you can't get inundated with large numbers of fires (beyond the 3).  The player will be able to see the fire and smoke at the correct location of the fire, both for your own ship and other ships in the game.  These fire and smoke effects grow in size with the intensity and seriousness of the fire, so will be a good visual indicator.

So this should look cool and add a bit more depth to the combat in Broadside: Perilous Waters.  Have fun with it.

Wednesday, December 4, 2019

Lots of small improvements

The last few months have focused on nice to have and quality of life added features, bug fixes, some visual improvements, and overall polish of the game.  Going forward for the next few months will be more of the same.  Adding somewhat minor features which make the game a more rich environment, add to the complexity of the gameplay, polish menus and the combat system, and fix any important bugs. 

In the next release (0.8.6) currently there are fixes checked in for a major bug with ship flooding and a minor bug with the teleport feature.  More known bugs are being targeted for this release, as well as some additional feature development.  Specifically the bug where on ships with multiple side gun decks sometimes when you switch decks it switches back to the previous deck is the next to be worked on (this was looked at over a year ago and unfortunately not correctly fixed). 

As far as feature development, ship fires, selecting ammunition types at sea, and adding the Heated Shot ammunition type, are the next features being worked on.  When that is done additional resource types and resource gathering will be added, specifically fishing.  0.8.6 will be released at some point during these features being added. 

After that, focus will switch back to the City UI, which while I thought it was somewhat innovative, play testers have reported it to be an initially confusing interface.  I'm going to experiment with switching the listing and moving of items to a drag and drop interface and replace tables of items with icons of items. 

Additionally the ship outfitting and customization part of the City UI (basically the current left size of the window) will be broken out into its own window.  Naming of ships will finally be added (the back end has supported it for a long time, but the UI interface for it was not implemented correctly).  Some additional ship customization features will also be added, such as Lieutenants assigned to ships which can be trained and provide ship bonuses. 

This is all in preparation for the start of actually promoting the game, raising awareness, and a eventually a possible crowd funding campaign to support eventual marketing and finishing its development. 

Saturday, October 19, 2019

Thursday, October 17, 2019

Improved Smoothness

A problem with Broadside: Perilous Waters has been the smoothness of the client side movement of objects, such as ships and cannonballs.  When I replaced Unet with the in house JCGNetwork system, I wrote a script called JCGNetworkTransform, which basically fills the role of Unet's NetworkTransform.  Essentially it syncs the position of an object from the server to the client. 

Now the NetworkTransform component from Unet was poorly documented, buggy, and overall didn't work very well.  JCGNetworkTransform was marginally better originally but would result in jittery motion especially for objects at high speed.  It has several modes, but the one I primarily used I called SmoothRB.  It would sync the current position, rotation, physics velocity, and angular velocity.  The client would apply the two physics values and apply the position and rotation over time between receiving new updates. 

In theory it seemed like it would work well, but the result was updates from the server don't come in at an exactly regular rate, and it was difficult to smoothly transition between the last position and the new position while the client was applying its own physics simulation.  I worked around this issue at the time by maxing out the send rate to match the server side 25 FPS.  But this just shrunk the problem instead of eliminating it, and created a new problem where the maximum number of players per server would be lower. 

Now I've written a new simple Interpolate mode.  It works by maintaining a queue of incoming position/rotation updates on the client and tries to keep to a specific target count in the queue.  Currently the queue target is just 1 so it is more responsive, but sometimes I may want to target a higher queue.  A higher queue count would reduce the chance that the client attempts to move the object but the next update hasn't yet arrives, at the expense of being further behind the position on the server. 

So now the server in these updates sends the current time, and the client can then interpolate between the last update and the current update being processed for the same amount of time the server took between those updates.  If the client gets behind replaying these updates it ever so slightly increases the speed it processes them in order to catch up over time, and if it gets ahead it either pauses or slightly slows down the movement.  All physics simulation on the client side is now disabled when in Interpolate mode. 

This has resulted in a much smoother movement of object movements, both ships and cannonballs, than before.  I'm still tuning the system, but it is looking good.  I've also increased the server side FPS and physics updates from 25 FPS to 32 FPS, and reduced the position update frequency from 25 FPS to 16 FPS.  The former was done to address an issue with very fast moving cannonballs from long guns flying through the smallest ships at close range without registering a hit.  Originally it was set so low to help with a CPU usage problem on the server side, but other improvements to address this over the past few months have allowed a little more head room to raise this back up again a bit. 

Hope you found this at all interesting.  This stuff will be included in 0.8.1. 

Saturday, October 12, 2019

0.8.0 Releasing today!

Big update with 0.8.0!  All of Europe is now ready, the world is on fire with a war centered around France, the Ottoman Empire is hostile to most of Europe, and there are now two Galley class ships which can use oars to go directly into the wind!

Very excited, as the game is coming along quite nicely. 

Tuesday, October 1, 2019

Adding Galley Classes

The next release will be 0.8.0, and with it will come the Galley.  This is a type of ship with an alternative form of propulsion, specifically oar power.  All galley type ships will have sails, but sail power is not the primary means of moving most of these ships.  You'll be able to get to high speeds, even directly into the wind, using oars. 

These ships will have very large crew compliments, and relatively small cargo.  When food/water becomes required to feed your crew this will make them not ideal for long journeys.  What they are ideal for are fast attacks near coastlines, especially inside inland seas.  Their large crews will also help when the boarding mechanic is eventually added to the game. 

Thursday, September 5, 2019

Teleport and Scuttle

A requested feature is quickly moving yourself to another location on the map, similar to "podding" yourself in Eve Online.  This will be included in 0.7.14.  To use this feature, you click the Menu button, then click Teleport.  From the Teleport window you can save your current location as your saved teleport location, or click Teleport Now to teleport to that saved location. 

To teleport you must be sailing an Escape Class Dinghy.  It will not be available for any other ship class.  This is so you can quickly move yourself to where your ships are stored after a loss, so you can get back into the game rather than potentially sailing for hours in your dinghy. 

Another feature being added to 0.7.14 is the ability to scuttle your own ship.  You click Menu then Scuttle.  To scuttle means to intentionally sink your own ship.  This will immediately flood your ship, which will cause it to sink as if sunk in combat.  The ship will be lost, as well as crew and items, as in any ship sinking. 

The scuttle feature is probably most useful in combination with the teleport feature, allowing you to quickly get into an Escape Class Dinghy so you can teleport. 

Lastly, I'm planning to add an in game bug reporting feature.  A button has been added under Menu, though the feature won't be ready for 0.7.14, but will be added in the future.