You can travel from the Swedish port of Karlskrona to Gdynia back and forth very cheap, and I really mean cheap. To be exact, on weekdays the standard price for the cruises is 20 euro (199 kronor) in low season, and a little bit higher on weekends. The price stays the same the whole season and does not change based on how close to the date it is. The price includes private cabin. That is about 10 euro per person. The price includes both the trip from Karlskrona to Gdynia and the trip from Gdynia to Karlskrona.
The price is doubled in high season, which is still very cheap.
But there is a catch. Stena Line does, maybe intentionally, not advertise these cruise deals on their English website. If you search on the English website, you will only get the standard fees which are alot higher, like 200 euro instead. It is not possible to book these ultra cheap deals on the English website!
However, if you visit the Swedish version stenaline.se and translate it (Swedish translates well into English), and check the cruises section, you will find them there.
The ship departs 21:00 from Karlskrona and arrives in Gdynia at 07:30 the following day, and goes back at 21:00, arriving 07:30 in Karlskrona the day after that. You have to be at the ferry terminal at least 1 hour before departure, so make sure to be there in time.
Karlskrona is a 3 hours train ride from Copenhagen, and about 2 and a half from Malmö, Sweden. There is one direct train every hour, with Karlskrona as it's final destination. From Karlskrona central station there is a bus to the ferry terminal every 30 minutes, and you do not even have to cross the road to get to the bus stop, it's right next to the railway tracks. Take the bus that says Verkö on it, you can use your Karlskrona train ticket to ride with the bus cause the ticket is valid for public transport in all of Karlskrona.
Gdynia is not an interesting place, but it's very close to top northern Polish destinations Sopot and Gdansk, and not so far from Malbork. There are taxis waiting outside the ferry terminal with standard fares, there are also buses if you prefer that.
So you can spend a whole day in this region in whatever city/town you like. I split my trip between Gdansk and Sopot, and when I did the same trip earlier I spent my time in Gdansk and Malbork.