Jump to content
  • Topics

  • Posts

    • That was good suggestion. I placed as much "warns" as possible and discovered that in my OnInitGame trigger: Trigger.prototype.TestLearningStart = function() { warn("Init"); //zapytajmy czy jest plik startowy inicjalizujacy nasz algorytm wstepnymi entities itp let cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGuiInterface.PushNotification({ "type": "load-json", "players": [0], "name": "testlearning-last", "param": "init" }); warn("Init finish"); //this.TestLearningStartFromScratch(); }   PushNotification sends the request without errors, but OnCommand never receives it. It is was clear that my custom message "load-json", which loads JSON file, is simply not being push further. This is my load-json msg: "load-json": function(notification, player) { warn("Received load-json"); let name = notification.name || "testlearning"; let data = null; if (Engine.FileExists("simulation/" + name + ".json")) data = Engine.ReadJSONFile("simulation/" + name + ".json"); Engine.PostNetworkCommand({ "type": "dialog-answer", "dialog": "json", "answer": { "param": notification.param, "data": data, }, }); warn("finished load-json"); }, And this is how I run the game with loading mod with customized "messages.js": $ pyrogenesis -mod="public" -mod="train" -autostart-victory="endless" -autostart="skirmishes/test_sparta" -autostart-disable-replay -quickstart -autostart-nonvisual Mod "train" contains just one single file with modified "messages.js". Since warning "Received load-json" never appears, we can be sure this message never hits in headless mode. So the only explanation is that under -autostart-nonvisual, custom "messages.js" coming from my mod is either ignored or, which is more likely, overlapped with different set of "messages.js" designated for -autostart-nonvisual. Since I need custom messages to communicate with some GUI APIs, I can't get rid of this pattern... 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.
    • Hey @Lopess and @Duileoga I know I don't speak spanish, but if you ever need help or me to look at a model and tell you what you can optimize for performance, just ping me here   Keep up the awesome work!
    • 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.
    • Do you have the same mods loaded when you play the saved game ? Any errors ?
    • I have been able to compile fine but i do have a few tricks. For the first part of the build I use brew clang, and for the game build i use normal apple clang.
×
×
  • Create New...