Author Topic: compileable calculations  (Read 512 times)

0 Members and 1 Guest are viewing this topic.

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
compileable calculations
« 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.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Now it's day and night the irons clang, and like poor galley slaves
We toil and toil, and when we die, must fill dishonored graves
But some dark night, when everything is silent in the town
I'll shoot those tyrants one and all, I'll gun the flogger down
I'll give the land a little shock, remember what I say,
And they'll yet regret they've sent Jim Jones in chains to Botany Bay.
~'Jim Jones', Traditional

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 47 - 1280KB. (show)
Queries used: 39.

[Show Queries]