Jump to content
  1. Welcome

    1. Announcements / News

      The latest. What is happening with 0 A.D. Stay tuned...

      5,3k
      posts
    2. Introductions & Off-Topic Discussion

      Want to discuss something that isn't related to 0 A.D. or Wildfire Games? This is the place. Come on in and introduce yourself. Get to know others who are using 0 A.D.

      38,4k
      posts
    3. Help & Feedback

      Here is where you can get help with your questions. Also be sure to tell us how we are doing. What can we improve? What do you wish we could do better? Your opinion matters to us!

      16,4k
      posts
  2. 0 A.D.

    1. General Discussion

      This is the place to post general stuff concerning the game. Want to express your love for hoplites or find people to play the game with? Want to share your stories about matches you have played or discuss historical connections to the game? These and any other topics which are related to the game, but don't have their own forums belong in this forum.

      49,8k
      posts
    2. Gameplay Discussion

      Discuss the game play of 0 A.D. Want to know why the game plays the way it does or offer suggestions for how to improve the game play experience? Then this is the forum.

      27,4k
      posts
    3. Game Development & Technical Discussion

      A forum for technical discussion about the development of 0 A.D. Feel free to ask questions of the developers and among yourselves.

      47,5k
      posts
    4. Art Development

      Open development for the game's art. Submissions, comments, and suggestions now open.

      31k
      posts
    5. Game Modification

      Do you have any questions about modifying the game? What will you need to do what you want to? What are the best techniques? Discuss Modifications, Map Making, AI scripting and Random Map Scripting here.

      43,6k
      posts
    6. Project Governance

      Forums for decision-making on issues where a consensus can't be reached or isn't sufficient. The committees are chosen from among the official team members, but to ensure an open and transparent decision process it's publically viewable.

      148
      posts
    7. 599
      posts
  • Topics

  • Posts

    • 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 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
    • 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 ?
×
×
  • Create New...