Creditstable

From Sega Retro

Auto-generating production history

I have solved a problem. The code needs cleaning up and the output needs to be formatted better, but as a proof of concept, it's not a bad start.

Given a developer name and a known list of games the developer has worked on, I can retreive the role he/she played during each game's development.

e.g. Mie Kumagai (Sandbox, User:Black Squirrel/Sandbox3)

  • Sandbox –
  • User:Black Squirrel/Sandbox3 –


cons:

  • it's not clean or efficient (i.e. there may be other extensions better suited to this task)
  • every usage of Creditstable will need to be changed
  • it's complicated to explain. Basically I'm generating variables called CREDITS##NAME and transcluding big chunks of wiki pages

this prototype does not handle aliases or multiple roles or multiple platforms (and it's not ignoring square brackets yet), and it could theoretically be automated further to find relevant games, but yeah, this is a thing. Make it better. -Black Squirrel (talk) 14:28, 8 August 2017 (CDT)

I can't really think of a good way to automate credits. The best I've come up with is to have DPL pull from "Category:Mie Kumagai games credits" and about 1000 other similar categories. Not ideal. - Hivebrain (talk) 12:17, 9 August 2017 (CDT)
I did a bit of exploring. You can do this:

i.e. get a list of "backlinks". We could always have a whopping big GAMES category and do a categorymatch to filter things out. How you'd cleanly work out the release dates, I can't say. -Black Squirrel (talk) 13:18, 9 August 2017 (CDT)

categorymatch can use wildcards. - Hivebrain (talk) 14:06, 9 August 2017 (CDT)

gee (Hive)brain, what are we doing to do tonight

I think

the best course of action is merge ideas from template:CreditsTest into this template, and cruicially have it backwards compatible.

i.e. something like

<section begin="credits_whatever" />
{{creditstable|
{{creditsrow|Role here|person 1, person 2, person 3}}
{{creditsrow|Alternatively|person 4|person 5|person 6|whatever's easiest}}
{{creditsheader|Same headers as before}}
*'''This is valid too:''' but we'd discourage it going forward
|source=Bums
|ref={{fileref|ButtsMagazine UK 01.pdf|page=4}}
}}
<section end="credits_whatever" />

creditsrow would basically just return a bullet point. Splitting the ref from the source might make it easier to work with - dunno.


You'd then have algorithms in the creditsrow and creditsheader templates that will create variables that look like

{{#var:SomePerson}} = Mega Drive: Programmer|Special Thanks (Sega)|Master System: Whatever


(there may be better ways to format the string but you get the point. Probably want to pass the source through too. )


by doing it this way, we can add a check to creditstable to detect whether it has any "nested" creditsrow templates. If there aren't any, the creditstable template can put the page in a "THIS IS THE OLD CREDITSTABLE SCHEME" category - i.e. the wiki can tell us which pages need updating with minimal effort.


the only thing this doesn't do is give us the date of when the game was released. However, I don't really know how to easily sort things in mediawiki, so I'm not sure what I'd do with that information right now


the ProductionHistory template would transclude the "credits_whatever" section, compare names and pump out a list ("GAME (SYSTEM; DATE) -- ROLE1, ROLE2, ROLE3 (as ALIAS)")


I don't like having to put the section tags in manually but I don't think there's a workaround for that. -Black Squirrel (talk) 14:05, 16 August 2017 (CDT)

#lst apparently doesn't allow for sections in templates. Maybe we could use #lsth to transclude the whole "Production credits" section and then have an optional "console=" parameter in template:creditstable? I think I might prefer to drop creditstable entirely and use creditsTest with some modifications. It would be a lot cleaner. - Hivebrain (talk) 15:49, 16 August 2017 (CDT)

SMS/GG

For games whose credits are duplicated across multiple platforms, I'm thinking it should look something like this:

{{creditstable|
*blah
*blah
*blah
| console=SMS,GG
}}

There are two options: we can either parse "SMS,GG" on the wiki side before the store (i.e. the credits will be stored twice under different platforms), or on the SQL side in the query.

For wiki parsing, I've just written Template:Foreach, since we're playing with lists quite a bit - give it a list, a delimiter, and something to do for each cycle.

e.g.

{{foreach|list=SMS,GG|delimiter=,
|[value]
}}

gives

{{{{{template}}}|SMS}}{{{{{template}}}|GG}}

Due to the unique way MediaWiki parses things, I've used "[value]" as a substitute - change it to whatever you see fit.

also it will probably break with nested foreach templates due to the way variable names are handled. Something to think about, anyway -Black Squirrel (talk) 12:34, 20 November 2017 (CST)

double quotes

Evander Holyfield's "Real Deal" Boxing is causing problems because SQL doesn't like titles with " in them.

Thing is, I'm not sure why my fixes aren't working - I don't know if it's because the system's slow, or if I'm doing something genuinely wrong. If you look at Chris Cutliff:

Query: SELECT `date` AS `date` FROM `wiki_cargo__releases` WHERE name="Evander Holyfield's "Real Deal" Boxing (Game Gear)" AND console="GG" ORDER BY `date` LIMIT 100 Function: CargoSQLQuery::run Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Real Deal" Boxing (Game Gear)" AND console="GG" ORDER BY `date` LIMIT 100' at line 1 (localhost)

I've traced the issue down to Template:GetEarliestRelease, but look:

1992

it works fine on its own. ???? -Black Squirrel (talk) 11:58, 17 December 2017 (CST)

The game name is stored correctly in the database.[1] It looks to me like the cargo_query command in Template:ProductionHistory is failing with quotes. Quotes will probably have to be removed from all the databases. - Hivebrain (talk) 16:46, 17 December 2017 (CST)
I had experimented a bit with that - I settled on trying to replace all " characters with '' (to be converted back later) but it wasn't playing ball for some reason. -Black Squirrel (talk) 13:33, 18 December 2017 (CST)

source

Found a problem - the Saturn version of Fighting Vipers

there are two creditstables, but the wiki is only storing the second one. I've tried to introduce a "source" field in the hopes that it might recognise there's a difference between the two... but idk, it should already be doing that (also I'm not sure I can add columns without rebuilding the table and breaking everything for x hours).

see:

game console name role
Fighting Vipers SAT Abe Navarro Testers
Fighting Vipers SAT Akira Yamanaka Jacket Designer
Fighting Vipers SAT Andrew Stein Special Thanks to
Fighting Vipers SAT Anne Moellering Marketing Manager
Fighting Vipers SAT Arata Hanashima Programmers
Fighting Vipers SAT Arvin Carlson Special Thanks to
Fighting Vipers SAT Chris Lucich Testers
Fighting Vipers SAT Daichi Katagiri Special Thanks
Fighting Vipers SAT David Leytze Music
Fighting Vipers SAT Dennis Lee Testers
Fighting Vipers SAT Eileen Sacman Production Manager
Fighting Vipers SAT Eric Smith Art Director
Fighting Vipers SAT Fred Selker Testers
Fighting Vipers SAT Fumio Kurokawa Publicity by
Fighting Vipers SAT Hideya Shibazaki Chief Programmers
Fighting Vipers SAT Hiroshi Kataoka Director
Fighting Vipers SAT Jason Bartholomew Testers
Fighting Vipers SAT Jeff B. Junio Lead Tester
Fighting Vipers SAT Kanae Tomikawa Publicity by
Fighting Vipers SAT Kaoru Nagahama Character Designers
Fighting Vipers SAT Kaznori O Assistant Graphic Designers
Fighting Vipers SAT Kazufumi Ohashi Assistant Graphic Designers
Fighting Vipers SAT Kentarow Nishimura Character Designers
Fighting Vipers SAT Len Jung Testers
Fighting Vipers SAT Lorne Asuncion Assistant Leads
Fighting Vipers SAT Makito Nomiya Sound Designers
Fighting Vipers SAT Manabu Sato Character Designers
Fighting Vipers SAT Manny Granillo Special Thanks to
Fighting Vipers SAT Mark McCunney Testers
Fighting Vipers SAT Mark Subotnick Special Thanks to
Fighting Vipers SAT Masahiro Sugiyama Movie Staff
Fighting Vipers SAT Masaru Nakamura Programmers
Fighting Vipers SAT Masatoshi Shibata Programmers
Fighting Vipers SAT Masud Husain Art Designers
Fighting Vipers SAT Matt Dunbar Special Thanks to
Fighting Vipers SAT Michael Dobbins Testers
Fighting Vipers SAT Mike Needham Special Thanks to
Fighting Vipers SAT Motoki Shinohara Exhibition Player
Fighting Vipers SAT Osamu Shibamiya Assistant Localization Producer
Fighting Vipers SAT Peter Young Assistant Leads
Fighting Vipers SAT Rey Alferez Testers
Fighting Vipers SAT Rick Greer Assistant Leads
Fighting Vipers SAT Scott Allen Art Designers
Fighting Vipers SAT Sean Potter Testers
Fighting Vipers SAT Sega Enterprises, Ltd. Presented by
Fighting Vipers SAT Seth Gerson Product Manager
Fighting Vipers SAT Shin Kataoka Movie Staff
Fighting Vipers SAT Shinji Ohshima Programmers
Fighting Vipers SAT Stephen Bourdet Testers
Fighting Vipers SAT Steve Hutchins Producer
Fighting Vipers SAT Steve Thompson Testers
Fighting Vipers SAT Susumu Morii Programmers
Fighting Vipers SAT Takako Kawaguchi Assistant Graphic Designers
Fighting Vipers SAT Tetsuya Kawauchi Sound Designers
Fighting Vipers SAT Tetsuya Sugimoto Chief Programmers
Fighting Vipers SAT The SEEDY Crew Special Thanks to
Fighting Vipers SAT Tim Spengler Testers
Fighting Vipers SAT Tony Lynch Testers
Fighting Vipers SAT Undyne Stafford Special Thanks to
Fighting Vipers SAT Wataru Kawashima Movie Staff
Fighting Vipers SAT Yoji Kato Chief Graphic Designer
Fighting Vipers SAT Yu Suzuki Producer
Fighting Vipers SAT Yutaka Ito Programmers

Yu Suzuki should be showing up - he's not -Black Squirrel (talk) 17:16, 2 January 2020 (EST)

It has nothing to do with there being two templates. The first one doesn't work even if it's on its own. I haven't been able to figure out why, but it thinks the first line is blank, which causes the while loop to abort. I'll have to rewrite the template from scratch later. - Hivebrain (talk) 19:16, 2 January 2020 (EST)
I found the problem. Credits can't be more than 1000 characters long. It's easy to fix in localsettings, but I no longer have access. In the meantime I've added a message to the template so you'll know if credits aren't going to be added to the cargo table. - Hivebrain (talk) 23:32, 26 January 2020 (EST)

support commas

Putting a tag here so I might actually remember to do it

spoilers: it's a faff -Black Squirrel (talk) 07:26, 2 April 2021 (EDT)

done. At least for one comma -Black Squirrel (talk) 06:03, 3 April 2021 (EDT)