triplea-game / triplea-game.github.io

TripleA Website
https://triplea-game.org/
GNU Affero General Public License v3.0
12 stars 16 forks source link

Maps Page #33

Closed ghost closed 7 years ago

ghost commented 8 years ago

I am creating this thread as a place for discussion on the map page that I am currently working on. The project will potentially be the only dynamic content on the site, with the JSON features of Javascript being used to edit the DOM upon page load. A few things have already been discussed in #11.

Current Features being worked on

I will soon be pushing to a maps_page branch. I welcome and any ideas or comments you leave below.

Here is a screenshot of how it looks currently:

Maps Page Screenshot

Roadmap

Work will continue to take place in the maps_page branch.

DanVanAtta commented 8 years ago

One note, the github API automatically pages the response, need to add some args to see the full list: https://api.github.com/orgs/triplea-maps/repos?page=1&per_page=10000

The API rate limit is an interesting problem. Another solution would be to regenerate the static content and republish every now and then. Thinking along those lines, we could add a deploy hook to each map to invoke a script that will regenerate the site content. Then each time the maps are updated, so will the site.

ghost commented 8 years ago

Interestingly, I just found out that Jekyll supports "Data Files," which basically would allow us to put the JSON file in the _data folder and call it into a page via the site.data variable. This seems way easier than coding a DOM script.

ghost commented 8 years ago

@DanVanAtta You are a lot better at automation than me. I looked at the maps project, and it seems that a little script could run every time a commit is made to a map that will take the JSON and place it in the _data folder and name it maps.json. Now, I am using that file name by manually downloading it right now for testing purposes. If we get this, I have figured out the rest.

ghost commented 8 years ago

I have confirmed that the _data method works, and have generated a simplistic maps page from the JSON. I also have begun an issue here to discuss other elements of the maps page. Here is a screenshot of the page in progress:

maps750

I am against a wall until either we add new map images and info, or we can figure out how to setup the automation of the JSON. Here is a issue I just created dealing with the map requirements.

DanVanAtta commented 8 years ago

@williamdekryger , the map config file is now yaml: https://github.com/triplea-game/triplea/blob/master/triplea_maps.yaml

  1. Where does it need to get dropped?
  2. How does the file work for you? The path to small images I spotted hardcoded in the game code, but it is standard.
ghost commented 8 years ago

@DanVanAtta I'll be grabbing that and pushing the to the maps_page branch pretty soon. It is the _data folder, but obviously I'll need to put in in for now, as I'll code the page around it.

ghost commented 8 years ago

@DanVanAtta Ok, a few concerns.

First, the descriptions are way too long to be displayed on the listing. Is there any way we could have a short, one sentence description for the listing, then a longer one for the individual page?

Also, the map images are part of the description, and not every map has one. We should go around and take screenshots of maps that have none, and make the map image its own element in YAML.

There are a few others that I will not put here. Would it be possible for me to add to the file a bit to suit the website, while keeping the parts that the engine needs?

ghost commented 8 years ago

@DanVanAtta I just noticed that the images were hosted on Sourceforge as well...

DanVanAtta commented 8 years ago

@williamdekryger , still in progress? If so, could please suggest an example JSON entry. I believe that would be a good basis for determining how to better structure map data

ghost commented 8 years ago

So, on this project, I found that in reality filling a maps page with values from a file in the _data folder is quite simple. I tested it with the JSON that the Github API spits out, and really liked that we could even have number of stars in our listing. I haven't tried the YAML file yet, but that would be relatively easy to add as well, and would be better for the long term as it can be controlled by the map-makers.

There are a few roadblocks in this project. First of all, we need a mechanism to get the YAML file into the _data folder every time it is updated. Maybe a bot of some sort could do the trick. Also, I want to know if I may add some more fields to the YAML file that I could manipulate to have some more information for the listing.

I would like to add a separate field for "pretty" map name (like Age of Tribes, instead of age_of_tribes), image (since currently it is just included in the description), the short description (for the listing), and era. I am more than willing to set this up for the existing maps, but I'd like map-makers themselves to be able to choose these in the end. Images are currently hosted on Sourceforge, so I'd also like to bring those over to Github somehow.

So this is the status of the project. In the end, I want it to be how the map-makers want it, so I may end up starting a thread on the forums about this.

FrostionAAA commented 8 years ago

Concerning thumbnails and where to put them, right now I have my maps’ thumbnails uploaded to the maps' Github folders, like this (link from the yaml file): img: https://raw.githubusercontent.com/triplea-maps/star_trek_dilithium_war/master/description/StarTrek_mini.png

To me it seemed to be a good, reliable and long term place to upload the image at the time, and it would be easy to drag, drop and replace the image with a new one with new dimensions at a later time. I didn’t really consult any developer before doing this, so I don’t know if it was a good idea?

DanVanAtta commented 8 years ago

@FrostionAAA , that is fine. The image location is going to be pulled from the "img" tag in the maps.yaml file. Ideally we would use github cloud hosting for the images where possible to keep the download and map repo sizes smaller. (example, select an image, attach to this issue, that gives you a hosted URL that is then always valid, cancel the comment, and walk away with the image URL)

FrostionAAA commented 8 years ago

@DanVanAtta and @williamdekryger (As you propose / request map thumbnails at https://github.com/triplea-maps/Project/issues/16 )

Right now, I can see that the folder ”description”, a folder I made and placed beside all my maps’ ”map” folders is actually downloaded along with the maps. The description folder contains the thumbnails displayed at my maps in the download maps section of TripleA. I didn’t know by the time that we would change the download procedure to now include downloading the entire master folder. This is of course not optimal.

Should we not have a dedicated folder somewhere on GitHub to store every maps thumbnail pictures? Every map could have a full size and a smaller one uploaded, files also fitting the website “maps page” and thumbnails to fit the TripleA program download section.

If a storage site is given I will gladly update my six current maps’ XMLs and also upload the required thumbnails and full scale pictures. But until then the thumbnails (approx. 0.25 MB large) are stored by my maps .Before every single map soon needs an image link we should have the location standardized I think.

DanVanAtta commented 8 years ago

@FrostionAAA , simply upload your images to a github issue. That will give you a link to the image. That link will then always be good whether you go on to create the issue or not. So from then on, just use link.

Should we not have a dedicated folder somewhere on GitHub to store every maps thumbnail pictures?

So no. Centralizing items is also a bad idea. The complete map data should be contained in the map repo, so when we remove one, it is completely removed, and same if we add a map repo.

The maps.yaml file is a violation of this. IT is something to fix one day so that the maps.yaml file truly auto-updates when a map repo is updated.

I didn’t know by the time that we would change the download procedure to now include downloading the entire master folder.

I didn't really either, but by popular demand.. Too many people were having trouble finding the 'releases' section. Plus also the not having to update URLs when maps update is a nice benefit.

DanVanAtta commented 7 years ago

@williamdekryger most of the infrastructure should be there in terms of data being published. Assigning to you, I for one at least am still interested to have this project move forward.

RoiEXLab commented 7 years ago

@williamdekryger Are you still working on this? Anyway I'd recommend deleting the maps_page branch until something is actually changed...

DanVanAtta commented 7 years ago

@RoiEXLab Keeping the branch around is pretty harmless.

IIRC we have the map data feed infrastructure in place, just need need to finish the map parsing (which quickly leads to needing standard map data in various locations, the data from triplea_maps.yaml is not very rich) . I suspect if anyone wants to pick this up, they would be welcome to.

ghost commented 7 years ago

@DanVanAtta @RoiEXLab FYI, I'm just about to the point where I'll have some time to wrap this up. As you both might remember, there is a live page already on the site for testing purposes that has most of the progress so far.

As of right now, the only change I think we need to see before this replaces the current maps page is to get the download links to do something useful. (Right now, the links are broken, pointing to a page that I haven't written yet which will point the user towards downloading the map in-game.)

I think we can get this page working with the information we currently have in triplea_maps.yaml before coding for additional data. The idea there is that we support it on the maps page, do it ourselves for official "project" maps or MIA authors and then allow any present map authors to do their own information. Obviously what we add will not always be in depth as the level of detail we want to support or what would be possible to include.

Definitely planned is some sort of individual maps page for any map maker that wants to do some additional advertising (I see at least @FrostionAAA and hepster jumping on that), but that's a while down the road. I'm going to see if I can get this listing live.

ghost commented 7 years ago

@DanVanAtta @RoiEXLab I worked a bit on this today and wanted to show some progress.

I've gotten it so that the "Download" buttons kick the user over to this page here:

screen shot 2017-05-17 at 8 24 10 pm

The notification on top is an addition to steer the user through the process and remind them of the map name while they move through the map downloading instructions. The map name and URL are communicated through GET (which is in the url, so like "http://www.triplea-game.org/downloading_maps/?name=Tutorial&url=https://github.com/triplea-maps/tutorial/archive/master.zip". This gets us around the limitations of client side scripting a bit. The old map installation instructions page, which also has been live for some time here, now has a download button near the manual map installation instructions like so:

screen shot 2017-05-17 at 8 24 22 pm

The idea is to steer the user away from using this option and try to get them to use the in-game download. Of course, what would be great would be if TripleA had some deep-linking capability where I could have a download button that opened TripleA and downloaded the map, but this will do, I think.

If you have any other thoughts or suggestions, I'll gladly hear them. I'm nearing the point where I push and send a PR. This is close to being production-ready, I think.

RoiEXLab commented 7 years ago

I did some quick research and it would be possible to launch triplea and download the map when clicking on a link. We'd need to configure install4j to enter some values into the registry and add a url handler to triplea which initiates the download and we should be good to go! Will take some time though... We May need to change the way downloads are currently handled

RoiEXLab commented 7 years ago

Would be possible on linux as well, but there would be more custom cases to handle

ghost commented 7 years ago

Right. Steam, Github, and many more have these types of implementations. I guess it would depend on those who were doing the work 😉

RoiEXLab commented 7 years ago

I opened https://github.com/triplea-game/triplea/issues/1723

RoiEXLab commented 7 years ago

@theredbaronaaa I believe I found a solution to your problem. There is a way to create a site for each individual map. When my current PR gets merged I could create a sample page

RoiEXLab commented 7 years ago

@theredbaronaaa The "new" maps pages are now live. Have a look yourself: http://www.triplea-game.org/maps-list/ After #202 being merged feel free to edit the maps-list pages however you like in order to replace the current maps page...

RoiEXLab commented 7 years ago

I removed the maps_page branch, because its just getting older and older... If we needed it in the future I'd suggest creating a PR for master and mentioning this, so we can then create a new branch from master and merge the PR into that if it needs more work...

DanVanAtta commented 7 years ago

@theredbaronaaa can you give you a really quick update on this project at all? It may be useful to after to cap off any current efforts and get them merged in.

RoiEXLab commented 7 years ago

In #246 a link is provided for this page, the latest TripleA pre-release allows users to download maps directly from the website.

DanVanAtta commented 7 years ago

Thanks for the foundation @theredbaronaaa and picking this up @RoiEXLab . Will close, this ticket was before github had 'project's, this was an early project tracking thread. Given the maps page is launched, we can create new threads to pick up new topics.