The 10 Commandments of Non-Lua Trait Creation

Homusubi

Lafcadio Hearn Wannabe
Joined
Dec 21, 2012
Messages
1,035
After seeing quite a few bad UAs out there by modders who couldn't make a good trait if their life depended on it, I thought I should write this. This is for people who can't use Lua, because people who can, although they invariably make better traits, they have to spend twenty years up a mountain learning how to use the damn thing. So here goes.


1. Percentages always look worse. Most traits use a percent in some way or another. The problem with this approach is that there are no actual new ways of playing with percent traits, they just help you with something as if they were a policy. Non-percentage traits, therefore, give a better reason to choose the civ. The best Firaxis example of a non-percentage trait I can think of is Austria; it introduces a new unique mechanic. Japan and Aztec are also good in this regard. On the other hand, traits like Germany's, which are almost completely %-driven (How bad would it be to always convert barbarians?) seem relatively amateur.

2. Combinations of small percentages look worse still. If non-percentage traits are too hard and you need a percent sign in the UA somewhere, keep them big and sparse. Whatever you do, don't make it so that you generate 10 percent more science and get 15 percent less unhappiness from population, for example (argh!). That is a textbook case of a bad trait. No offence to the modders involved in these bad cases coming up, but Okinaro Empire and Magyar Mod Vanilla (both on Steam) are both big offenders. So if you want a percentage, keep it above 30%. Putting it under 20% is a criminal offence. The 33% and 50% involved in Furor Teutonicus keep me from raging at Firaxis.

3. Use the tables, Luke, use the tables. Using the same effects as Firaxis traits but in different amounts is a recipe for disaster, in particular if they are T/F effects such as Bushido and Long Count. You may have noticed in XML that there are these tables under the <traits> row. Use them, no exceptions. Free unit promotion? Use a table. Improvement yield changes? There, it's in a table. Free building? Well, it's not a table, but it has a TXT_KEY string, so it might as well be. So use these things to make new traits. Say that you've seen a trait that gives all units the Amphibious promotion. You can them use a modified version of this to give all your units the Indirect Fire or Rival Territory promotions, say. You've seen a free harbour; give 'em a free granary or workshop when you're modding.


I'll continue this when I next have the chance.
 
About the third point, I'd like to emphasize something.

With fake free buildings and very special promotions you can manage a lot of nice things. So also check the tables for promotions and buildings. For example, in order to get happiness per number of policies, you can add a free building that can't be built that does that. And of course in the description you simply talk about the effect of the building rather than of the building.

With the free building tag one can also make certain terrain yield more rather than just features. I just tested something interesting, when you gift a free building that requires, say, mountains; it only gifts it on cities with mountains. So you could make a trait that "Adds a culture bonus in cities with mountains" that sound interesting and changes the playstyle a bit... Unused elements in tables open up a lot of possibilities.
 
@Leugi: I'm ahead of you, using promotions and "invisible" buildings are two more commandments.

@Hambil: That's underpowered.
 
If you must. I'm not arguing any more about it. It just seems like one of those traits that would annoy experienced tacticians but not the AI.

Moderator Action: Moved to appropriate forum.
 
If you must. I'm not arguing any more about it. It just seems like one of those traits that would annoy experienced tacticians but not the AI.

I didn't respond to your OP initially because I generally try to avoid arguing with people "smarter" than me. However, I find your OP lacking the tags <IMHO></IMHO> and your response to Hambil more than a little condescending. Who died and made you the Civ5 Modding God anyway, having the omnipotent power to write the almighty list of 10 commandments of trait modding? I can agree more or less with #2 as I find small percentages fairly useless, but I don't pretend that such an opinion is anything more than that, an opinion. Not everybody chooses a civilization based on it's trait. Every mod is different, and most modders follow the general rule of creating the mod they want to play, even if it means annoying an experienced (anal retentive) tactician. The experienced tactician can learn modding for themselves and mod the mod or make their own with "better" traits. Your "commandments" are useful suggestions for creating mods that will appeal to more experienced players, but I would suggest using a little more humility in presenting your opinion.

I would also suggest, since this is a tutorial forum, rather than a rant and rave forum, you should give some more specific examples, rather than vague suggestions. You say you are using "invisible" and "fake" buildings, give us some concrete examples of how you are doing this, if you want others to follow suit. What kind of creative leader specific promotions have you come up with that aren't already in the game? You seem to be striving for more trait variety as opposed to rehashing what Firaxis has already done. If this is better done with LUA, then create a crash course tutorial for those of us "who couldn't make a good trait if their life depended on it". Tis easy to criticize, harder to shut up and teach.
 
I just tested something interesting, when you gift a free building that requires, say, mountains; it only gifts it on cities with mountains.

So, in theory, you could create a new Mountain Fortress building based on Machu Picchu or Neuschwanstein Castle? I always like building those wonders just because they look kind of cool sitting atop a well fortified mountain pass. :) These free buildings are given to every city settled and not just the first one? I guess I just assumed it would only be the first one like the Palace but I guess that is because the Palace has a MaxInstance of 1 per player.

I might have to think about adding something like that for my warmonger civilization or maybe one of the builder civilizations that will be more heavily geared towards defense.
 
So, in theory, you could create a new Mountain Fortress building based on Machu Picchu or Neuschwanstein Castle? I always like building those wonders just because they look kind of cool sitting atop a well fortified mountain pass. :) These free buildings are given to every city settled and not just the first one? I guess I just assumed it would only be the first one like the Palace but I guess that is because the Palace has a MaxInstance of 1 per player.

I might have to think about adding something like that for my warmonger civilization or maybe one of the builder civilizations that will be more heavily geared towards defense.

They are in fact given to every city (that meets the terrain requirements when they exist). Of course, this must be done through the <FreeBuilding> tag on the Trait table rather than through the Civilization table...
 
Can you stop flaming me LuvToBuild, I'm trying to teach but you lot won't let me. When I said "annoy" experienced tacticians I meant "be useful against" them.
 
4. Invisible palaces are often overlooked. There are a ton of XML effects that are present due to wonders. World wonder effects can be incorporated into a trait by creating an "invisible palace": that is, a palace that looks like a palace and has the same text as a palace, but is actually a UB with a world wonder effect. Machu Picchu's effect maybe? "+30% gold from trade routes" would work for an econocentric civ. How about Cristo Redentor?

5. Free buildings that nobody knows are there are ability goldmines. (first found in the Book of Leugi, 11;42). This is a hard one to achieve as UBs have to replace an existing building. But making a FreeBuilding plus another effect could also work. Just like commandment 4, wonder effects come in useful here, such as Petra's and Neuschwanstein's. It may seem hard, but the end result is worth it. Leugi's example of mountain effects shows how, as do other required terrains. Yes, that's right, it could make tundra useful. (Hey, I've just come up with a trait idea...)

6. Who says tables can only be used the Firaxis way? Some tables can be utilised in more than one way. While one of these was the reason for the table's existence, the other could come in useful. Take the <Trait_ResourceYieldModifiers> (or something like that) table. Firaxis used this for Russia's trait by doubling Iron and Uranium resources, and Arabia's by doubling Oil. There are two ways this can be altered. The first and easier way is to create an Aluminium enhancing trait, for example. The second is more interesting and catches Firaxis off guard. It is not exclusive to strategic resources. That's right, luxuries work too. (Not sure about bonus resources). When I was creating the Shimazu clan for my Japanese mod, the trait ended up being "quantity of Luxury Resources is doubled". This may not seem like much. It doesn't boost happiness. It's not meant to. What it does do is give the Shimazu much better bargaining tools when trading. Used properly, this means a good Shimazu player (I do not claim to be one) could, by skilful war-related trade deals with luxuries, plunge the rest of the continent into chaos while the Shimazu themselves sit and watch, whether that means going for science or culture or attacking weakened civs.

7. XML constants do not need to be constant. When I say "XML constants" I am talking about those values that you copy and paste from other civilisation XMLs, like the one that gives you a palace at the start of the game. One of these - additional free starting technologies - has already been used in a number of good traits. The others are less explored. Why not explore them? Give your civ an extra settler, maybe, or give them a fairly early wonder on turn one. (I used Himeji Castle for this; the resulting civ, the Mori, became one of the strongest in the mod)

I'll post the final 3 when I next get the chance.
 
Can you stop flaming me LuvToBuild, I'm trying to teach but you lot won't let me. When I said "annoy" experienced tacticians I meant "be useful against" them.

I am not flaming you. I was expressing my opinion that you are presenting yourself as being superior in terms of creating XML based traits for new civs. I realize this probably wasn't your intent. However, when you express frustration with "modders who couldn't make a good trait if their life depended on it", and then go on to say that percentage traits are basically lame, you are bad mouthing other modders who have chosen those kinds of traits for reasons of their own. You are free to have an opinion, but please don't bad mouth the hard work that others have gone to when creating their own mods. Your ideas are valid and should be expressed. I'm always open to new ideas and I don't wish to shut you up or bad mouth your work. I would just like to see it presented in a more community friendly way.

Specifically, regarding your comment about Hambil's no pillage trait, you are failing to consider the context of the mod. In a normal game, disabling the enemy's ability to pillage might be "lame". In Hambil's mod, it makes a lot more sense, especially for an AI civ against a human invader. If the human is taking damage from attrition and can't heal so easily from pillaging, he will be more likely to sue for peace as opposed to fighting a long and protracted foreign war. It's a similar concept to the Ethiopian Spirit of Adwa which favors a defender AI against an aggressive human player.
 
I already conceded to Harbil that his trait is good against a human player. That argument is over and I was not criticising him; I just originally thought that it was UP because the AI don't pillage much.

The thing is about the percentage traits thing is that a) I have had to create a total of 16 non-Lua traits so far, so I should know what I'm talking about, and b) I am sick of seeing traits that raise a certain value by 10% and reduce unhappiness from population by 10%. That kind of trait makes an otherwise good mod bad.

Oh, one more thing:

I would just like to see it presented in a more community friendly way.

&#8220;They represented what people called the "international community." And like all uses of the word "community," you were never quite sure what or who it was.&#8221; --Terry Pratchett

sort of sums up how I feel about people who use the word community.
 
sort of sums up how I feel about people who use the word community.

Flaming is out, but trolling is in. Good to know where you stand. Thanks for enlightening us.
 
They're both out, and I'm not trolling. I just want to see the word community removed from the dictionary because dictionaries are only meant to have words that mean something in them. Can we get back on topic?
 
They're both out, and I'm not trolling. I just want to see the word community removed from the dictionary because dictionaries are only meant to have words that mean something in them. Can we get back on topic?

Ahhh, the eternal debate between individualism and collectivism... :P

It is somewhat on-topic, however, as I'd agree with the criticisms of your method of presentation. While the various ideas you've presented are quite helpful, the method of delivery leaves a fair bit to be desired. Anyone who's seeking guidance in making more interesting traits is probably going to be turned off by the fact that you insult them in the first lines. Not to mention your use of the term "commandments" comes across less tongue-in-cheek and more as an insistence on conformity, rather than innovation. "NO ONE should make a trait I disappove of!"

Ah well.

As I said, though, the bulk of the information is rather useful, although I'd love to see someone actually make a tutorial on how to make a building invisible. (I'm still not sure which commands are necessary, and if it can be done via XML or whether it requires Lua.)
 
I'm not sure about the invisible buildings thing. With palaces, you can just use already existing TXT_KEY's and add a hidden effect. With <FreeBuilding>, one possibility is making a new building class and making it available at Future Tech, thus making it unavailable by any means other than <FreeBuilding>. Another method might be to make the free building an official UB.

As for the innovation/conformism thing, you're wrong. I'm not telling people to conform, I'm telling people to do the opposite. Conformism is telling people what a good trait is. I'm trying to tell people what a bad trait is and how to avoid the low-percentage-unhappiness-reduction pitfall. I'm not stopping people from making a trait which looks something like "+5% production, gold, science, culture, and faith". That is not a bad trait. I'm trying to stop people from making a trait which is a few bits straight out of Firaxis traits bashed together.
 
As I said, though, the bulk of the information is rather useful, although I'd love to see someone actually make a tutorial on how to make a building invisible. (I'm still not sure which commands are necessary, and if it can be done via XML or whether it requires Lua.)

Indeed this would be a good tutorial. since the freebuildings you can create via xml or lua are so useless to see.
 
They are in fact given to every city (that meets the terrain requirements when they exist). Of course, this must be done through the <FreeBuilding> tag on the Trait table rather than through the Civilization table...

Okay, that clears up some of my confusion. You mean:
Code:
...in CIV5Traits_Expansion.xml
<Traits>
	<Row>
		<Type>TRAIT_PHOENICIAN_HERITAGE</Type>
		...
		[B][COLOR="Red"]<FreeBuilding>BUILDING_HARBOR</FreeBuilding>[/COLOR][/B]
	</Row>
</Traits>
which grants a single free building to that civilization in every city that could otherwise have built it normally, and not:
Code:
...in CIV5Civilizations_Expansion.xml
[B][COLOR="Red"]<Civilization_FreeBuildingClasses>[/COLOR][/B]
	<Row>
		<CivilizationType>CIVILIZATION_CARTHAGE</CivilizationType>
		<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
	</Row>
[B][COLOR="red"]</Civilization_FreeBuildingClasses>[/COLOR][/B]
which grants multiple free buildings to that civilization at the start of the game.

What hasn't been mentioned as far as I can tell, is the corresponding:
Code:
...in CIV5Buildings_Expansion.xml
<Buildings>
	<Row>
		<Type>BUILDING_CN_TOWER</Type>
		<BuildingClass>BUILDINGCLASS_CN_TOWER</BuildingClass>
		...
		[COLOR="Red"][B]<FreeBuilding>BUILDINGCLASS_BROADCAST_TOWER</FreeBuilding>[/B][/COLOR]		...
	</Row>
</Buildings>

It seems to me that you could use the Traits FreeBuilding and the Buildings FreeBuilding with Homusubi's suggestion ;) #4 to give a civilization two free buildings in every city. However, the Palace will probably show up as the UB if you make it unique to that civilization. At least that has been my experience. If you want a different building to be the actual UB that shows up as such, you may need a different approach.

Theoretically, you could also give a civilization multiple free "wonders" in the capital that would grant free buildings in all of your cities. For instance, you could have a Grand Mosque or Notre Dame or something that gave all of your cities a free mosque or cathedral as soon as they were built. I think maybe you could combine that with FoundsReligion to give a civ an automatic religion and automatic religious buildings. I think I will test that out for my mod.

The one thing I am still totally confused about is the whole "hidden", "invisible", and "fake" thing. Are you guys talking about deleting the icon and TXT_KEY references so that the building / wonder doesn't show up in the city view interface?

In the end, I'm not sure I would agree with calling a hidden building a UA. To me, they should just be UBs, but I guess I can see how using them in a hidden fashion allows you to create more interesting "UA"s.
 
I'd love to see someone actually make a tutorial on how to make a building invisible. (I'm still not sure which commands are necessary, and if it can be done via XML or whether it requires Lua.)

I'm not sure about the invisible buildings thing..

Indeed this would be a good tutorial. since the freebuildings you can create via xml or lua are so useless to see.

Just open one of Tomatekh's mods and copy his files and file structure if you want to see how to do invisible buildings.

It needs some lua changes to the cityview and civlopedia lua screens. These changes were made by Thalassicus & trystero49 so be sure to credit them if you use these edited lua files.

You have to make a new buildingclass for the building (XML) with a negative cost.

Then you also need to use SQL to update the building tables, and then set the visibility with the buildings themselves which can be done with either SQL or XML.
 
Back
Top Bottom