What Utilities Do I Need to Mod?

samthedagger

Warlord
Joined
Jul 8, 2009
Messages
134
I am in the progress of developing a mod based on the RIFTS roleplaying game for BTS. I expect it to be a fairly large undertaking. I have been reading around the Civfanatics boards for several weeks now trying to gather knowledge on the resources that will be needed for me to accomplish this monumental task. I want to do a quality mod that will do Civ4 and the RPG justice, complete with new civs, leaders, units, animations, terrain, and novel rules that break the barriers of what has been done so far. I have a very concise vision of what I want done, but my knowledge of the tools needed to mod Civ4 is still very limited.

My programming background is minimal, but not non-existent. I learned some worthless languages like Basic and Pascal when I was in high school and learned some C, Visual Basic, and C++ for AP Computer Science, but it was nothing beyond what you could learn in a college freshman level course (very elementary stuff). So I am familiar with the basics of programming, but I do not know about the specific languages used by Civ4. Artistically I am very inexperienced. I don't even have Photoshop experience. 3D rendering and so forth is far beyond my abilities at present.

Despite my weak background, I always excelled at my computer programming courses and am not daunted by the task of learning to code the new rules that I want for the mod myself. Perhaps the greatest task is upgrading my computer to handle some of the higher resource-requiring programs if I decide to do the art myself. The problem is there is not a lot of science-fiction/fantasy hybrid art (wizards fighting robots and the like) available in the current Civ4 library so that may become a necessity.

Here is my vision of the changes I would like to make for my mod. If you would be so kind, what sort of skills would you recommend I work on so that I will be capable of handling these sorts of things? And what utilities should I obtain to be able to carry out these tasks most effectively?

-A key aspect of the mod will require the designing of a new type of terrain feature called ley lines and ley line nexuses. Similar to rivers, they travel in straight lines along the edges of tiles. Anywhere a ley line crosses with another, they form a ley line nexus. Cities with certain buildings will be able to harvest benefits from tiles adjacent to ley lines with improved benefits from nexuses. Certain units (magic and psychic) will also gain combat bonuses when adjacent to ley lines and nexuses. Some of these units also travel faster when adjacent to ley lines. I imagine coding based on the river terrain and levee building will be useful in this regard. I just need to know where it is and what language.
-Replacing barbarians in this mod are monsters who appear at random intervals through portals called Rifts to raid cities, pillage improvements and the like. Rifts can only occur on ley lines and ley line nexuses. More importantly, at least as far as coding goes (I think), unlike barbarians, Rifts can appear in the middle of your territory. Rifts are most prevalent at nexuses, so I will need a way to control probabilities. Playtesting will probably have to determine a rate that is balanced for fun play.
-There is a unit called the juicer that automatically dies after 5-8 years in service. They are integral to the game and this feature is critical. I will need a way to make an individual unit a proverbial "ticking time bomb." There is an increasing chance that the unit will die the longer it is alive, to a maximum of 100% chance of death at 8 years. (The default turn will be shorter than one year, FYI.) I also need a way to conveniently shut off this feature for a civ that builds a specific wonder.
-I will need to design more than a dozen new civs and more than two dozen new leader heads. The leader heads will need to fit a post-apocalyptic world so I don't know if I will be able to use much of the current leader head database. I imagine I will have to design many of them myself.
-I want to design units that are capable of operating as land units, or spending their move to perform an aerial action. Dragons and certain power armor units are central in this regard.
-I want to design units that do not heal naturally (e.g. cyborgs and robots) and must be in a city with certain facilities or have special promotions to do so.
-I want to design a unit that automatically starts with the ability to choose any two promotions (from a list of promotions available to that unit of course).
-Insanity system: Units that fight monsters emerging from the Rifts have a small chance to "go rogue" and start behaving like the monsters, attacking friendly cities, pillaging improvements, etc.
-I need an aerial unit that can transport troops and act as a stationary defense (temporary base) for such troops.
-I need a bunch of original animations for units, including things not seen before such as insect creatures, a robot that walks on six legs like a bug, large robots, laser guns, half-man half-dog creatures and other weird monsters, not to mention dozens of sci-fi infantry-like units.
-I need a way for units to teleport to visible terrain. I mean this as in a special ability for the unit. Perhaps the paratrooper code can help me here. Could I increase the range to infinite and disable the requirement that the unit begin in a city? Also most teleportations would have a failure rate that could be reduced with a promotion available only to units that can teleport. It would be a powerful, but unreliable strategy for invasion, great for raiders and getting around hostile borders.

Let me emphasize I am not necessarily asking people to design these things for me, although I welcome any assistance. I simply would like someone to point me in the right direction of the tools I will need to do these things. I already know a bit about editing the XML and have toyed with creating units. Thank you for any assistance you can provide!
 
Based on how things seem to play out around here your best bet would be to focus on the function aspects. Once you get things working and artists know their work will be used, those who are interested in in your vision are likely to create art for you. Also when you just need something specific and can't find something in the database there is always the Unit Graphic Request thread (but you're more likely to get a response if the artists that check requests know you are going to use their work for a complete mod).

You should also check out Fall From Heaven 2, and also History of the three Kingdoms, but mostly FFH2. FFH2 will give you some good ideas since it is a fantasy genre mod. In fact you may end up choosing to make a mod mod using the FFH2 gamecore as it already has spells and a myriad of extra functionality built into it that would be very useful for a mod using RPG elements.

To start with all you really need is notepad++. You should start by downloading and playtesting FFH2, then design a bare bones alpha build, and start working on the XML and python you need to build a core function only mod, from there see how things are going and reavalute. At this point though that's my reccomendation on how to start.

Here is a wiki page with alot of the useful utilities for Civ4:

http://modiki.civfanatics.com/index.php/Civ4_Useful_Programs

at this point though, probably all you need is notepad++ (and you don't even need that, you could just use your computers built in notepad text editor, but trust me notepad++ makes things far easier, as it's actually designed for working with code).
 
Looking at what you want to do:
Begin small ;).

Search for some moddels, which could maybe/nearly fit, and add them.
Rename some civilizations.
Create some new buttons.
And then look further.

Most things, which you want to do, are not really difficult, but will need some work.
Especially the art is a problem, but you can find some models as good placeholder.
The only problem i see are the ley lines, because the river system is something, which is hidden and not really good accessible.
 
Well, it really depends. First, find out exactly what you want to do (which you seem to have down). Next, start small. Don't try to rewrite the engine, just try adding a Unit or Leader, then a Civilization, progressing upwards. Know what you have to do where (this is critical!)

For XML files (all the basic info of the game: Civs, Leaders, Units, etc.): Download Notepad++, it's great.

For Python files (events, etc.): Download the latest version of Python.

For the DLL (modding core game mechanics, adding new ones, messing around with the AI): There are tons of guides for this. I prefer the free Visual Studio 2005/2008 for editing and making a debug DLL (it's in C++).
 
Based on how things seem to play out around here your best bet would be to focus on the function aspects. Once you get things working and artists know their work will be used, those who are interested in in your vision are likely to create art for you. ...

That's good advice. Since art is not my thing and programming is more up my alley, I will focus on making a complete mod first and request art when a v 0.5 is ready (all mod components minus art).

You should also check out Fall From Heaven 2, and also History of the three Kingdoms, but mostly FFH2. ...

More good advice. I've played the AoI mod included with the retail and it gave me some ideas. I've heard of FFH2 and that sounds like a good place to grab some ideas.

To start with all you really need is notepad++. You should start by downloading and playtesting FFH2, then design a bare bones alpha build, and start working on the XML and python you need to build a core function only mod, from there see how things are going and reavalute.

Already have N++, and you are right, it is much easier for editing the XML. What do you mean by core function only?


Great link! Thanks a lot! Very good advice phungus420. I appreciate it.

Looking at what you want to do:
Begin small ;).

Search for some moddels, which could maybe/nearly fit, and add them.
Rename some civilizations.
Create some new buttons.
And then look further.

Done all that. I've gone through the "create a new civ" (the australian one) tutorial found her and practiced with buttons. One thing I am having problem with is getting unit skins to show up properly. But I will create a thread for that issue with some screen shots (I am getting the red blob a lot).

...
The only problem i see are the ley lines, because the river system is something, which is hidden and not really good accessible.

Yea that is an essential element to get the flavor of the RPG. I mean, Rifts is in the name of the game, so they really need to shine for this mod to be something unique and different and do justice to the RPG. I'm sure there is some programmer out there who knows where the river system is located though. If not, I will start a thread to get help on finding it. More good help. TYVM!

...
For the DLL (modding core game mechanics, adding new ones, messing around with the AI): There are tons of guides for this. I prefer the free Visual Studio 2005/2008 for editing and making a debug DLL (it's in C++).

Done most of the stuff you recommend already. This is very helpful though. Thank you!

Thanks for everyone who has responded so far. I really appreciate the cooperative nature of this community.
 
River system can be changed, but so far it has eluded people on how to clone it. So if you are willing to give up rivers on your maps and instead have the leylines, you could quite possibly pull that off. It may be easier in the end though to do them as a route type, at least initially. Modification to the code to allow 2 route types on a tile wouldn't be difficult at all, and writing your own special routines for how to create the lines on Map Generation shouldn't take much effort either.


If you do look at Fall from Heaven, look at the modmods for it as well. Quite a few expansions on the general functionality exist between the lot of them (and I do mean LOT of them), but most exist within Orbis and Fall Further. Though if you go with any of those code bases I advise you ask the majority of your questions in their subforums, until you get to the point of inventing new things again, as the changes are relatively profound in some areas and require special understanding of their intricacies. Most notable of the changes added which you may benefit from would be making it possible to have multiple Barbarian factions, and an already existing modification of the rules for how/where they spawn which would allow your Rifts to work quite easily. In fact, if the actual Rift itself was an improvement, you could accomplish exactly what you specified with XML alone (spawning units directly from the Rift, even if in owned territory)

Timed duration of units would also be pretty trivial with Fall Further (and potentially Orbis, we import each other's stuff frequently) code base.

Starting with multiple free promotions on a specific unit is (pretty sure) base BtS possible. If not, then all FfH based mods carry the ability. As well as the ability to have units which do not naturally heal or promote.

Teleportation is possible with a minor work-around in FF, you have the unit summon a targetting beacon, then the beacon moves to a tile and sacrifices itself to bring the other unit to it's location. Making the beacon have immense movement and being unable to move into tiles you cannot see achieves what you want (and both are trivially accomplished with XML)


Overall, most of what you want it quite possible with existing code, so go for it :)
 
Hmm, perhaps I shall earn my place in Civ4 modding history by being the first to unlock the secrets of river cloning. :nya: It can't be impossible. I'm not willing to give up rivers.

The idea of a route type is an interesting one. They would have to be un-pillageable of course and the number would have to be static. However, I was also hoping to have a random map generator option. As of yet, I have not seen any maps that generate improvements. Although maybe it is possible.

Another option is terrain-on-top-of-terrain, such as forests. I might be able to mod this somehow to get the intended effect.

River-modding was only my first idea for how to do the ley lines. I am open to other ideas. You've given me some things to think about.

I have playtested FFH:AoI fairly thoroughly and gotten a lot of good ideas out of it. I expect to get many more FFH2. I just downloaded it and will be playtesting it over the next few weeks.
 
I'm still in the brainstorming phase here and I wanted to know what some of you who are more familiar with the modding process think of this idea. I want to make corporations work differently in the Rifts mod. Rather than granting bonuses or resources, I want corporations to grant the ability to build certain units, but with a twist. When spread within your territory, corporations simply grant the ability to build certain units and have an upkeep cost as usual. Where I really want to change up the system is when you spread corporations to neighboring civs. The other civ pays the upkeep cost for their city as usual and like you, gains access to certain units. However, instead of granting you credits (gold) per turn, you are granted a specific number of credits each time one of the units accessible by that corporation is built in that city. I also want corporations to be built as wonders as opposed to by GP, but I think that part should be simple.

Let's say for example you build the corporation Northern Gun in your city of Ishpeming. You can now build Samson Power Armor in Ishpeming (provided you have the requisite tech). You build a few Samson Power Armor units, but soon you want your corporation to start earning money for you. Meanwhile, the foreign city of Kingsdale belongs to a friendly civ and you are not worried about them having access to your mighty Samson Power Armor. Let's say Samson Power Armor costs 150 hammers to build. After you spread your corporation to Kingsdale, they can now build Samson Power Armor too, but each time they do, you get +150 credits. This is just an example of how it would work.

It seems feasible to me, but I'm not as familiar with the limits of the coding languages.
 
Another option is terrain-on-top-of-terrain, such as forests. I might be able to mod this somehow to get the intended effect.

They are "features".
Maybe a good idea, if you don't want other features on that tiles.

I want to make corporations work differently in the Rifts mod. Rather than granting bonuses or resources, I want corporations to grant the ability to build certain units

You mean, like the corporation CEOs ;)?

Where I really want to change up the system is when you spread corporations to neighboring civs. The other civ pays the upkeep cost for their city as usual and like you, gains access to certain units. However, instead of granting you credits (gold) per turn, you are granted a specific number of credits each time one of the units accessible by that corporation is built in that city.

Could be done in python, but the AI would not understand that.

I also want corporations to be built as wonders as opposed to by GP, but I think that part should be simple.

Jup, is really simple.
Just give the corporation headquaters a value for iCost, and remove the ability to let it be built by GPs in the UnitInfos.xml.
 
They are "features".
Maybe a good idea, if you don't want other features on that tiles.

Oooo, that's probably no good then. Ley lines definitely coexist peacefully with forests in Rifts Earth.

You mean, like the corporation CEOs ;)?

LOL! Sometimes I get so caught up in what I want to do that I forget what the game already does! Thanks for the reminder.

Could be done in python, but the AI would not understand that.

I know there are ways to make the AI favor certain units over others though. I have to think there is some way to set up a condition so that at the very least the AI will avoid building certain units if the owner of the corporation is beating them in score. Making the AI understand that spreading corporations is a way to earn money is difficult I admit. However, it should be a simple thing to set a condition so that they only spread corporations to friendlies and allies right?. In general, that should be a human's strategy most of the time, especially since this will be a heavily war-based mod and you won't want to give your enemies weapons to fight you.
 
I believe base BtS code has the AI only spread a corporation if they own the Headquarters for it. So you'd be fairly safe in that regard. But if they can get the corporation through a national wonder, there is nothing telling them to avoid building it if the HQ is already owned by someone else.
 
Corporations will be world wonders, so I'm not concerned by that. If players want to compete with existing corporations, they will have to build new ones. Each corporation will grant access to its own set of units, often with specialties depending on what the corporation is know for. For example Titan Robotics makes excellent power armor and robots. Chipwell Armaments provides inexpensive, but fairly weak power armor. Ultra-Tech Industries improves your juicers. Etc.
 
In regards to teleporting- this is doable by using the python pickPlot command and then selecting a plot on the map without having to summon something without needing to use a beacon unit.

It will only target a visible plot but you can do it like this (note my example uses a FFH spell function I made up called "teleport" that would be called in CvSpellInterface.py and the onPlotPicked function from CvEventManager.py)

Code:
def spellTeleport(caster):
	cf.iCaster = caster
	cf.iTeleport = 1
	CyInterface().setInterfaceMode(InterfaceModeTypes.INTERFACEMODE_PYTHON_PICK_PLOT)

(.cf is the FFH 2 custom functions file and you'd have to create a variable there called iCaster and iTeleport that could then be called from other python files in FFH 2)

Code:
	def onPlotPicked(self, argsList):
		'Plot Picked'
		pPlot = argsList[0]
		CvUtil.pyPrint('Plot was picked at %d, %d'
			%(pPlot.getX(), pPlot.getY()))
		if cf.iTeleport == 1:
			pCaster = cf.iCaster
			iX = pPlot.getX()
			iY = pPlot.getY()
			pCaster.setXY(iX, iY, false, true, true)

I haven't tested this, but I've used the setXY stuff to teleport units in my Wormholes modcomp and the python pick plot stuff in my Star Wars mod work for python action buttons, so I would assume it's possible to combine them. The syntax may be a little off though. You could do it outside of FFH 2 as well assuming you used a python action button and your own custom file to store variables between other python files.
 
Thanks, TC01. I will be sure to test that out once I start getting my feet wet with python. This is a function I expect to start working on by month 3 or so of the project, but your input is highly appreciated, and I will be sure to credit you for your help.

Incidentally, for those who have offered help and wish to be credited by name instead of/in addition to screen name, please email or pm (preferred) your name to me and I will happily include both your full name and screen name in the credits of the mod.
 
Don't worry about credits man, that's the least of your concerns. Most of us that try to help out each other get our reward by seeing our work or advice used to make working mods.

BtW, what do you think of FFH2? I know you wrote you have done some playtesting of the AoI mod that is included in BtS, personally I think that is a waste of time. I'm curious to know what you think of FFH2 though, it's a very well made game, let alone a mod (personally I think FFH2 is at a counterstrike level of user content made gamer stuff, it'll probably outlive Civ4 itself).
 
So far I have playtested two games on an Erebus map and played through the first three scenarios that come included. I believe the mod is excellent in content. I have found a number of typos that I have documented (which I will post in the feedback thread) and the mod is obviously not complete (lots of civilopedia entries needed) but perfectly playable. I have enjoyed it thus far, although I haven't really been trying to so much to "play it" as I have "play around with it" to see what it can do. I'm very impressed with the magic system although mine is certainly going to be quite a bit different. I agree with you on the analogy to Counterstrike. I think mods in general will outlive Civ4 because there is simply so much you can do with them in terms of adding new elements to the game. FFH2 is definitely one of the best I've seen. I rank it up there with the Road to War mod. I look at these two as paradigms for what I hope to eventually achieve with my own mod. I still have a lot more playtesting to do though. I want to play through all the scenarios and run through at least one game as each of the leaders before I'll have a chance to really give the mod a thorough evaluation.
 
Here is another issue that will come up at some point and I want to know what some of the more experienced modders think about making it possible. Hover cycles and the like are fairly prevalent in RIFTS Earth and ought to be represented in some form or fashion in the mod. Ideally, I would prefer this to work something like the items in FFH2, but requiring actual production in a city first. For example, the Speedster Hovercycle is a non-combat unit with a movement of 3 and the ability to ignore terrain movement penalties. If a Speedster Hovercycle is in the same square as a recon, laser, or melee unit, it can be attached to that unit, granting the recon, laser, or melee unit the hovercycle promotion, which gives it a move of 3 and the ability to ignore terrain penalties for movement. Preferably it can be unattached later as well, if desired; attaching or unattaching would use up the attaching/unattaching unit's action for that turn, to prevent the swapping of one hovercycle many times over 1 turn. Based on what I've seen in FFH2 this shouldn't be that hard to implement. What would be even cooler is if this altered the graphic for the unit, but such a thing might not be possible. What do you think?
 
Here is a wiki page with alot of the useful utilities for Civ4:

http://modiki.civfanatics.com/index.php/Civ4_Useful_Programs

Very nice. I'd add 3 things to it:
1. XML (text) editor - VIM. Most people will plod through hours of edits when the same change can be accomplished in a few moments in vim. http://forums.civfanatics.com/archive/index.php/t-179437.html
2. CVS/RCS or some other sort of revision control system or method. Don't lose your work!
3. civchecker - for finding certain XML errors and inconsistencies (typically ART_REF/ART_DEF mismatches). Sure these can be found using a debug dll, but a batch program is much quicker if there are many.
 
Back
Top Bottom