Jump to content

Stan`

0 A.D. Project Leader
  • Posts

    18.287
  • Joined

  • Last visited

  • Days Won

    596

Posts posted by Stan`

  1. Ah right, that makes some kind of sense since there is no GUI in non visual ... So probably nothing gets initialized and nothing listen to the messages :(

    1 hour ago, CulturedCait said:

    I think it is not worth investigating further. I'm satisfied with my current solution as it is and although headless mode certainly could be nice improvement it is not that important for these type of calculations. Thank you again for your help.

    No problem, sorry we couldn't figure out a solution. I do believe that using the RL interface might be better in this case, since it should have a lot more access to the engine functions because you can send arbitrary js to the engine.

     

    The tickets hyperion mentioned above.

    https://gitea.wildfiregames.com/0ad/0ad/issues?q=autostart&type=all&state=all&labels=43

  2. It seems it shouldn't have any weird side effects. https://gitea.wildfiregames.com/0ad/0ad/src/branch/main/binaries/data/mods/public/maps/scripts/NonVisualTrigger.js
    It does load your genetic_async.js too bad we don't have https://gitea.wildfiregames.com/0ad/0ad/pulls/7245 yet in your version.

     

    Can you figure the furthest it goes in your script before it starts warning.
    BTW thanks for helping us debug this.

  3. 6 hours ago, CulturedCait said:

    Looks like it is impossible to use headless mode just to run map with scripts. Probably -autostart-nonvisual is not just turning off graphics and sound, but rather special mode designated to work with -rl-interface only.

    Yeah something is off. Is it writing to interestinglog.html /mainlog.html ?

    Whether it's visual or non visual it should do the same thing because it needs to be reproductible. It was there long time before the RL interface.

     

    Cc @phosit @hyperion @Itms

  4. 1 hour ago, CulturedCait said:

    That explains a lot.

    Hmm.. Weird idea, but is it possible that in nonvisual mode "OnInitGame" is not invoked?? This is my entry point:

    {
        let learnTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger);
    
        learnTrigger.RegisterTrigger("OnDeserialized", "TestLearningLoad", { "enabled": true });
        learnTrigger.RegisterTrigger("OnInitGame", "TestLearningStart", { "enabled": true });
        learnTrigger.RegisterTrigger("OnPlayerCommand", "TestLearningCommand", { "enabled": true });
    
        ////learnTrigger.DoAfterDelay(1000, "TestLearningSpeed", { "enabled": true });
    }

    In single run my script ends in about 20 minutes,then Engine.Exit is issued to close the game. If it works much faster in -nonvisual mode, then we should expect it to finish in less than 20 minutes.

    What I did was to test it again with -autostart-nonvisual and just waited. Although it didn't produce save games and JSON files, we could explain this is somehow forbidden in this mode. But considering it has still not finished after 30 minutes, maybe the whole thing is just that the script is not triggering in -nonvisual mode??

    To check this on Linux just add debug prints to your handlers like warn("something") or error("something")

  5. Okay let's adress points in order then :) 

    1 hour ago, CulturedCait said:

    Nope, this is not the issue. Script works correctly. It was just redundancy but didn't affect anything. I removed "TestLearningCommand" so you could see it had nothing to do with this matter.

    Alright, just wanted to make sure it was not causing any weird side effects :) 

    The difference between non visual and visual is that it runs the game as fast as possible, that's why it's using so much processing power. If your script expects the game to run normally from a time standpoint that's maybe where it's going wrong.

    That's also why I suggested the RL interface, as you can you can run step to control things a bit more finely.

    If you ran the profiler2 you'd see what it was spending time on https://gitea.wildfiregames.com/0ad/0ad/wiki/Profiler2

    https://gitea.wildfiregames.com/0ad/0ad/wiki/EngineProfiling
     

    1 hour ago, CulturedCait said:

    checked on windows and it's same story. The only difference is that if you use --autostart-nonvisual, "Turn (....)" output is not being produced at all, program exits immediately spawning another process. Rest is the same. Spawned process *does something* on all cores, but not running the map that it was asked.

    Yeah the terminal is not able to capture the game's output, you need something like dbgview. It's very likely it's running in the background still.

     

  6. 1 hour ago, AlexHerbert said:

    This suggests that stats are stored locally and are lost after reinstalling, which can be confusing.

    Where do you expect them to be stored ?

    The only cloud localratings is https://replay-pallas.wildfiregames.ovh/

    Else as the name implies the stats made from the replay are stored locally.

    Also depending on how you run the game e.g with -writableRoot the locations change. 

    • Like 1
  7. In that python example they wrote a client with the endpoints IIRC

    You can run arbitrary JS with /evaluate and /step to make the simulation progress.

    Regarding saving the map itself I'm not sure you can do it one go might have to replay the map and save it after.

    You can load any map with that endpoint.

    If you're on Windows you might have some issues with python not going as fast as it can. Probably some issue with flushing.

  8. 3 hours ago, NewWorldHero said:

    The Debian Bullseye is just that isnt it? Using Bullseye to compile and try and get a working .deb that will work in Mint 22.2. But Mint (the cinnamon version I use) is Ubuntu.  Why wouldnt you use a Live USB of 22.2 that is Ubuntu based? 

    No his point was that you could install an old debian to get it to run without compiling it. Same as running an old ubuntu.

     

×
×
  • Create New...