Congrats Toady! I Wish you and your beloved many happy memories together.
After that, for even some basic things I want to do with magic, I require multi-step scripts that can refer back to variables and so forth, and it was just looking like I needed to make a scripting language. And that would be too much, when scripting languages exist when a history of use in games, which also solve the forgotten beast problem. So we arrived here. The happy world of scripts generating scripts using a standard scripting language.
[..]
As long as it remains performant, we'll just keep expanding over time, and try to make new features compliant immediately if large problems don't arise, etc. Currently optimistic!
1. Raws generation for the initial release, but it gives us the opportunity for run-time use down the road, since it's already in the system.
[..]
One-based indexing is absolutely hideous, maximum engineer-brain, and much of the code I've written so far demonstrates its ugliness fantastically
[..]
4. Which ones? The Lua systems you see here are already old systems rewritten to use Lua, the code included in the game is all code that used to be in C++.
I thought I'd just leave this here, in case the option was not known:https://root.cern/cling/ :
Cling is an interactive C++ interpreter, built on the top of LLVM and Clang libraries.
https://github.com/root-project/root/tree/master/interpreter/cling :
Cling implements the read-eval-print loop (REPL) concept, in order to leverage rapid application development. Implemented as a small extension to LLVM and Clang, the interpreter reuses their strengths such as the praised concise and expressive compiler diagnostics.
I believe Cling is the fastest interpreter available - faster than LUA? - as Cling is used by CERN as a faster alternative to the old CINT of the Root project. Cling is no doubt stress tested on algorithmic-y code, similar to procedural generation algorithms.
Cling is licensed under LGPL by CERN. This means it can be used in DF:
https://github.com/root-project/root/blob/master/interpreter/cling/LICENSE.TXTThe original Clang is licensed under the permissive Apache 2.0 license these days which is also fine for use in DF:
https://github.com/llvm-mirror/clang/blob/master/LICENSE.TXTUse of Cling/Clang basically allows embedding a interpreter/compiler within DF. It should allow scripts to generate code which are then compiled to DLLs to get the fastest performance. For example, this could allow scripts during world generation to create compiled code that runs when the game is played. All in C/C++.
There are LUA to C++ machine translators, if there's code that's been moved to LUA and improved for the magic system already.
These tools might also be good for "rapid application development" in DF, as advertised - think quickly copying a function from compiled space into scripting space, then rapidly iterating on procedural algorithms without recompiling and restarting each time - then copying code back with no changes needed. Unlike when using LUA.
Just in case you find Cling useful.
As long as it remains performant, we'll just keep expanding over time [..]
As for being performant - I think the limit of scripts creating compiled DLLs might be reduced benefit from whole program optimisation aka Link Time Optimisation. It shouldn't matter that much. With JIT compiled scripts that run during gameplay, performance will be slower.
One impact of performance on general development that is easily overlooked, is if something slows down the time for the testing loop: start the game and test out a change in-game, close, make a change to code or data, then restart and get back into the game. It's something seemingly insignificant, but could make a large impact on development. If the testing loop takes too long people also lose track of their thoughts. This applies even be when iterating on something simple like texture - which could be avoided by having a debug menu to reload assets/scripts. But even testing bugs and saves involves restarting a lot. If world generation is being tested then slowdown due to scripting would be impactful.
Q1: Healing Magic. Will healing magic need substantial rules constraining use in fighting, for the usage to be plausible with what people would do if that magic was available in real life?
It seems magic healing would normally promote the use of "high alpha" weapons - ones that are one-hit-kill or do a debilitating amount of damage. People would sacrifice other aspects of warfare for a chance to take out enemies. They'd use overwhelming force whenever possible. They'd target healers as a priority. They'd focus on anything that prevented healers from applying healing, including disruptive magics and substances if they existed. On the flip-side, people would prioritise protection for healers, and focus on fetch squads to bring the injured to protected healing areas. The rich and the powerful would have an army of healers monopolising rarer healing resources.
As a real world example, in warfare, sometimes armies use horrible debilitating but non-lethal weapons to try to overload medics, to slow down advances, and stop medics from being free to patch up minor injuries to get warriors back up.
Fantasy stories tend to just focus on the protagonist's party or side using healing, and handwave that the societies' focus on healing and disrupting healing is balanced everywhere. DF has the problem that the opponents side and technology could be anything - even Dwarves, and the player could be in a lot of the possible situations. Plausibility aside, players will take advantage of tatics abusing healing, even if the AI won't.
Q2:
As I understand it from following DF over the years:
DF's procedural myth and magic setup is to be different every time, so people can enjoy learning the rules and myth behind magic, similar to the discovery when getting into a new fantasy game franchise for every world...
With this, I can see a situation where people want the same rough procedural setup of myth and magic for multiple different worlds - even if the specifics are different for every world.
For example they might find a setup where powerful people killed the original gods and took their power to become something like gods themselves, and then tried to rewrite history pretending they were the original gods to throw off would be usurpers. Maybe those gods were keeping something at bay and now it's running unchecked. Maybe the gods experimented and opened a doorway into another plane and let in demonic hordes. Maybe a cataclysmic event opened a rift between two worlds in different dimensions with their own sets of gods, and now there's a war - and possibly 2 competing magic systems. Maybe a cataclysmic event let in another type of magic, force of nature, runic or ley line system. Maybe they liked a particular setup of a pantheon and forces.
Big supernatural events don't all happen before year 0. Events like rifts or worlds colliding might be scheduled to happen after X years regardless of what gods and sapients did - so players might want the same event to be scheduled in a different world after some years.
(For those that don't know, IIRC Toady has mentioned the ability to have multiple worlds, different planes, and map changing cataclysms as part of the 3-4 year map restructure, myth, and magic arc. So distinctive setups like mentioned above are on the cards AIUI.)
The exact proc gen capabilities aren't important - what I'm trying to get at is, in a procedural system, there will inevitably be some flavours of myth and magic people really like to recreate. They'll want to keep the rough myth and magic setup, but let the specifics change to keep it interesting - and let the other parts of world generation be different as normal.
At the other end of the scale, ending up with a completely different myth and magic setup because a player didn't like the shape of the landmasses and re-rolled the RNG makes it hard to get desired generations.
Q2: Is it possible to design, from the start, to separate parts of the myth and magic procedural setup from other elements of world generation? Such that people can use a similar flavour of myth and magic setup on different worlds. Maybe have a combination of parameters outlining the general shape of myth and magic setup, and compartmentalise parts of the myth and magic procedural generation using different PRNG seeds players can copy/paste... Or is everything likely to be causally linked, and un-entagleable?. I'm asking now as it may be hard to change in 4+ years..
Players may like to share interesting myth and magic setups - they may want to view some of the hidden spoilery myth and magic output, and re-roll until they get a acceptable result. Sort of like a "re-generate" button during map generation to get different landmass shapes and types with the same advanced world gen parameters - which also would be a nice feature.
Edit:limegreen for questions only