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

A Spork

  • Spam Killer
  • *
  • Posts: 1010
  • Turrets: +37/-230
    • Spork - Unvanquished.net
Re: Screenshot naming + gpp1 patch
« Reply #30 on: December 20, 2009, 09:22:28 pm »
Whatever, still makes more sense to me to have
mapnam before nnnn...
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:

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #31 on: December 21, 2009, 06:21:23 am »
Whatever, still makes more sense to me to have
mapnam before nnnn...

Whatever, but read the thread you are posting in for it to make more sense.
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

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

~Mooseberry.

A Spork

  • Spam Killer
  • *
  • Posts: 1010
  • Turrets: +37/-230
    • Spork - Unvanquished.net
Re: Screenshot naming + gpp1 patch
« Reply #32 on: December 21, 2009, 06:48:14 pm »
What?
how does it not make sense?
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:

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #33 on: December 21, 2009, 08:42:33 pm »
What?
how does it not make sense?

Hm... Again you should read what people say.

I said read the whole thread carefully to better understand why things are what.

So what are you asking me "how does it not make sense?" for.

(I'll save you time, that was a rhetorical question.)
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

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

~Mooseberry.

A Spork

  • Spam Killer
  • *
  • Posts: 1010
  • Turrets: +37/-230
    • Spork - Unvanquished.net
Re: Screenshot naming + gpp1 patch
« Reply #34 on: December 21, 2009, 10:58:00 pm »
Your wording sucks.
And I did read the thread, and I didn't see any reason why mapname has to be last.
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:

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #35 on: December 21, 2009, 11:32:32 pm »
Your wording sucks.
And I did read the thread, and I didn't see any reason why mapname has to be last.
:(
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

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

~Mooseberry.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: Screenshot naming + gpp1 patch
« Reply #36 on: December 21, 2009, 11:44:56 pm »
<date>-0000-atcs
<date>-0001-tremor
<date>-0002-atcs
is better than
<date>-atcs-0000
<date>-atcs-0002
<date>-tremor-0001

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #37 on: December 22, 2009, 12:09:50 am »
Give them all random junk names, and make a lots of text files all indexed different ways.  Or could make tons and tons of symlinks to make everyone happy.  Or a cvar to let you choose it.  Or do whatever you want safe in the knowledge no one will care enough to submit a rival patch.
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.

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: Screenshot naming + gpp1 patch
« Reply #38 on: December 22, 2009, 01:23:10 am »
Or wait until Tremfusion adds a cvar containing date and time (maybe game time too :P).

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Re: Screenshot naming + gpp1 patch
« Reply #39 on: December 22, 2009, 02:30:34 am »
Why not just mapname/yyyy-mm-dd.jpg?

∧OMG ENTROPY∧

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #40 on: December 22, 2009, 08:24:19 am »
Because then I have to go through a stack of folders to find all of todays shots.
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.

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #41 on: January 06, 2010, 06:57:57 pm »
mapname can't be done because I have to be able to check if a file with a certain number already exists.
I can't use wildcards.

In any case, I cleaned up the patch some more, format stays the same (yyyymmdd-nnnn) but the number resets to 0
on date changes. Demos and videos now use the same naming convention. (I did not change the autorecord demo names).

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

Thorn

  • Guest
Re: Screenshot naming + gpp1 patch
« Reply #42 on: January 06, 2010, 09:31:30 pm »
How many Ingar's does it take to change a screenshot?

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Screenshot naming + gpp1 patch
« Reply #43 on: January 06, 2010, 10:47:06 pm »
Six.  One to write the patch and 5 to fight off the ravaging hordes.
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.

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Screenshot naming + gpp1 patch
« Reply #44 on: January 07, 2010, 07:20:23 am »
mapname can't be done because I have to be able to check if a file with a certain number already exists.
I can't use wildcards.

Wouldn't it make things alot simpler if you just add an archived cvar that holds the date and number of the last screenshot/avi ? Then you don't need to check for existing files at the start, you just continue where you last stopped.

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #45 on: January 07, 2010, 08:11:57 pm »
mapname can't be done because I have to be able to check if a file with a certain number already exists.
I can't use wildcards.

Wouldn't it make things alot simpler if you just add an archived cvar that holds the date and number of the last screenshot/avi ? Then you don't need to check for existing files at the start, you just continue where you last stopped.


The last used number is stored in a static int but it still has to scan the first time. It seems a bit overkill
to make it more complicated  ;)

How many Ingar's does it take to change a screenshot?
Six.  One to write the patch and 5 to fight off the ravaging hordes.

I have an infinite number of scary monkeys.

« Last Edit: January 07, 2010, 08:20:07 pm by Ingar »

Lakitu7

  • Tremulous Developers
  • *
  • Posts: 1002
  • Turrets: +120/-73
Re: Screenshot naming + gpp1 patch
« Reply #46 on: February 08, 2010, 04:47:17 pm »
So is this now done, tested, and ready to go in, with people generally happy about the results?

Liskey

  • Posts: 112
  • Turrets: +7/-4
Re: Screenshot naming + gpp1 patch
« Reply #47 on: February 08, 2010, 09:55:37 pm »
Silence means consent - so it must be all good :-)

But since I'm snowed in and bored, I'll ask why would wildcards even be mentioned as an issue.  Don't you need to read all the filenames anyway in order to find the latest?  Just parse out the date and sequence number and ignore the rest -- it makes no difference how filenames are formatted or what else they contain.

Code: [Select]
nextn = 0
today = current_date()
while (fname = readdir(dir)) {
  if (parse_date(fname) == today) {
     if (n=parse_nnnn(fname) >= nextn) nextn = n
  }
}
nextn += 1
 

Winnie the Pooh

  • Posts: 442
  • Turrets: +45/-85
Re: Screenshot naming + gpp1 patch
« Reply #48 on: February 08, 2010, 10:01:00 pm »
Ingar has become a developer?
Quote
I also realize that this is the internet, but even more so this is the forum for a video game on an internet, then even beyond that this is TREMULOUS forums the Satan version of all video game forums for a video game that is ON the internet.

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #49 on: February 09, 2010, 01:57:51 am »
What are you talking about?
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

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

~Mooseberry.

Winnie the Pooh

  • Posts: 442
  • Turrets: +45/-85
Re: Screenshot naming + gpp1 patch
« Reply #50 on: February 09, 2010, 02:27:07 am »
What are you talking about?
I'm talking about Ingar's work going straight into the official Final.
So is this now done, tested, and ready to go in, with people generally happy about the results?
Quote
I also realize that this is the internet, but even more so this is the forum for a video game on an internet, then even beyond that this is TREMULOUS forums the Satan version of all video game forums for a video game that is ON the internet.

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: Screenshot naming + gpp1 patch
« Reply #51 on: February 09, 2010, 03:06:28 am »
What are you talking about?
I'm talking about Ingar's work going straight into the official Final.
So is this now done, tested, and ready to go in, with people generally happy about the results?

I don't think/didn't know he is official dev, (although I could be wrong for sure) but this is open source, so anyone can create something useful, and "anything" could "potentially" end up being included in 1.2.
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

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

~Mooseberry.

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Screenshot naming + gpp1 patch
« Reply #52 on: February 09, 2010, 06:56:35 am »
Silence means consent - so it must be all good :-)

But since I'm snowed in and bored, I'll ask why would wildcards even be mentioned as an issue.  Don't you need to read all the filenames anyway in order to find the latest?  Just parse out the date and sequence number and ignore the rest -- it makes no difference how filenames are formatted or what else they contain.

Code: [Select]
nextn = 0
today = current_date()
while (fname = readdir(dir)) {
  if (parse_date(fname) == today) {
     if (n=parse_nnnn(fname) >= nextn) nextn = n
  }
}
nextn += 1
 

Ingar keeps the current file number in a variable, but the variable is lost when you quit and restart tremulous, so it has to scan the existing files to find the highest existing number. After the first screenshot it's just a matter of incrementing a counter.

An other possibility to fix this is to keep the counter value over restarts by storing it in the autogen.cfg.

Liskey

  • Posts: 112
  • Turrets: +7/-4
Re: Screenshot naming + gpp1 patch
« Reply #53 on: February 10, 2010, 09:57:40 pm »
Yes of course, he explained all that.
mapname can't be done because I have to be able to check if a file with a certain number already exists. I can't use wildcards.
That was the question - mapname can certainly be included in filenames, there is no reason to use wildcards, and you can check if a file already exists using readdir.

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Screenshot naming + gpp1 patch
« Reply #54 on: February 28, 2010, 10:37:07 am »
What are you talking about?
I'm talking about Ingar's work going straight into the official Final.
So is this now done, tested, and ready to go in, with people generally happy about the results?

I don't think/didn't know he is official dev, (although I could be wrong for sure) but this is open source, so anyone can create something useful, and "anything" could "potentially" end up being included in 1.2.

Sorry for the somewhate late response, but I still wanted to clear this up:

I am not an official developer, but I knew how to write code before I could make maps.
When there's something about a program that bothers me, I sometimes take the time to
correct it, make a patch and offer it to the developers. I already did this for a lot
of programs, not just tremulous.

In general, developers tend to pay more attention to patches than to random suggestions.