Author Topic: Screenshot naming + gpp1 patch  (Read 44321 times)

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Screenshot naming + gpp1 patch
« on: December 07, 2009, 10:19:49 pm »
Update 2:
The number resets on date changes now, demos (except autorecord) and videos use the same naming convention.
http://ingar.satgnu.net/tremulous/files/tremulous-gpp1-screenshot_timestamp3.patch

Update 1:

The format is now
yyyy-mm-dd-nnnn.jpg (or .tga)

nnnn is a number from 0000 to 9999, the client will continue numbering shots one the same day. If you happen to be playing at 0h 00m, it will not reset the numbering until you restart the client. If you make more than 10,000 screenshots on a single day you'll get an error message.

http://ingar.satgnu.net/files/tremulous/tremulous-gpp1-screenshot_timestamp2.patch

Original post:

The default screenshot naming scheme isn't very convenient: if you like to make a lot of pictures and keep them organized it's easy get confused.

Personally, I like my screenshots to contain a timestamp. Such files are always neatly organised
in explorer and are much easier to find when you need them.

I propose the following format:
tremulous-yyyymmdd-hhmmss-nnnn.jpg or .tga

The nnnn part is somewhat interesting: it's a number from 0-9999 that gets reset to 0 every time
you start the client. That way you can have multiple screenshots per second and you also
have some kind of session numbering.

I made a small patch for gpp1 that does just that, you can find it here:
http://ingar.satgnu.net/files/tremulous/tremulous-gpp1-screenshot_timestamp1.patch
The patch also removes the delay you experience when you make your first screenshot because
the client doesn't have to search for the first available screenshot number.

« Last Edit: January 06, 2010, 07:01:43 pm by Ingar »

Norfenstein

  • Posts: 628
  • Turrets: +81/-78
Re: Screenshot naming + gpp1 patch
« Reply #1 on: December 08, 2009, 12:19:42 am »
Would be nice to have the map name in there too, but maybe it's not worth making the file name even longer.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #2 on: December 08, 2009, 12:24:42 am »
Why the tremulous- at the start?  Surely its being in ~/.tremulous gives that away?

Also with thousands of them, maybe splitting into folders could help?  eg folder per day or whatever.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Demolution

  • Posts: 1198
  • Turrets: +157/-64
Re: Screenshot naming + gpp1 patch
« Reply #3 on: December 08, 2009, 02:13:34 am »
Substitute the "tremulous" part for a map name?

Clan [AC] - For all your air conditioning needs please visit: http://s1.zetaboards.com/AC_NoS/index/
my brain > your brain.
and i am VERY stupid.

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #4 on: December 08, 2009, 04:44:26 am »
Also I'd drop two of the yy just for simplicities' sake. I don't really see too much of a worry for Tremulous being played in the 22nd century. Shortens the file name too.
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

मैं हिन्दी का समर्थन

~Mooseberry.

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #5 on: December 08, 2009, 06:27:08 pm »
Would be nice to have the map name in there too, but maybe it's not worth making the file name even longer.
Might mess up chronological ordering of the files, unless the mapname comes after the timestamp.
Also, I have no idea where to find the mapname (code wise). It might be more difficult than it sounds,
but worth exploring.

Why the tremulous- at the start?  Surely its being in ~/.tremulous gives that away?
The best reason of all: lazyness. That way I can just upload screenshots
to my website without having to rename them.

I admit the number thingy does bother me somewhat, maybe I should limit it to two digits.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #6 on: December 08, 2009, 06:55:37 pm »
I seem to recall there being a mapname cvar, although that may be server only.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: Screenshot naming + gpp1 patch
« Reply #7 on: December 08, 2009, 11:24:58 pm »
Maybe put the map name into an exif field?

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Screenshot naming + gpp1 patch
« Reply #8 on: December 08, 2009, 11:30:23 pm »
I seem to recall there being a mapname cvar, although that may be server only.
it is, but the client has easy access to the mapname anyway (how would it load it otherwise?), see the cl_autorecorddemo code.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Norfenstein

  • Posts: 628
  • Turrets: +81/-78
Re: Screenshot naming + gpp1 patch
« Reply #9 on: December 08, 2009, 11:57:38 pm »
Would be nice to have the map name in there too, but maybe it's not worth making the file name even longer.
Might mess up chronological ordering of the files, unless the mapname comes after the timestamp.
Also, I have no idea where to find the mapname (code wise). It might be more difficult than it sounds,
but worth exploring.
After all the numbers was what I was thinking. And David's right, if you wanted tremulous- in front of all the file names you could easily mass rename them yourself. Agree with mooseberry too.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: Screenshot naming + gpp1 patch
« Reply #10 on: December 09, 2009, 11:04:55 am »
If Tremulous had a time cvar: bind f11 screenshotJPEG tremulous-\$time\-\$mapname\. At least in Tremfusion, the mapname part works already and I could get gametime with a script that starts counting time when I enter a game. The nnnn part can be made to work too. Why can't Tremulous have scripting?

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #11 on: December 09, 2009, 06:08:08 pm »
I did think about a cvar but it's just overkill. I don't feel like writing a parser for it.
I'll take a look at how tremfusion does it and maybe steal a good idea or two.

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #12 on: December 17, 2009, 02:16:41 pm »
The format in the new patch is:
yyyy-mm-dd-nnnn.jpg (or .tga)

nnnn is a number from 0000 to 9999, the client will continue numbering shots one the same day. If you happen to be playing at 0h 00m, it will not reset the numbering until you restart the client. If you make more than 10,000 screenshots on a single day you'll get an error message.

http://ingar.satgnu.net/tremulous/files/tremulous-gpp1-screenshot_timestamp2.patch

This way the funky number does something useful, I noticed it's quite confusing to find screenshots between a bunch of timestamps so I removed it and made the date a bit more readable.

I looked into adding the mapname but it seems slightly complicated, volunteers are always appreciated ;D

@moosberry:
I don't like 2-digit year numbers. It's like a different kind of soda: It sounds good
but I like my usual brand better.


gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Screenshot naming + gpp1 patch
« Reply #13 on: December 17, 2009, 04:50:54 pm »
The renderer stores the map name is in tr.world->baseName (this is the file name of the .bsp without extension), but be careful: tr.world may be NULL when no map is loaded !

Demolution

  • Posts: 1198
  • Turrets: +157/-64
Re: Screenshot naming + gpp1 patch
« Reply #14 on: December 17, 2009, 05:23:33 pm »
Is there something similar to this for demos?

If you make more than 10,000 screenshots on a single day you'll get an error message.

aww..

Clan [AC] - For all your air conditioning needs please visit: http://s1.zetaboards.com/AC_NoS/index/
my brain > your brain.
and i am VERY stupid.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Screenshot naming + gpp1 patch
« Reply #15 on: December 17, 2009, 05:35:44 pm »
The format in the new patch is:
yyyy-mm-dd-nnnn.jpg (or .tga)

nnnn is a number from 0000 to 9999, the client will continue numbering shots one the same day. If you happen to be playing at 0h 00m, it will not reset the numbering until you restart the client. If you make more than 10,000 screenshots on a single day you'll get an error message.

http://ingar.satgnu.net/tremulous/files/tremulous-gpp1-screenshot_timestamp2.patch

This way the funky number does something useful, I noticed it's quite confusing to find screenshots between a bunch of timestamps so I removed it and made the date a bit more readable.

I looked into adding the mapname but it seems slightly complicated, volunteers are always appreciated ;D

@moosberry:
I don't like 2-digit year numbers. It's like a different kind of soda: It sounds good
but I like my usual brand better.


cl_main.c:2928
Code: [Select]
                       Q_strncpyz( mapName, COM_SkipPath( cl.mapname ), sizeof( cl.mapname ) );
                        COM_StripExtension(mapName, mapName, sizeof(mapName));
« Last Edit: December 17, 2009, 06:21:58 pm by khalsa »
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

MitSugna

  • Guest
Re: Screenshot naming + gpp1 patch
« Reply #16 on: December 17, 2009, 06:32:19 pm »
That would be awesome if all I did was taking screenshots

khalsa

  • Administrator
  • Posts: 597
  • Turrets: +187/-132
    • http://www.mercenariesguild.net
Re: Screenshot naming + gpp1 patch
« Reply #17 on: December 17, 2009, 06:48:59 pm »
This patch should be for both demo's and sshots.

My vote is for yyyy-mm-dd-nnnn-mapname
}MG{ Mercenariesguild
ਮਨੁ ਜੀਤੇ ਜਗੁ ਜੀਤਿਆ

KillerWhale

  • Spam Killer
  • *
  • Posts: 469
  • Turrets: +63/-26
Re: Screenshot naming + gpp1 patch
« Reply #18 on: December 17, 2009, 09:19:01 pm »
I'd prefer to see yyyy-mm-dd-mapname-nnnn for better sorting, in my opinion. Either that or, mapname-yyyy-mm-dd-nnnn.

Both of those ways will group the shots from a map together, where Khalsa's way would group all of the first shots from every map together, which doesn't sound too intuitive to me.

Having this on demos and on screenshots sounds very nice. I don't like "screenshot0001" and "demo0001". :P

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #19 on: December 18, 2009, 02:40:02 am »
I'd prefer to see yyyy-mm-dd-mapname-nnnn for better sorting, in my opinion. Either that or, mapname-yyyy-mm-dd-nnnn.

Both of those ways will group the shots from a map together, where Khalsa's way would group all of the first shots from every map together, which doesn't sound too intuitive to me.

Having this on demos and on screenshots sounds very nice. I don't like "screenshot0001" and "demo0001". :P


yyyy-mm-dd-nnnn-mapname seems the best way to me.

That would make the picture be 2009-12-17-0001-atcs.jpg. That doesn't make a ton of sense logically but I think it would be easiest to sort by. Knowing what map the picture was take on is nice, but I don't really see the need to ever sort by mapname (unless you're going back through old photos looking for pictures on a specific map.) It seems to me most of the time you will want it sorted by date.

And, you can name demos, but of course, this will make it a lot nicer if you don't bother to name them.
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

मैं हिन्दी का समर्थन

~Mooseberry.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Screenshot naming + gpp1 patch
« Reply #20 on: December 18, 2009, 03:04:35 am »
cl_autorecorddemo has already done this for ages...
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

KillerWhale

  • Spam Killer
  • *
  • Posts: 469
  • Turrets: +63/-26
Re: Screenshot naming + gpp1 patch
« Reply #21 on: December 18, 2009, 06:00:28 am »
Well, I am confused as to the number. Is the number +1 for every shot taken on that day, or for on that map on that day?

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #22 on: December 18, 2009, 06:01:52 pm »
@KillerWhale
patch number 2 does +1 on a new day, it doesn't have mapname yet.

I did add the mapname, in fact it was rather easy thanks to the tips in this thread.
BUT it screws chronological order. bigtime. Think playing the same maps, in a different order,
in several games on a single day.

mapname and number don't mix, so it's either

- full timestamp (down to the millisecond)
- short timestamp (date and/or time) + number
- full timestamp + mapname

There is a perfectly sound technical reason but I won't bore you with it.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: Screenshot naming + gpp1 patch
« Reply #23 on: December 19, 2009, 01:50:38 am »
yyyy-mm-dd-nnnn-mapname shouldn't mess with cronological order tho.

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Re: Screenshot naming + gpp1 patch
« Reply #24 on: December 19, 2009, 10:49:30 pm »
I like the idea of dumping mapname in EXIF data. Bissig said it, i believe

∧OMG ENTROPY∧

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #25 on: December 20, 2009, 12:11:59 am »
I like the idea of dumping mapname in EXIF data. Bissig said it, i believe

Only problem is for the average user they will not know what this is or how to view it.
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

मैं हिन्दी का समर्थन

~Mooseberry.

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #26 on: December 20, 2009, 12:07:29 pm »
yyyy-mm-dd-nnnn-mapname shouldn't mess with cronological order tho.

The basic problem is I can't check if a filename yyyy-mm-dd-nnnn-* exists.
And after closer inspection, it will screw up in other situations as well.

I need to think this over.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #27 on: December 20, 2009, 01:04:44 pm »
Make it yyyy-mm-dd/nnnn-mapname, then all you have to do is count the number of nodes in the directory.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

A Spork

  • Spam Killer
  • *
  • Posts: 1010
  • Turrets: +37/-230
    • Spork - Unvanquished.net
Re: Screenshot naming + gpp1 patch
« Reply #28 on: December 20, 2009, 02:59:56 pm »
Shouldn't mapname be before nnnn?
Otherwise you will get
0000atcs
0000niveus
0000nexus6
0001atcs
0002atcs

It should goup by map IMHO.
Don't shoot friend :basilisk:! Friend :basilisk: only wants to give you hugz and to be your hat

Proud Member of the S.O.B.F.O.B.S.A.D: The Society Of Basilisks For Other Basilisks Safety and Dominance
:basilisk:    :basilisk:    :basilisk:

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #29 on: December 20, 2009, 05:04:14 pm »
The numbers keep going up even if the map changes.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.