Idea: game record feature

Idea: game record feature

Postby acme_pjz » 21 Jan 2012, 18:19

Hi everybody,

I think it's a cool feature that you can save your game play to a record file after playing a level, and next time you can watch the replay and/or upload your play to the Internet :) I have made some puzzle game before and some of them have game record support. I'd like to implement this feature in Meandmyshadow :) Any suggestions?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Idea: game record feature

Postby Edward_Lii » 21 Jan 2012, 18:33

Hello acme_pjz,

acme_pjz {l Wrote}:I think it's a cool feature that you can save your game play to a record file after playing a level, and next time you can watch the replay and/or upload your play to the Internet :) I have made some puzzle game before and some of them have game record support. I'd like to implement this feature in Meandmyshadow :) Any suggestions?

This can indeed be a great addition. :)
I think we can use a similar approach as we use for the player recording for the shadow.
MeAndMyShadow runs at a constant 40fps meaning that storing the key presses are enough to replay a complete level.

This has some downsides, including that if the level changes the replay will be invalid.
To prevent this you can add the level file to the replay, if it is the replay will also work without the original level.

One problem that can't really be solved is that when the physics change the replays will be invalid.
But assuming this won't occur to often (and only between release) I think it's a good enough solution.

As for the system I think we should create a ReplayState that extends the Game state.
This state won't listen to player input, do the key presses every frame.
It can also be used to increase the play speed by calling logic twice before rendering.

Anyway, good luck! ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Idea: game record feature

Postby acme_pjz » 24 Jan 2012, 16:11

Hi,

I have implemented the experimental game record save/load features in SVN revision 209. When you finished a level the file "test.mnmsrec" will created automatically, and if you press '2' key while playing then "test.mnmsrec" will be loaded and played. Now we should consider how we manage record files :| and how do we add "ReplayState" and change replay speed... Any suggestions?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Idea: game record feature

Postby Edward_Lii » 24 Jan 2012, 16:20

Hello acme_pjz,

acme_pjz {l Wrote}:I have implemented the experimental game record save/load features in SVN revision 209. When you finished a level the file "test.mnmsrec" will created automatically, and if you press '2' key while playing then "test.mnmsrec" will be loaded and played. Now we should consider how we manage record files :| and how do we add "ReplayState" and change replay speed... Any suggestions?

Wow, nice work! :cool:
Only the two play buttons is a bit weird.

It's hard to find a place to put the record buttons without cluttering the menus.
The same goes for the stats, it's impossible to tell that the stats are from two different goes.

Perhaps we should use a certain space in the levelselect screen where the stats will be filled when hovering over the levels.
Beside the stats could be some icon/button that will play the recording of that go.
This means we store two recordings per level: (best time) and (least number of recordings).

Beside these per level recording the user should be able to save replays he wants to keep or wants to use as part of a bug report.
This could be done by a fourth button in the level select screen, this however clutters the screen again. :think:

Any suggestions are welcome on how to solve this problem.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Idea: game record feature

Postby MCMic » 24 Jan 2012, 17:05

Edward_Lii {l Wrote}:Perhaps we should use a certain space in the levelselect screen where the stats will be filled when hovering over the levels.
absolutely
Beside the stats could be some icon/button that will play the recording of that go.
This means we store two recordings per level: (best time) and (least number of recordings).
good idea.
Beside these per level recording the user should be able to save replays he wants to keep or wants to use as part of a bug report.
Good idea too, should be some "save last level record" button.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Idea: game record feature

Postby Edward_Lii » 24 Jan 2012, 17:30

Hello MCMic,

I've been thinking and if we add the replay icons behind the stats it should be easily clickable by the player.
This won't go well with the hovering since the user would have to move his mouse between the levels in order to reach the stats and click the replay button.
Any false move would cause frustration and the user needs to go back to the level he/she wants to play the replay.
What we can do is adding some sort of selected level, the user can select a level by clicking on it.
Instead of directly starting the level the user would be able to go to the stats and select the replays.

MCMic {l Wrote}:Good idea too, should be some "save last level record" button.

If we show a popup like when you finish a levelpack but then every level we could show the stats and a "Save Replay" and "Next level" buttons.
This however removes the flow of playing a levelpack in one go, but perhaps it increases the usability?

Any feedback is welcome.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Idea: game record feature

Postby acme_pjz » 26 Jan 2012, 10:51

Hi,

Edward_Lii {l Wrote}:I've been thinking and if we add the replay icons behind the stats it should be easily clickable by the player.
This won't go well with the hovering since the user would have to move his mouse between the levels in order to reach the stats and click the replay button.
Any false move would cause frustration and the user needs to go back to the level he/she wants to play the replay.


I think so.

Edward_Lii {l Wrote}:What we can do is adding some sort of selected level, the user can select a level by clicking on it.
Instead of directly starting the level the user would be able to go to the stats and select the replays.


Good idea. And double-click (or click again) the level still means play the level.

Edward_Lii {l Wrote}:If we show a popup like when you finish a levelpack but then every level we could show the stats and a "Save Replay" and "Next level" buttons.


I think so, it should also displays game time and number of recordings.

Edward_Lii {l Wrote}:This however removes the flow of playing a levelpack in one go


A little bit. Maybe we can use Enter button for the shortcut to play next level, perhaps we could add "Don't display this dialog again" checkbox...

Another question: How do we name the record files of level "example.map"? use "example.map-1.mnmsrec" or use "<md5>-1.mnmsrec"? If use the first solution, how do we distinguish file with same name but different folder? If use the second solution, noticed that because of different line endings of Windows and Linux, same level may have different MD5s in different systems :|
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Idea: game record feature

Postby Edward_Lii » 26 Jan 2012, 17:56

Hello acme_pjz,

acme_pjz {l Wrote}:A little bit. Maybe we can use Enter button for the shortcut to play next level, perhaps we could add "Don't display this dialog again" checkbox...

There's a popup window in XMoto when you finish a level and IIRC enter was enough to go to the next level, so I think we should also go for this.
I'm not sure the "Don't display again" option is such a good idea, how should the user re-enable it?
And the user will be unable to save any replays when the popup is disabled. :think:

acme_pjz {l Wrote}:Another question: How do we name the record files of level "example.map"? use "example.map-1.mnmsrec" or use "<md5>-1.mnmsrec"? If use the first solution, how do we distinguish file with same name but different folder? If use the second solution, noticed that because of different line endings of Windows and Linux, same level may have different MD5s in different systems :|

First of all I think that there should be two kinds of recordings, the ones used by stats (best time or least recordings) and user saved replays.

For users it makes no sense to have to select the level and only see the recordings of that level.
It would be easier to show the user a list with his replays and the names he gave them.

The problem still exists with the stats replays, I think it's best if we base them on the level name. (preventing the md5 issue)
And perhaps we should create a folder structure similar to the level(pack) one? :think:
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Idea: game record feature

Postby acme_pjz » 27 Jan 2012, 07:16

Hi Edward_Lii,

Edward_Lii {l Wrote}:I'm not sure the "Don't display again" option is such a good idea, how should the user re-enable it?


Of course in Options menu we can re-enable it again :)

Edward_Lii {l Wrote}:And the user will be unable to save any replays when the popup is disabled.


Maybe this time the game replay is always saved :| not sure

Edward_Lii {l Wrote}:And perhaps we should create a folder structure similar to the level(pack) one?


Not sure...

Edward_Lii {l Wrote}:The problem still exists with the stats replays, I think it's best if we base them on the level name. (preventing the md5 issue)


I have an idea to overcome the md5 issue, that is calculate the md5 based on the TreeStorageNode data structure, thus we ignore the space characters in the level file... But we calculate the MD5 only when we have selected a level to prevent useless computations...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Idea: game record feature

Postby Edward_Lii » 27 Jan 2012, 16:51

Hello acme_pjz,

acme_pjz {l Wrote}:Of course in Options menu we can re-enable it again :)

I think we should do it the other way around.
There shouldn't be a "Don't display again" option on the popup, only one in the options menu.
This won't clutter the popup and prevent accidentally disabling the popup.

acme_pjz {l Wrote}:Maybe this time the game replay is always saved :| not sure

Not sure if that's really such a good idea.
I don't think it will make sense for the player to suddenly have hundreds of replays after disabling the popup. :think:

acme_pjz {l Wrote}:I have an idea to overcome the md5 issue, that is calculate the md5 based on the TreeStorageNode data structure, thus we ignore the space characters in the level file... But we calculate the MD5 only when we have selected a level to prevent useless computations...

I think it is a good enough solution if the hashing won't take too long.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Idea: game record feature

Postby acme_pjz » 08 Feb 2012, 09:02

Hi Edward_Lii,

:( Unfortunately it looks like different version of game will get different MD5 checksum on same file :( Do you have such problems?

If yes IMHO we should abandon MD5 checksums :(
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Idea: game record feature

Postby Edward_Lii » 08 Feb 2012, 11:01

Hello acme_pjz,

acme_pjz {l Wrote}::( Unfortunately it looks like different version of game will get different MD5 checksum on same file :( Do you have such problems?

That's because there was a bug in the md5calc code of the TreeStorageNode as pointed out by MCMic on IRC.
The change was in svn rev. 245, I noticed the changed md5sum too.
We jut got to make sure that there are no bugs in the md5 code before version 0.3.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Idea: game record feature

Postby acme_pjz » 08 Feb 2012, 16:46

Hi,

Edward_Lii {l Wrote}:That's because there was a bug in the md5calc code of the TreeStorageNode as pointed out by MCMic on IRC.
The change was in svn rev. 245, I noticed the changed md5sum too.


I see :| How embarrassed :oops:
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Who is online

Users browsing this forum: No registered users and 1 guest