Jump to content
Game-Labs Forum

Public "API" for Naval Action


Recommended Posts

Guys, relax. "Information wants to be free." Someone will make a sweet, publicly -available website / map incorporating this data soon enough. I have no idea who, but I've been around the Internet long enough to know that this is the way of things.

  • Like 1
Link to comment
Share on other sites

So we still don't have a sextant and a chronometer to tell us were we are on the map....but we know now w/o ever visiting a port what is sold there. 

Nobody needs to explore anymore, you get all the info served on a silver platter. Another part of the fun of this game was burried...

 

The good thing: we can finally forget words like "simulation" or "realism" when discussing Naval Action.

 

 

 

.

Edited by Jan van Santen
  • Like 7
Link to comment
Share on other sites

Because so many people have problems with the API i will give you a sample how to get all Ports.

Result can be seen here (https://docs.google.com/spreadsheets/d/1M-wUC6pK3eQL8rwNHGH4uoAqVE-UOkGhQdML6NFQYLA/edit#gid=1565570060)

and this is the function (in Google Sheet open Tools->Scripteditor and copy this code)

function getAllTowns(){
 var options = {
     "contentType" : "ContentService.MimeType.JAVASCRIPT",
   };

var url_ports = "http://storage.googleapis.com/nacleanopenworldprodshards/Ports_cleanopenworldprodeu1.json";
eval(UrlFetchApp.fetch(url_ports,options).getContentText());// Ports
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("Ports");
  sheet.getRange(1, 1, 368, 4).clearContent();

  sheet.getRange(1, 1).setValue("Id");
  sheet.getRange(1, 2).setValue("Name");
  sheet.getRange(1, 3).setValue("NationId");
  sheet.getRange(1, 4).setValue("Nation Name");
  sheet.getRange(1, 5).setValue("ConquestFlagTimeSlot");
  sheet.getRange(1, 6).setValue("LordProtector");
  
  var index = 0;
  var Nation = "not set";
  for(index = 0; index < Ports.length; index++){
    switch(Ports[index].Nation)
    {
      case 0: Nation = "Neutral";
      break;
      case 1: Nation = "Pirates";
      break;
      case 2: Nation = "Espana";
      break;
      case 3: Nation = "France";
      break;
      case 4: Nation = "Great Britain";
      break;
      case 5: Nation = "Verenigde Provincien";
      break;
      case 6: Nation = "Danmark-Norge";
      break;
      case 7: Nation = "Sverige";
      break;
      case 8: Nation = "United States";
      break;
      case 9: Nation = "Free Towns";
      break;
      default: Nation = "not set";
    }
  sheet.getRange(index+2, 1).setValue(Ports[index].Id);
  sheet.getRange(index+2, 2).setValue(Ports[index].Name);
  sheet.getRange(index+2, 3).setValue(Ports[index].Nation);
  sheet.getRange(index+2, 4).setValue(Nation);
  sheet.getRange(index+2, 5).setValue(Ports[index].ConquestFlagTimeSlot);
  sheet.getRange(index+2, 6).setValue(Ports[index].Capturer);
  }
}
Edited by Mored
  • Like 3
Link to comment
Share on other sites

 

Because so many people have problems with the API i will give you a sample how to get all Ports.

Result can be seen here (https://docs.google.com/spreadsheets/d/1M-wUC6pK3eQL8rwNHGH4uoAqVE-UOkGhQdML6NFQYLA/edit#gid=1565570060)

and this is the function (in Google Sheet open Tools->Scripteditor and copy this code)

function getAllTowns(){
 var options = {
     "contentType" : "ContentService.MimeType.JAVASCRIPT",
   };

var url_ports = "http://storage.googleapis.com/nacleanopenworldprodshards/Ports_cleanopenworldprodeu1.json";
eval(UrlFetchApp.fetch(url_ports,options).getContentText());// Ports
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("Ports");
  sheet.getRange(1, 1, 368, 4).clearContent();

  sheet.getRange(1, 1).setValue("Id");
  sheet.getRange(1, 2).setValue("Name");
  sheet.getRange(1, 3).setValue("NationId");
  sheet.getRange(1, 4).setValue("Nation Name");
  sheet.getRange(1, 5).setValue("ConquestFlagTimeSlot");
  sheet.getRange(1, 6).setValue("LordProtector");
  
  var index = 0;
  var Nation = "not set";
  for(index = 0; index < Ports.length; index++){
    switch(Ports[index].Nation)
    {
      case 0: Nation = "Neutral";
      break;
      case 1: Nation = "Pirates";
      break;
      case 2: Nation = "Espana";
      break;
      case 3: Nation = "France";
      break;
      case 4: Nation = "Great Britain";
      break;
      case 5: Nation = "Verenigde Provincien";
      break;
      case 6: Nation = "Danmark-Norge";
      break;
      case 7: Nation = "Sverige";
      break;
      case 8: Nation = "United States";
      break;
      case 9: Nation = "Free Towns";
      break;
      default: Nation = "not set";
    }
  sheet.getRange(index+2, 1).setValue(Ports[index].Id);
  sheet.getRange(index+2, 2).setValue(Ports[index].Name);
  sheet.getRange(index+2, 3).setValue(Ports[index].Nation);
  sheet.getRange(index+2, 4).setValue(Nation);
  sheet.getRange(index+2, 5).setValue(Ports[index].ConquestFlagTimeSlot);
  sheet.getRange(index+2, 6).setValue(Ports[index].Capturer);
  }
}

Don't hardcode your making all of us sad :(

  • Like 1
Link to comment
Share on other sites

And what use the would this API be? We get an update once every day (maintenance) making almost every data we can get inaccurate except within maybe 30 minutes after maintenance. This seems quite pointless to me, someone please enlighten me.

Link to comment
Share on other sites

So we still don't have a sextant and a chronometer to tell us were we are on the map....but we know now w/o ever visiting a port what is sold there. 

Nobody needs to explore anymore, you get all the info served on a silver platter. Another part of the fun of this game was burried...

 

The good thing: we can finally forget words like "simulation" or "realism" when discussing Naval Action.

 

 

 

.

 

Aye, don't like this at all. A step closer to being an evelike spreadsheets online game.

  • Like 2
Link to comment
Share on other sites

I don't see a problem with that at least for two reasons.

1) API is mainly for out of game use since it is not implemented ingame, so it is not obligatory.

2) Tools like that already exists and will exist regardles of the API existance (example: http://www.navalactioncraft.com/shop-price).What this API does is only making it easier for guys working on community tools in development of such tools.

So basically API doesn't change much, we have tools already, only difference is now they can be made more reliable.

Those kinds of tools really help any MMO community and will exist regardless, but developers helping community in developing such tools is a good move showing us they care and want to share information we can find useful, so community tool makers don't have to reverse engineer everything.

Edited by Wyspa
  • Like 1
Link to comment
Share on other sites

You eco guys are a funny bunch.

I've heard so much about "EVE" this and "EVE" that over the last year that my ears are bleeding. But the minute we get a feature that is EVE-like it's suddenly terrible!?

 

Thay are blasphemous infiels: EVE is wonderful! And such is everything is EVE-like! Also goons ... oh wait!

Edited by victor
Link to comment
Share on other sites

Don't hardcode your making all of us sad :(

Yeah sorry,  it was only a short example and to keep it simple i decided to hardcode the nations in there. Also the code to enter the data into the table is really bad but easy to read.

In my version i use a array and write the data as a block.

function print_data(shart,data){
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName(shart);
  sheet.clearContents();
  sheet.getRange(1,1,data.length,data[0].length).setValues(data);
}

Edited by Mored
Link to comment
Share on other sites

Once the AI stops producing resources this tool won't have any negative impact.  I think we need to think of AI producing goods as temporary and not long term, as devs have stated it will be removed or very much reduced.

 

Also, I'm not sure how you can hack this or exploit it.  It is separate from Naval Action.  It is a deposit, not a connection into the game servers.

  • Like 2
Link to comment
Share on other sites

There are some disadvantages but they are really low in comparison what you can get on other information.

For Example a google docs sheet can now show you the times when a port is attackable, so you dont have to use the *sorry* crap ingame function to find out which citys are when attackable.

Link to comment
Share on other sites

Can you explain more, not sure I follow your reasoning... and you're usually right.

 

I could be wrong, but once npc port resources are eliminated, prices and quantities will be set by players.    I am guessing that trade hubs will be set up.  Players won't want to spread out across the map because not all ports can have guaranteed protection.  US players will probably produce mainly around Cabo.  Because production will be up to the player, there won't be a guaranteed "so many resources are produced each hour by the server" and these are typically bought for a cheaper price.  There will be less advantage for players who play right after Maintenance.

 

I still don't think shop data should be published, but I don't think it will really matter.  Once npcs are taken out of production, I think the economy will drastically change and this tool won't really affect it or give a major advantage.  It will mostly show where the trading hubs are.  Maybe some player will set up in a remote spot and put up gold for 130 gold each, but I doubt it.

Link to comment
Share on other sites

Cool looks good. Thx.

 

Recently we've finished preparing server data for public access and now we are ready to share it with community

Currently we prefer to avoid extra load on our servers so "API" does not contain run-time information, instead we're making dump of all data each time when we do maintenance and export it to google storage

All information about shard contained in 4 files:
- ItemTemplates_*.json
- Shops_*.json
- Ports_*.json
- Nations_*.json
where '*' replaced by internal shard name (ex. ItemTemplates_cleanopenworldprodeu1.json) and stored at google storage (ex. https://storage.googleapis.com/nacleanopenworldprodshards/ItemTemplates_cleanopenworldprodeu1.json)

From this data you can access description about all item templates in game (not items), shop content, port statuses and national information, but there is no player specific data

Also, in here (http://pastebin.com/Q68M53ev) you can find simple tool based on top of this data - TradersTool, which allows to find specific items/resources/materials/... within specified range from port and filtered by nation

Edited by Joo
Link to comment
Share on other sites

×
×
  • Create New...