Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

Donate!

pls donate


#1 2018-06-03 00:28:42, last edited by ninjasupeatsninja (2019-04-30 00:04:09)

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

[RELEASE] Minimap Viewer

Minimap Viewer

Get minimaps of your world programatically via a simple URL.

What does it do?
It gives you an image of your world.

Are the images realtime?
No. The image of your world is generated when the URL is called by the saved data in BigDB ( i.e. it generates a minimap of you world as of how it looks when you last saved it ).
Afterwords, the images are cached for one hour so it should load faster after the initial loading.

How do I use it?
Simply link an image over to https://mm.sirjosh3917.com/<worldid> and let the API do the rest.

Is it case sensitive?
Yes.

How accurate is the minimap?
Pretty accurate, though it could be better. It (should) handle transparency and the like just fine, though I haven't tested this in depth.
It'd be great if I could have some worlds with lots of transparency so I can compare the original minimap with the generated one and see how well it does.

How do I know it won't die immediately like the last one you made?
I'm hosting this one on a VPS so it won't kill my internet and it'll be faster for all of you.

Does it respect worlds with MinimapEnabled set to false?
Yeah.

Does it respect visible false?
Yeah.

Example of it working?
v | See below | v

Removed Features

PW01
PWL17t1R6bbUI
PW5m6ANVwRcEI

Offline

#2 2018-06-03 01:14:28

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,795

Re: [RELEASE] Minimap Viewer

Cool!

ninjasupeatsninja wrote:

Does it respect worlds with MinimapEnabled set to false?

does it respect worlds with /visible false?

Offline

Wooted by: (3)

#3 2018-06-03 05:54:51

icepegasus
Member
Joined: 2015-08-21
Posts: 64

Re: [RELEASE] Minimap Viewer

hummerz5 wrote:

does it respect worlds with /visible false?

I don't think that's an issue. People with visible false don't want other players joining their world. They don't care about minimap (that's how I see it)


user.php?id=icepegasus

Offline

#4 2018-06-03 06:51:18

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

Let's settle it with a poll.

Straw poll/

It ends on June 9th 12:00 AM UTC time.

If anybody knows of any good strawpoll alternatives, let me know.

The API will, for now, be built to respect both 'MinimapEnabled' and 'Visible' until the poll results come in.

Offline

#5 2018-06-03 09:07:28

LukeM
Dev Team
From: England
Joined: 2016-06-03
Posts: 2,877
Website

Re: [RELEASE] Minimap Viewer

I guess visible false could sometimes be used to keep worlds a secret until they are released, so might be best not to show the minimap if it's not visible.

Offline

Wooted by: (3)

#6 2018-06-03 13:00:55

capasha
Member
Joined: 2015-02-21
Posts: 3,817

Re: [RELEASE] Minimap Viewer

Looks good. Maybe you should try to make something similar in JavaScript.
LukeM know how to code in JavaScript maybe he can help you with databases?

Offline

#7 2018-06-03 13:47:23, last edited by LukeM (2018-06-03 13:49:56)

LukeM
Dev Team
From: England
Joined: 2016-06-03
Posts: 2,877
Website

Re: [RELEASE] Minimap Viewer

capasha wrote:

LukeM know how to code in JavaScript maybe he can help you with databases

No idea how I've managed to completely avoid such a huge part of online programming but I've never actually used a database XD

Edit: Also what do you mean by make it using javascript? Make something you can run client side to generate the minimap? (This is a serverside program so it shouldn't matter what language it is written in, you can make a request from pretty much any language)

Offline

Wooted by:

#8 2018-06-03 14:07:21

capasha
Member
Joined: 2015-02-21
Posts: 3,817

Re: [RELEASE] Minimap Viewer

LukeM wrote:
capasha wrote:

LukeM know how to code in JavaScript maybe he can help you with databases

No idea how I've managed to completely avoid such a huge part of online programming but I've never actually used a database XD

Edit: Also what do you mean by make it using javascript? Make something you can run client side to generate the minimap? (This is a serverside program so it shouldn't matter what language it is written in, you can make a request from pretty much any language)

Hasn't you made bot's before in JavaScript? Shouldn't be that hard to use database objects that way too if you are good at JavaScript.
Atilla have had so many issues to run as example mono programs. So I guess it would happen the same for ninja.

Offline

#9 2018-06-03 14:08:51, last edited by ninjasupeatsninja (2018-06-03 14:09:07)

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

capasha wrote:

Looks good. Maybe you should try to make something similar in JavaScript.

Already have. You can use jsparse to feed it some "init" data, or just load from the BigDB, deserialize that, and make a minimap as well.
Not sure how that went unnoticed https://wiki.everybodyedits.com/images/c/c0/069_LOL

capasha wrote:

LukeM know how to code in JavaScript maybe he can help you with databases?

All I need to do is parse the BigDB, and atilla's World library does that just fine. It'd just need to be "ported" to javascript.

Offline

Wooted by:

#10 2018-06-03 16:15:13

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

Open sourced the inner MinimapViewer API.

This is what the official API will use internally to get and fetch minimaps.
I rewrote the first MinimapViewer and open sourced it in case anybody wants to make their own custom alternatives.
Please review the source code and suggest improvements
The code in the github repo will go into effect on June 9th. Expect that by June 10th UTC time, the official API will use these improvements

Offline

Wooted by: (2)

#11 2018-06-12 11:14:32, last edited by ninjasupeatsninja (2018-06-12 11:52:51)

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

The MinimapViewer API is now running the updated version of the code.

New link shorteners: minimap.sirjosh3917.com and mm.sirjosh3917.com
If you like the MinimapViewer API, please woot the suggestion topic for it

The official API is running off of this code right here
There are a few new features:

Feature Note:
You can append a ?format=x to the end of a /metadata or /worlddata request to get it in a different format. Supports json, xml, csv, defaults to a custom (awful) format, plaintext.

Old links to /world/PW01 as images will still work, though it's recommended to update them.

Offline

#12 2018-06-12 18:09:30

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

MinimapViewer Updated & Fixed

New (left) v.s. Old (right)
explorer_2018-06-12_13-04-33.png

Minimaps now handle transparency and background colors properly.
See the commit for more details.

The API will be back up in under 20 minutes

Offline

#13 2018-06-12 20:07:37

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

New Update

More detailed error messages
See the Settings.CS file for detailed information on what errors look like

{"Error": "The world does not exist in the BigDB (or the world was unable to be loaded). Please check that you spelled the World ID correctly."}
{"Error": "World disrespects the guidelines:\r\nThe world's MinimapEnabled setting (False) doesn't match the desired MinimapEnabled (True)"}

Update will be applied in under 20 minutes, please wait for the API to restart.

Offline

#14 2018-08-28 05:19:35

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

Expected Downtime

There will be downtime for an unspecified period of time, perhaps a long one.
I will be moving from NancyFX to ASP.NET Kestrel ( asynchronous request performance ) and on .NET Core ( new DotNetCore binaries from PlayerIO ), and this will require a major rewrite to do things properly.

Offline

#15 2018-09-03 06:56:56

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

Laziness

To be entirely honest, I don't feel like re-coding the MinimapViewer API despite it badly needing one.
However, it has beem moved to ASP NET with Kestrel using fancy asynchronous stuff (true async, not the bullcrud nancy does) and it's mostly a hackjob of how it's up and running (caching was removed, a few other things), but at least it's up and running.

Offline

#16 2018-11-24 03:18:21

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

Revitalization Update

New Feature: the ?scale query parameter
The ?scale parameter will scale an image 1x, 2x, or 3x it's original size.
Example: PWlAgeabQ_b0I?scale=1 PWlAgeabQ_b0I?scale=2 PWlAgeabQ_b0I?scale=3

In other news...
The API has been revitalized - it's now using ASP.NET Core properly, along with some other improvements down in the caching center which should help speed up the experience for you.

New Internal API changes!

  • We use ImageSharp now, which should bring some performance improvements over the old Bitmap way of doing things

  • A rewrite of the MinimapViewer API, which should help cleanup the old mess that it was

  • We use caching more than ever, and it should help with performance a lot!

As for the cache times:

  • A given World is cached for 3 hours

Offline

#17 2019-04-29 23:57:31

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

Hosting Updates

Artificial Limits Increased: ?scale can now go to 4x
Example: PWlAgeabQ_b0I?scale=1 PWlAgeabQ_b0I?scale=2 PWlAgeabQ_b0I?scale=3 PWlAgeabQ_b0I?scale=4

In other news...
The hosting box has been moved to an Azure VM, providing blazing fast performance and internet speeds, as long as high costs ;-;
I'm not sure if I'll stay here but for the time being it's fast.

New Internal API changes!

  • LazyCache is used for caching now.

  • Scale incresed to 4x

  • Rewrite of the hosting server, but not of the minimap viewer API

As for the cache times:

  • A given World request is cached for 6 hours, but will be removed from the cache if not accessed for 30 minutes

  • A given World image is cached until it's not accessed for 5 minutes

Offline

Wooted by: (2)

#18 2019-06-06 23:23:21

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 2,007
Website

Re: [RELEASE] Minimap Viewer

BETA Forum Release!

HUGE thanks to SmittyW for helping out create the design of the world info box and error images!

That's right, minimaps finally have come to the forums!
Please see the official announcement for information on how to use the service.

Release Information

Because this is a BETA release, expect there to be some mild bugs. If you find anything, report about it! Want something added? Suggest it!

API Modifications
  • + Additional /username/<simpleid> endpoint

  • + Additional /world/update endpoint

  • * Enhancement of /world/metadata/<worldid> endpoint

  • - Removal of the /world/worlddata/<worldid> endpoint

  • /username/<simpleid> - An endpoint to return only the username and simpleid of a user based on their simpleid.

  • /world/update - Endpoint for users. Wipes the cache of a world.

  • /world/metadata/<worldid> - Additional UserName key, which can be null. If it's not null, loading the /username/<simpleid> endpoint with the worlds Owner simpleid will set it to the username of the owner.

Caching

The MinimapVIewer API is notorious for caching heavily, and in this latest release, there are layers upon layers of caching.
In order to clear the cache of a world, head on over to http://api.sirjosh3917.com/world/update. Type in your World ID, click submit, press the checkmark on the recaptcha, press submit, and you'll be redirected to an image of your world. All new modifications should be shown!

Minimap requests:

1. You make a request for a minimap
2. Is it in memory? if so, return it.
3. If not, is it on disk? if so, add the file to memory, queue up a request to update the minimap, return the image.
4. If it's not on disk, request a world, create a minimap from it.

When a minimap is requested, it needs to fetch the world. A request for a world is very similar:

1. Request for a world is made.
2. Is it in memory? if so, return it.
3. If not, is it on disk? if so, add the file to memory, queue up a request to update the minimap, return the image.
4. If it's not on disk, download it from PlayerIO

Thank you for your time!
Click to play PWlAgeabQ_b0I!

Offline

ninjasupeatsninja1559859801751791

Board footer

Powered by FluxBB

[ Started around 1571881904.8008 - Generated in 0.085 seconds, 12 queries executed - Memory usage: 1.62 MiB (Peak: 1.87 MiB) ]