PTE build 85104-pte is now live!

Discussion in 'Planetary Annihilation General Discussion' started by jables, July 16, 2015.

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Yeah Yikes indeed. Though to get actually get rid of hidden hack pips in my Ubermap mod I'd also need an API to give move commands as well as ping commands in world coordinates. Basically in Ubermap I create one pip per planet. They jump around with the camera between the 2 planet sides by default. When the player clicks the map to give a command on a planet the camera on that pip is moved to that location, then the command is given to the center of that pip and after that it continues to jump around ;) Basically the ability to set the camera in world coordinates combined with hidden pips yields me the ability to use the 2D screen coordinate holodeck APIs in world coordinates. If you could add versions of all holodeck command APIs that take world coordinates and allow a mod to turn of the culling via some js call then there would be no hack holodecks anymore. Just disabling culling alone would help with others who only want data and not give commands as well though.
    Thanks for the reply.

    EDIT:
    Random though for disabling culling:
    Make it a js call that takes some time value as parameter and works per planet.
    "I want the data of units on that planet to be fully updated once every X ms".
    That way a mod could make a rather high update rate on the currently viewn planet and a lower on (once per second or so) on a not currently viewn planet.
    No idea if that kind of concept would work together with your culling system, just an idea for a balance between network usage and up to date data. If the culling system isn't this flexiable a call like "setNetworkCullingEnabled(false)" would be nice as well for sure.
    Last edited: July 17, 2015
    cdrkf likes this.
  2. pinbender

    pinbender Active Member

    Messages:
    78
    Likes Received:
    137
    I'll look in on that, too.

    Like you guessed, the server culling is not that flexible. I added an API for disabling it, and that's about all I have the budget for right now.
    Remy561, cdrkf and cola_colin like this.
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Was just a random thought :) If you looking into the orders query and the world coordinate commands yields APIs for those things that would be quite a big API improvement. Like really big :)
    Also YEY for disabling culling via API.

    EDIT:
    To be precise about giving commands via API:
    look at ui/main/shared/js/api/holodeck.js
    All those calls that take anchroX, anchorY coordinates. or unitGo with x,y.
    An alternative version that instead takes planet id/index and x/y/z would be the thing.

    Obviously that would not necessarily be placed into holodeck.js anymore, as it would be pretty much independent from the holodeck.

    In addition to that, again something that probably may be a little more complex: Add another parameter that is an array of unit IDs. Make it give the command to those specific unit IDs and ignore the current selection. Obviously that would be really really powerful for UI mods.
    Last edited: July 17, 2015
  4. pinbender

    pinbender Active Member

    Messages:
    78
    Likes Received:
    137
    Ok, I have an idea here. The WorldView api is pretty under-used by the rest of the code. If a different id is provided to api.getWorldView() (right now, it uses 0 everywhere), it opens another server connection.

    The time API operates on the "currently focused" worldview, and is kind of explicit to the requirements of the current chronocam UI. I'm going to extend that to accept a worldview. At that point, you will be able to have a secondary worldview with culling disabled. You can leave it paused and and then skip it forward at a periodic rate, and that should give you a system you can tweak to get a similar effect.
    wondible, cdrkf and cola_colin like this.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    That sounds really great. Maybe you could even use that system in default PA to once every few seconds update everything for the sake of the idle alerts. Those really suffer from this problem.

    Though last time I tried to use a different id in the worldview I could not really use it for anything... wait was that only because the time API implicitly always uses the worldview 0 currently? So if you change that API to work with a explicitly given value could I actually not only use it to determine myself when I want full data updates, but could I also create a pip that is showing a different time than the main view? If so that's also big!!!
    cdrkf likes this.
  6. pinbender

    pinbender Active Member

    Messages:
    78
    Likes Received:
    137
    That's actually been a feature of holodecks this whole time. If you put a button on a pip with a different view (it's pulled from the config blob) that calls api.time.pause(), it should pause time in just the pip. The trick there is that it focuses the pip when you move the mouse over it.
    cdrkf, wondible and cola_colin like this.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    ha I guess I never made that connection between holodeck focus and the time API. Or maybe I failed to config the holodeck for another view. Hmmm..... I need to check that out again.
    cdrkf likes this.
  8. crizmess

    crizmess Well-Known Member

    Messages:
    434
    Likes Received:
    317
    Now it is getting interesting. With an api for move commands to units a whole new world of mods opens up. It would be fun to see a gernadier-auto-kite mod ;)
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    That would require the version that even has a parameter for the unitIds to give the command to. The more basic version would just give a command to the units you have selected, like you could do yourself.
  10. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Can you add parameters to the various APIs so that focus is not required? ie no parameters = focus based
  11. crizmess

    crizmess Well-Known Member

    Messages:
    434
    Likes Received:
    317
    I know, but since you ask for that api too, I just wanted to put up a reminder, that there may be some problems on the horizon.
  12. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Well is it a problem? I tbh doubt that even if the API were added there would be an auto micro mod that actually "works". Making a good mod of that kind is .... far from easy and for example the information on the map a UI mod can have is very very limited. How do you micro when you don't know there is a mountain there that will block your movements? etc
    SupCom:FA has an API to do mods that for example switch your metal converters on/off in a dynamic and pretty much perfect way. Nobody really disliked that kind of thing there.
  13. crizmess

    crizmess Well-Known Member

    Messages:
    434
    Likes Received:
    317
    I don't think this is the right place to discuss this. It just was a reminder, nothing more, nothing less.
  14. ace63

    ace63 Post Master General

    Messages:
    1,067
    Likes Received:
    826
    Sooo I must say a small asteroid completely annihilating a big planet is not as cool as the old crater system. Sorry. It is exactly as anticipated.
    gerii and EdWood like this.
  15. Spriggan43

    Spriggan43 Active Member

    Messages:
    110
    Likes Received:
    68
    Thanks for the update,

    Problem; Any one else see that the units are completing and exiting the factory before the steps or the ramps have been opened on the factory?

    Request; Add the ability for the T1 unit air carrier to be queued set (A point) for load and set a (B point) for unload.
    cdrkf likes this.
  16. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
    Uber Launcher crashes on OS X 10.11 (15A216g) El Capitan Beta 3:

    Code:
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.uberent.launcher              0x00000001020ec94a crom::DarwinPlatform::getPresenter() + 10
    1   com.uberent.launcher              0x00000001020edc89 crom::Game::doCreateRenderer() + 41
    2   com.uberent.launcher              0x00000001020eda5b crom::Game::createRenderer() + 27
    3   com.uberent.launcher              0x00000001020e912e crom::DarwinGameProxy::createRenderer() + 30
    4   com.uberent.launcher              0x00000001020ed0be crom::DarwinPlatform::run() + 462
    5   com.uberent.launcher              0x00000001020e8d52 main + 210
    6   com.uberent.launcher              0x00000001020ba064 start + 52
  17. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Two questions about the puppet API:

    1.) I don't understand the animate property on the puppet. Looking at the metal extractor unit spec "animtree" seems to be part of the model node.
    2.) The documentation says the key for textures and shaders is "materal". Is that supposed to be "material" or is the typo also in the parsing code?
  18. pinbender

    pinbender Active Member

    Messages:
    78
    Likes Received:
    137
    Try this:
    Code:
    var puppet = {
        id: 1,
        model: {
            filename: '/pa/units/commanders/quad_ajax/quad_ajax.papa',
            animations: {
                walk: '/pa/units/commanders/quad_base/quad_base_anim_walk.papa',
                idle: '/pa/units/commanders/quad_base/quad_base_anim_idle.papa'
            }
        },
        animate: {
            anim_name: 'walk'
        },
        location: {
            planet: 0,
            pos: [0,0,500],
            scale: 20,
            orient: [0,0,0,1],
            orient_rel: true,
            snap: true
        },
        material: {
            shader: 'pa_unit_ghost',
            constants: {
                Color: [0,0,1,0.5],
                GhostColor: [0,0,1,0.5],
                BuildInfo: [0, 10, 0, 0]
            }
        },
        fx_offsets: [
            {
                "filename": "/pa/units/air/bomber/bomber_jets.pfx",
                "bone": "socket_leftMuzzle",
                "offset": [0,-2,0],
                "orientation": [0,180,0]
            }
        ],
        decal: '/pa/effects/specs/skirt_bot.json'
    };
    
    It may or may not be what I used for testing while implementing the API. >_>

    (Typo in the "docs" fixed. It's supposed to be "material".)
  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    [​IMG]

    great example.

    This stuff probably could also be huge fun for effects modders.
    @Alpha2546 @dom314
    You're graphical wizards, make some nice looking biome effects with custom shaders, textures, models, etc that can be placed on maps via a UI mod that loads them specific for a map.
    Nicb1, Remy561, Alpha2546 and 2 others like this.
  20. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Soon.

    (after the faction mod is done)

    Btw does this mean real volcanoes now?

Share This Page