Introduce me to modding

Discussion in 'Mod Discussions' started by liftupyourheart, February 18, 2015.

?

Would you use this mod?

  1. Yes

    75.0%
  2. No

    25.0%
  1. liftupyourheart

    liftupyourheart New Member

    Messages:
    2
    Likes Received:
    0
    Hey, I'm fairly new to PA. My friend group jumped in, hoping to replace SupCom2 with PA as our RTS of choice for gaming sessions. After about 15hrs of gameplay, my review is this: there's some serious UI issues with PA that hinder an otherwise good game. I was just about to leave for greener pastures when I thought, what about making a mod for what I want? I've poked around but haven't seen any "this is how you mod PA" threads/blogs/documents, so I guess I'll just post here. I've been a software engineer for 8yrs who's also dabbled in game dev sporadically - how do I start modding for PA?

    My initial thought is a HUD-like overlay on planets to help me keep track of where I am on these rather homogenous rotating spheres. I'd like to do this by:
    1. Draw an equator line. Possibly a two-tone with parallel lines - one signifying North, one South.
    2. Draw N and S marker on the poles.
    3. Draw 4 longitudinal lines to divide the sphere into quadrants and label them, probably just 1-4.
    That should give me plenty of map context information so I don't get lost as I'm running around on a planet.
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    The functions you describe are afaik not possible with a UI mods. "UI" in terms of PA modding usually only means "the 2D HUD in front of the 3D world". So drawing stuff into the 3D world is not possible.
    However using server mods it may be possible to use the effects system to spawn effects to draw into the world. But that is more a "maybe we could do it like this" idea I just randomly had. Would need to look into that.
    A setup that works like that probably will need a modified server though and it would basically more work like "the server is modified so all player see the markers on the planet". So not a UI mod at all. Mods that modify servers cannot even be used on the normal playfab server. You need to setup your own server for it.

    To start modding in PA you have to look at the files of PA. Especially the stuff under media/ui, but most of the stuff in the whole PA directory is interesting. You will basically find webpages that make up the UI. Notice there is a coherent directory with a web debugger you can use to debug the UI. To package your modifications into a UI mod there is a system to load extra UI files. See how UI mods you can download from pamm are setup and copy that. (preferably with rather up to date mods ofc).
    Mods are located in "%LOCALAPPDATA%\Uber Entertainment\Planetary Annihilation\mods"
  3. liftupyourheart

    liftupyourheart New Member

    Messages:
    2
    Likes Received:
    0
    Thanks a bunch for the reply! Sad - I expect we'll be leaving the game due to UI frustrations then :(.
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    What exactly is the problem with the UI? Just the orientation? Do you know of the camera hotkeys?
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I almost thought you could do this with planet decals, but I'm pretty sure the server generates the locations and sends them to the client, so it would have to be a server mod.

    You might be able to co-opt one of the planet shaders and hack up some stuff from the orbital shell shader to add reference lines. Perhaps @bgolus would be kind enough to suggest one to work with?
  6. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    The decal controls you have access to are server based, so you can't modify them easily no. The game already has a north and south pole indicator, though it doesn't stay on screen at all times. I don't know the UI systems well enough to know if you can access enough camera and planet info to be able to project those into the UI. However splitting up the quadrants of the planet is plausible. Something like the orbital shell shader could be copied into the prelight_virtual.fs shader files to draw lines on the planet surface.
    wondible likes this.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I've tried really hard and the best I came up with is this: https://forums.uberent.com/threads/rel-alerts-minimap.64595/ To my knowledge there is no way to directly get even that data, I need to prepare it for every map via "can I build there" tests.
    An API to get that data directly would be great ^^
  8. Nicb1

    Nicb1 Post Master General

    Messages:
    1,010
    Likes Received:
    1,286
    If you let us know exactly what area you find the ui lacking in, we may be able to give you a few tips about various hotkeys and shortcuts that you could use.
  9. guest1

    guest1 Active Member

    Messages:
    113
    Likes Received:
    239
    There is a setting in the vanilla game that I think you and your group would benefit from. If you look under settings -> camera, there is an option called pole lock. Turning this on will align your camera in-game so that south is always "down" and north is "up".

    Some people find pole lock restrictive, but I think having a fixed camera orientation makes it much easier to recognize areas on the map.

    Another useful tool is the camera anchor system. Press shift and then a number to set a camera point, and then alt and a number to return to that camera point.
    Nicb1 and wondible like this.
  10. CrazyVulcan

    CrazyVulcan Active Member

    Messages:
    102
    Likes Received:
    50
    Could you edit the texture of the orbital shell that while normally set to not be visible and have your marking lines on that. Then you just have to have one file that will work on any type of planet be it rocky or gas. Much less work than having a line drawn on the planet its self.

    Also you could have it set to only be visible when you hold shift like when seeing move orders and area commands. So the view does not appear to be cluttered.
  11. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    It looks to me like the shader calculates the lines, there is no texture.

    I'm pretty sure the hold-shift would require engine extension.
    Last edited: February 28, 2015

Share This Page