Jump to content

Itms

0 A.D. Project Leader
  • Content Count

    2,238
  • Joined

  • Last visited

  • Days Won

    96

Everything posted by Itms

  1. Ah! When seeing your last message I thought you had discovered a bug. But I just discovered that Stan has added you to the list of owners of the Balancing changes. You are basically an automatic reviewer for all those changes. @Stan` you probably shouldn't do that before explaining to people that it will flood their notifications/inbox
  2. You're not subscribed to this diff, you shouldn't receive any notification about it. Are you talking about the public Activity stream? You cannot possibly catch up with everything. You should rather manually subscribe to what you are interested in, and monitor your emails or notifications depending on your preferences (by notifications I mean the small bell icon on the top left). This is a bit confusing indeed. It is a summary of the pending actions you would perform if you clicked "Submit". By default it would subscribe you. If you write inline comments, or choose actions in the Add Action.. menu, they will be added to the summary, waiting for you to press Submit.
  3. I don't understand. When you click on the link above, you get to this page, right? As written there, your notifications should already be limited to what you are subscribed to. Do you have an example of a change that you would not have wanted to receive a notification for?
  4. Here is the page for your account For others, click on your avatar on the top-right of the page, then Settings, then Email Preferences (which also handles notification preferences).
  5. (I deleted the duplicate topic) The build restrictions are handled in binaries/data/mods/public/simulation/components/BuildRestrictions.js. It is there that you can find the logic behind where buildings can be placed. You would need to add some information to the templates of the buildings (in binaries/data/mods/public/simulation/templates) In the BuildRestrictions component, you will need to query the engine's TerritoryManager. Maybe you'll need to tweak it as well. It is implemented in source/simulation2/components/CCmpTerritoryManager.cpp.
  6. Ah, I see it as well. Which one should I rather sign? Signing both sounds like a big overlap.
  7. @Stan` @andy5995 I think I managed to "undelete" Hyrule Conquest and Vision Sharing. However I cannot see the Korean pack anywhere.
  8. Hi andy, sorry I hadn't seen this topic, so I didn't know I had to review the mod. It's better to send me a PM (even though I can be long to answer, at least I know I have a mod to sign). I haven't deleted/rejected any mod, so I don't know what happened with yours. EDIT: I think one of the mod.io developers cleaned up all pending/incomplete mods from the whole platform.
  9. There is a confusion here: we do use the same engine as Firefox. However, we need to build the game with it, so we need the development files of SpiderMonkey. When one installs Firefox, they only download the compiled Firefox which includes (or comes alongside) the compiled SpiderMonkey. Similarly, when we release 0 A.D., we distribute the compiled SpiderMonkey which is quite small. 0 A.D. end-users can download the compiled SpiderMonkey to run 0 A.D.; on the other hand, they cannot build 0 A.D. For that, one needs the development files which are heavy. If you want to take a look, in some package managers, the former is called mozjs52, the latter is called libmozjs52-dev. That is because you built SpiderMonkey. If you checkout a fresh SVN copy, that folder is 98 MB (which is already heavy: it's the development files). It is worth mentioning that SpiderMonkey devs improved the size of the source SM tarball so in SM52 that folder is now only 35 MB. When you build a big project such as SpiderMonkey, the compiler outputs a huge lot of intermediate build binary files that take up a lot of space. If you want to reclaim that space after building, you can delete the folder libraries/source/spidermonkey/mozjs-45.0.2/. The built files, needed by 0 A.D., are copied elsewhere at the end of a build. Not really. It is SpiderMonkey that constrains which C++ version we support. Right now, it's a lot of work to migrate to C++14/17: that work is upgrading SM Once SM is upgraded, supporting new versions consists of a three-line change in premake and possibly some small adjustments. Upgrading SM also means dropping some old compilers, which is work, but it's communication work with package managers rather that programming work.
  10. Sorry I'm only looking at this now, but you haven't installed any mods by any chance? If not, can you delete all the folders that are in "Documents/My Games/0ad/mods/"?
  11. Not necessarily. I am going to try to update SpiderMonkey as far as possible in A24. I don't want to unnecessarily delay the release of A24, but the less obsolete SM is, the fewer problems we will have.
  12. Thanks! No, I didn't need to patch SM to use the clone API. It probably breaks in a more recent version.
  13. Removal of ObjectToIDMap In source/scriptinterface/third_party/ObjectToIDMap.h, we have some code, taken from Firefox, allowing us to keep a map where JavaScript objects are the keys, and the values can be anything (integers or strings in our case). This code was upgraded in Firefox 45 and the old version, which I had forgotten to update, stops working with SpiderMonkey 52. However, I discovered recently that the new code doesn't work either! SpiderMonkey developers tell me it is never actually used in Firefox. In fact, this code is not needed. If we have an object to which we want to attach an ID, we can use Symbol properties. JS symbols act as unique property keys that allow us to safely assign an ID to an object. Additionally, they are ignored when iterating over an object's properties, so the rest of the code won't know about them. f1fa7a1 (up for review at D2897 in Phabricator) In the AI manager, we used object maps in some code about "serializable prototypes" which is completely dead: no code calls into it. So I removed it. @wraitii has written D2746 which actually implements prototype serialization, but he tells me he would rather rebase his work after the upgrade. e9f2161 : I replaced the other use of object maps, in the serialization code, with symbol properties. 727f26c : This allowed me to remove that code entirely. This means less external code to maintain! Sometimes what we actually need is a map with custom keys, and JS objects as values. Currently, we do that using std::map<KeyType,JS::Heap<JSObject*>>, but I believe we should use JS::GCHashMap. I'll look into that in the future. Other cleanups 43bb449 : Previously, in SM, objects rooted on the stack did not have a default constructor, so we had created our own class wrapping them with such a default constructor. Nowadays, this wrapper is not needed anymore, so I removed its remaining use and deleted the class. Also less code to maintain. 58ba02e : I performed an optional cleanup that would make the refactoring below easier. c148184 : We have a ScriptInterface::IsExceptionPending function that just calls a SpiderMonkey function with an unneeded GC request, so I removed it. TODO: I did that under SM52 and I don't know if it works under SM45. If it does, it should be committed before the upgrade. Refactoring of runtimes, contexts, and compartments This is the main part of the upgrade Until SM45, there were three levels of containers in the SpiderMonkey API. Each thread of the engine needed to have a runtime to execute some JavaScript. In each runtime, there could be several isolated contexts. In our case, we had one context for the simulation, another one for each page of the GUI, etc. The isolation of contexts allows us to separate properly the different parts of our code. Inside contexts, there could be several isolated compartments, but we didn't use that. Each context had its own and only compartment. In our code, JSContext is abstracted by our ScriptInterface class. We also have ScriptRuntime for JSRuntime. In SM52, the runtime and context levels are merged. Runtimes are removed from the API. There must be one context per thread, and isolation of the different parts of a thread must be done using different compartments. This is summarized in the following picture made by @Bellaz89: The difficulty here is that calls to the SpiderMonkey API still use a context. Previously, it was enough to get the context from the script interface, and call SM: the target code would be in the correct compartment. Now, getting the context is not enough: we first need to make the context enter the compartment of the script interface, and only then, we can call the SM API on the context. In order to prevent mistakes, I decided to perform a big change. I think it's better to prevent getting the context from a script interface directly. I wrote a Request struct which allows one to get the context from a script interface, and which automatically enters and leave the associated compartment. In the past, we had many issues with JSAutoRequest, which is needed to properly handle the memory of the JS runtimes. In a lot of cases, we forgot to add JSAutoRequest, which created bugs. The new Request object allows us to prevent these mistakes, because it automatically opens a memory request as well. The changes go like this: c65093e and 25dc831 : Prevent getting the context, except through a Request that acts just like JSAutoRequest. I made two commits for readability but they should be committed together. This change removes quite some boilerplate code previously caused by JSAutoRequest. 5d4e4c4 : Rename "context private" to "compartment private" (this commit is huge but changes nothing, just the name of classes and variables). 8142e29 : Here I make the central change: each ScriptRuntime now has one single context, whereas each ScriptInterface is associated with a compartment. Getting the context through a Request automatically enters the correct compartment. The Request also provides the global object associated with the compartment. It is still possible to get the general context but this is now advertised as unsafe. 521fd88 : There is a check made on the creation/destruction of runtimes, I change it to be made on the creation/destruction of contexts. 17ce48e : Rename ScriptRuntime to ScriptContext to match its new role (this commit is big but changes nothing, just the name of classes and variables). 0 A.D. is now ready to use SM52! Actual SM upgrade be5b0ed and 3013473 : In two commits, I upgrade the SM52 files, including a prebuilt version for Windows, and I adapt the build and premake scripts to use the new version. Simple API changes A lot of commits are made to match the API changes. They are very simple. I will merge them as a single commit in the future, along with links to SpiderMonkey's bugtracker. Right now I keep them separate so that I have a list. Some of them deserve a note: c4fc364 : In this one I remove all uses of runtimes, which become "unsafe contexts" with no compartment barrier. 8c6476a : In this one I use the new API for structured clones. Those take a new argument which is a scope, depending on whether the clone will be used in the same thread, or even in the same run of the application. My choices of scopes have to be reviewed. Changes in the error reporting API cc31596: The heaviest API change is due to the error reporting made differently. Previously, both errors and warnings in JS code would make SM call the error/warning reporter, which we implemented ourselves. Now, only the warning reporter can be supplied. Errors are always handled by the exception system, in which all exceptions have to be caught. Sometimes, they are caught by the JS code itself, but sometimes they are not. In this case, the engine has to catch them and display them. If they stay uncaught, the engine can crash when a new exception is raised, or when performing a core operation such as creating a new compartment. Thus, I had to refactor a big part of our JS error handling. I think I have improved the design which was a bit hacky, but my code is not foolproof, as uncaught exceptions are maybe still possible.
  14. Hi everyone In this thread, I am going to present the SpiderMonkey upgrade work I have dedicated myself to since around a month. The aim of the thread is to explain what this upgrade is, why it is such a big change, and how I organized it. Please don't hesitate if you have comments or questions on anything! What is SpiderMonkey? SpiderMonkey is Mozilla's JavaScript engine, used first and foremost in Firefox. As you probably know, 0 A.D. is written in C++ but a large part of the gameplay is programmed in JavaScript, in order to be easily modifiable by mods. In order to execute the JavaScript code of the game, we include SpiderMonkey inside 0 A.D. (this is also called embedding). We are not the only ones to embed SpiderMonkey: for instance, GNOME (a well-known desktop environment) also embeds SpiderMonkey. I will often use the acronym SM to designate SpiderMonkey. No kinks here, just laziness to type! All about upgrading The advantage of embedding SM is that we don't have to take care of bugs or complicated JavaScript interpretation quirks: the folks at Mozilla have us covered. The downside, however, is that we are often out of the loop on the evolution of SpiderMonkey. In order to get the improvements of the engine, we have to upgrade it to recent versions, and this is very complicated. A big part of 0 A.D. is built upon SpiderMonkey, so when the latter changes, we have a lot of work to do to adapt. On top of this, SM upgrades are big changes. SM evolves along with Firefox (which has a new release every 8 weeks), but a stand-alone SM version is only released for embedders approximately once a year, when Firefox releases an Extended Support Release (a kind of Firefox LTS, which is, for instance, the one available on Debian). See the Firefox release calendar. The difficulty of upgrading is that, between two ESR releases, SM accumulates a lot of changes, and, whereas Firefox is always on top of them, other front-ends like 0 A.D. are faced with numerous breakages which could create bugs. Additionally, at 0 A.D. we haven't upgraded SM for a long time due to the difficulty of upgrading. Thus, it is also difficult to find information to upgrade to SM releases that are already outdated. It is not much easier to jump to the current SM release: so many changes have happened that we would be unable to make sense of them all at once. Current status I upgraded SM to version 38 in the ends of 2016. At that point, we were mostly up-to-date: version 45 was already out but it was still getting some fixes, and the stand-alone SM45 was not officially released. Nowadays, stand-alone SM versions are almost never officially released, however the SM development team has started to put out more and more news (see their brand new website) so things are certainly getting better. I couldn't work on the SM45 upgrade until the summer of 2019, and even then I left a few bugs in, that we will discover in the next posts I am releasing today the upgrade to SM52, which is a big one (hence the forum thread). That brings us to "only" two years late, as SM52 stopped receiving fixes in June of 2018. It is now necessary to work on the upgrade to SM60, SM68, and SM78 (the latter is still getting fixes until the beginning of 2021). However, I am going to work on other urgent things in August. I need to improve a lot of things with the CI, Jenkins and the handling of patches, and I would like to allow contributors to use git instead of SVN. I hope these exciting news will make you forgive me for delaying the SM upgrades In any case, I want to get back to further SM work as soon as possible. In this other thread, @Bellaz89 did the daunting work of making SM68 work with no previous knowledge of 0 A.D.! Many of you probably saw it. Bellaz was then very helpful and answered all my questions concerning the upgrade. His spadework, which cannot be committed just as-is, made the actual upgrade a breeze; and apparently there will be no big work to perform on 0 A.D. between SM52 and SM68, apart from an encoding change. We will see... Overview of the upgrade The upgrade can be found at this git branch. It is very big. Not counting the changes to SpiderMonkey itself, in the engine of 0 A.D., it consists of 145 files changed, with 2667 insertions(+) and 3243 deletions(-)! The objective is to split the massive change into independent parts, which can be understood, tested and committed one by one. I tried to make a majority of changes before the actual upgrade. That way, the upgrade itself is leaner. There are a few changes that I will be able to do just after the upgrade. Right now they are not uploaded, but I will announce them here later. I will also keep the posts below updated whenever I update or commit a part of the upgrade. You are probably wondering about the performance. From my few tests, the performance is identical in SM45 and SM52. If I'm not mistaken, the structural changes in SM52 pave the way for performance improvements in the next SM versions. On top of this, I have written a patch for a huge performance bottleneck (D2919) that was very apparent under SM52, and I have identified a couple of easy improvements that I will list in a ticket soon. Finally, Bellaz thinks that we have a few JIT optimizations (i.e. whether JavaScript code should be compiled, which costs some time, but makes it faster) which have become counterproductive. We could try and tweak our JIT options and see if we can improve the performance that way. You can already checkout the branch and test it! Now, to the details for the curious programmers!
  15. Hello, indeed I was AFK for a few days. Atlas is not automatically built, but one can manually start a build of Atlas on Jenkins. I did just that, and it will be committed in a few minutes once the build finishes. Any team member with a Jenkins account can do it. Right now you don't have an account Angen, but I'm sending you a PM to remedy that. Else, as far as Atlas devs are concerned, trompetin17 and wraitii have an access, even if they don't use it often due to the low activity on Atlas recently.
  16. I performed the upgrade in r23814. We figured out Stan's issue on IRC as well.
  17. Hola @soloooy0, he aprobado tu cuenta manualmente en Phabricator. Pero, como lo dijo Lion, no necesitabas registrarte para probar el patch.
  18. Hi @LeineX! I think you are missing the Windows 7.1 SDK, which was proposed in VS 2017 but apparently not in VS 2019. This SDK includes the gl.h file you're missing, among others. You can download it and install it from here: https://www.microsoft.com/en-us/download/details.aspx?id=8279 Let us know if it works. If it does we'll add this piece of information to the build instructions
  19. But did you fix the CMakeLists line which controls the filename, as instructed? zlib has not received any upgrade since last time I upgraded it, so you should just follow the instructions to the letter and it should work, unless of course I made a mistake writing them.
  20. You should not rename libs after compiling them. I assume that you followed the BuildingWindowsDependencies page? When does it fail exactly?
  21. Hi @Bellaz89, nice to meet you! I have seen your work on SM in my emails, but as you've probably been told I was unavailable because of my PhD. I will be back to programming on 0 A.D. next week, and I will start with the SM 45->52 migration. I have already prepared this migration in a way that will probably conflict with yours, so I apologize in advance. When I'm back I propose that we schedule a chat together (IRC or elsewhere) to discuss how I plan to do the migration to 52 and whether you could help, and after that migration, I would be happy to help you include your work in the game by targeting SM 60, 68 and probably 78 at that point! To answer the question above, yes we plan to update incrementally every time. Thanks for your work and see you soon
  22. Itms

    NSIS error.

    Well, we never got this issue with nsisbi. The last time we used it it was this version: https://sourceforge.net/projects/nsisbi/files/nsisbi3.03.1/ Maybe trying this version will work for you.
  23. Itms

    NSIS error.

    Sorry I'm seeing this only now. Yes, we do use nsisbi to package the game in order to work around the size of the public mod. What is your question?
  24. I signed the mod and validated it. If you wish to distribute it somewhere else and want proof that is was validated by WFG, here is the signature file: linux-libertine.zip.minisig
  25. Oh, it's not required, I'm just giving you a suggestion here and the language packs do include the license of packed fonts, which is the reason why I came up with the suggestion for you. However, and I'm discovering this only now, I forgot to put the license files in the a23b releases of the mods they were in a22 and a23 versions. Be assured that I will keep adding them when I don't forget, and that your mod won't set a precedent. The script directly calls libcairo's API, so the answer is probably yes, even though I don't know much about that API. I also really like the "unusual" but better perispomene accent featured on the bottom line
×
×
  • Create New...