[REL] Alerts Minimap

Discussion in 'Released Mods' started by cola_colin, September 27, 2014.

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    [REL], so it is on pamm now :)

    This is a mod that shows a minimap with alerts for known systems. That means it needs to have some data prepared for a given map to provide it's features. By default all maps from the exodus map pack and all 1vs1 ranked maps are supported. On unsupported maps no minimap will be visible.
    If after a patch maps are changed I will need to update this. At the end of this post you will find a bit of info about how to setup more maps for it if you want to, but beware you will need to edit a js file for best results ;)

    Features:

    - show land, sea, mex and spawns.
    - land is brown, sea is blue, mex are green. Spawns are orange circles. It shows you all spawns that the planets give for 1vs1.
    - configure what projection to use by planet
    - rotate the projection by moving the mouse on it and holding down alt, both rotation and projection settings are saved and restored
    - shows pings in white-yellow blinking circles: [​IMG]
    - shows your own buildings as orange circles: [​IMG]
    - shows enemy buildings for a few seconds after you detected them (I have to remove them, as I can't be sure if they are destroyed or not) as black blinking circles: [​IMG]
    - shows location where an enemy unit was first seen for a few seconds as black blinking dot: [​IMG]
    - shows death of your units/buildings as red blinking dot: [​IMG]
    - moving the mouse over the minimap shows the alerts pip and moves the camera on it, so you have a preview of the location. The preview-pip has a constant polelock for this.
    - left click on the minimap results in the main camera moving there
    - right clicking on the minimap gives a move command for the selected units to move to the clicked location. Notice that on multiplanet maps it usually will fail on the very first command you give per planet, for technical reasons, so click twice. After the first command all other commands will work with one click.
    - you can also set factory waypoints by right clicking the minimap

    Screens of the current version, which features default mappings especially for the pte ranked maps. Currently it supports all Uber maps, all maps from Gandalfs Mappack and all maps from that 12 something tournament mappack.
    For those maps the mod contains a premade configuration that is ready to play. For other maps you will need to map the planets first. Read the point "Adding more maps" below. It's not even that hard to do :)

    Lot's of examples:
    [​IMG] [​IMG]
    [​IMG]
    [​IMG]
    [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG]

    You can do a few configurations per planet:
    [​IMG]
    geo, spawns, metal and others controls the size of the respective dots. width and height ajdusts the size of the minimap. Projection should be obvious.
    The pte maps are coming with good default settings, so you will only need to do this for other maps. See the end of the post for how to add support for your own maps.

    A video of the most recent version (as of 26.11.2014)


    A video of an older version, but it already has a lot of the features:


    Adding more maps:

    For this you need the mods GeoMapperClient and Server. Make sure to also have the create unit cheat enabled.

    Warning: There is a bug in pamm that requires you to copy <PA directory>/stable/media/stockmods/server/cheat_allow_create_unit to %LOCALAPPDATA%\Uber Entertainment\Planetary Annihilation\server_mods
    before you install GeoMapperClient. If you forget this pamm will tell you that you are missing that mod.

    You then can load any map you want, spawn your commander somewhere safe and map it by entering startmapping in the chat, as you are asked for.
    However that has one disadvantage: You won't get all spawns into your mapping. To do that you need to map on a local server and modify it a tiny bit. The required modification is in
    \media\server-script\states\landing.js
    first around line 90 you have to replace a code block that does some while loop. The new code that replaces it is this:
    Code:
    _.forEach(zones, function (zone) {
            _.forEach(zone.positions, function(spawn) {
                    _.forEach(armies, function (army) {
                    army.zones.push({
                        position: spawn,
                        planet_index: zone.planet_index,
                        radius: zone.radius
                    });
                });
            });
        });
    
    So it should end up looking like this:
    [​IMG]
    This will make the server give all spawns to all players. Additionally if you increase the number in line 28 FORCE_START_TIMEOUT to a very high value you can map out planets without spawning your commander. Just directly enter the command to start into the chat and watch it do the magic.
    The mappings are stored in your PA. If a map was changed you can map it again to update the mapping.


    Here is a video of the old process before it was that simple:

    mods directory path: %LOCALAPPDATA%\Uber Entertainment\Planetary Annihilation\mods
    Github: https://github.com/pamods/Minimap
    oh and btw I recommend to disable pa stats while mapping ;)


    For developers: https://github.com/pamods/Minimap
    I think especially this file may be interesting, as it is code to allow giving commands to units in 3D coordinates from mods: https://github.com/pamods/Minimap/blob/master/Minimap/ui/mods/minimap/unitcommands.js
    This file https://github.com/pamods/Minimap/blob/master/GeoMapperClient/ui/mods/geomapper/core.js also has some new hacks, especially the "traverse the whole planet surface and try to place a building to check every location for blocked or not." Note that this check doesn't actually need to have a worker selected and is quite fast with 50+ tests per second possible.
    Alerts Minimap is also an example of a mod that creates it's own panel and does a bit of inter panel communication to manage stuff.
    Last edited: March 8, 2015
    netpyxa, proeleert, dukyduke and 11 others like this.
  2. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    Dude........ Far out!!

    EDIT: OMG! even the waterman butterfly!
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    That was the first one I looked for obviously.
  4. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    ugh... the WB is a headache to look at.

    What's orthographic, airy's and aitof if not a sphere?

    honestly I had a heck of a good time looking at Alber's equal area conic, Healpix, and baker dinomic.

    maybe that's just me but I felt that the smaller amounts of distortion led me to understand what was going on easier.
    X'D oh, you!
  5. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    omg the colligon, what a joke. o_O

    EDIT : Berghaus Star ... wtf

    Lamber conformal conic, waterman butterfly and Van der Griten 4 have to be the worst to look at, hands down.

    ugh! Mercator unusable. Gnomonic butterfly and bonne, same.
    Last edited: September 28, 2014
  6. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Wasn't there a project that rendered out planets as pictures (originally for use as icons)? Could this be used for the terrain image?
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    @SXX was building on something like that, though he already had it working pretty well to make screenshots and convert them into a short video/gif. Dunno why he never released anything about it.

    Before @yrrep came up with the idea of using area build with small buildings to map out the planet I was thinking of making screenshots and somehow throwing them together as well.
    To project screenshots of the planet I wouldn't use d3 though, as that renders svg kind of graphics.
  8. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    It's was Linux-only and way too complicated system to what's it's did, takes too much storage, had problems with proper camera rotation rate, with some summer updates there also was problem with black textures, etc. Also HDDs in my old home server died so unfortunately I abandon it.

    Realistically preview creator it's just 30 lines script that emulate user input to game, make video, split it to frames, clean background and convert to GIF animation and it's won't take long to recreate it, but I just unable to find actual use-case of some bigger problem except creation of cool-looking GIFs. :confused:

    PS: So what I mean there should be better way to handle it without using external software.
    Last edited: September 28, 2014
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Land + Mex + Spawns of taxman 2v2 on the pte:
    http://nanodesu.info/stuff/pa/mods/test2.html

    Azimuthal Equidistant looks pretty good for this one:
    [​IMG]
    No land unit will ever make a jump across the borders here and I can clearly see both of the islands.
    I think maybe the mod should allow players to configure what projection to use at what rotation on a per map basis.

    Yes there is distortion but I am pretty sure my brain can be trained to account for that pretty quickly and the return of that is pretty decent map awareness.
  10. Pawz

    Pawz Active Member

    Messages:
    951
    Likes Received:
    161
    @cola_colin
    Any way we can lock the poles in this? I find that full-world views are tough to navigate when it moves on both axis - your brain is all about pattern recognition, so the changing shapes of multi-axis projections really messes with it (at least, it does for me!)
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Lock the poles? The test html pages rotate the view on mousemove, I don't think that is very useful for the ingame version. The ingame version will allow you to configure one rotation and use that.

    EDIT:
    This is how my ingame version looks right now for that map:
    [​IMG]

    Black are alerts. It doesn't change rotation unless I move the mouse on it while holding alt down. I can click it to move the camera and for some tests I also made it change the camera position during any mousemoves on it, so it allowed me to scroll around the planet by moving the mouse over it.
    Imaging having one of these for every planet in the game. Switching the camera between them will be as simple as a single click to the location you want to go to. :)
  12. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    Wow that's perfect man. Really good job.
    philoscience likes this.
  13. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Painting with buildings onto the minimap.

    [​IMG]
  14. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Something weird going on:
    upload_2014-10-1_6-14-23.png
  15. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    You just need to learn to read it right. :p
    [​IMG]

    Takes a little practice. But all of PA needs a little practice.
  16. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Oh lol. Makes much more sense. :oops: :p

    This is really amazing. I didn't think something even approaching a minimap would be moddable in.
    Schulti, cola_colin and squishypon3 like this.
  17. torrasque

    torrasque Active Member

    Messages:
    337
    Likes Received:
    36
    Did you try to bind the minimap to the camera point of view? You would have the area you're looking at with the minimum of distortion. But I can't imagine if it's more or less disturbing than a fixed minimap :)
  18. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    There is no way to get the current camera position afaik. I can move the camera, but I cant tell where it is.
  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Have multiple maps, one for every planet, working now:
    [​IMG]
    Left clicks move the camera, works really well between planets as well.
    Right click with a unit selected gives a move command. Orbital units can be moved between planets that way as well.
    Tomorrow I'll finally start looking into making different alerts visible. After that I'll look into making the tool to gather the required map data more userfriendly, so far it requires to copy paste textblocks out of the debugger together into my code xD
    Once that is done I'll map out some common maps and release :)
    Schulti, snierke, CryFisch and 7 others like this.
  20. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Playing around with the combination of a pip as a preview and the minimap.
    The mouse cursor in the video is a little smaller than usual, but if you look closely you can see how I move the cursor over the minimap and the pip camera follows. I then right click and you can see the move commands pop up in the pip. Later you can also see a few black and red blinking when my fighters find the enemy base and die. The other player gets black dots for "enemy detected" as well. Though all kinds of "xyz deteced" are only shown once, so you can't track new stuff for a longer period of time. What is possible is to get warned about i.e. raids.
    Also ignore my music xD

Share This Page