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