Talk:External Services and Tools/API Documentation

From BattleMaster Wiki
Jump to navigation Jump to search

I noticed the following with regional data:

  • The population value seems to be the region's max population, not the current population value. The current pop for every region is shown on the region listing for each island, and available from the region details by clicking any realm icon on the dynamic map, so it's not like this is privileged information.
  • The "lord" value provides only the character's first name, and not the family name.

--Indirik 14:21, 25 March 2009 (UTC)

The first is intentional, see dev list. The second is simply a ton easier right now, and might be sufficient. At least for the moment, let's leave it at that. We can always improve it later. :-) --Tom 14:26, 25 March 2009 (UTC)
The first is intentional, see dev list. Sorry, I'm not on that one. But apparently the pop values on the region list should not be showing actual population? --Indirik 14:29, 25 March 2009 (UTC)
Correct. That would allow automatic monitoring of damage/recovery cycles of realms. --Tom 18:00, 25 March 2009 (UTC)
In terms of the second, you can use the world ID already supplied and the first name of the character to find out about them using noble.php. --Flightwing 18:57, 25 March 2009 (UTC)
Good point. When the noble.php script is official, I'll have to see if I can do something with that. Shouldn't be too difficult. --Indirik 19:21, 25 March 2009 (UTC)

There's no indication of a realm a noble is in, only their continent. And can there be a tag for their position(s)?' --Flightwing 18:53, 25 March 2009 (UTC)

I have been told that will be added when the new version of the noble.php script is approved. --Indirik 19:21, 25 March 2009 (UTC)

Name instead of ID

No guarantee that this remains available. A string comparison is more expensive than accessing a numeric primary key. --Tom 19:46, 25 March 2009 (UTC)

If you get rid of the name link, then we won't be able to dynamically link to characters from, for example, the region lord's name on region pages, or council member's names on realm pages. Unless you added character ID data to the region and realm data sets. --Indirik 21:30, 25 March 2009 (UTC)
Err, what? What would you need the ability to fetch character data from a name from? All character names on this wiki have a string type anyways, because there is no consistent naming that we could link to. --Tom 23:25, 25 March 2009 (UTC)
All family pages should named according to "(familyname) Family". This is even give to us on the Politics>Paperwork page IG, and listed in the Style Guide. Players don't always use subpages for each character, so I'm not looking into linking that far, but if they have a family page on the wiki, that's where it is. So if I have the lord character's first name, which is all region.php and realm.php return, I can pipe that through Template:FamilyLink which will check "character.php" for the lord's family name and dynamically generate a link to the lord's family page. Without the ability to do a name check against character.php, I can't get that dynamic link to the family page. As I posted on Template talk:FamilyLink, I can do a check with parser functions and display the link if the family page exists, and just make it unlinked plain text if not. If you don't find this useful, or think it's too many parser checks and data lookups for a page, then that's fine, I can skip it. I would imagine that it would generate quite a few lookups to display the realm infobox for a large realm like Enweil, CE, or Morek. --Indirik 03:21, 26 March 2009 (UTC)
It certainly would. Also, immediately returning the family name would be easier. But then you have to split the name up somehow, which isn't trivial, either. --Tom 06:37, 26 March 2009 (UTC)
+1 for keeping name lookups for the same reasons Indirik gives; it allows much more flexibility and detail to be included in templates.Wraith 21:32 5 November 2009 (UTC)

Diplomatic Relations

Would be useful, especially if you add the date modified to the info. --Jmadsen 22:27, 25 March 2009 (UTC)

Impossible as the game engine doesn't keep track. Also, wait for the new treaty system before adding anything like that. --Tom 23:25, 25 March 2009 (UTC)
I don't understand the first part. All of this data is coming from the db, is it not? For the second part, under the new system, how will other realms know when two realms are at war?
Ask them. --Indirik 03:10, 26 March 2009 (UTC)


Duchy List

A duchy list, based on realm? Is there a way to get this already that I don't see? --Paulandon 01:37, 17 August 2009 (UTC)

Looping Extension

Have you considered (or is there already) any sort of looping function extensions? I can certainly understand why you would want to be careful, but perhaps there is a way that someone could make a few useful templates but not open the functions to everyone?

Realm/duchy/region hierarchy; nobles hierarchy; list of armies are just a few examples of how the realm pages could be kept up to date automatically with loops. --Paulandon 01:37, 17 August 2009 (UTC)

Some of this stuff can be done with nested templates. Take a look at Template:Regions of. There are some issues with it, though, that we're still trying to work out. As for other stuff, some of that is not include in the external feed, as it is not available in-game. i.e. noble hierarchies, and lists of armies. --Indirik (talk), Editor (talk) 02:42, 17 August 2009 (UTC)

XML Output Examples

It may be worth mentioning that though the examples suggest spaces around the values there are no surrounding spaces in the actual output. It's unlikely anyone savvy enough to be developing tools that use the API will be tripped up by this but mentioning it may save someone a headache.

Additional Data

Just a request for some addition Data. For realm.php would it be possible to extract the founding date of the realm? I'm working on a template that allows people to easily convert the RL date an event occurred to a date based on the founding date of the realm. Something along the lines of the 2nd Day of Winter in the 5th Since the Founding of Enwiel or whatever. Currently each realm needs to make their own template that hard codes the reference date they want to use. If I had access to the realms founding date I could simply make a more generic template that accepts the realm name and extracts the founding date, assuming that dead realms still provide info to the realm.php, which maybe isn't true.

region.php I would like to see Gold and Food values, the same ones available on the region page in game. I was working on a tool to aid Lords in managing their food requirements over the seasons, and again it would be easier to be able to extract the data for each region needed, instead of having to look it up and code it in.