Jump to content

Choice of Programming Languange


Recommended Posts

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 by Faizan Khalid Mohsin
improve clarity of question
Link to comment
Share on other sites

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 by maroder
Typos
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...