In 2012 the Chinese naval ships operating off Somalia were seen accompanied by what appeared to be a cruise ship. It was actually the first of two “barracks ships” that the Chinese Navy has built since 2011. Both are 30,000 ton ships that appear to be based on cruise ship designs with lots of topside cabins with windows and large open decks for recreation. These two ships are indeed “barracks ships” but were designed to be quite flexible.
They were first seen in operation off Somalia and described as an example the Chinese Navy learning how important morale at sea was. Until 2008 Chinese warships rarely spent more than a week away from port but since then China has been sending "Naval Escort Task Forces" to participate in the anti-piracy patrol off Somalia. There, for four months (plus a month to get to and from China) the two warships (accompanied by a supply ship) look for pirates and escort merchant ships. On those long voyages Chinese officers soon noted that many months at sea put more strain on sailors than the usual shorter training voyages.
Morale for the Chinese sailors was particularly important because China had not yet allowed its navy to establish a base for shore leave in the region. All other navies have such arrangements but not China (until 2017 when they set up one in Djibouti). Back in 2011 China created the barracks ship that could also serve as a special crew support ship. Because the first barracks ship looked like a cruise ship it was believed to be a converted cruise ship, with expanded medical facilities (to treat any victims of local diseases or those injured on duty). But recreational and entertainment spaces that would normally be present in a cruise ship were also present in the barrack ship but mainly as multi-purpose spaces for recreation or training. Off Somalia these spaces were used for giving Chinese sailors a few days of rest and relaxation without going ashore anywhere. There was Internet access, plenty of video games, sports equipment and cruise ship class quarters. The food was more varied and there was a bar.
The two barracks ships (hull numbers 88 and 89) are also being used for sea trials of the new Chinese aircraft carriers. The barracks ships accommodate hundreds of additional engineers, technicians and naval personnel, as well as computers, simulators and other special gear that enables the aircraft carrier to have equipment examined carefully when used, then tweaked or even modified while still at sea. The additional personnel needed for this then return to the barracks ship when their shifts are over and live in much more comfortable accommodations than they would have if some of them were sent off with the carrier. The Chinese Navy also plans to send one of these barracks ships off on long deployments of their carrier task forces. In addition the barracks ships can accommodate up to 2,500 troops for short periods, like for a major invasion (of Taiwan, North Korea or whatever).