Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 35

Thread: Utopia Target Finder Contest

  1. #16
    Post Fiend
    Join Date
    Dec 2016
    Posts
    142
    You might want to fix this: http://imgur.com/a/dwzcJ

  2. #17
    Forum Addict
    Join Date
    Dec 2011
    Posts
    1,030
    Quote Originally Posted by chadde View Post
    You might want to fix this: http://imgur.com/a/dwzcJ
    What function are you using? I'd think using jQuery.getJSON() wouldn't throw that error. Can you confirm?

  3. #18
    Post Fiend
    Join Date
    Dec 2016
    Posts
    142
    Quote Originally Posted by munk View Post
    What function are you using? I'd think using jQuery.getJSON() wouldn't throw that error. Can you confirm?
    I was using jQuery.ajax() which should be the same thing. Just tried using getJSON() instead but it also throws the error. I think you need an access-control-allow-origin header on the server.

  4. #19
    Enthusiast
    Join Date
    Aug 2011
    Posts
    332
    Works flawless with PHP here..

  5. #20
    Regular
    Join Date
    Jun 2014
    Posts
    78
    Darkmoore, you probably using Curl to access the data. Doesn't send an origin header like a modern browser does. I experienced the same.

  6. #21
    Enthusiast
    Join Date
    Aug 2011
    Posts
    332
    I am using file_get_contents() and json_decode()

    I used CURL when they did not provide the dump.

  7. #22
    Veteran
    Join Date
    Jan 2009
    Posts
    507
    Ehm, the contest rules state that "Submission should be a solution based entirely on javascript and some CSS - You may use D3 / jQuery solutions.". So for a valid contest entry this means you have to request data in the browser (via ajax or fetch).

    In order for this to work on a website hosted on any other domain than utopia-game.com, access control headers must be set on the json response from the utopia server. (As a workaround, fiddle with browser settings or install an extension that overrides this header, or fetch the json serverside and proxy it.)

    (as mentioned before, since you have to write a clientside app, not a serverside app, the resulting tf will be kinda lame, as no historic data is available from the json response you have to work with)
    Last edited by Yadda9To5; 20-04-2017 at 14:44.
    http://www.upoopu.com/: an intel repository (or: "pimp alternative") for utopia (read the guide).

  8. #23
    Regular
    Join Date
    Jun 2014
    Posts
    78
    Quote Originally Posted by Yadda9To5 View Post
    Ehm, the contest rules state that "Submission should be a solution based entirely on javascript and some CSS - You may use D3 / jQuery solutions.". So for a valid contest entry this means you have to request data in the browser (via ajax or fetch).

    In order for this to work on a website hosted on any other domain than utopia-game.com, access control headers must be set on the json response from the utopia server. (As a workaround, fiddle with browser settings or install an extension that overrides this header, or fetch the json serverside and proxy it.)

    (as mentioned before, since you have to write a clientside app, not a serverside app, the resulting tf will be kinda lame, as no historic data is available from the json response you have to work with)
    Yes, this is true. The metrics from only a current set are mostly informative, but you can't really make an informed decision with it. Perhaps when looking for a kd to war, you'd like to avoid a full Avian KD.

    But, this is only for this contest. No-one stops you from storing the data every 15 minutes in your own database and make a tool for that :)

  9. #24
    Enthusiast
    Join Date
    Aug 2011
    Posts
    332
    Quote Originally Posted by Patrijspoortje View Post
    Yes, this is true. The metrics from only a current set are mostly informative, but you can't really make an informed decision with it. Perhaps when looking for a kd to war, you'd like to avoid a full Avian KD.

    But, this is only for this contest. No-one stops you from storing the data every 15 minutes in your own database and make a tool for that :)
    My solution is based on PHP/JQuery/MySQL. I am on the other hand, not submitting anything to the contest either. My solution was ready before, the contest started and for sure does not meet the requirements needed to implement it in-game 

  10. #25
    Veteran
    Join Date
    Jan 2009
    Posts
    507
    Quote Originally Posted by Darkmoore View Post
    My solution is based on PHP/JQuery/MySQL. I am on the other hand, not submitting anything to the contest either. My solution was ready before, the contest started and for sure does not meet the requirements needed to implement it in-game 
    You could do it backwards, serve json from your targetfinder with the right access-control headers so you can access it client-side ingame. (any tf that is less feature full than yours is a waste of space, so it'd be nice to have something similar to yours ingame, though while it should work it likely is still a breach of requirements, and i suppose the owners don't want to be too dependent on things hosted outside the game)
    Last edited by Yadda9To5; 20-04-2017 at 17:27.
    http://www.upoopu.com/: an intel repository (or: "pimp alternative") for utopia (read the guide).

  11. #26
    Post Fiend kendy's Avatar
    Join Date
    Aug 2016
    Location
    Kendra Page Park
    Posts
    185
    http://www.************.eu/

    I have always used this, and the "random" button on the KD page. Gee if this keeps up somebody will make a bot so I can play all 25 provs by myself.

    lol CENSORED <removed>

    why is a contest censored?

    I also like upoopu more than munk Yadda
    Last edited by Palem; 21-04-2017 at 03:20.

  12. #27
    Forum Fanatic khronosschoty's Avatar
    Join Date
    May 2010
    Posts
    2,506
    upoopu (which I do not like) > munk.
    #magi

  13. #28
    Member
    Join Date
    Nov 2009
    Posts
    21
    Darkmoore. I suspect you've got an answer for your question regarding the total province count discrepancies. If not, I ran into this when building a target locator for my kingdom. It's a bug in the dump caused when a kingdom contains a province which has no owner (ie. disbanded province)

  14. #29
    Enthusiast
    Join Date
    Aug 2011
    Posts
    332
    hylandor: Good stuff.. thanks for the info..

  15. #30
    Veteran
    Join Date
    Jan 2009
    Posts
    507
    Too late for the contest, but i'm not seeing any submission yet ;) So here is a start, only working with the provided json list, no server-side stuff (which is cached on build time since the live data does not provide the right access control headers, the data is stale) https://utopia-things.gitlab.io/targetfinder/

    What i want to add is:
    • Ready kd data instead of prov data (based on the same input)
    • Ready make kd numbers link to ingame k
    • Not going to be there, i have no clue how to implement it sanely make clicking on province go to thievery (but making that useful is finicky, since you need to make a post request, setting thievery to the right kingdom)
    • While i tried to build on the utopia css styles, some work is likely needed to make it fit with the default style and third party styles.


    It's pretty basic, things like honor aren't listed, there simply is no room in the tables if it's supposed to fit in the in game window ;) Besides, who looks at that anyway, if that's f your consideration you probably want to compare to historic data as well, and that isn't available by design (unfortunately this also makes things quite sluggish on old hardware, processing 600kb of json to show data can be heavy, if creating a json api that can be consumed in-game is acceptable, i'll not mind doing that so more interesting data is available).

    (the used parts are in https://gitlab.com/utopia-things/tar.../master/client and https://gitlab.com/utopia-things/tar...argetfinder/js contributions are welcome :) the rest is server-side processing and database cache, which is not used currently, eventually i'll add that and host it myself)
    Last edited by Yadda9To5; 28-04-2017 at 13:32.
    http://www.upoopu.com/: an intel repository (or: "pimp alternative") for utopia (read the guide).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •