Modding on a Saturday night

This weekend I’m trying to see how much I can do to the game without having to have access to the source or, for that matter, without having art skills.

Right now, for beta testers, there’s not much modding possible because there are is no documentation and the data is streamed from our servers so that we can do real-time updating. 

Here’s how modding works:

First, you have to think of everything in the world in three parts:

1. The data that explains what the thing you want in the game is.

2. The image that represents the thing you want in the game.

3. The 3D object that represents the thing in the game when seeing it in 3D.

Right now, we’re lucky because the 3D engine is disabled in the beta and in the final version, there will be a huge pool of 3D assets that modders can make use of or use the built in mod tools to create without ever having to crack open Maya or 3D Studio.

So for tonight, I decided to make a new resource called twilight bees.  This would be a food resource.

Step 1: The data

The biggest load hog on Elemental right now is because of the way we do our XML. We will have to optimize it but it was done to make modding easier.  The idea is that you can toss in any XML file in the data/<your language> directory and voila, the game will read it in.

This way, modders don’t have to worry about modifying existing files. They can easily add their own files.

So I created a file called twilightbees.xml

Using the “stuff” I found in coreresources.xml I reversed engineered how resources were put in (yea, if I was at work, I would just ask but I’m at home so I have to figure it out or worse, look through the google docs on the project).

image

The stuff I highlighted is the stuff I couldn’t figure out and think it needs to be either taken out entirely or have a pretty important point for existing because they don’t seem to matter except rarity but what does “3” mean?  I am going to ask that rarity be simply a percent 0 to 100% odds of the item showing up in a given tile.

Step 2: The image

I found a bee hive image on the net and copied it into the gfx/tacticalicons directory.

In the game

They I ran the game and was greeted with this:

image

One thing that was nice is that I didn’t have to worry about sizes. Old modders reading this know what I speak of.  The game took care of sizing it properly for me so I didn’t have to make it some 128x128 image or whatever.

image

Once I had farming tech, I could build a farm on the twilight bees.  Why a farm?

Because I kept the <Type> as fertileland and in the file k_farming.xml is where the “farm” improvement is.

image

One thing I learned is that there is a lot of XML possibility already in the current beta.  For example, there is also a f_farming.xml for the Fallen farm.  What resources show up is all data driven and what improvements, how they look, what they do, is all data driven.

So for instance, I could create a race of dwarves with their own tech tree, their own improvements, but could act on the same land in different ways.  Maybe Dwarven mines, for instance, could be more productive than the standard mines.  Or maybe there would be resources that only dwarves could even see on the map.

My main complaint right now though is the sheer amount of clutter that I’m not convinced is necessary. We’ll have to be careful not to let too much legacy XML stay in there.

Now, the question rises, what should be in the game by default in terms of “stuff”?  It’s always a challenging question to answer.  For instance, having spent years playing games from Dominions to MOM to Civilization and HOMM and so on, each game has its own take on how much “stuff” the user needs to deal with.

I’m of the opinion that I’d like to see quite a bit of different stuff on the game map that does interesting things even if it makes the map a bit more “cluttered”.

Tomorrow, I plan to start digging into the technology trees for the game.

83,759 views 42 replies
Reply #1 Top

Thanks for the insight, Brad; I've done some looking and analyzing at the xml data, like the dungeon files (which are probably very placeholder right now anyway), but hadn't really tried to apply any mods because I figured the downloaded data would override it (or should, at least, for testing purposes).

By the way, if at some point (before Beta 5) you want us to look at the xml files and see what isn't self-explanatory and needs more documentation, etc, let us know.

Reply #2 Top

I suspect long before beta 5 we'll be making mods.  I plan to make mods and release them myself long before beta 5.

Mine won't be total conversions or anything. But I would like to see if I could make a third race or a new alignment or something.

Reply #3 Top

The default kingdoms/empires are "RaceConfig" records in CoreRaceConfigs.xml, it looks like.  They have a RaceType ("Kingdom" or "Fallen") and and an Alignment ("Good" or "Evil").  I can't find anywhere in any of the files an actual definition of the RaceType "Kingdom" or Alignment "Evil", so I don't think new ones could be modded in at this point.  But that's probably because RaceType didn't exist in GC2 and the hardcorded alignments were sufficient for GC2 and y'all haven't had any time for non-essentials like making either xml-extendable.  Or I'm just missing it, always a possibility.

Reply #4 Top

My vote is for putting a good amount of terrain-specific or faction-specific content into the game (with the added benefit that the art will be better than what most people can make). I really like the games where the factions play significantly differently from each other. Things like Dwarven mines that are unique to the faction are extremely important, I feel. Maybe even scenarios like elves being able to make magical tree houses that get mana bonuses from forests, whereas humans might get a production bonus from having logging camps. The expansion plans for the two races would be very different as a result, and I'm a big fan of that.

Also, I'd like to see more, rather than less, special terrain features. Not that every one of them needs to be in every game. I like Dominions, where the sites of power are sometimes random, and sometimes not. In and of themselves, none of the special features should be a huge advantage, but they should be significant enough to be able to incorporate into your strategy that would make a good strategy great.

It's great that the data-driven engine is already in place! I look forward to playing with it :)

Reply #5 Top

Hmm, is Blender--which I've only played with a bit--capable of exporting to 3ds or whatever filetypes Elemental accepts?

Reply #6 Top

I like the idea of having a more "cluttered" map.   A pre-industrial world should have defensible hills and river fords, and at least sketch that the rural areas are important.   An empty void between cities is just "Galciv with swords", I want it to have depth and reality as itself. 

 

Reply #7 Top

Now, the question rises, what should be in the game by default in terms of “stuff”?


  • Stuff about economics:

Places that would change the way economic works : artifacts that you need to put in a city, then economic change, like you can transform food in gold, or mana in gold etc.

  • Stuff about war

Places that result from ancient battles or big battles. Consecrated terrain that would impact tactical battles, ancient shrines that would bless the last who visited it. Places now haunted by the several lost men.

  • Stuff about magic

Once again, think about artifacts that have a power only in the right place : on a hero, on a city, why not things you get then you need to "build" on the map : some forteresses, some mana dwell where random stuff can happen, places that would create mutation of your units (that would be a real gamble.. will I get a monster or a super-hero ?), places where you can see the future (for instance the next 5 random events, if such a thiing will ever exist), places where you could see far away places, places where you could spy on a particuliar unit, places where you could sacrifice peasants to get blood mana for rituals, etc.

  • Stuff about quests

Places where you can get some stuff, enhance your units, "holy" ground where there can't be any battle and would be usefull to sign peace treaty, quest that would let the world change, like making appear some new mana shard, or disable them, or randomly change the type of mana, etc.

  • Stuff about dungeons

Dungeons should be meaningful. A crypt would appear near a big battles. A new mana shard would appear near a place where extensive magic research would be done, water would rise up if you open the ancient valves.

  • Stuff about resources

I would like combined resources. A system like in Morrowind would be a real blast. Please ... think about it. (for those who doesn't know, Morrowind had several resources with different effects. when you mix several resources you get on the final object only the effects that are at least on two different resource. the fact is, there were good and bad effects, and you often get a potion of strentgth that would decrease intelligence... instead you find the right resource)

  • Stuff about lore

One thing that would be interesting is you could be searching for what happenned before. You only know what existed before the cataclysm thanks to speach. Then once on the surface, you could do archeological research that would give bonuses in relation with what causes the cataclysm (and there could be several diffenret explanation, but only one would be loaded at start a of a new game)

  • Stuff that mix some of previous things said

Then just think about you could with mix ? Ok, you find a honey bee. Get it back to town, get a bonus in health, then you discover that it was there before the cataclysm. You get a quest. In the meanwhile, your units get sometimes some mutations. weird. You discover the world collapses due to those bees ! You get a quest to destroy them. You lose the health bonus but get a huge influence boost "whoaaa they have the weapon that destroyed the earth". But you could also choose to create a weapon from those bees. But .. they don't react to mana !! Hum .. seemes like your anti-magic researching got a boost !

And so on .... Just imagine

Reply #8 Top

This looks very simple so far...awesome! :D

It's too bad, that we won't have a built in 3D unit creator however. [Like the Spore creature creator for example...] Why? Because that is very easy to use. "Ordinary people" won't be able to create 3D models at all...hopefully lot of experienced 3D modellers will play with the game, else....it won't be possible to create quality mods [Just think about a total conversion mod: I would like to mod in Orcs, Elves, Dwarves etc. for example...now it's impossible until I don't have the necessary 3D unit models.]

 

Reply #9 Top

I'd assume the Worth entry is meant to provide info to the AI about how valuable the resource is when it judges city building spots. But then I guess you'd know if that was the case.

Some questions about the XML and modding:

Are the values in the XML exposed to scripting for reading and altering (meaning altering it in game, not altering the original value in the XML)?

Can mods add their own XML entries that they can then use in scripts? That would be very useful to keep data and code separate. Like a mod which makes some resources only visible in certain "ages" would like to add that info to the XML for each resource and then access it in the script (instead of writing that info in the script itself).

What does the XML reader currently do if he encounters the same internal name twice? Does he report an error, overwrite or add? Example: First a twilight bee resource definition with all entries and later he encounters one that only has a Rarity entry. Useful would be if he only alters the Rarity entry then and keeps the rest. That helps to keep multiple mods running at the same time.

If you want to reduce the clutter, what about default values? So whenever he does not encounter a specific entry after reading through everything, he uses the default value. Best would be if that was exposed to scripting. So you could register a callback function in the script for a specific object type and entry which is then called if a value is not specified.

Reply #10 Top

This is the most interesting journal so far. As civ4 have proved, an easy to moddable game is something players (and modders, of course) really appreciate.

And, about the question you posted, I also like to see a cluttered map and not an empty one. The more items, dungeons and structures, the better.

Reply #11 Top

Saturday night's all right for modding. ^_^

Reply #12 Top

Any idea when we're going to get our own copies of the XML files to play with? Or are they there and I just don't know it?

Reply #13 Top

Elemental>Data>English

No need to thank me B)

Is there a way I could mod the english.str, without editing it ? I'd like to start a french translation and I don't know where I should put the file and what I've to do to make it recognized by the game.

Reply #14 Top


Now, the question rises, what should be in the game by default in terms of “stuff”?  It’s always a challenging question to answer.  For instance, having spent years playing games from Dominions to MOM to Civilization and HOMM and so on, each game has its own take on how much “stuff” the user needs to deal with.
I’m of the opinion that I’d like to see quite a bit of different stuff on the game map that does interesting things even if it makes the map a bit more “cluttered”.

Forgive me, I'm going to skip past all the modding stuff (which sounds GREAT, but I'm honestly more worried about seeing the vanilla game come to life before I attempt to mod it) and snip out this part.

It's debatable how much 'stuff' you want in the long run, but the game certainly needs 'more'. Aside from the rare resources - and the more of those, the better - the landscape feels very plain. Ok, there are mountains and water and forests, but these are essentially the same in that they're all completely unuseable, and then there are flatlands that you can build on.. but one piece of flatland appears to be identical to any other. Sure we know from the 3D engine screenshots that flatlands can come in different colors - some appear to be grasslands, or deserts, or corrupted fallen lands .. but among all these types, does it really matter where you choose to plop a city? Once you've spent 5 essence to vivify a piece of land, don't they all turn out the same? This is as opposed to Civilization where hills, flatlands, plains, grasslands, etc are all very different places to put a city, but all useful, you have to consider carefully where to position a city even when rare resources aren't involved. Right now in Elemental I can just stick a city anywhere, the landscape needs more gameplay variety to differentiate one potential city spot from another.

For that matter once I've built a city, it also doesn't seem to matter where I stick buildings I add onto the city, unless I'm building towards a particular rare resource. At first I was excited by the idea of expanding a city in any direction, but it turns out it really doesn't matter which featureless spot of flatland to build my next set of kingdom hovels on (because all the flatland appears to be identical, gameplay-wise, this is you see really the same problem).

In the end the rare resources are probably going to be the most important factor in positioning cities, and that's fine, but I'd also like there to be more to it than "Should I build my city on the flat area near a fertile land tile, or the flat area near an iron ore?" - I'd prefer if it was more Civilization-esque: "Should I build my city on the grasslands with a few hills for added production and a wheat resource nearby, or the plains which have more production but less food, with an iron resource nearby but no hills?" - note how the rare resource part hasn't really changed but the different landscape makes the question a whole lot more interesting.

If you have no plans to do anything with the "featureless" landscape, an alternative is to simply add a ton of rare resources everywhere, if each potential city spot had 4-6 "rare" resources like fertile land/twilight bees/iron ore/etc it would have the same effect as adding hills/grasslands/plains/etc (making city placement more interesting and important).

Reply #15 Top

and think it needs to be either taken out entirely or have a pretty important point for existing because they don’t seem to matter

From what I can tell it looks like the highlighted part <IconColor>0,0,0</IconColor> controls the color of the icon. That's Very handy to be able to do. So long as there isn't another color setting somewhere else that over-writes it then it's very useful for map customization.

Why would you want to take that out?

Of course I'm sure you know more about it then I do, but it does seem like a good function to keep in for us Modders. I definitely like how it automatically scales pictures to fit in the game. That will come in very handy as well.

So, my only suggestion, please don't yank code that can be easily used to customize stuff :)

Reply #16 Top

While reducing clutter of the XML files is good, please do not remove neat features that are working fine. The more options modders have in their control, the better things they can make. I agree with Raven in guessing that the icon colour will colour the icon with what you set it. I am really looking forward to this because it seems that making small mods will simply integrate so well.

My main wonder right now is about total conversions (TC's). Do you plan to somehow support TC's in your mod database? It is hard to know, since you could have a TC that entirely changed combat, the economy, the main menu itself, etc. and it would not work with other normal mod add-ons. What I would love is to have some separate section for TC's in the mod database, and then when one is loaded up, it will somehow refresh all of the data already loaded, such as the mod menu that it is in, so that if it even changed the main menu with a different background and another option like "Defensive Skirmish Battle" or something, it would show right up without needing to close the game and re-open it.

I hope that made sense. Looking great so far, so keep it up!

Reply #17 Top

So does the game read all .xml in the English folder, regardless of the file name?

Reply #18 Top

Quoting austinvn, reply 14

quoting post
Now, the question rises, what should be in the game by default in terms of “stuff”?  It’s always a challenging question to answer.  For instance, having spent years playing games from Dominions to MOM to Civilization and HOMM and so on, each game has its own take on how much “stuff” the user needs to deal with.
I’m of the opinion that I’d like to see quite a bit of different stuff on the game map that does interesting things even if it makes the map a bit more “cluttered”.

Forgive me, I'm going to skip past all the modding stuff (which sounds GREAT, but I'm honestly more worried about seeing the vanilla game come to life before I attempt to mod it) and snip out this part.

It's debatable how much 'stuff' you want in the long run, but the game certainly needs 'more'. Aside from the rare resources - and the more of those, the better - the landscape feels very plain. Ok, there are mountains and water and forests, but these are essentially the same in that they're all completely unuseable, and then there are flatlands that you can build on.. but one piece of flatland appears to be identical to any other. Sure we know from the 3D engine screenshots that flatlands can come in different colors - some appear to be grasslands, or deserts, or corrupted fallen lands .. but among all these types, does it really matter where you choose to plop a city? Once you've spent 5 essence to vivify a piece of land, don't they all turn out the same? This is as opposed to Civilization where hills, flatlands, plains, grasslands, etc are all very different places to put a city, but all useful, you have to consider carefully where to position a city even when rare resources aren't involved. Right now in Elemental I can just stick a city anywhere, the landscape needs more gameplay variety to differentiate one potential city spot from another.

For that matter once I've built a city, it also doesn't seem to matter where I stick buildings I add onto the city, unless I'm building towards a particular rare resource. At first I was excited by the idea of expanding a city in any direction, but it turns out it really doesn't matter which featureless spot of flatland to build my next set of kingdom hovels on (because all the flatland appears to be identical, gameplay-wise, this is you see really the same problem).

In the end the rare resources are probably going to be the most important factor in positioning cities, and that's fine, but I'd also like there to be more to it than "Should I build my city on the flat area near a fertile land tile, or the flat area near an iron ore?" - I'd prefer if it was more Civilization-esque: "Should I build my city on the grasslands with a few hills for added production and a wheat resource nearby, or the plains which have more production but less food, with an iron resource nearby but no hills?" - note how the rare resource part hasn't really changed but the different landscape makes the question a whole lot more interesting.

If you have no plans to do anything with the "featureless" landscape, an alternative is to simply add a ton of rare resources everywhere, if each potential city spot had 4-6 "rare" resources like fertile land/twilight bees/iron ore/etc it would have the same effect as adding hills/grasslands/plains/etc (making city placement more interesting and important).

It reminds me that in MoM each square had different value for mining, fertility, and maximum population.

And I am "onemore-ing" to the fact that the more resources you have, the more important will be the decision about the place of your cities.

Anyway, if each resources I talked about in the list is implemented, then nearly each square will have a different resource ;)

Reply #19 Top

Quoting Frogboy, reply 2
I suspect long before beta 5 we'll be making mods.  I plan to make mods and release them myself long before beta 5.

Mine won't be total conversions or anything. But I would like to see if I could make a third race or a new alignment or something.

Exactly what I intend to do as well!

Things are rather bare bones right now though so I don't expect to get into it until at least beta 2.

Reply #20 Top

I think a more flexible system to allow for more user added resources would simply be that any tile has an X percent chance of having a resource of any type.

The game then rolls to see what category of resource should spawn (common, uncommon, rare, unique, or maybe even categories based on terrain type or something else), and then it would choose one resource from that category.

Reply #21 Top

I'm also for lots of interesting stuff on the map, even if it makes it cluttered -- at least let this possibility exist! You could always introduce filters which let you sort what is visible and what isn't, for example filter the map view by tech prerequisites (e.g. show me only resources I can see with "farming" techs, etc.).

Reply #22 Top

Quoting wknowles9876, reply 6
I like the idea of having a more "cluttered" map.   A pre-industrial world should have defensible hills and river fords, and at least sketch that the rural areas are important.   An empty void between cities is just "Galciv with swords", I want it to have depth and reality as itself. 

 

I agree.  Terrain is of huge important to land warfare, and I want that to be shown.  It's interesting, because the same darn pieces of terrain have often seen dozens of battles over the centuries.  Elemental could have a similar situation (mountain passes, river crossings, etc.), but with a fun twist: channelers could reshape the terrain at some point.  Forget the Great Wall of China: I'm throwing up a mountain range.

Reply #23 Top

Frogboy plays Dominions?  This is great news, and vastly improves the chances of Elemental having coastal illithid-hybrid tentacle monsters!

...keeping my fingers crossed for a blood magic sphere...

Reply #25 Top

Quoting SaberCherry, reply 23
Frogboy plays Dominions?  This is great news, and vastly improves the chances of Elemental having coastal illithid-hybrid tentacle monsters!

...keeping my fingers crossed for a blood magic sphere...

Forget it! I think Brad knows of Dominions, and may even like it, but he's aiming for something much more streamlined and accessable here. Mechanics like fear, morale, routing, weapon length, awe, unit attributes, weaknesses, etc etc etc won't make the cut, so we won't be able to mod anything like an illithid!