MKelm / mct

"Mass Control Tycoon" a GPL game for Windows, Mac and Linux
Other
5 stars 1 forks source link

own node.js modules / C++ bindings #38

Open MKelm opened 10 years ago

MKelm commented 10 years ago

I have some topics that might need own node.js modules, because that makes it possible to use faster C++ bindings.

So in the later stages it might be needed if we have some performance concerns and have to transfer some game modules to C++ bindings.

Here is a article about addons: http://nodejs.org/docs/latest/api/addons.html#addons_addons

Here are some examples: Example hello-world-ish programs:

Examples:

Something offtopic, my last bigger C project ;) http://repo.or.cz/w/jimb.git

MKelm commented 10 years ago

I placed the issue to final 1, but the final 1 has no requirement for performance issues, so it might be useful to add at least one milestone for performance patches for final versions.

MKelm commented 10 years ago

A binding library for complex calculation functions might be useful, but I do not know the potential of speed enhancement in detail, C++ is definitely faster, but the JS V8 engine is very fast too.

jackery4444 commented 10 years ago

C++ is much faster than pretty much every other language, with the only exception being assembly as far as I am aware. However this extra speed that C++ provides really isn't needed due to the lightweight nature of the game. We should never use C++ if performance is the only reason because the extra effort and added complexity to the project outweighs the practically un-noticeable speed difference.

MKelm commented 10 years ago

Yes, it is more for a worse case scenario if something occurs which needs this, but you are right the game looks lightweight, till now ...