Faizan Khalid Mohsin Posted August 20, 2021 Report Share Posted August 20, 2021 (edited) Hello, everyone. Great job with the entire thing. Just a primer, I am new to programming and only know python and R. I was just wondering why the programming languages of choice for developing the game were chosen to be C++ and JavaScript and why python was not used as the main programming language. Lastly, I was also wondering what is the database that was used? Edited August 20, 2021 by Faizan Khalid Mohsin improve clarity of question Quote Link to comment Share on other sites More sharing options...
maroder Posted August 20, 2021 Report Share Posted August 20, 2021 (edited) I don't know the true answer, but I would guess c++ because it is versatile and compiled i.e. fast enough to actually run the main simulation. Afaik it is also easier to write than C, Fortran, Lisp ect and there is the actual chance you find developers who know it. js because many people use it and it's easier to make scripts. Why js is used as the scripting language and not python or lua ect: don't know. And for the database: not sure what you mean. The files that hold static informations about units ect are either xml or json. Edited August 20, 2021 by maroder Typos Quote Link to comment Share on other sites More sharing options...
hyperion Posted August 20, 2021 Report Share Posted August 20, 2021 20 years ago C++ was the only reasonable choice for the engine, I'd still pick it today. As for scripting for mods, lua might have been an option but I guess javascript was a decent choice as well, even more in hindsight. As for writing the whole game in python, besides not being as widespread or mature at that time, search for GIL. There is no "database", just the filesystem. Quote Link to comment Share on other sites More sharing options...
Ceres Posted August 21, 2021 Report Share Posted August 21, 2021 And Godot? I assume that changing the language now does not make any sense, though. Quote Link to comment Share on other sites More sharing options...
Genava55 Posted August 21, 2021 Report Share Posted August 21, 2021 14 hours ago, Faizan Khalid Mohsin said: why python was not used Python could not replace C++ (too slow for various reasons). It could be used in some parts instead of javascript but it would be more complex. 0AD uses SpiderMonkey as a JavaScript engine. https://en.wikipedia.org/wiki/SpiderMonkey Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 21, 2021 Report Share Posted August 21, 2021 19 minutes ago, Ceres said: And Godot? I assume that changing the language now does not make any sense, though. Godot was a commercial project at the time IIRC. Quote Link to comment Share on other sites More sharing options...
alre Posted August 21, 2021 Report Share Posted August 21, 2021 between javascript and lua, I'd have gone with lua all the time, but that is my personal preference. anyway, I wonder if there is some way to test javascript files in some way different from running the game. I'm working on my random map project and I don't know any other way than editing the files with notepad++ and then directly try the game. since there is some relatively complex algorithm involved, that's quite suboptimal, there is some way I can set an IDE to run my code and see how it works? Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 21, 2021 Report Share Posted August 21, 2021 1 minute ago, alre said: between javascript and lua, I'd have gone with lua all the time, but that is my personal preference. anyway, I wonder if there is some way to test javascript files in some way different from running the game. I'm working on my random map project and I don't know any other way than editing the files with notepad++ and then directly try the game. since there is some relatively complex algorithm involved, that's quite suboptimal, there is some way I can set an IDE to run my code and see how it works? Well I've seen some people generate some html output to test things out (it's js after all) but you'd have to write a nodjs backend or something. I believe random maps have hotloading so you should be able to test things on the fly while the game is running. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.