Notice: please read the entire post before posting an answer to this, and sorry it's so long! Also thread
derailment
Why is this thing in Content Creation -> Games & Mods forum? I recall posting it in the Feature Requests, as it was and still is a genuine
engine feature request.
I'm not satisfied with the proposed solutions as they all look hacky, and I don't think lua should be used just because you can, as it either unnecessary complicates the game or wrongly models (f.e unit with large amount of storage, large real value amount of storage) the desired effect (infinite storage in this example).
Now since the thread has already derailed, I'd like to whine about this and a couple of other things (such as the Invulnerable units thread, or changing Unit Defs runtime and changing players/teams runtime):
Even though you can normally work around some of these things, it is still a problem when you get to more complex things such as f.e scenario(mission) editors in which you'd like to allow users an easy way to edit stuff, and you don't want to annoy yourself by doing game restarts (for teams/players/unitdefs changes), or hacky things that may/may not work depending on the mod you are using (no idea if bullethits or economy changes would conflict with existing mod mechanics).
Also, the more of these core concepts that you have out of the engine, the harder it will be for new people to create content for Spring, and the harder it will be for AI creators to work with Spring - simply due to the lack of a proper, well known interface.
My current aim with Spring is twofold:
1. To assist in creation of non-skirmish games, such as f.e multiplayer competitive/cooperative games (think WC3: footmen frenzy, risk, tower defenses, hero arenas/sieges, etc.), as well as single/multi-player storytelling games with a (linear/non-linear) campaign. I believe in order to facilitate that we need to widen the range of people that can create that content (which they will most likely base on existing skirmish mods/games). I also believe this should be done by creating graphical tools (such as the existing ZK mission editor, but better), and I believe those tools should be built on top of the engine, since WYSIWYG tools ease the start for people familiar with the game they'd base their work on (which they probably played a lot and got their motivation from), but not with lua or the spring engine interface.
2. Create a good environment to develop AI in multiple languages, with the ability to easily test, compare and compete with other AIs. For this I'm working on springgrid, a site that allows people to queue AI games, create AI leagues and whatnot. I'd also like to see AIs that can solve scenario based games (and not just skirmish ones), which I think would be a great thing for AI research as well as AI gaming.
The problem I see with Lua is that it complicates creation of new content by independent developers. If someone were to implement some feature (such as f.e infinite storage or invulnerable units) in the engine, it would be easily used by any of the target groups: mod/game devs, AI devs (such a small community), widget devs (sorry! i believe they still exist), scenario devs (indirectly, by using a scenario editor), etc.
However, if someone were to do it in Lua, and say he were to also create an library-like interface, how would we be able to use it in our independent widgets/scenario editors/AIs - i.e how can we know of it's existence (programmatically).
The AI problem.
Sending messages to lua sucks, I want a clean interface (with doc) to work with.
F.e in a Java AI, how am I to know that a certain unit can be invulnerable (or any other Lua game/unit property)? I would probably need to have an additional library (an additional .jar) from that mod that supports the notion of invulnerability (and what happens if a scenario supports that concept while the mod on which it's based on does not? the creator of the scenario would need to supply it).
Now if we don't want those content developers to spend their time creating java libraries that expose the features they're using, we would most likely want some sort of a parser that would create an interface automagically (yes, that interface may send messages to lua all it wants, but that should be hidden from the developer). I'm worried that this is a
hard problem, seeing as how we're still struggling to create basic (spring engine) AI interfaces for other non C++/Java languages.
The Scenario Editor problem.
So what extra stuff does your mod support? What can the users configure? What values does it take, etc.?
In the process of creating the Scenario Editor, I've reached a point where I'd like to allow users to configure/test properties, and based on that make some changes to the game/have some sort of notifications (f.e: if hp% of trigger unit < 50% send message "the base is under heavy fire!"). The problem is with the idea that I'd like to support all mods with this - which in theory should be possible since it's based on the same engine, however, while I could define properties such as this:
Code: Select all
{
humanName = "Unit HP%",
name = "unitHP%",
data = { "unit" },
output = "number",
},
I have no idea how to do this for mod-specific properties outside of writing custom files for those mods that should hold those properties, (imagined) example:
Code: Select all
{
humanName = "Unit Neutrino Capacity",
name = "unitNeutrinoCapacity",
data = { "unit" },
output = "number",
},
It gets more complex with infinite storage and other stuff that isn't just simply properties, but rather game options.
The problem boils down to the same thing like with the AI, can lua feature creators specify stuff that they created in a way that allows usage on the same level of quality like it would be with the official Spring engine documentation? And how can we expose that stuff in a pleasant manner to other (independent) devs?