quadra-game / quadra

An addictive action puzzle game with single player and multiplayer capabilities (Internet or LAN).
GNU Lesser General Public License v2.1
28 stars 18 forks source link

Missing level info in DOWNLOAD packet #41

Closed pphaneuf closed 10 years ago

pphaneuf commented 10 years ago

Submitted by Patrick Aaltonen (pihvi):

Let's say a server runs with levelup set to true, and a player for instance came to level 2. If a new player suddenly connects to this server, then there is no way for this new player to know which level the other players are at, which again means he will calculate their score wrong. I think information about the level for each player should be added to the download packet (or the gameserver packet).

Comment by slajoie:

Is scoring really dependant on the level? I don't remember...

In any case, the level can be determined by looking at the number of lines and whether levelup is enabled on the server so there would be no need to add information to P_DOWNLOAD.

Comment by pihvi:

It's easy to check: Create for example an ffa server with levelup enabled and join a player to clear at least 15 lines to get to level 2. Then pause the game and connect a new client. Go back to the first player, unpause, and clear some more lines and then check the scores in both clients. The score is different (I checked with 1.1.8 that there really is a scorfe difference). The score is dependant by the level with this statement in canvas.cpp: score_add += (score_add/10)*level; As far as I can see, there is no lines information in P_DOWNLOAD, but you get one with P_STAT. The problem here is that LINESTOT is the total number of lines cleared, so if the player has played more than one round, it will be impossible to know how many lines have been cleared in the current round. You won't even know how many rounds each player has played when the game is FFA.

Comment by slajoie:

You're right! Sorry I'm a little rusty :). Maybe there should be a stat for LINES in P_STAT. Maintaining backward compatibility is easier (or at least less ugly) in P_STAT.

Comment by slajoie:

I have this fixed in my workspace but it needs a little testing.

Comment by pphaneuf:

Stéphane, didn't you already commit this change, in revision 248?

http://code.google.com/p/quadra/source/detail?r=248

pphaneuf commented 10 years ago

slajoie looks like he knows something. :-)

pphaneuf commented 10 years ago

Yes, that revision looks right.