Shipboard Combat
Shipboard combat is just like any other combat between the PCs and their opponents, except the encounter takes place on board a ship, rather than in a dungeon or on a forest path. For the most part, shipboard combat can be resolved normally. The only constraints are the size of the ship (and therefore, the size of the battlefield), the danger of falling overboard into the water, and the effects of weather on the ship.
If the combat happens during a storm or in rough seas, treat the ship’s deck as difficult terrain. Remember to take into account the effects on spellcasters’ concentration checks due to weather or the motion of the ship’s deck (Pathfinder RPG Core Rulebook 206–207). If a combatant falls overboard, see the rules for aquatic terrain and water dangers on pages 432 and 445 of the Core Rulebook. In all other ways, shipboard combat functions no differently than combat on land.