[Religion and Revolution]: Mod Development

Status
Not open for further replies.
Imagine this scenario. You have colonies A and B, which imports lumber as they both use 6 each turn without producing anything themselves. Both are set to 100 and import and export.

A wagon train unloads in A. Now it has 180 and 80 is taken to B. However B already had 94, which means it now has 168 when the wagon train arrives the next turn. It will then move 68 lumber to A. Arriving at A, it notices 94 lumber at B and.... you get the idea.

It gets even worse if another wagon train unloads lumber once in a while because the the A-B route can jam a wagon train forever.

A a lumber surplus accumulates in the wagon trains and not the colonies, it will not produce a warning about overflowing. Instead you will notice other stuff not being transported anymore and building more wagon trains only helps for a short while. The worst I had of this issue is 20 wagon trains stuck with lumber out of 30. I know I should have noticed, but this is the point, it was hiding the fact from me until I wondered where the capacity went and at that time it had already hurt me as I lost goods they should have carried.

Turning off export solves this issue, but then you risk uneven distribution, possibly completely avoiding some colonies. No good either.

Enlighten me if I'm wrong but I only see two scenarios for feeders with the current transport system.

Setup A and B has a building, which consumes yield X. Other colonies produces X and are all set to export only.

Case 1:
A and B are both set to import and not export.
Wagon trains may decide to give everything to A while the building in B stalls due to lack of X.

Case 2:
A and B are both set to import and export.
The wagon trains overloads A and then they move some from A to B.
Risk of loop.

TBH the huge number of individual Wagon Trains and Routes can eventually become overwhelming and unenjoyable/tedious, especially if you manually transport domestic demand locally for each settlement. If you have the programming skills, do you think you'd be able to try a modmod of something like the National Domestic Market feature here? A lot of others posted they'd be interested in it too, and I'd really like to have something like that available to try as a modmod or gameoption.:king:
 
1. It is hard to explain.
2. All experienced TAC and RaR players got used to the current system.
3. It adds additional and complicated logic.
1: It's easy to explain. It's just two rules. (X < 50% & X> 100%)
2: don't use the checkbox and nothing will change.
3: I fail to see anything complex in this.

TBH the huge number of individual Wagon Trains and Routes can eventually become overwhelming and unenjoyable/tedious, especially if you manually transport domestic demand locally for each settlement.
I think a number of the disagreements can be narrowed down to scale or "micromanagement vs huge empire".

If you have the programming skills, do you think you'd be able to try a modmod of something like the National Domestic Market feature here? A lot of others posted they'd be interested in it too, and I'd really like to have something like that available to try as a modmod or gameoption.:king:
I'm not sure I like this idea. I agree with the issue, but I don't like the solution. It's a huge coding task as it isn't an addon to some existing functionality and it appears to be fairly complex when you interact that much between colonies.
It's not that I can't do it, it's more like I think it's an unwise usage of time spend coding. Also I disagree about moving that much behind the scene.

However reading it gave me an idea. Assuming I code the feeder service, the domestic marked window could then have the option "import to store for X turns". Say yield Y sells 5 each turn. If X is 10, then the marked would automatically set import threshold to 5*10=50. As it sets the feeder checkbox, it will import until it has 50, then stop import until it only has 25 left where it will import again until it has 50 etc. If new people move in and the marked sells 7 each turn, then it would set the threshold to 7*10=70.

You would still need to build the transports, but you can just automate them without micromanaging feeding your 30 colonies.

Is this worth a modmod? It's worth considering. However I will not make a modmod now. If I do, it will be after the next release of RaR.
 
I think a number of the disagreements can be narrowed down to scale or "micromanagement vs huge empire".

No single mod can fulfill the wishes of everybody. :)

I like to do micromanagement and thus most of the features have been designed that way.

However I will not make a modmod now. If I do, it will be after the next release of RaR.

Sounds good. :thumbsup:

At the moment my priorities are:

1. Solving bugs that are reported.
2. Adding a few nice but small improvements, additions and features.

What I don't want to do:

1. Major changes in features that work fine for me.
2. Adding bigger amounts of code that could potentially cause bugs and performance issues.

After the next Release, we will simply see what happens. :)
(The next Release will be in a few weeks.)

Maybe the rest of the team will continue.
Maybe some modmods will be created.
 
I added a specialist column to the native advisor. I tested it with a few savegames and it appears to work just fine so I committed it to svn.

Sorting this new column is a fairly quick way to identify which natives train what you need. Sadly it just gives you the name of the settlement you should go to, which brings me to my next topic.

Scroll to settlement
I looked into double clicking and it looks like nothing in the python code doubleclicks. I could use a single click, but wouldn't that be a bit strange? I could also add a "goto" button, but then the idea of "simple code" starts to die. I'm not really sure what to do about it right now, but I do know I want the feature.

At the moment my priorities are:

1. Solving bugs that are reported.
2. Adding a few nice but small improvements, additions and features.
Sounds reasonable, if only it didn't clash with my wish to add the stuff I always wanted :p
 
Sadly it just gives you the name of the settlement you should go to, ...

I am just wondering out of curiosity how you use Native Training. :think:
Because for me it is very simply and does not involve any real planning.

There are only 2 aspects for me:

1. I identify a Native Village with a Specialization I will probably need often.

-> I create a Mission there and all Converted Natives that it spawns directly train that Specialization.

2. A new (normal) Colonist arrives or is spawned by Growth in a City where I do not yet have Schools (Education System).

-> I take a look on the Map which interesting Specializations are available in Native Villages near that City.
(Any far away City is not worth bothering, because there is Learning by Doing as well.)

When the colonist has become a Specialist I look again where I can send him.

------

So the important criteria for me to use Native Training for a certain colonist is the availability of an interesting Specialization in close range.

It is quite reactive to the situation and does not really involve planning.
Also I am not sure how jumping from a a list to a village on the map would help me, if I need to look on the map anyways to figure out distances.

Also, I am playing on mapsize "Gigantic".
Distances and amount of Native Villages can become incredible.

------

So it is not meant to critizise, I am just curious how the functionality of jumping from the list to the village on the map (a nice general overview) would help you ?
(Because for me, the interesting view is directly the map.)

A lot of playing Religion and Revolution for me recquires Micromanagement, meaning to analyze the current and specific local situation in detail and react accordingly.
Large scale planning of Education and Training fails for me here. :dunno:
 
I made a decision. I will make a modmod. We clearly have different and incompatible goals for what we would like in RaR as we apparently have different styles of playing. I still think it would be a bad idea to branch of before next release though.

I coded the automated on/off import feature. It turned out to improve wagon train efficiency even greater than I had expected. Don't ask for it yet. It isn't completely done yet as settings aren't saved, interface needs tweaking etc. I will tell when it works. (which isn't in the very near future, see below)

However seeing that it will not be committed to svn, I decided to turn my attention to something else for the time being. I noticed that whenever I test my code with asserts enabled, my code doesn't assert, but the AI appears to assert quite often. This is annoying because it makes real game testing harder. Also it could be a sign that the AI is buggy and behaves stupidly. It's also possible that it cheats, like moving into mountain peaks with units which shouldn't be able to do so.

This is why I have decided to simply play with asserts on and look into every assert which turns up. This will make debugging easier and I may fix a gameplay affecting bug or two in the process.
 
I have been thinking about a modmod and it isn't as easy as it appeared at first :(

What I want to do
Add the features I would like to use ingame.

What I don't want to do
Change the name.
The name itself really isn't the issue here. The problem is changing the name results in the following:
  • Unable to load savegames from RaR
  • New or modified main menu background
  • Possibly a lot of text needs changing in Pedia and stuff like that
To be honest I don't really want to do any of that.

Possible solution
Not publishing what I do.
Sure it's a bad decision as I don't have a problem with sharing what I code and I'm not happy about the concept of "secret coding" (assuming it's "hobby coding" like this).

Alternatively somebody else could volunteer to fix this.

There is also the issue with copyright I haven't looked into yet. However I don't consider that to be a serious problem. I will not look into it until I actually have something to release.

For now I'm still looking for asserts and other bugs. Naturally now that I'm actually looking for asserts, they will not longer appear.
 
Change the name.

Keep it easy. :)
I guess you really misunderstand our intentions.

We want to encourage modmodders and not cause them problems. :thumbsup:

All you are supposed to do:

1. You call your thread to discuss your changes something like "[MODMOD] Religion and Revolution: Nighinggale Edititon"
2. You call the archive you offer for download something like "Religion_and_Revolution_NE.7z"
3. You state clearly that any bugs that are found in your version are supposed to be reported to you.
4. You give credits to RaR in general and post a link to the Welcome Page.
5. You state clearly that you are developing a modmod (or if it is a massive expansion as RaR is to TAC, that you are based on RaR)
6. You generally follow the same rules as we have done. (see here)

You do not have to:
(But you could of course.)

1. Completely change the name (like we did, when moving on from TAC)
2. Change any texts
3. Change the Main Screen
4. Take care of any copyright issues of things that are already in RaR, because I can handle that
 
Given vanilla Civ4 Colonization (and TAC) lacks soldier and flag changes upon rebelling against the King, but that Dale in Age of Discovery II included the following modification...

Code:
* Added new tag in Civ4CivilizationInfos.xml: RevArtDefineTag - what the Civs art definition is changed to on revolution
* Added revolution flags for all Civs (England - BetsyRoss, France - Quebec, Spain - Argentina, Netherlands - Netherlands Antilles, Portugal - Brazil)
...it should be quite possible to have colonial factions restyle considerably upon declaration of independence. Unless there's some critical flaw in that RevArtDefineTag breakthrough that doomed that avenue, it should be possible to make use of that and mod the DLL a bit further to provide variants for text references (Description and ShortDescription, mainly), DefaultPlayerColor and more importantly UnitArtStyleType.

As for alternatives, on the one hand we know Civ4Col treats the revolution stage as a special kind of Civ4 tech era. It's how it defines when to play independence-related music and the like. So given that in Civ4 workers visually change in the Industrial Era, couldn't that concept somehow be used to have soldiers change appearance upon entering the revolution in Civ4Col?

And on the other hand, what is the DerivativeCiv clause at the end of each colony's entry in CIV4CivilizationInfos.xml (in Civ4Col), exactly? That's more of a long shot, but it'd be ideal if colonies could become different "civs" altogether once they start fighting for independence. It'd naturally change their flag, button and general and unit art styles, in addition to textual references and such, but I feel the game wouldn't allow such a fundamental change to occur mid-game.

I'd tinker with this myself, but unfortunately my modding knowledge only extends to XML and some graphics stuff. You're obviously more familiar with DLL modding, Ray, so maybe you could do something about this.
 
You're obviously more familiar with DLL modding, Ray, so maybe you could do something about this.

My Civ4Col modding times are basically over.

However, Release 1.4 is still pretty fresh and I want to see if some serious issues or bugs arise, which I will fix before I finally end my "career".

At the moment I am just waiting for more feedback, fixing the issues reported, improving balancing a bit and maybe add some really small improvements or additions.

I a few weeks, we will release these things as Release 1.5 then.
(Depends how things develop.)

I am not programming any further big new features, sorry.
These things might be implemented in modmods though or maybe the rest of the team will continue the project.

We will see. :dunno:
 
There have been further indirect effects of Wild Animals:
(reported by agnat86)

1. Europeans did not want to join a war (through Diplomacy) because already being at war with Wild Animals.
2. Natives did not want to accept Defensive Pacts, due to the fact that the player is at war with Wild Animals.

Both issues have been resolved. :thumbsup:
(Due to the current problems of our SVN not yet commited though.)
 
As for alternatives, on the one hand we know Civ4Col treats the revolution stage as a special kind of Civ4 tech era. It's how it defines when to play independence-related music and the like. So given that in Civ4 workers visually change in the Industrial Era, couldn't that concept somehow be used to have soldiers change appearance upon entering the revolution in Civ4Col?

Assuming Civ4Col reads the XML like Civ4, I decided to look at how Civ4 change the worker graphics in the modern era and found this

CIV4UnitInfos.xml said:
Spoiler :
Code:
			<UnitMeshGroups>
				<iGroupSize>2</iGroupSize>
				<fMaxSpeed>1.75</fMaxSpeed>
				<iMeleeWaveSize>2</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>2</iRequired>
					<EarlyArtDefineTag>ART_DEF_UNIT_WORKER</EarlyArtDefineTag>
					<LateArtDefineTag>ART_DEF_UNIT_WORKERMODERN</LateArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>
A little more investigation on how this triggers and revolution graphics could be an XML/dds change only.

As for changing the flags themselves... somebody would have to take a closer look at AOD2.

@Lord Shadow: I'm considering continuing a modmod of RaR in the near future. Assuming I get it started and get it up and running, then I guess this could be included. However you would have to deal with XML, graphics and testing as I have other plans for my own time investments. I can code DLL changed if needed though and I might also be helpful on finding stuff to get you started.
 
This is commited to SVN. :)

No need to start a new game.
Savegames (from revision before) will still be compatible.

Please everybody (with access to SVN) get the newest revision. :thumbsup:
 
A little more investigation on how this triggers and revolution graphics could be an XML/dds change only.

As for changing the flags themselves... somebody would have to take a closer look at AOD2.

@Lord Shadow: I'm considering continuing a modmod of RaR in the near future. Assuming I get it started and get it up and running, then I guess this could be included. However you would have to deal with XML, graphics and testing as I have other plans for my own time investments. I can code DLL changed if needed though and I might also be helpful on finding stuff to get you started.
I can do that, but I don't have any experience with RaR. I've only been playing TAC, but given that's the base for this mod, your hypothetical modded .dll would have backwards compatibility, right?

As for the method itself, based on what you've managed to uncover, I don't know how the worker appearance change mechanic would interact with the unit art style scheme, which is a customized system not present in vanilla Civ4Col.

But if RevArtDefineTag works (gotta check AoD2's .dll files), we should go down that road. Without too much trouble, it should be quite possible to copy the function a few times, and through its modification create revolution variant tags for ArtStyleType (unsure about the difference with ArtDefineTag, possibly unnecessary) and UnitArtStyleType, ideally also DefaultPlayerColor, Description, ShortDescription and Adjective.

If that was done, I'd only have to create unit art styles for the rebel versions of the colonies, art defines specifying flags and buttons, their new colour values and text references. That's all XML-wise, graphically I should be able to create the flags and buttons from scratch (I've done some in a couple of personal mods), but as far as unit models go, I'd have to rummage through the Downloads section here in CivFanatics. I can reskin some stuff if necessary, but I can't really create entirely new things.

The vanilla models for soldiers, dragoons and their veteran variants work fairly well for the Thirteen Colonies, and there's some volume of content floating around, so that's not a problem. The tricky part would be the other colonial factions, but I think I could come up with something, especially if I could tinker with models such as those in the Continental Guard set.
 
I've only been playing TAC, but given that's the base for this mod, your hypothetical modded .dll would have backwards compatibility, right?

DLLs of TAC and RaR are not compatible.
(You could not use the DLL of RaR in any other mod either).

Meaning you cannot simply exchange them.
The other mod would not even start anymore.

A programmer however might take a look at the source code and use pieces of the code to program the same feature for the DLL of another mod.
 
As for the method itself, based on what you've managed to uncover, I don't know how the worker appearance change mechanic would interact with the unit art style scheme, which is a customized system not present in vanilla Civ4Col.
I don't know how it works either, but I do know that the worker actually do change, meaning it's a functionality in Civ4. I also know that Civ4Col is based on Civ4, which means this functionality is likely included. It may not be called in vanilla, but that's not the same as they bothered to remove the functionality from the exe file. If that really is the case, all we need to do is to make the right call and the functionality will come to life.

The real question is if we can make it do what we want it to do. Maybe add code like this to expert farmers to make modern farmers look like blacksmiths and see how it affects the game. WIth a bit of luck they will look like farmers at the start of the game and turn into blacksmith when the player declare independence.

I looked up ART_DEF_UNIT_WORKER and ART_DEF_UNIT_WORKERMODERN and found this:
Art/CIV4ArtDefines_Unit.xml said:
Spoiler :
Code:
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_WORKER</Type>
			<fScale>0.44</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			<NIF>Art/Units/Worker/Worker.nif</NIF>
			<KFM>Art/Units/Worker/Worker.kfm</KFM>
			<SHADERNIF>Art/Units/Worker/Worker_FX.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>0.9</fShadowScale>
			</ShadowDef>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.31</fRangedDeathTime>
			<bActAsRanged>0</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_WORKERMODERN</Type>
			<fScale>0.44</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			<NIF>Art/Units/ModernWorker/ModernWorker.nif</NIF>
			<KFM>Art/Units/ModernWorker/ModernWorker.kfm</KFM>
			<SHADERNIF>Art/Units/ModernWorker/ModernWorker_FX.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>0.9</fShadowScale>
			</ShadowDef>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.31</fRangedDeathTime>
			<bActAsRanged>0</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>

This will only change the unit itself (if it even works) and not the flag. AOD2 holds the key to the flag change and I haven't looked for that (yet?).
 
I don't know how it works either, but I do know that the worker actually do change, meaning it's a functionality in Civ4. I also know that Civ4Col is based on Civ4, which means this functionality is likely included. It may not be called in vanilla, but that's not the same as they bothered to remove the functionality from the exe file. If that really is the case, all we need to do is to make the right call and the functionality will come to life.

The real question is if we can make it do what we want it to do. Maybe add code like this to expert farmers to make modern farmers look like blacksmiths and see how it affects the game. WIth a bit of luck they will look like farmers at the start of the game and turn into blacksmith when the player declare independence.

I looked up ART_DEF_UNIT_WORKER and ART_DEF_UNIT_WORKERMODERN and found this:

(snip)

This will only change the unit itself (if it even works) and not the flag. AOD2 holds the key to the flag change and I haven't looked for that (yet?).
The worker appearance change hinges on this...

Code:
<EarlyArtDefineTag>ART_DEF_UNIT_WORKER</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_WORKERMODERN</LateArtDefineTag>
Well, more specifically, whatever defines when the first tag is used and when the second one is. The graphics XMLs won't tell you that. Should be something in the tech eras XML or the units one (the one that holds the stats and such), if you want to keep looking into that. I don't have Civ4 installed at the moment, so I can't check myself. But we can't test its functionality in Col until we find where the trigger is in Civ.

Also, as an additional complexity there's also the fact we're dealing with professions, not plain units, for the most part. So even if the test farmer visually changes to blacksmith, it won't help us much in figuring out how to deal the appearance of professions such as soldier and dragoon.

But AoD2 holds the key to everything, and not just the flag change, because the presumed RevArtDefineTag formula (X becomes Y during the Revolution) can be used to create all the variant tags we need. And I think it's by far the easiest route to take, if the mechanic can be found within the DLL.
 
@Lord Shadow, Nightinggale:

Please do not use the Mod Development thread of Religion and Revolution to have long detailled discussions about features not related to the mod.
Even discussions about features of modmods should not take place in threads of the main forum for RaR, because it would only confuse the players.

Please create separate threads in Civ4Col - Creation & Customization for such discussions.
(If it turns out to become a project that gets big enough, moderators will surely also create a separate project forum.)

Thanks. :thumbsup:
 
Status
Not open for further replies.
Top Bottom