Ludeon Forums

RimWorld => General Discussion => Topic started by: Crystalline Cat on January 13, 2015, 11:41:20 AM

Title: Can we please have the Semantic MediaWiki plugin?
Post by: Crystalline Cat on January 13, 2015, 11:41:20 AM
RimWorld items now use a fairly complex process to calculate a lot of their stats. To get the final damage reduction and deflection values for a piece of clothing, for example, you have to get data from the item type def, the material defs, the damage type enumeration, and soon the quality and condition of the item.

The wiki should not only show those individual pieces of information, but also lists and tables of commonly encountered combinations, e.g. how much damage reduction each item of clothing has using each kind of material, because having an overview over those things allows for easy comparision, which the in-game stats views don't provide.

However, there is currently no good way to store those individual pieces of information and then query them easily to calculate values and make lists and tables.

You can use templates, as I've done on the Clothing Page (http://rimworldwiki.com/wiki/Clothing), but to avoid duplicating the information you'd have to put each individual number into its own template, or use a template to act as a giant switch for a bunch of related numbers, to be parsed and executed a ton of times. Also, querying anything this way requires creating a whole bunch of nested templates, which are time-intensive to create and their interaction is often not easy to understand for anyone but their creator.

My current problem, for example, is that the full protection table for one piece of apparel is rather large, and I would like to do a simpler table showing only the range for each damage type over all materials on the overview page, and then the full information on the clothing type's page itself. This is doable with templates (or manually, but that can't realistically be maintained over version changes), but will get complex really fast.

So I would like to ask Tynan (or any other wiki sysadmin with the authority) to install the Semantic MediaWiki (http://semantic-mediawiki.org) plugin. SWM allows one to attach properties and relations to individual pages and then to construct queries which do exactly those things I mentioned above.
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: Arenji on January 13, 2015, 12:31:05 PM
That is one beautiful clothing stats page my friend. Wiki done right!

Would it be possible to add the amount of materials required to craft each item?
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: ZestyLemons on January 13, 2015, 09:17:04 PM
I'll forward this to Tynan, it's ultimately up to him what extensions get in and which ones don't.

Looks pretty awesome, I'm definitely up for any extensions that make table and calculation management easier. The infoboxes are a prime example of 'massive switch statements' that not a lot of people understand.
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: amul on January 13, 2015, 11:53:19 PM
I've always wondered how those pretty pages get made. I would make copies of them and edit the info by hand....
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: Fernbhoy on January 14, 2015, 11:54:28 AM
puts my random "noob trying to create tables in wiki" ones too shame :D
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: ZestyLemons on January 16, 2015, 04:23:58 PM
Heyo, sorry for the delay. Just installed Semantic wiki ( should be listed here: http://rimworldwiki.com/wiki/Special:Version ).

Let me know if it's working properly!
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: Crystalline Cat on January 16, 2015, 09:07:17 PM
Thank you! :)

However, I think there are some tables missing. Editing a page now gives me a database error. If I don't use any of the SWM stuff, the edit goes through despite the error, otherwise it doesn't.

When I go to http://rimworldwiki.com/wiki/Special:Types/URL (http://rimworldwiki.com/wiki/Special:Types/URL), I get an exception (stack trace omitted):

Unexpected non-MediaWiki exception encountered, of type "RuntimeException"
[81e071a7] /wiki/Special:Types/URL Exception from line 162 of /home/tynansylvester/public_html/rimworldwiki.com/extensions/SemanticMediaWiki/includes/src/MediaWiki/Database.php: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: SELECT DISTINCT smw_title, smw_namespace, smw_iw, smw_sortkey, smw_subobject FROM `mr_smw_object_ids` INNER JOIN `mr_smw_fpt_type` AS t1 ON t1.s_id=smw_id WHERE t1.o_serialized='http://semantic-mediawiki.org/swivt/1.0#_uri' ORDER BY smw_sortkey LIMIT 201
Function: SMWSQLStore3Readers::getPropertySubjects
Error: 1146 Table 'rimworldwiki.mr_smw_object_ids' doesn't exist (localhost)


Hmm... just noticed the exception message says:

QuoteDid you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script (https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script)
Title: Re: Can we please have the Semantic MediaWiki plugin?
Post by: ZestyLemons on January 17, 2015, 03:32:26 AM
Whoops, forgot to set up the DB stuff. Working on it now.

Edit:

DB should be set up and working. I made a test page here, and it seems like everything is in working order now: test page (http://rimworldwiki.com/wiki/TestSMW), properties of test page (http://rimworldwiki.com/wiki/Special:Browse/TestSMW).