Map viewpoint and location markers not read in multiplayer mode

Bug #1623375 reported by GunChleoc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
Unassigned

Bug Description

In GameLoader, the GameInteractivePlayerPacket is only read in singleplayer mode. This means that the last viewpoint and the map location markers can't be restored from a savegame.

Related branches

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Why did I then see the logs when I added that logoutput?
Is it reading from /dev/null ?

Revision history for this message
GunChleoc (gunchleoc) wrote :

I don't know where that came from, I didn't dig that deep into the code.

Revision history for this message
SirVer (sirver) wrote :

Klaus, which logs are you referring too?

Revision history for this message
GunChleoc (gunchleoc) wrote :
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Hello Gun, SirVer: I have a local branch here, where I just added some logs, for now:
bug-1623375-location-markers

--- src/game_io/game_interactive_player_packet.cc 2016-08-04 15:49:05 +0000
+++ src/game_io/game_interactive_player_packet.cc 2016-09-11 10:54:54 +0000

    if (packet_version >= 3) {
     if (InteractiveBase* const ibase = game.get_ibase()) {
      size_t no_of_landmarks = fr.unsigned_8();
+ log("Reading %lu landmarks\n", no_of_landmarks);
      for (size_t i = 0; i < no_of_landmarks; ++i) {
       uint8_t set = fr.unsigned_8();
       Point landmark(fr.signed_32(), fr.signed_32());
+ log("landmark set %u at %u,%u \n", set, landmark.x, landmark.y);
       if (set > 0) {

  // Map landmarks
  const std::vector<QuickNavigation::Landmark>& landmarks = ibase->landmarks();
+ log("Writing %lu landmarks\n", landmarks.size());
  fw.unsigned_8(landmarks.size());
  for (const QuickNavigation::Landmark& landmark : landmarks) {
+ log("landmark set %u at %u,%u \n", landmark.set, landmark.point.x, landmark.point.y);
   fw.unsigned_8(landmark.set ? 1 : 0);
   fw.signed_32(landmark.point.x);

thats wehre those logs came from.

The next week and weekned I will be occupied (singing Elias by Felix Mendelssohn Bartholdy)

I think I will spend the rest of this day cleaning up my inbox and perhaps testing #1622121.

Revision history for this message
SirVer (sirver) wrote :

> The next week and weekned I will be occupied (singing Elias by Felix Mendelssohn Bartholdy)

Sounds awesome! I cannot sing for s***, but always wanted to. I play some instruments in bands though and that is very fulfilling - singing with a big choir is probably too. Enjoy your weekends!

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

OK, coming back to this Issue. It actually works as designed.
The code is found in gane_loader.cc
There is only one interactive player per (in memory) game.
So it is impossible to store all locaction markers for all
players as that info is not available.

So an enhancement would be to save the location markers
anyway, resulting in different savegames per player.

But for an internetgame this would mean soemone not hosting
the game would get the location markers of the host,
eventually revealing crtical points on the map.

If we want this to really work the host must keep track
of "foreign" InteractivePlayer objects via some network command,
which would be a major change. Or the player must get some
information from the Interactive player.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Gun: please give this some thougts, but for r20 we should drop this.

Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Maybe we could keep them in a binary map packet, and store them for all players. This was, if one switches hosts after a crash, we could restore them too. And a binary package would make it at least a bit harder to cheat.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I just had another idea: Rather than the pretty useless map origin which is often unexplored, let's move to the player's starting position. For spectators, move to the starting position of the first open player slot.

GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → In Progress
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.