Why was replay format changed?

Why was replay format changed?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Why was replay format changed?

Post by TradeMark »

These random-useless-changes really pisses me off.

Before:

Code: Select all

GameType=BA66.sd7;
Now:

Code: Select all

GameType=Balanced Annihilation V6.61;
I need mod filename!


Before:

Code: Select all

	[PLAYER0]
	{
		Name=[FSR]Autohost;
		countryCode=de;
		Rank=3;
		Spectator=1;
	}
Now:

Code: Select all

  [PLAYER0]
  {
     name=[fi]Autohost4;
     Spectator=1;
  }
Missing rank and countrycode!

+ more to find...

Did you change the header data too? Seems like i cant even read the script anymore. Also lobby replay list is broken now >_<

Who idiot changes these things? if you wanna change something, make new tag, dont replace the old ones.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Why was replay format changed?

Post by Peet »

The first change was essential to fix a bug that many people (including yourself at one point iirc) complained about.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

I dont remember complaining about that, though, its good to show the mod name too, but it should have new tag, instead of replacing the old ones!

"Modname" for example.

+ you didnt change REPLAY VERSION, its still 3!! now how the heck i differentiate between old replays
Last edited by TradeMark on 13 Jan 2009, 17:03, edited 1 time in total.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Why was replay format changed?

Post by Auswaschbar »

TradeMark wrote:These random-useless-changes really pisses me off.

Before:

Code: Select all

GameType=BA66.sd7;
Now:

Code: Select all

GameType=Balanced Annihilation V6.61;
BA_InstallerVersion.sd7 , yay
TradeMark wrote: Before:

Code: Select all

	[PLAYER0]
	{
		Name=[FSR]Autohost;
		countryCode=de;
		Rank=3;
		Spectator=1;
	}
Now:

Code: Select all

  [PLAYER0]
  {
     name=[fi]Autohost4;
     Spectator=1;
  }
Tdf never where whitespace sensitive. If it confuses your progs, you made them wrong.
TradeMark wrote: Missing rank and countrycode!
The setupscript is transfered from server to clients uppon gamestart. If the server don't include them, blame him.
TradeMark wrote:Did you change the header data too? Seems like i cant even read the script anymore. Also lobby replay list is broken now >_<
The only usefull part. Its indeed a bug, the script does get written to the file, but not where it used to be (its somewhere in the stream). Its already fixed.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

TradeMark wrote:These random-useless-changes really pisses me off.

Before:

Code: Select all

GameType=BA66.sd7;
Now:

Code: Select all

GameType=Balanced Annihilation V6.61;
I need mod filename!
That isn't a change that has been allowed for a long time already. Depends on lobby what ends up in the demo.
TradeMark wrote: Before:

Code: Select all

	[PLAYER0]
	{
		Name=[FSR]Autohost;
		countryCode=de;
		Rank=3;
		Spectator=1;
	}
Now:

Code: Select all

  [PLAYER0]
  {
     name=[fi]Autohost4;
     Spectator=1;
  }
Missing rank and countrycode!
Both tags are entirely optional and have been optional since they were created. In other words, nothing was changed.
Did you change the header data too? Seems like i cant even read the script anymore. Also lobby replay list is broken now >_<

Who idiot changes these things? if you wanna change something, make new tag, dont replace the old ones.
As pointed out, nothing was replaced or changed, you just didn't implement everything Spring accepts. (idiot?)
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

BA_InstallerVersion.sd7 , yay
yeah, that also could have been fixed via the installer, no need to change replay format because of that bug.
Tdf never where whitespace sensitive. If it confuses your progs, you made them wrong
My TDF reader isnt whitespace sensitive.
Last edited by TradeMark on 13 Jan 2009, 17:14, edited 1 time in total.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

TradeMark wrote:+ you didnt change REPLAY VERSION, its still 3!! now how the heck i differentiate between old replays
Spring version?
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

idk there is "version" in the replay header, i thought its for replay format.

Now the format has changed, because i cant find the script anymore, gives wrong coordinate or something.


Edit: yeah its broken, it gives me scriptSize = 0
That isn't a change that has been allowed for a long time already. Depends on lobby what ends up in the demo.
We need some format which all lobbies will use, or its pain in the ass to parse the replays and pls no LUA shit
Last edited by TradeMark on 13 Jan 2009, 17:24, edited 4 times in total.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Why was replay format changed?

Post by KDR_11k »

The format is in the Spring code. Country code and rank are optional and for an autohost don't make sense to list anyway.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Re: Why was replay format changed?

Post by MelTraX »

And the startscript is already fixed..
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

KDR_11k wrote:The format is in the Spring code. Country code and rank are optional and for an autohost don't make sense to list anyway.
its missing from every player.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

Yay i got it working now.

if scriptsize=0 I just simply search for [GAME] and that means there starts the script crap, and then count { and } to define when that shit ends. gg

I noticed the header isnt 116 bytes anymore, its 127 bytes, so you added some crap there... without changing the version number for the replay format, which is currently 3, and should be 4 now then.

I also noticed that the script.txt is always from the host, for example: http://replays.adune.nl/?640 it shows "Uploaded by: dojeh (NoruasMan)". inside ( and ) means who is the player who recorded that replay. It should show [RoX]Dojeh, but theres something wrong...
--> Explains this problem:
TradeMark wrote:
KDR_11k wrote:The format is in the Spring code. Country code and rank are optional and for an autohost don't make sense to list anyway.
its missing from every player.
So i received the host script.txt instead of using my own <_>
Last edited by TradeMark on 14 Jan 2009, 01:41, edited 6 times in total.
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: Why was replay format changed?

Post by el_matarife »

By the way I assume in the future it makes more sense to use file hashes rather than mod names or file names or maybe a combination of mod name plus hash. (And make it all case insensitive and white space insensitive too I think.)
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

Mod name is needed if you dont have the mod where you extract the mod name... Also mod file name would be good if some idiot makes same named mods etc. It wont hurt if you know filename, modname, hash.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

TradeMark wrote:I noticed the header isnt 116 bytes anymore, its 127 bytes, so you added some crap there... without changing the version number for the replay format, which is currently 3, and should be 4 now then.

Code: Select all

struct DemoFileHeader
{
char magic[16]; // 16 bytes
int version; // 4 bytes
int headerSize; // 4 bytes
char versionString[16]; // 16 bytes
Uint8 gameID[16]; // 16 bytes
Uint64 unixTime; // 8 bytes
int scriptSize; // 4 bytes
int demoStreamSize; // 4 bytes
int gameTime; // 4 bytes
int wallclockTime; // 4 bytes
int maxPlayerNum; // 4 bytes
int numPlayers; // 4 bytes
int playerStatSize; // 4 bytes
int playerStatElemSize; // 4 bytes
int numTeams; // 4 bytes
int teamStatSize; // 4 bytes
int teamStatElemSize; // 4 bytes
int teamStatPeriod; // 4 bytes
int winningAllyTeam; // 4 bytes
};
Total = 116 bytes, so it didn't change after the last version bump (to version 3).
I also noticed that the script.txt is always from the host, for example: http://replays.adune.nl/?640 it shows "Uploaded by: dojeh (NoruasMan)". inside ( and ) means who is the player who recorded that replay. It should show [RoX]Dojeh, but theres something wrong...
--> Explains this problem:
TradeMark wrote:
KDR_11k wrote:The format is in the Spring code. Country code and rank are optional and for an autohost don't make sense to list anyway.
its missing from every player.
So i received the host script.txt instead of using my own <_>
This is because only the host has to specify the script and Spring sends it over by itself. Reduces chance for sync errors due to lobby errors by a huge amount. That also explains why the script isn't stored in the demofile anymore (scriptSize = 0). The script you find by searching the demofile is embedded in the network stream.

Oh and, btw, Auswaschbar has this fixed already.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

wth, why it shows me 127 bytes then?
I compared old and new replays, and every time i compare, theres 11 bytes difference in the header size, the [GAME] now starts 11 bytes later than it was in old version.

Here i readed 20 random replays from both versions, capital alphabets are bolded with - mark, other is hex:
Image
(click to see bigger image)
First 20 is from new spring, the other 20 from old.


i think it makes more sync errors now, 80% of all games ive played have got unsynced in long games, which i didnt really get in old release so often. Could it be hosts fault? Its one of the autohosts...

Also ive got weird crashes with that autohost:

Code: Select all

[      0] Spring 0.78.1.1 (gb61c117{@0.78.1.1}-s) has crashed.
[      0] Exception: Access violation (0xc0000005)
[      0] Exception Address: 0x006161ae
crash 1:

Code: Select all

[      0] Stacktrace:
[      0] (0) I:\Spring_7811\spring.exe [0x006161AE]
[      0] (1) Unknown [0x6C416D75]
crash 2:

Code: Select all

[      0] Stacktrace:
[      0] (0) I:\Spring_7811\spring.exe [0x006161AE]
[      0] (1) Unknown [0x20200A5D]
crash 3:

Code: Select all

[      0] Stacktrace:
[      0] (0) I:\Spring_7811\spring.exe [0x006161AE]
[      0] (1) Unknown [0xFF2445C8]
Last edited by TradeMark on 14 Jan 2009, 13:46, edited 1 time in total.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

Tobi wrote:That also explains why the script isn't stored in the demofile anymore (scriptSize = 0). The script you find by searching the demofile is embedded in the network stream.

Oh and, btw, Auswaschbar has this fixed already.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

So you added some network stream data before the script.txt? that would explain the extra 11 bytes, but makes it sound fucking stupid to pad the script.txt with that shit, it should come after the script.txt
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

Tobi wrote:This is because only the host has to specify the script and Spring sends it over by itself. Reduces chance for sync errors due to lobby errors by a huge amount.
Fucking stupid eh, that we reduced chance for sync errors caused by lobby bugs?

And maybe you should read posts some time and actually try to understand why stuff is done, I keep having to quote myself.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Why was replay format changed?

Post by imbaczek »

trademark: i didn't notice any bug reports from you before release, is it perhaps because you, like, didn't test it?
Post Reply

Return to “Engine”