Page 1 of 3

Project Reality Mapviewer

Posted: 2015-12-07 18:09
by Senshi
Image
No pics, no clicks, I know: So click here to dive right in!


What is this?
Simple: It's a map viewer that allows to interactively view all the maps PR offers (2D only ;) ). Think of Google Maps, but for PR. Navigation not included.


Okay, but why?
I always felt an interactive mapviewer is something PR always lacked, and with my investment in the PR tournament, I decided to pick this project up again, because it might be useful for strategists. And going from the feedback I got from there, it seems like people like it.

Are you a nerd?
Considering I've been on-and-off working on the underlying mod explorer tool for years, I think the safe answer is YES. It's ~9000 lines of Java code by now, and is able to parse and reconstruct almost the entire BF2 game database in json/xml.

The map viewer is really just a side project I've picked up a couple months ago, because I wanted a better implementation for my wiki (another side project, see sig).

Hey, this doesn't work as well as Google Maps does...
The mapviewer is certainly WIP, but I feel it's pretty useful by now. It works on most major browsers: Chromium, Firefox, IE11 & Edge. Surprisingly, Edge currently works even better than Firefox, though it's just some visual offsets, nothing game-breaking. It even works on my Android smartphone, though it's not really fun with the tiny screen. I'm still not super happy with the interface design, but it hasn't been a priority (function first!).
Also, this is my first project that involves more than "Hello World" Javascript and CSS...

The best part (for me) is: Updating the entire thing takes me two clicks and a batch-upload of ~490 files (~22MB total). That means whenever PR gets patched, I don't have to comb through all files for changes, but instead just recompile it automagically :) . This means that you can expect the mapviewer to be updated very shortly after an update.


Why do I only see this now???
I presented my first WIP versions with rudimentary functionality and a lot of web design bugs back in the PRT forums (Original thread here), but exposure there is obviously limited. Most PR players hang out in this here forum.

To increase exposure and get more feedback on possible bugs and user wishes, I'm presenting the viewer here to a wider audience. Feel free to use it frequently and share it to non-forum-goers. And PLEASE, come back here and yell at me if things are broken/unintuitive/missing that you would like to have. Only then can I know where I can improve it!


Currently implemented features:
  • All maps, all gamemodes
  • Super high res tiles (2048?px for 1km, 4096?px for 2km, 8192?px for 4km maps). This means at least double the resolution of the ingame map.
  • Subtle color range corrections on all maps to make them easier to read
  • Zoom& pan maps
  • Clickable vehicle icons for additional information
  • List presentation of all vehicles for both teams (filter for one team only by pressing the "Team" buttons above the list or collapse the list entirely by clicking the big tank icon in the top right)
  • Clickable flags (incl. radius circle) with all info
  • Visual representation of AAS routes. Individual routes are toggleable using the big button in the top right header
  • Clickable combatareas ("dome of death") with relevant info
  • Layers can be toggled off/on as desired (use the small white layers-icon on the top right of the map)
Current feature wish-list:
  • Show actual individual soldier spawners in base, grouped by selectable spawnpoints
  • Show information about kit availability and composition for each gamemode faction
  • Show general information about the map (size, viewrange, fogrange...)
  • Link assets in asset list with their icons on the map (e.g. highlight map icons when hovering over the corresponding list entry, and vice versa)
  • Ability to draw on map. And save it/forward/share it. This is a big one, and is still far, far away.

Looking forward to your feedback!

Re: Project Reality Mapviewer

Posted: 2015-12-07 20:47
by Mats391
This is awesome. Now i have to slap Turista until he integrates it into the map gallery :D
One thing i find a bit annoying tho: When you open a map you are centered on the top left corner of the map. Would make sense to center it to the mid of the map.

Re: Project Reality Mapviewer

Posted: 2015-12-08 06:47
by solidfire93
cutting edge shit right here !

Amazing work here m8.

i like it, keep up the good work.

Re: Project Reality Mapviewer

Posted: 2015-12-08 07:42
by My_Self
Wow this is incredibly useful.
Only thing is the lack of assets conditioned by capturing first flag (see Muttrah or Beirut AAS).
Thank you so much for the Google maps of PR :)

upd: The other issue i've noticed is sometimes it doesn't let you choose gamemode after choosing the maps by clicking the layers button. You have to reload the page manually.

Also, is it possible to show ticket cost for each asset?

Re: Project Reality Mapviewer

Posted: 2015-12-08 08:16
by Senshi
Thanks for the responses, guys.

@Mats: Fixed for next version. Just changing two numbers was necessary :) .

@My_Self:
First flag assets: Odd that I never noticed that. Thanks for the report, I'll have to look into that. That certainly is a must-have.

Layers button? You mean the "choose gamemode" subtitle? Odd, that always works for me. Sometimes however the map stays empty when switching map (not gamemode). Apparently some race condition that I've monitored for some time, but haven't tracked down yet.

Re: Project Reality Mapviewer

Posted: 2015-12-08 08:30
by My_Self
Senshi wrote:Layers button? You mean the "choose gamemode" subtitle? Odd, that always works for me. Sometimes however the map stays empty when switching map (not gamemode). Apparently some race condition that I've monitored for some time, but haven't tracked down yet.
Yes, the #Map-button one. Weird, I can't reproduce the issue now either.
The way I did it before was:
1. Go to tournament.realitymod.com/mapviewer , choose a map and a gamemode
2. Click #Map-button, choose another map
3. The result was that "MapGallery" value in #SubTitle-title was never replaced with "Choose a gamemode" dropdown.
Must've been a load issue.

upd: There it is. Notice Barracuda showing Kashan gamemodes.
I'm on Chrome 46.0.2490.86 m, Win 8.1 Pro
Image

Re: Project Reality Mapviewer

Posted: 2015-12-09 03:15
by Evox
wow! nice work!

Posted: 2015-12-09 23:30
by Stalker[SpecOps]
Awesome job!

Re: Project Reality Mapviewer

Posted: 2015-12-10 12:47
by Senshi
Updated
  • Map now focuses on the center of the map instead of topleft corner on opening
  • Fixed Dragon Fly skirmish overlaying every other gamemode
  • Improved number formatting (seconds are properly converted to mm:ss for respawn times)
  • Added recognition and display of maxnrofobjects spawners (more than one vehicle can spawn from a single spawner, if the first vehicle has been moved from the spawn location).
  • Added recognition and visualization of spawner-ownership (link between object and flag: Object only spawns if the flag is held by the correct team).
    This means objects that will only spawn once a formerly neutral/enemy flag has been captured are now shown properly (see Muttrah City).
    Visualized by orange line when hovering the cursor over an icon.
  • Added handling of spawners that spawn different objects depending on who controls the parent flag (not sure if PR uses this anywhere, so not tested, but it should work)
EDIT:
@My_Self: Thanks for reproducing it.
I'm pretty sure I know what causes this. The process of loading a map and its gamemodes takes some time (JSON and icon images have to be downloaded and parsed). The interface is not blocked during this, so you can move around the map already, and the icons and features will "pop in" when they are ready.
And as particular UI elements such as the gamemodelist can only updated once the gamemodelist has been read and parsed, you can basically overtake the parsing and have loaded an entirely different map in the meantime. Currently the mapviewer doesn't recognize it has to abort/discard the old loading and start a fresh one, possibly throwing everything into chaos. Async-load handling is annoying, and I'll need a couple of free hours to make a good handler for this. Especially as I don't consider it overly critical :) .

Re: Project Reality Mapviewer

Posted: 2015-12-11 06:21
by My_Self
Yep, it's certainly not game-breaking, just slightly annoying.
Some other bugs:
  • Asad Khal tiles are messed up
  • Tad Sae and Wanda Shan skirmish overlaying AAS

Re: Project Reality Mapviewer

Posted: 2015-12-11 07:33
by Senshi
Both fixed.

Asad was caused by the source file not being a multiple of 2 in size (2054 instead of 2048px, making the tile-generator generate an extra set of tiles...)
The others were caused by GPO files being left in the "Editor" subfolder. Now shouldn't happen again, I've marked that folder to be always excluded in parsing.

Re: Project Reality Mapviewer

Posted: 2015-12-11 08:48
by CR8Z
Totally awesome!

I'm not suggesting that you go and do this, but when I used to strat out maps back in the day, I would edit a map in photoshop and draw markers and such where I would want units to be, and draw routes for them to go.

Would it be possible to add tools for folks to use to place markers on the map to later share with their team?

Re: Project Reality Mapviewer

Posted: 2015-12-11 12:09
by Senshi
That is already answered in the first post...

Senshi wrote: Current feature wish-list:
  • Ability to draw on map. And save it/forward/share it. This is a big one, and is still far, far away.

Re: Project Reality Mapviewer

Posted: 2015-12-11 14:13
by gerardusnl0
i like it, well done.

Re: Project Reality Mapviewer

Posted: 2015-12-11 16:54
by Senshi
Update

Changed localization to prefer PR original localization for objects over the previously used wiki dictionary.

This means when both the game files and the dictionary have a translation to offer, the game files will be preferred over the (outdated) wiki dictionary. I'm not a fan of this, because some of the PR names are unclear/misleading (who knows the different designations of all those slightly different chinese APCs by heart, for example?), but lest I find time (or a volunteer?) to update the wiki dictionary with meaningful translations (basically append "25mm"/"30mm"/"30mm ATGM" to these APCs, for example), this has to do.

EDIT:

Also, I'm actually pretty close to show "advanced vehicle info", at least on the technical level. Individual subobject info is there, as is hierarchy:

Code: Select all

fr_the_nh90_navyNH90 NFH
	fr_the_nh90_navy_copilot PlayerControlObject
	fr_the_nh90_navy_fstrut LandingGear
	fr_the_nh90_navy_left_gunner PlayerControlObject
		fr_the_nh90_navy_lgunyaw RotationalBundle
			fr_the_nh90_navy_lgunpitch RotationalBundle
				gpmg_c6_spade GenericFireArm
				ammo_belt_7-62mm_long GenericFireArm
	fr_the_nh90_navy_mainengine Engine
	fr_the_nh90_navy_rearstruts LandingGear
	fr_the_nh90_navy_right_gunner PlayerControlObject
		fr_the_nh90_navy_rgunyaw RotationalBundle
			fr_the_nh90_navy_rgunpitch RotationalBundle
				gpmg_c6_spade GenericFireArm
				ammo_belt_7-62mm_long GenericFireArm
	fr_the_nh90_navy_tailengine Engine
	fr_the_nh90_navy_rotorhead1 RotationalBundle
		fr_the_nh90_navy_rotorhead2 RotationalBundle
			fr_the_nh90_navy_rotor Engine
	fr_the_nh90_navy_passenger1 PlayerControlObject
	fr_the_nh90_navy_passenger2 PlayerControlObject
	fr_the_nh90_navy_passenger3 PlayerControlObject
	fr_the_nh90_navy_passenger4 PlayerControlObject
	fr_the_nh90_navy_supply_drop_bighelo_tglcam GenericFireArm
	fr_the_nh90_navy_flare_group_the_counter GenericFireArm
	fr_the_nh90_navy_flare_group_the_launcher GenericFireArm
		fr_the_nh90_navy_flare_group_the_launcher_barrel RotationalBundle
		fr_the_nh90_navy_flare_group_the_launcher_barrel RotationalBundle
		fr_the_nh90_navy_flare_group_the_launcher_barrel RotationalBundle
		fr_the_nh90_navy_flare_group_the_launcher_barrel RotationalBundle
		fr_the_nh90_navy_flare_group_the_launcher_barrel RotationalBundle
		fr_the_nh90_navy_flare_group_the_launcher_barrel RotationalBundle
	fr_the_nh90_navy_pilot_cameramount RotationalBundle
		fr_the_nh90_navy_genericfirearm_pov_down GenericFireArm
		fr_the_nh90_navy_genericfirearm_pov_left GenericFireArm
		fr_the_nh90_navy_genericfirearm_pov_up GenericFireArm
		fr_the_nh90_navy_genericfirearm_pov_right GenericFireArm
Now I "just" have to figure out a way to compile the useful info (crew, passengers, armament incl ammo types, magsize/count, specials (FLIR cams, amphibious ability, ticket count, ...) and present it in a concise manner...

Re: Project Reality Mapviewer

Posted: 2015-12-13 22:45
by celticalliance
Senshi, this tool is amazing. Our CO, who is a real PR addict, totally digs it.

Keep up the good work :)

Re: Project Reality Mapviewer

Posted: 2016-06-23 06:39
by Senshi
*dust off*

Sooo, it looks like the number of incoming complaints has reduced drastically.

Do you think this mapviewer deserves a more popular spot in PR? Or are there still critical features missing? If it's complete enough, I'd ask the DEVs about granting this a more prominent link/button somewhere.

Re: Project Reality Mapviewer

Posted: 2016-06-23 12:29
by parch
I think it's really great in it's current state. If I were to nitpick, I would say that there is no information about the map size, but no experienced player will need that (also you can figure it out based on flag radius).
Overall fantastic job, Senshi, I'd love to see Mapviewer button next to PRSPY.

Re: Project Reality Mapviewer

Posted: 2016-06-23 13:18
by Ason
Great Job Senshi, I really like that you can check/uncheck specific routes, although it seems to be a bit buggy. Sometimes routes and controlpoints remain when you switch from layer to layer and also when you check/uncheck routes on a layer.

Tried Grozny, first clicked on aas inf then switched to aas std, then pressed "Route 2", the forest route on the east side shows from aas inf but only the red line, and the other flags (real aas std route 2) has no lines between flags.

Also would like it to be more clear what routes you have selected and unselected, right now there seems to just be a slight change in brightness on the route select, could perhaps make it a bit more clear.