Well, at least in the in game mod thing that Firaxis is trumpeting there will be a rating system. I'm sure the best mods will get the highest rating. Since you should be able to sort by rating, the cream should rise to the top.
aside rant:
{
Using scripts for data instead of XML is just... such a better alternative for games. Honestly, these days I sometimes struggle to see why XML is still so heavily used when there are dozens of frankly better smaller faster simpler easier alternatives. I guess it's because there are so many already made tools and built in language features (like in C#.) (And I've always found the idea of 'we need type safety for data but not for scripts' to be incredibly wonky.) Basically, after using YAML for the past 10 months or so, I've decided that the next time I use XML, it will be because I'm being paid to...
}
I totally agree about a scripting language. Lua, python are both good candidates. Lua is probably better if it has to be hooked in from the outside by a modder because it's faster.
As for the ai, all mods don't have anything to do with the ai. There are GUI mods to begin with. There are map scripts (I'd rather code mine in a scripting language please because it's full of list/table processing and that would be 3 or 4 times shorter in lua than in C++). There are scenarios where you map an event to some unit entering a tile. There are lots and lots of things.
As for the ai, it can be modded too anyway.
With XML, you don't need to mod the AI unless you are adding totally new XML tags.![]()
AI, AI, and AI. With a standard data format, it's relatively easy to predict the values and make the AI preform accordingly. With scripts, you'd basically be hardcoding the AI for every little feature, which would work fine, until some unsuspecting modder came along...
This already happens with python. Some modders will give a building a cool effect via python in Civ4, but the AI will be completely clueless about it, unless you go to the trouble to hardcoding in the SDK.
The point I'm trying to make is not that you shouldn't have data separated from functionality, it's that you can have a much easier time making data if you make your data -out of- code. Just the fact that it's code lets you avoid redundancy and recognize patterns that can be functionally separated. It makes everything much easier to work with, basically. In short, I'm not saying you should put functionality in your data, I'm saying you should make your data using functionality, to save labor. See what I'm saying?
For example, in lua, a building data file might look like: (keep in mind this is all hypothetical... this isn't something I'm planning on doing in Civ V... probably. It depends on how much they give me.)
DefineBuildings
{
Building{name = "theater", cost = 50, culture = 5, allowed_specialists = {artist = 2}, button = "theater_button_image" --[[etc]]},
Building{--[[etc]]},
Building{--[[etc]]}
}
Now, there's already an advantage over XML: it's prettier! At least IMO, this is much easier to read and write.
But here's the real advantage over a data description standard like XML or YAML: in a scripting language it's very easy to save time by making helper functions like
function temple(religion_adjective, building)
building.name = religion_adjective.." temple"
building.culture = 1
--other stuff that's true for every temple
return Building{building}
end
and then later when making the temples you have calls like
temple{"Jewish", {button = "jewish_temple_button", --[[etc]]} }
so you don't have to repeat yourself later.
and that's just the tip of the iceberg.
I assume what you were thinking I meant putting functionality like "onEndTurn" in these data files. That's not what I'm suggesting (although for quick hacks it could be useful... and yeah screw up AI, because it can't make heads or tails of a function, but can of a number...)
Hope this explains what I mean by 'using scripts for data description.'
This already happens with python. Some modders will give a building a cool effect via python in Civ4, but the AI will be completely clueless about it, unless you go to the trouble to hardcoding in the SDK.
I don't see what people are worried about. If an editor provides easy access to the XML equivilant people will quit releasing half-arsed mods because they are able to do more on a basic level.
Doesn't matter, if the AI has no clue about it, when it's just build and the effect is passive. Sure, could be better, but it's not useless.
XML is really easy to add or modify on the fly as well. Adding a new tag to 100 buildings takes only a minute or two, depending on how diverse the values are.
As for readibility, XML tags don't need to be there for 0 or default values. You can delete all those lines and the game will just use the default value from the constructor. You can make a building out of 5-6 lines of XML.
A scripting language sounds like a PITA to parse and even worse to try to get the game engine/AI to understand...
But you have to define the defaults in C++.
What's the point of a plaintext data format if nobody is going to type it?
But you have to define the defaults in C++. With, say, lua, you could define defaults as part of the data just as a language feature. There's so much that's already built in, and it's all designed to reduce your workload.
and defaults aren't the only thing that help readability. {} is much easier on the eyes (and fingers) than <blahblah></blahblah>, it's nice to not have something that's strongly typed (because honestly you almost never need type safety in data), it's nice to be able to rename things you don't like (don't like "DefineBuildings"? "Ilikethisfunctionnamebetter = DefineBuildings" done).
Sure, but you lose the schema validations with YAML.XML in general is just a ridiculous amount of keystrokes to do the simplest things and it's really frustrating coming off of something like YAML.
well they wouldn't be very popular languages if parsers weren't already written for you... and the lua interpreter is smaller than a lot of XML libraries I've seen...![]()
Like <!-- and --> are that much harder.I will concede though that depending on the architecture that's built around it, it could be made difficult to do the equivalent of adding tags in XML.
But,
Here's another example:
DefineBuildings
{
DefineVanillaBuildings(),
DefineWarlordsBuildings(),
DefineBTSBuildings(),
DefineRoMBuildings(),
DefineANDBuildings()
--now you can easily comment out a group with two keystrokes
}
function DefineEmbassies()
ret = {}
for _,civ in ipairs(civs) do --for each civ
table.insert(ret,Building{name =civ.adjective.." Embassy", --[[other stuff for embassies, i dunno]] })
end
return unpack(ret) --you can return more than one thing in lua O_o
end
so now not only have you avoided a lot of copy-pasting, but you've made it so that embassy buildings are automatically generated when you define a new civ. You could do the same for religious temples or potentially any pattern, in very very little work.
Again, I'm sure there's a way to do this in XML, but it would involve writing C++ code at some point, right? Doing it all with scripts is just... so much easier. It's like you're a housewife in the 50's and you just bought a washing machine.
<Define>
<DefineName>CAPITAL_BUILDINGCLASS</DefineName>
<DefineTextVal>BUILDINGCLASS_PALACE</DefineTextVal>
</Define>
This already happens with python in my mod. I'm not against the use of a scripting language... in addition to XML.Other advantages to using scripting:
it's code!
things you could do:
- have it pop up a message box before loading asking you which things you want to load. [/CODE]
Conceded. However, most values that are important don't exist until the game does it's final initialization, so having dynamic values would be pretty useless during loadup.- use complicated algorithms / math to calculate values in your data, rather than doing it on a calculator and typing it in.
Often times with really snazzy data systems you'll see whole programs dedicated to generating XML and getting things like cascading changes and performing math. To me this is incredibly silly. What's the point of a plaintext data format if nobody is going to type it? If you use a scripting language, your data is already a program, and that's what makes it so magnificent.
Oh come on. Adding a default setting takes only a few keystrokes. That's not a real arguing point.
This is more a matter of opinion. Not that I don't agree, but it's completely subjective.
Sure, but you lose the schema validations with YAML.
Like <!-- and --> are that much harder.![]()
You mean like this:
Code:<Define> <DefineName>CAPITAL_BUILDINGCLASS</DefineName> <DefineTextVal>BUILDINGCLASS_PALACE</DefineTextVal> </Define>
That's all the XML you need to put a palace in every capital. Not much either. A lot of the extra XML is designed around customizability, not minimizing code.
This already happens with python in my mod. I'm not against the use of a scripting language... in addition to XML.
Conceded. However, most values that are important don't exist until the game does it's final initialization, so having dynamic values would be pretty useless during loadup.
If your data is already a program, think how much slower the program will be if it has to load that program first.![]()
What about active effects?
A feature that the AI doesn't understand is worse than no feature at all.
I doubt all the people demanding an editor would tell you the biggest problem with modding is the time.