Why was replay format changed?
Moderator: Moderators
Re: Why was replay format changed?
is it really that hard to check for another [GAME] after the first script? i can't understand what's the fuss about.
Re: Why was replay format changed?
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.
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.
Exactly!lurker wrote: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.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.)
Re: Why was replay format changed?
i'm +1 on that, actually. no point in storing redundant data in the demo.TradeMark wrote:I was thinking that you could include first then player own script.txt and then the host one
Re: Why was replay format changed?
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..)
(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..)
Re: Why was replay format changed?
No need to store two copies, though; you can have the offset point into the demostream.
Re: Why was replay format changed?
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.
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.
Re: Why was replay format changed?
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.)lurker wrote:No need to store two copies, though; you can have the offset point into the demostream.
Re: Why was replay format changed?
Speaking of scripts, is there any reason to limit them to 32KB as is currently done?
Re: Why was replay format changed?
Where is that limit? (Never seen it.)
Re: Why was replay format changed?
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.
Re: Why was replay format changed?
Auswaschbar told me it could be 2^32 bits now. Didn't check it though.
I suggested it because that way the format wouldn't need to change. But I don't really care myself whether it changes.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.)
Re: Why was replay format changed?
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.
Re: Why was replay format changed?
32 kilobytes should be enough for everybody.
oh, and don't quote me on that.
oh, and don't quote me on that.
Re: Why was replay format changed?
Hmm ok. I suppose the reason is that it was easiest to make it this waylurker 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.

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.
Hmm, from the code in github the limit still seems to be at 32K bytes max per network message.MelTraX wrote:Auswaschbar told me it could be 2^32 bits now. Didn't check it though.
-
- Spring Developer
- Posts: 1254
- Joined: 24 Jun 2007, 08:34
Re: Why was replay format changed?
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.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.
Re: Why was replay format changed?
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.
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.