Leaderboard
Popular Content
Showing content with the highest reputation on 2020-07-31 in all areas
-
3 points
-
2 points
-
2 points
-
The feature is called "turrets" and it's being worked on. I'm personally notsomuch interested in mounting and dismounting troops (way too much micro). My main thing is just allowing the soldiers in the tower to target nearby enemy soldiers independently from the main elephant attack. So imagine tasking your elephant to batter down a building while the archers on his back shooting at random nearby enemy soldiers.2 points
-
Hey folks, To get the hang of things here is the model and texture for the european bison. I worked from a 3000 tri model and a 2k complete texture and for the game the I tried to follow the bovidae specs found in the game file. I more than welcome feedback on any aspect. I got the textures from wiki commons and can provide the originals. I think I the back legs should be higher for the european bison but really after tweaking I could't tell. Engine compliant (i hope) version. 574 triangles, a slight more than the bovidae Eye candy hp and 2k texture version The files themselves Source Texture, used a mix of those.1 point
-
For some time now I've been wanting to make a spec mod. Currently the 'chrome', 'dashboard' or whatever the overlay is named provides little insight to what the player is doing. This is true for both players and specs. This is the benchmark I'd use, notice the production pane on top-left as well, income rate besides resource amounts on mid bottom and military upgrades on its right: The first step would be to implement the production overlay, the icons should be easy to display, just run a query over all production facilities to return the units, their amounts and the researching technologies. Would also be disabled for players, just enabled for specs at first. Ultimate goal would be to replace all of the current overlay with a minimal one with more relevant information on display, and also an alternate version for players. One blocker I could see are queries and their calculation taking a lot of CPU on each tick due to inefficient model or something similar. Otherwise I don't think there should be too many blockers I made this thread to ask if anyone has any suggestions, insights or tips on how to perform it (e.g. code I can look at for reference), thanks!1 point
-
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!1 point
-
I found .dev ppa and made this. Markdown file here0 A.D. a24 SVN Current Changes.md 0 A.D. a24 SVN Current Changes Build: Jul 26, 2020 (23898-development) General Credits is added to the main page. Many Languages are added. New Kushites background. Panel Slide has smoother animation. Structure Tree is smaller and centered. History is now called Civilization Overview. FXAA anti-aliasing, game-setup new player notification, snap to edges (3 people can stand between) for buildings and multiple control group membership is available in Options. Game-setup Now able to reset Team with one click. World population cap (shared between all players) is available to a maximum of 1200. Ceasefire setting is now a slider. Bot configuration shows the gathering rate and trading gain altered for per difficulty level. In-Game New appearance, sound effects and music. Champions are cheaper and prior to Heroes in production panel. Advance/elite techs changed. Gather penalty decrease from- 50% to -30%. Health decrease from +20% to +10%. Siege Workshop is available for every civilization. Fortress can no longer produce siege engines. Loot 20% the cost of structures (wall gate 10%) and 10% the cost of soldiers (mercenaries are looted as normal units). Heroes remain 10F/25M. Ships aren't affected. Expertise In War no longer causes +20% training time for mercenaries, but cost 600M instead of 200F/300M. It no longer takes the Greeks and the Hellenistics 10% more construction time. A maximum of 3 embassies can be built, up from 2. No Mills for the Celtics anymore. Structures Village Phase House The Loom increases women's health by 100%, up from 50%. The Loom research cost increased from 150F to 200F. Farm Every subsequent gatherer works less efficiently. Corral Gauls and Kushites get a 75F livestock (might be a bug that 75F only get 100F in return). Wooden Wall (a24 Palisade) Walls Cost changed from 4W~13W to 4W~12W. Build time changed from 5s~11s to 4s~12s. Health decreased from 275~1100 to 220~1100. Gate Cost decreased from 20W to 10W. Build time increased from 5s to 6s. Health decreased from 637 to 500. "Tower" Cost increased from 5W to 14W. Build time increased from 8s to 14s. Health decreased from 825 to 770. Barracks Non-Celtic or Mauryas' Barracks cost 200W/100S. Archery Tradition is altered and is now available for Kushites, Mauryas and Persians: Cost 500W/300M. -10% training time, +8 attack range, and -10% attack spread for archers. Town Phase Defense Tower Some civilizations can upgrade it in City Phase. Stone Wall Walls Cost changed from 15S~28S to 12S~36S. Build time changed from 15s~45s to 12s~36s. Gate Cost decreased from 60S to 20W. Build time increased from 10s to 12s. Health decreased from 2550 to 2500. City Phase Wonder Cost changed from 1000F/1000W/1000S/1000M to 1000W/1500S/1000M. Siege Workshop Available for all civilizations. Build time decreased to 180s. Fortress Can no longer produce siege engines. New buildings: Artillery Tower Shoot bombards. Available for Athenians, Carthaginians, Macedonians, Ptolemies, Romans and Seleucids. Can be upgraded from a Defense Tower costing 150W/100S and taking 200s. Cost: 200W/200S Health: 1400 Ranged Attack: 35P/25C, Range: 20~78(+14), Interval: 5s Circular Splash Damage: 25P/5C Armor: 25H/30P/3C Garrison Limit: 5 Projectile Limit: 2, Default: 1, Per Unit: 0.2 (garrison 3 units to get the second shot) Loot: 40W/40S Only armor upgrade works. Bolt Tower Shoot bolts. Available for Athenians, Carthaginians, Macedonians, Ptolemies, Romans, Seleucids and Spartans. Cannot be constructed directly. Only can be upgraded from a Defense Tower costing 100S/100M and taking 200s. Health: 1400 Ranged Attack: 55P/5C, Range: 15~84(+14), Interval: 4s Linear Splash Damage: 12P Armor: 25H/30P/3C Garrison Limit: 5 Projectile Limit: 2, Default: 1, Per Unit: 0.2 (garrison 3 units to get the second shot) Loot: 40S/20M Only armor upgrade works. Rampart Tower Archers can garrison to shoot on the towers. The rampart doesn't protect them from ranged attack. Only Available for Mauryas. Cannot be constructed directly. Only can be upgraded from a Defense Tower costing 150W/70S and taking 200s. Health: 1200 Ranged Attack: 12P, Range: 10~76(+14), Interval: 2s Armor: 25H/30P/3C Garrison Limit: 20 (16 exposed) only archers Projectile Limit: 7, Default: 2, Per Unit: 1 Crenellations doesn't increase the Projectile Limit. Units Woman Gather rate increased from 0.8F/0.7W/0.3S/0.3M to 0.83F/0.7W/0.35S/0.35M. The Loom increases their health by 100%, up from 50%. Infantry Citizen-Soldier Gather rate decreased from 0.6F/0.8W/0.5S/0.5M to 0.58F/0.75W/0.5S/0.5M. Infantry Archer Damage increased from 6.0P to 6.7P. Movement speed increased from 9.9W/16.5R to 10.8W/18.0R. Archery Tradition is altered and is now available for Kushites, Mauryas and Persians: Cost 500W/300M. -10% training time, +8 attack range, and -10% attack spread for archers. Slinger Damage decreased from 9.5P/1.0C to 9.2P/0.9C. Javelineer Movement speed decreased from 12.6W/21.0R to 10.8W/18R. Spearman Movement speed increased from 8.5W/14.2R to 9.0W/15.0R. Pikeman Movement speed increased from 7.0W/12.0R to 8.1W/13.5R. Swordsman Movement speed decreased from 9.4W/15.7R to 9.0W/15.0R. Cavalry Cavalry Javelineer Movement speed increased from 17.5W/29.2R to 18.0W/30.1R. Cavalry Spearman Damage decreased from 6.0H/5.0P to 4.0H/3.0P. Interval decreased from 2s to 1.25s. Movement speed increased from 19.3W/32.2R to 19.8W/33.1R. Cavalry Swordsman Cost changed from 100F/30W/20M to 100F/40W/10M. Movement speed increased from 21.1W/35.1R to 21.6W/36.1R. Cavalry Archer Movement speed increased from 17.5W/29.2R to 18.0W/30.1R. Siege Engines Bolt Shooter Movement speed decreased from 8.1W/13.5R to 8.1W/8.1R. Siege Catapult Movement speed decreased from 7.2W/12.0R to 7.2W/7.2R. Battering Ram Movement speed decreased from 8.1W/13.5R to 7.2W/7.2R. Cannot attack field or organic units. Siege Tower Movement speed decreased from 6.3W/10.5R to 6.3W/6.3R. Champions Infantry Now cost 80F/60W/80M. Movement speed changed to 9.0W/15.0R for melee and 10.8W/188.0R for ranged. Cavalry Now cost 150F/80W/100M. Movement speed changed to 19.8W/33.1R for melee and 18.0W/30.1R for ranged. Cavalry Spearman Damage decreased from 12H/10P to 8H/6P. Interval decreased from 2s to 1.25s. War Elephants Basic cost is now 300F/200M. +10% value (cost inclued) for Mauryas and Seleucids, -10% value for the others. Movement speed increased from 8.5W/14.2R to 8.5W/14.3R. Heroes Infantry Movement speed changed to 9.0W/15.0R. Cavalry Movement speed increased from 16.6W/27.7R to 18.0W/30.1R. Cavalry Spearman Damage decreased from 24H/20P to 16H/12P. Interval decreased from 2s to 1.25s. Civilizations Athenians ̶A̶l̶l̶i̶e̶d̶ ̶s̶h̶i̶p̶s̶ ̶c̶o̶n̶s̶t̶r̶u̶c̶t̶ ̶2̶5̶%̶ ̶f̶a̶s̶t̶e̶r̶.̶ Allied Warships -25% construction time. Artillery Tower and Bolt Tower are available. Britons War Dog Kennel is removed. Now trained by Barracks to a maximum number of 20. Health increased from 90 to 110. Movement speed changed from 14.4W/24.0R to 13.5W/27.0R. No promotion. Starts with basic rank. Carthaginians Hannibal's Tactician (+1 capture and +20% attack within 60 meters) now affects allies. Artillery Tower and Bolt Tower are available. Light War Elephant. Gauls ̶-̶1̶0̶%̶ ̶r̶e̶s̶e̶a̶r̶c̶h̶ ̶t̶i̶m̶e̶ ̶f̶o̶r̶ ̶t̶e̶c̶h̶n̶o̶l̶o̶g̶i̶e̶s̶ ̶o̶f̶ ̶a̶l̶l̶i̶e̶s̶.̶ Allied blacksmith -15% technology resouce cost and research time. Farmstead New Tech: Harvesting Machine Cost 400W/250M. Requires Town Phase. Workers +15% grain gather rate. Naked Fanatic Movement speed decreased from 16.4W/27.3R to 12.6W/21.0R. Iberians ̶C̶i̶t̶i̶z̶e̶n̶-̶s̶o̶l̶d̶i̶e̶r̶ ̶i̶n̶f̶a̶n̶t̶r̶y̶ ̶s̶k̶i̶r̶m̶i̶s̶h̶e̶r̶s̶ ̶a̶n̶d̶ ̶c̶a̶v̶a̶l̶r̶y̶ ̶s̶k̶i̶r̶m̶i̶s̶h̶e̶r̶s̶ ̶-̶2̶0̶%̶ ̶c̶o̶s̶t̶ ̶f̶o̶r̶ ̶a̶l̶l̶i̶e̶s̶.̶ Allied citizen javelineers -10& resource cost. Kushites No extra mine. Civic Center New Tech: Monumental Architecture Cost 600S. Requires Town Phase. Moved from Large Pyramid. ̶+̶2̶5̶%̶H̶P̶ ̶a̶n̶d̶ ̶-̶5̶0̶%̶ ̶b̶u̶i̶l̶d̶ ̶t̶i̶m̶e̶ ̶f̶o̶r̶ ̶C̶i̶v̶i̶c̶ ̶C̶e̶n̶t̶e̶r̶s̶,̶ ̶T̶e̶m̶p̶l̶e̶s̶,̶ ̶P̶y̶r̶a̶m̶i̶d̶s̶ ̶a̶n̶d̶ ̶W̶o̶n̶d̶e̶r̶s̶.̶ Civic Structures +20% buildtime, +20% health, and +20% capture points. Blemmye Camp and Nuba Village Can be built in neutral territory with a 0.5/s territory decay rate. Temple Meroitic Temple Guard Damage increased from 11H to 12H/4C. Interval increased from 0.75s to 1s. Armor increased from 7H/7P/20C to 7H/8P/20C. Armor-piercing Axes (+30% damage vs. Champions and Heros) is removed. Sword class removed. Small Pyramid Cost changed from 300F/300S to 300S/100M. Large Pyramid Cost changed from 400S/400M to 450S/150M. Meroitic Pyramids (Civic Center +10% territory influence) and Patriotism (+15% gether rate) is removed. Exhortative Presence now provides +1 armor level and +10% melee and ranged attack damage within 70 meters. Monumental Architecture is moved from Large Pyramid to Civic Center. Grand Temple of Amun Powerful Priesthood no longer stack, only -5% health for Heros. Light War Elephant. Missing % for Nastasen. Macedonians Hellenic League (attack bonus and debonus vs. different civilizations) is removed. Artillery Tower and Bolt Tower are available. Champion Crossbowman can now be trained by Siege Workshop. Theracian Black Cloak can now be trained by Fortress. Mauryans (a24 Mauryas) Elephants -30% training time. Worker Elephant Can no longer constructs buildings. Now provides workers +25% build rate within 15 meters. Training time decreased from 15s to 14s. Elephant Archer Cost decreased from 200F/80W/20M to 175F/75W. Training time decreased from 15s to 14s. Movement speed increased from 8.8W/14.6R to 9.0W/15.0R. War Elephant Training time decreased from 30s to 24s. No upgrades in Siege Workshop. Heavy War Elephant. Persians Barracks Can train Hyrcanian Cavalry. Stable Cost changed from 200S to 200W/50S. Cavalry movement speed upgrades are also available in Stable. Bactrian Heavy Lancer is moved from Fortress to Stable. Hyrcanian Cavalry Cost changed from 100F/30W/20M to 100F/40W/10M. Damage increased from 6.5H to 6.9H/2.3C. Interval increased from 0.75s to 1s. Sword class is replaced by Axeman. Ishtar Gate and Persian Hall are removed. New unit: Babylonian Scythed Chariot Can be trained by Fortress. Same as Seleucids' one. Ptolemies No loot from free structures. Artillery Tower and Bolt Tower are available. Light War Elephant. Romans Allied infantry -10% training time, down from -20%. Army Camp no longer cost metal. Artillery Tower and Bolt Tower are available. Siege Wall Walls Build time decreased from 15s~45s to 12s~36s. Gate Cost decerased from 80W to 20W. Build time decreased from 12s to 10s. Health decreased from 1912 to 1875. Loot decerased from 15W to 10W. Seleucids Artillery Tower is available. Heavy War Elephant. Spartans Skirital Commando Health decreased from 144 to 121. Movement speed decreased from 10.4W/15.7R to 9.0W/15.0R. Gather rate increased from 0.1F/0.2W/0.1S/0.1M to 0.29F/0.37W/0.24S/0.24M. Loot changed from 7.2F/7.2M to 7.2F/5.76W/1.44M. Bolt Tower is available. 0 A.D. a24 SVN Current Changes.md1 point
-
It's a very nice mod. Last feature allows even to measure gathered resources per sec. I like that. Would be nice if implemented in next alpha release, as well as your balanced maps bundled into regular 0ad version (out of the box). Thanks a lot @badosu for significant contribution into 0ad polishing and tuning up!1 point
-
1 point
-
There is possibility to do this thanks to https://code.wildfiregames.com/D2281 https://code.wildfiregames.com/D2092 and so on @Freagarach @Stan`1 point
-
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.1 point
-
On Zapotec siege, i think it would be more accurate to lose their wheeled ram (They did not use wheels). Instead have a group of guys holding a log like Xiongnu ram. So siege workshop could be a relatively simple structure with some tree trunks lying around.1 point
-
Might be a little too much black lines on the first, but nonetheless an outstanding improvements. I will commit some of them with their permission. @m7600 could send me one of the blend files?1 point
-
1 point
-
Okay, got it. Took me an hour but I managed to get the model in game after modifying with the feedback. So the back is more flat and the legs a bit higher (minor tweaks). At first I took the scale of the bull but then I read that speciemens tend to be 1.8m to 2.2m hight so here is a ingame screenshot from the Atlas. Added the horse actor and iberian hero swordsman as a scale. Also there are the files in the respectives folders. I just used copy paste on the main art in mods/public for my convienience. I don't know how you want to receive it. About the naming convention, I went for animal_latin-name_variantion . Should it be otherwise? Lastly, I have two questions: - I got that I can rotate entities in the atlas but I don't know how to make them, any help, any use? - Animations are already listed even if the model doesn't have those. Is it because they are limited, and should I fit mine into those already describe (like th hawk that 'walks' by flying) ? art.zip1 point
-
this guy leaved the game without resigning my lobby name: Zavitar his lobby name: zr0ad commands.txt @user11 point
-
- Advance/elite techs changed. Gather penalty decrease from- 50% to -30%. Health decrease from +20% to +10%. - Dogs cant promote - Brit start with basic dog - Crossbowman on workshop is not a bug. Probably chariots add to worshop too. We are working hard now and a lot of work still to be done to balance/gameplay.1 point
-
1 point
-
@user1 @Hannibal_Barca Hello, I played a rated 1v1 game vs "breoso" who quit instead of resigning when I started winning. I don't know if he knew it was rated but the game name was 1v1 and he had no prior rating. It would be nice to get the points though as I lost two prior games and I've been trying for a while to get some back Edit: my username is Faendal commands.txt1 point
-
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.1 point
-
maybe we have to change the color of the texture of the Zapotecs. I'll try to do it myself :D1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
1 point