Alpha Centauri 2

Community => Recreation Commons => Topic started by: bvanevery on February 15, 2018, 03:51:46 PM

Title: compileable calculations
Post by: bvanevery on February 15, 2018, 03:51:46 PM
One thing I'm learning from reading the archives, and looking at all the things Yitzi got up to over the years.  It would be really useful if the mathematical forumlas for various game rules, were explicitly available in human readable files somewhere.  That would put a crazy .exe modder like Yitzi out of a job.   ;lol  Seriously, needing that level of skill to perform mods is not a way to grow a modding community.  Now, opening up formulas like that does carry some risk, as modders can be expected to be complete amateurs about QA and versioning.  So one would want some kind of firewalling or sandboxing, at least at the level of user perception if nothing else.  Nasty notes about "you're using a modded game.  If it blows up and dies, it's your fault!" or some such?

It would be highly desireable to have calculations compiled into native code.  This in practice would mean not only having a formula modifiable by the user, but also having some kind of code injector and compiler as part of the game.  The paradigm might be something like "iterate over all these tiles / cities / units / whatever and perform the following calculation".  Because of this, formulas might have to be less longish and "closed form specifying everything".  More just values computed in a pipeline of successive computations, until one arrives at a final phenomenon.

Now I suppose if mere values are compiled into native code, then one doesn't need a compiler.  One just parses the text and loads the value statically.  Or dynamically, if one wishes to encourage on-the-fly editing of a .txt file.  Offering the ability to design the entire formula, is more flexibility.  I wonder if that really has much value?

Maybe the problem is more about making it easy, or even automatic, for the game programmer to publish the values used in formulas as items in a .txt file.  I imagine that if the game programmer is whizzing along creating this and that, making it accessible for anyone else's tweaking is a low priority.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 15.

[Show Queries]