Modding and Firaxis

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.
 
I just got turned off to DOW II/Chaos Rising and Empire/Napoleon Total War. I may even return my games because of the requirements to use Steam and all that is involved with that.

I see from reading the posted information about Civ5 (web browser, interactive fansite, etc.) that there is some evidence Firaxis may be going that way as well. I am keeping my fingers crossed in the hope that this will not be the case, because if it is then Moding as we knew it in CivIV is not likely to happen.

Has anyone confirmed anything that may tell us if it's one way or the other?
 
Perhaps you will be able to do the XML, SKD, python, etc. straight from the Worldbuilder, just like you could do the JASS coding in the Warcraft III worldbuilder?
 
>no scripting language mentioned

:sad:

I'm a C++ programmer by trade, so I'll probably just do that... And I guess it's possible that their XML files are incredibly powerful.

But I'd honestly rather a scripting language and no data description over data description and no scripting.

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. :crazyeye:) 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 digress)

So that brings me to my point: Somebody (perhaps me :mischief:) ought to make a lua interface for Civ V modding as soon as the game is released. I fear very much that without a scripting language we will see lots of mods with memory leaks and crashes and other issues, and that mods will not be produced as quickly anyway, because, let's face it, C++ isn't exactly the ideal language for rapid iteration of higher-level logic (and lua, if I may please avoid a language flame war, pretty much is.)

I've worked on C++ programs that used lua a few times now, and I'm pretty sure I could do a decent job hooking everything in the Civ V dll to a nice pretty lua interface. Of course this all depends on the dll, but I doubt it will get in the way. If I'm still interested at the time and not busy with other projects, this is probably what I'll be working on right after the game comes out. Otherwise, I hope someone else will be able to do something like this.

I just think that if you don't want to use C++, then there should be something other than XML to help you change the game, and lua is a fantastic (if, in some ways, a bit odd,) language.

Unless of course there is a scripting language, and they just haven't mentioned it... but I can't imagine why they wouldn't if they did.
 
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. :crazyeye:) 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...
}

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.
 
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.
 
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. Personaly, all that I want is a file that tells us how to format certain tags and what they do.
 
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. ;)
 
With XML, you don't need to mod the AI unless you are adding totally new XML tags. ;)

And not all new XML tags require AI programming either.
 
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. :devil:)

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.'
 
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. :devil:)

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.'

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...
 
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.

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.

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.

I don't think so.
The biggest problem on modding is not the skill, it's the time.
Look at Snafusmith or Shiggs. Their mod is not finished, not because they don't have the skill, it's because of the time.
 
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.

A feature that the AI doesn't understand is worse than no feature at all.
 
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.

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).

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.

A scripting language sounds like a PITA to parse and even worse to try to get the game engine/AI to understand...

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... :p

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
}

now, I'm sure something like this is doable in XML, but in lua it is almost NO work. And you don't have to change the C++. Or how about...


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.



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.
- use complicated algorithms / math to calculate values in your data, rather than doing it on a calculator and typing it in.
- make cascading changes that make it so you never forget to change something when something else changes, even using branching logic (ifs).
- find a library for translating strings from one language to another, saving countless man-hours on localization. (ok, this is kind of sketchy)

All this without changing the C++.

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.
 
But you have to define the defaults in C++.

No. You just put them in the schema. One line and you're good to go.

What's the point of a plaintext data format if nobody is going to type it?

I've used it as an interchange format for multiple programs in the past. Validation that your data is well-formed and of the correct type can be useful also.
 
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.

Oh come on. Adding a default setting takes only a few keystrokes. That's not a real arguing point.

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).

This is more a matter of opinion. Not that I don't agree, but it's completely subjective.

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.
Sure, but you lose the schema validations with 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... :p

Duh! You can make the "best"* programming language ever, but if it has no libraries, it's pretty useless. And vice versa.

*Subject to Opinion.

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
}
Like <!-- and --> are that much harder. :lol:

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.

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.

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]
This already happens with python in my mod. I'm not against the use of a scripting language... in addition to XML.
- use complicated algorithms / math to calculate values in your data, rather than doing it on a calculator and typing it in.
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.

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.

If your data is already a program, think how much slower the program will be if it has to load that program first. ;)
 
Oh come on. Adding a default setting takes only a few keystrokes. That's not a real arguing point.

again though, the fact that it's code gives lots of strength.
in lua you could have

function(a,b,c)
a = a or c or b or 0 --means 'if a is not defined, use b, unless it is not defined, then use c, otherwise use 0'
--[[stuff]]
end

or any other complex way of handling defaults.

This is more a matter of opinion. Not that I don't agree, but it's completely subjective.

Well that's why I said IMO :p

Sure, but you lose the schema validations with YAML.

Would you miss it? It isn't like programming languages, where strong typing can make debugging significantly easier, and "duck typing" can lead to having to walk up the stack a bit to find the problem. Chances are someone forgot to define a value that wasn't defaulted. Either way, you gotta go fix it, and you do so with the same amount of information if the exception system is any good.

Again, it's odd to me that people seem to think it's more important for data to have type validations than it is for scripts to have type validations.

Like <!-- and --> are that much harder. :lol:

What i meant was you can go from having the one huge table to separating similar things into functions (with very little effort), so it isn't even just the ease of removing them, it's the ease of... doing anything with them? It's difficult to put into words I guess.

It's difficult for me to express this any other way than the following sentence: a scripting language can do anything a data description language can do, and more, other than features you almost certainly won't miss for game configuration purposes.

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.

Not quite. I was referring to (i can't remember the name) a certain mod I played where it had a unique Embassy building for each civilization. With code, it's easy to programmatically generate a definition for each embassy, since the only difference is the name, the art, and the associated civilizations. Since it's programmatic, you wouldn't go have to add a new embassy building every time you added a new civ.

Now it's possible this mod had a clever way of defining these buildings, but my hunch is that they were each copy-pasted and edited.

This already happens with python in my mod. I'm not against the use of a scripting language... in addition to XML.

But I have not been convinced that a data description format is necessary (for a game) when scripts can be used to define data in a way that is potentially labor-saving.

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.

I know plenty of game designers who do an awful lot of math to balance configuration values for games. (of course I know others who are successful by just guessing at values and testing and changing it until it's right.)

But lets say you always want, i don't know, the :hammers: cost of a building to be proportional to the :culture: it provides. It's kind of nice to just have 1 variable to change that changes both values for you.

Now imagine that on a larger scale for balancing entire groups of buildings. Could be useful! Maybe you want a mode that halves the cost of each Wonder. Maybe you want code that increases the :science: cost of techs on a logarithmic curve. And then a moment later you want to change it to exponential and try that out.

Code is just plain useful.


If your data is already a program, think how much slower the program will be if it has to load that program first. ;)

This is something worth testing. My guess is that the runtime of the script that generates your data will be unnoticeable, and that the main decider for the load times will be parse time / compilation / etc.
 
What about active effects?

Yes, this is a problem...

A feature that the AI doesn't understand is worse than no feature at all.

Not if the AI uses it by accident in the right way ;).

I doubt all the people demanding an editor would tell you the biggest problem with modding is the time.

:think: okay, you're right here, but at this point we're not more talking about Adijica's subject, that many half finished mods could be released.
 
Back
Top Bottom