so you take your snapshot of the game; "save" to another memory, essentially, and then slowly write it out over time. i'm just thinking it's probably way faster to duplicate everything in a save file in ram than it is to give it to the disk.make some kind of extra copy in memory of the game state
Savegames as save points are wrong?
Re: Savegames as save points are wrong?
ew no, that's not what i was saying:
Re: Savegames as save points are wrong?
Ah, OK.
Tried it, didn't work.
Building the in-memory snapshot takes time - 25 ms for e3m7, for example. String concatenation in C is slow as hell - you'd need to build a pascal string interface to avoid having to scan over the entire buffer to find where it ends every time you want to add even a single char to it. Might test that sometime.
Tried it, didn't work.
Building the in-memory snapshot takes time - 25 ms for e3m7, for example. String concatenation in C is slow as hell - you'd need to build a pascal string interface to avoid having to scan over the entire buffer to find where it ends every time you want to add even a single char to it. Might test that sometime.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
Re: Savegames as save points are wrong?
What's the performance hit of demo recording? Restore games from a demo. To load a savegame, engine would load demo and fast-forward in memory to a savepoint (or to the end of the demo). Save files would be "huge" in 1996 terms but so what. Optionally show it on-screen so player could jump in anywhere on the timeline. Not to derail into a discussion of an improved demo format, just daydreaming...
Re: Savegames as save points are wrong?
I've no idea, but that sounds awesome.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
Re: Savegames as save points are wrong?
The performance hit from recording a demo seems pretty minimal from what I've seen.
Re: Savegames as save points are wrong?
you would think otherwise if you have a half-broken disk drive that caused the machine to totally lock up for the duration of any read or write.
on any modern system, its pointless to make system calls for any data less than 4k. personally I'd aim for at least 64k.
fwrite is meant to have a certain level of buffering anyway, though I guess its buffer is conservative and only really there to cover really inefficient single-byte access.
on any modern system, its pointless to make system calls for any data less than 4k. personally I'd aim for at least 64k.
fwrite is meant to have a certain level of buffering anyway, though I guess its buffer is conservative and only really there to cover really inefficient single-byte access.
Re: Savegames as save points are wrong?
The demo save system sounds pretty cool.
Would make for a nice game mechanic, having the ability to rewind time and correct your mistakes.
Would make for a nice game mechanic, having the ability to rewind time and correct your mistakes.
Re: Savegames as save points are wrong?
Demos record what the client knows (what the server tells it, which isn't much). The client doesn't know anything about entities except in single player (where you are both the client and server) and server stuff is never recorded into a demo.qbism wrote:What's the performance hit of demo recording? Restore games from a demo. To load a savegame, engine would load demo and fast-forward in memory to a savepoint (or to the end of the demo). Save files would be "huge" in 1996 terms but so what. Optionally show it on-screen so player could jump in anywhere on the timeline. Not to derail into a discussion of an improved demo format, just daydreaming...
A demo records: Visible entity positions and angles and frame, rendering effects flags. Your player's status bar info. And that's just about it. Well add static ends into that.
That monster that is on the other side of the map, a client doesn't know it is there. Doesn't know anything about triggers. Health other than your own. Etc.
The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Savegames as save points are wrong?
Worse than that, a demo won't record nothing that's not sent by network to the clients. So, if you have, let's say, a custom inventory in your entity represented by a bunch of floats in defs.qc... A demo won't record it. Your health ? The monsters current health ? Forget. Your game won't restore correctly. So while the idea is intriguing the current demo format is not suitable.Baker wrote:Demos record what the client knows (what the server tells it, which isn't much). The client doesn't know anything about entities except in single player (where you are both the client and server) and server stuff is never recorded into a demo.qbism wrote:What's the performance hit of demo recording? Restore games from a demo. To load a savegame, engine would load demo and fast-forward in memory to a savepoint (or to the end of the demo). Save files would be "huge" in 1996 terms but so what. Optionally show it on-screen so player could jump in anywhere on the timeline. Not to derail into a discussion of an improved demo format, just daydreaming...
A demo records: Visible entity positions and angles and frame, rendering effects flags. Your player's status bar info. And that's just about it. Well add static ends into that.
That monster that is on the other side of the map, a client doesn't know it is there. Doesn't know anything about triggers. Health other than your own. Etc.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)