Graded Invisibility Mod

primem0ver

Emperor
Joined
Jun 16, 2006
Messages
1,158
Location
Peoria, AZ
Want a better invisible system for your mod? Do you want spies who can see lesser spies or units that can see invisible units of a lesseer invisible "technology?" without the lower units seeing the better units? Tired of your units being only able to see one invisible type? I did, and I was... so I created this new little MODDABLE mod based on a new XML file.

Introducing the...

Graded Invisibility Mod (Component)
Version 0.5

What Is it?

I was slightly disappointed at the original invisibility system that was in Civ4 when I started modding (CTP2’s was a bit better with its spy types). I lived with it like everyone else for a while but then my needs as a mod developer ran up against this proverbial wall; hence the rudimentary beginnings of this mod. Even before it was asked for, this system was already in the works by way of some hard coded SDK and Python (Our mod developers were still debating on whether we would include my new “camouflaged” units in the mod). Then several visitors in the Genetic Era Mod forum suggested that with our emphasis on the sea, that we create some “upgraded” sea/underwater units based on “upgraded invisibility or stealth.” I finally decided to make a fully moddable and versatile invisibility system. So here we are: The Graded Invisibility Mod is an enhanced invisibility type that replaces the old (vanilla) invisibility type for Warlords 2.0.8.

IMPORTANT NOTE: In the original game and warlords expansion, a unit&#8217;s invisibility is dependent on two tags in CIV4UnitInfos.xml: namely <bInvisible> and <Invisible> where the <Invisible> tag contains a value that refers to an InvisibleType defined in the CIV4BasicInfos.xml file. This invisible type corresponds to a (or is represented by) CvBasicInfo in the SDK. This mod replaces (reassigns) the InvisibleType in both XML and the SDK. Invisible types defined in the CIV4BasicInfos.xml file are now obsolete (with this mod) and are not loaded by the game. They are replaced by a new xml file located in the GameInfos directory: CIV4InvisibleInfos.xml.

Using the above file, mod developers can create their own individualized invisible types (and type systems/series) using the new file as long as they follow the format properly. Information, directions, and help on how to do this are all in the help files.

Additional Note: Currently this mod is in beta (although the system seems to work well enough). I am sure that if people are interested in this sort of mod, they will probably have suggestions which I am open to. Please keep in mind though that I do have a job and a significantly larger mod to take care of :)).

New Invisibility Features:

&#8226; Allows units to see multiple invisibility types (of lower grade/ability levels) by creating a &#8220;graded&#8221; series.

&#8226; Allows invisibilities of a &#8220;higher grade&#8221; type to still be invisible to lower grade types while higher grade types can still see lower grade types

&#8226; Allows spy units to have a graded visibility so that better spies can see all lower spies but lower spies can only see each other (basically the same as the last bullet).

&#8226; Allows specialized invisibility (camouflage) where units are only invisible on certain types of terrain or with certain features.

&#8226; Uses a new XML file so that modders can easily define their own invisibility types and type systems (though you must keep track of your own system because as of now there is not an &#8220;invisibility class&#8221; per se.). This file is located in the GameInfo folder&#8230; but don&#8217;t forget to read the documentation!

&#8226; Adds new Info class to the SDK. This information is mostly useful for SDK modders: InvisibleTypes are now cast as class CvInvisibleInfo instead of the original CvBasicInfo class

&#8226; You can customize on what terrain(s) and with what feature(s) the units of a particular type are invisible or you can be more general (hills or trees for example)

&#8226; You can define any number of type (grading or scale) systems. For example, you can create one or more for each domain and they will operate separately (i.e. a graded system for land, sea, air, etc&#8230;) so that land units will not necessarily see units of the same grade or &#8220;level&#8221; on a different domain (or different type of unit with a different &#8220;system&#8221; for invisibility). One limit: you may only have 100 invisibility types in any one chain (which in my opinion is WAY too many&#8230;but hey&#8230; one never knows!).

&#8226; You can develop grading systems that you want to be based on a specific type of leveled technology and still keep them separate (by keeping their &#8220;scaling or grade systems separate). For example you can come up with a system based on underwater &#8220;cloaking&#8221; technology versus &#8220;silence&#8221; technology and one will not be able to see the same grade (or lower) of the other technology (as long as you don&#8217;t link one into another).​

Requirements:

&#8226; Necessary files: modified CvGameCoreDLL.dll, new XML file: CIV4InvisibilityTypes.xml, and modified schema file CIV4GameInfoSchema.xml

&#8226; Warlords Expansion with 2.0.8 patch. (NOTE: this mod may work on earlier versions but it has not been tested so there are no guarantees. You will also need to add the necessary code changes yourself in order to get it to work.)

&#8226; It is not recommended that you use the supplied files as they are UNLESS you have not made any sdk changes. To merge with your own mod you may use a file compare tool or follow the instructions in the SDK readme/help files.​


Future Plans:

I have plans for two improvements at the moment:

1. The first is that I would like to build in a slightly better feedback system for XML errors for the new XML file (Currently there is no checking for bad &#8220;links&#8221; to missing Invisible types for example.)

2. One slight limitation I can think of off the bat or &#8220;cuff&#8221; is that the AI is not programmed to maximize &#8220;cover&#8221; for camouflaged units when finding the best route from one place to another. I would like to eventually add this capability but I currently have other priorities. I also of course plan to correct any bugs that exist. Let me know of any mistakes/problems/suggestions for the documentation.​
The rest of my plans are pretty well limited to just seeing what people think. If people have big interest and big suggestions I may release a future version (after this one goes beyond beta). Otherwise, I don&#8217;t have to many immediate thoughts since I have my head in other projects for the moment.


"Terms" of Use:

As with any mod, the charge is free. I figured there would be some modders out there who could use this so I am donating it for free use. You may use this to your hearts content. All I ask if you do use this mod, is the following:

&#8226; Give credit where credit is due (to the author).

&#8226; Let me know personally of any major enhancements you may give to this mod (I promise to follow my own creed if I use it/them in future versions!)

&#8226; I may ask that you post to a &#8220;signup&#8221; forum so that I know who and what mods are making use of this new feature. (USE pm right now)​


The Files:

Click here to download the Modified DLL for the sample mod (to be linked to shortly... must find a place to host because file is over 1 MB)

The first download below contains just the modded files. It includes the modified CIV4GameInfoSchema.xml and the NEW CIV4InvisibleInfos.xml XML files. It also includes all changed SDK files. The SDK files are only those that have been modified from their original form (From the Warlords 2.0.8 update). It also contains the XML files for the sample mod.

The second download below contains all the help files and documentation on the new class and the new XML file. It contains step by step instructions (for those who need them) on what to change in the SDK. You may also use the SDK files included in the first download and simply merge them with a text comparing tool. This file ALSO CONTAINS the art files necessary for the sample mod
 

Attachments

  • GradedInvisibilityMod.zip
    267.9 KB · Views: 181
  • GradedInvisibilityMod_HelpFiles.zip
    222.1 KB · Views: 252
Reserved for future use
 
this is awesome!!!

but... will there be a non-warlords version?
 
Quite a interesing idea, I imagine invisibility levels could be extended into Promotions as well. Addin new files is rather challenging, you must have been working on this for some time in secret.

As for the version, why is their always someone begging for an Non-WL version of every mod, its often a lot of extra work for the mod maker ware its only what 20 dollars now for people to get WL which is woth that much on its own PLUS all the mod content which is inevitably going to be oriented towards the bulk of the users who own WL. Its basicly saying to the mod maker that you want them to do all the work so you can save a measly 20 dollars.
 
That is a wonderfull stuff man, PrimemOver, when I posted a reply regarding stealth and sea units in the Genetic Era mod thread, I did not know you were working on something of this scale! This is absolutely brilliant! I suppose your mod is going to be added in the Genetice Era mod... well I hope anyway.
Thumbs up so, I can imagine already units such as commandos or special ops forces, nuclear submarines... it woud add a tremendous tactical aspect to the game as well as a tech race to get these units.
 
Impaler[WrG];5000527 said:
As for the version, why is their always someone begging for an Non-WL version of every mod, its often a lot of extra work for the mod maker ware its only what 20 dollars now for people to get WL which is woth that much on its own PLUS all the mod content which is inevitably going to be oriented towards the bulk of the users who own WL. Its basicly saying to the mod maker that you want them to do all the work so you can save a measly 20 dollars.

sorry, sorry, my bad...
 
Quite a interesing idea, I imagine invisibility levels could be extended into Promotions as well. Addin new files is rather challenging, you must have been working on this for some time in secret.

Yes... I have thought of the promotion idea but I wanted to see how usable people would find this before I did too much extra programming. That would take some changes to the code but it could be done.

Challenging... if one knows the SDK... not strictly speaking (especially when I have already been working on a much bigger one!!!... to be released in a few months, hopefully march.)... but debugging OH YES... it was a royal pain in the %#@(. Also... I am still learning new things about the SDK (which was why i had so many bugs) so yes... it was challenging at times. I have been working on the add-in version since the first week of Jan but I have had the python version for quite some time.

Its basicly saying to the mod maker that you want them to do all the work so you can save a measly 20 dollars.

ROFL! Exactly! I did not think that the expansion was worth $20 either but I knew that the Genetic Era Mod and other mods would be (at least to me), especially because I wanted to join their developing team. But no worries cybrxkhan... I am not offended. As for your question...

but... will there be a non-warlords version?

I am not going to do it myself... especially because of something I said in the documentation for this mod which was basically this:

Even though I have not tested my code in the Original Civ4 game, I do not see any reason why it would not be compatible (except for the XML schema file itself).

Remember... this is a mod component, not a mod in and of itself. (I created the "sample" mod so people could see an example of how to use it). It was meant to enhance EVERYONES mod! So if you are making a non-warlords mod, you can try merging this and it should work. But you might have to remove some of the tags from the modified XML schema since I used the Warlords version of CIV4GameInfoSchema.xml to add my own shema.

I suppose I could just remove my addition to the schema to its own file and then it could be used in conjunction with either GameInfo schema... but I will do that a little later. I need to get back to my other project (which I started before this one).

I suppose your mod is going to be added in the Genetice Era mod... well I hope anyway.

Actually it was your post that motivated me to do this since it wasn't that big of a stretch from what I had already done anyway. It only took me two weeks. It would also serve as a test for a much bigger "addon" I am developing for Civ4 (specifically the Genetic Era mod but I will also release as a "component too) that is far more complicated to see what was involved in getting a new XML file and new info class to work successfully.

So yes... I always intended to use it in the genetic era mod. That team has been testing my "camouflage" units to see if we like them for some time now (which was the basis for this mod).
 
If I remember correctly Firaxis did make some alterations in the invisibily code in the 2.08 patch, I think this was to correct the Insi-bug which cause crashes when you moused over an invisible unit that wasn't being seen by anything. So their is some chance of it being incompatable with Vanilla Civ and probaly unpatched WL as well.
 
Even though I have not tested my code in the Original Civ4 game, I do not see any reason why it would not be compatible (except for the XML schema file itself).

thanks... i'll try it. and if the game crashes... my bad.

but still, excellent idea!
 
thanks for the info impaler
 
np... btw I have an addition to this mod that I might release later. A new kind of improvement... but I have to be able to "teach" the AI how to use it. I call them "vision" improvements. Since it is directly related to this mod, I may add them on later (example: sonar buoy)
 
Great work, primem0ver. I'm gong to merge this with some of the stuff I've been doing... I think it will prove to be a better solution than the one I was using for my promotions.
 
This is an outstanding mod that I'm sure will get a ton of use! You're not the only one who always felt stifled by the in-place invisibility system. Thanks primem0ver!!
 
I'm gong to merge this with some of the stuff I've been doing... I think it will prove to be a better solution than the one I was using for my promotions.

No problem! Thanks for letting me know. I want to eventually work the promotions idea into this... let me know if you come up with anything.

I appreciate the complements guys. Let me know if you find any bugs.
 
Impaler[WrG];5000527 said:
Quite a interesing idea, I imagine invisibility levels could be extended into Promotions as well. Addin new files is rather challenging, you must have been working on this for some time in secret.

As for the version, why is their always someone begging for an Non-WL version of every mod, its often a lot of extra work for the mod maker ware its only what 20 dollars now for people to get WL which is woth that much on its own PLUS all the mod content which is inevitably going to be oriented towards the bulk of the users who own WL. Its basicly saying to the mod maker that you want them to do all the work so you can save a measly 20 dollars.


I hear that, i have even went out and bought a few people, that are willing to help me, the Warlords Expansion, LOL.:p
 
I hear that, i have even went out and bought a few people, that are willing to help me, the Warlords Expansion, LOL.

:lol: :goodjob: Now THATS Dedication (or desparation?). Sometimes its a fine line! ;)
 
Top Bottom