Why was replay format changed? - Page 3

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

imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Why was replay format changed?

Post by imbaczek »

is it really that hard to check for another [GAME] after the first script? i can't understand what's the fuss about.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

Yeah it isnt.

I was thinking that you could include first then player own script.txt and then the host one, that way i could get the flags/ranks/watsoever without crying when i play on crappy autohosts, and it wouldnt affect the syncing at all, since my script.txt isnt used in the game.
lurker wrote:
Tobi wrote:Actually that kind of stuff would be possible (including lobby generated script (ie. the one Auswaschbar quoted) and then TradeMark concvincing all lobby devs to still include this player information. (Since it won't be required for Spring anymore.)
Well, lobby devs don't have to include that; if both scripts are include Trademark can parse the first for myplayername and get the rest of the info from the real script.
Exactly!
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Why was replay format changed?

Post by imbaczek »

TradeMark wrote:I was thinking that you could include first then player own script.txt and then the host one
i'm +1 on that, actually. no point in storing redundant data in the demo.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

At least include a (client)scriptOffset field in the header then, scanning for the second occurrence of [GAME] (second, because client has the first one) and counting { and } seems like way too hacky to be the 'official' way to access the thing.

(I can think of multiple normally harmless changes to a lobby that would brick this search: using case sensitive search and lobby writing [game], which is fine for Spring, in the script; lobby putting some comment in the script that happens to include '[GAME]', etc.)

(I should have made everything with offsets in the header in the first place..)
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Why was replay format changed?

Post by lurker »

No need to store two copies, though; you can have the offset point into the demostream.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Re: Why was replay format changed?

Post by MelTraX »

I don't really care one way or the other as long as everything needed to access the scripts is in the header.

Just wanted to point out that the player info stuff is also redundant and I don't think a few kilobytes hurt anyone if it makes it easier to get the info.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

lurker wrote:No need to store two copies, though; you can have the offset point into the demostream.
Yes, storing two copies was only a workaround because the format requires the script to start directly after the header. (At least that's how I see it.)
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Why was replay format changed?

Post by lurker »

Speaking of scripts, is there any reason to limit them to 32KB as is currently done?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

Where is that limit? (Never seen it.)
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Why was replay format changed?

Post by lurker »

The fix to make it not crash at 4KB was to up the buffer to 32KB. But there are valid reasons to want to store a lot of data in the start script.
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Re: Why was replay format changed?

Post by MelTraX »

Auswaschbar told me it could be 2^32 bits now. Didn't check it though.
Tobi wrote:Yes, storing two copies was only a workaround because the format requires the script to start directly after the header. (At least that's how I see it.)
I suggested it because that way the format wouldn't need to change. But I don't really care myself whether it changes.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Why was replay format changed?

Post by lurker »

Well the commit labeled "increase the size of the fragnment-buffer to fix crash with long script.txt" merely changes three instances of 4096 to 32768, and the two commits related to outputting the startscript don't seem to change its ability to be larger.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Why was replay format changed?

Post by imbaczek »

32 kilobytes should be enough for everybody.

oh, and don't quote me on that.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Why was replay format changed?

Post by Tobi »

lurker wrote:The fix to make it not crash at 4KB was to up the buffer to 32KB. But there are valid reasons to want to store a lot of data in the start script.
Hmm ok. I suppose the reason is that it was easiest to make it this way :-P (and fastest).

But I suppose it wouldn't be that hard to make buf a std::vector<unsigned char> (with sane default size, e.g. this 4K) and change the asserts to conditions that double the vector size when necessary.

If I remember when I get home I might do that.
MelTraX wrote:Auswaschbar told me it could be 2^32 bits now. Didn't check it though.
Hmm, from the code in github the limit still seems to be at 32K bytes max per network message.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Why was replay format changed?

Post by Auswaschbar »

Tobi wrote:But I suppose it wouldn't be that hard to make buf a std::vector<unsigned char> (with sane default size, e.g. this 4K) and change the asserts to conditions that double the vector size when necessary.
First I wanted to do it with variable size. This should be easy because you know the size you need in the first place, so no need to increase it even. But I then got occupied by rl work, and just made it to 32kb.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Why was replay format changed?

Post by TradeMark »

Why couldnt you put my script.txt first, and then host script.txt ?

It sucks now when its 2 identical copies for nothing.

It tells me every time i am the host, MyPlayerName=Soloman; bullshit, im not soloman.
Post Reply

Return to “Engine”