[REL] [SERVER] [LOBBY] [LIVE GAME] Unit Selector

Discussion in 'Released Mods' started by mikeyh, January 11, 2015.

  1. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    The Unit Selector 2.0 server mod is now on the PA Mod Manager (PAMM).

    You can now disable units for the following:
    • everyone
    • per army (FFA player or team)
    Unit selector does not work with the AI.

    PA Mod Manager (PAMM): https://forums.uberent.com/threads/rel-pa-mod-manager-cross-platform.59992/

    As a host if you don't have Faster Server Browser then you'll have to refresh the user interface to enable the server mod in the game lobby. eg F5 or browsing for a system (you don't have to actually select a system).

    Original Post (edited with current units and functionality)

    It looks like I have a working server mod that provides a unit selector in the game lobby that allows you to disable units in the live game.

    Currently it's a very basic user interface in new game using reduced size build bar icons and tool tips for all 81 units.

    Use the following to disable groups of units: (needs a proper user interface for this)
    • bot factory (disable all bots)
    • advanced bot factory (disable T2 bots)
    • air factory (disable all air)
    • advanced air factory (disable T2 air)
    • vehicle factory (disable all vehicles)
    • advanced vehicle factory (disable T2 vehicles)
    • orbital launcher (disable all orbital)
    • orbital factory (disable T2 orbital)
    All units are enabled in the screenshot below. Dimmed icons are disabled.

    The lobby sends real time updates to all players showing which units are disabled and toggles the ready state if changes to units are made.

    Stuff still to test;
    • key bindings
    • interaction with other mods
    • reconnects
    • access to uuid for games (using creatorUberId, hostname and port)
    • workaround user interface not loading for host until refreshed (use Faster Server Browser)
    • AI still has access to disabled units
    • stability of client / server (messing with units might upset the engine)

    Unit Selector.png

    PA-PTE-76695-Unit-Selector2.png
    Last edited: March 21, 2015
    jonasmod, proeleert, snierke and 4 others like this.
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    That's something a lot of people will be happy about. I guess you work by removing the units from the UI of the clients and that is why the AI still uses the units?
  3. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    I haven't actually tested the AI yet.. that's just an assumption based on what I've seen so far in the code. I need to take a look through the GW code.

    There's a game in PTE now if you want to test if this works outside of my dev environment.
  4. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Just played a quick game in stable with dox, bombers and nukes disabled.
  5. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Added the following and played another quick game in stable:
    • snipers
    • shellers
    • holkins
    Will publish first version on PAMM soon.
  6. nuketf

    nuketf Active Member

    Messages:
    702
    Likes Received:
    130
    YES YES YYYYEEEESSSS!!! this will make my map X999 more fun! THANK YOU!! P.S need testers? :p
  7. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    The Unit Selector server mod is now on PAMM.

    I'll keep adding units and it will auto update.

    As a host you have to refresh the user interface to load the server mod in the game lobby.
    eg browsing for a system (you don't have to actually select a system).
  8. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    cool :)
    I am surprised to see where you store which units are blocked xD
  9. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    It's very simple code... and no other way to communicate disabled units to all the clients :)

    Lobby ID (and the new UDID in PTE) are not available at the correct time.
  10. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Maybe I missed something and I read so many modding posts this weekend.... how do you load global client code in a server mod without scenes???

    Only option I could find was shadowing / replacing game files.
  11. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Just made a couple of changes:
    • games are keyed off creatorUberId, gameHostname and gamePort (more unique)
    • fixed css to always show units (someone couldn't see icons as they wrapped and disappeared off screen)
    • starting to add factories (disabling t1 will currently disable t2)
  12. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Afaik that is the only option yeah. To get the lobby id you need to modify all scenes that join/create games to capture it on creation or join of the game. PA Stats has extra code for that as well.

    I wonder if there really is no other way to communicate. Can't you for example use chat messages? Or maybe picky back the data somewhere in the game config?
  13. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    There might be a way to piggyback on the engine messages that isn't fragile but I ran out of time to figure that out in the time I allocated to solve this over the weekend.

    I still have only a limited understanding of how units are handled and what the engine mutates.

    Did anyone take over the mod framework from chargrove?

    Still catching up on all the changes that occurred during my 3 month break from PA in October, November and December.
  14. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    All the units are now available and changed over to build bar icons.

    Unit Selector.png
    stuart98 and Bsport like this.
  15. nuketf

    nuketf Active Member

    Messages:
    702
    Likes Received:
    130
    how do you disable the units? all it says it that it is atvated where do i go to turn units off?
  16. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    The host has to refresh the page by browsing for a system (you don't have to select one) due to server mods not refreshing the game lobby for the host.

    There is also an issue which I need to fix where it loses your selections if you refresh again eg changing systems.
  17. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Just fixed the issue and unit selections should no longer be lost for the following:
    • host refreshes or changes system
    • host disconnects and reconnects
    • host leaves (new host can now manage)
    stuart98 likes this.
  18. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    How are people finding the unit selector mod?

    On my list is to add a starting game summary of disabled units.
    eg maybe add to commander start screen and generating planets
    stuart98 likes this.
  19. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Can someone please move this over to released.
    stuart98 likes this.
  20. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    moved
    stuart98 likes this.

Share This Page