Large Rivers (trying to make an old dream come true) [IMPLEMENTED]

Do you want Large Rivers in WTP?


  • Total voters
    45

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,637
Location
Stuttgart, Germany
Hi guys,

one of my oldest, most wanted but never realized concepts is: Large Rivers
(The link is to my original RaR concept, but please anwer here in WTP forum.)

But why was it not implemented then, you might ask? :think:
Simple answer, I lack myself several of the necessary skills to do it properly and effort is enormous.
  • My graphical skills are poor :c5unhappy:
  • My AI programming skills are poor :c5unhappy:
  • It is an incredible effort to adjust all existing Maps :c5unhappy:
  • It is also a lot of effort to adjust code generation for existing Map Scripts :c5unhappy:
Of course, there are other challenges and thus effort but I am not worried that much about them.
(Those I can hanlde reasonably myself.)
  • The base configuration of the terrain and base implementation of feature logic. :thumbsup:
  • There are lots of other additions neededed for this feature (new Imrovements, new Features, ...) :thumbsup:
  • There are lots of changes to existing XML needed (balancing of Bonus Ressources, Text, Colopedia, ...) :thumbsup:
So this would usually need a team with lots of different skills that could work together in a coordinated way.
(programmers, graphical experts, testers, people to write texts, translations and Pedia, ...)

However, I decided to still give it a try because I want to code something big again. :c5happy:
All that could go wrong is that I fail and might have wasted a month of work ... :dunno:

This feature will most likely be added as "new TerrainType" because it is technically the best option for coding features and performance.
(See explanation in my original thread.)

If that does not work out (due to limitations for graphics) I might try to add a "new River Type" which is most likely easier / better for graphical display.
(I figured that out recently.)

If we add this it will have massive impact on a lot of other things.
Thus it needs to be done as one of the first big new features - in my opinion the absolutely first.

After the upcoming Improvement Release I will basically be doing nothing else until this is finished or completely fails.
(Of course I will create a new branch, so I will not damage work of other team members.)

To implement my prototype I will reuse graphics from a Mod-Component of Ramkhamhaeng a former TAC member (because currently these graphics are the best I have)
but basically implement the rest completely different (because I still believe that a new Terrain Type is technically the best solution).
So definitely credits to Ramkhamhaeng. :hatsoff:

See Screenshot for first impression.
(Do not worry, I will not publish / not integrate in WTP with graphical issues like that.)
Spoiler :



All help, especially considering graphics, AI and Map Scripts will be highly appreciated. :hug:
(To be honest, I probably will not be able to realize it all alone ...)

Before others can really support me though I first need to have my protoype implemented so we can improve it together. :thumbsup:
And for that we first we need to get current imrpvement release published.

--------
Without even trying there is no chance for success. :)
 

Attachments

  • Rhein und Donau.JPG
    Rhein und Donau.JPG
    331.8 KB · Views: 1,760
Last edited:
I am a bit worried that adding "Large Rivers" to the game does the opposite of what it should do.

Historically people travelled along the rivers and colonized or set up trading posts and forts following rivers, because rivers were the only "streets" that existed, with travel times overland far, far longer than down or even up a river.

So a river should enable small ships/canoes to travel up and down, essentially making waggons far less useful as they are slower overland than small ships on a large river.

And if a "large" river would be something that scouts and hunters could not cross it would serve as an ahistorical barrier for exploration and colonization instead of drawing colonization up the river. Normal units should be able to cross even large rivers. Either at certain places like fords or by having the "Large River"-square have a higher movement cost that simulates that units are building themselves a raft to cross. After all turns are only 300 and simulate the duration of a FULL YEAR...
 
The screenshot doesn't work for me. Why would a large river be large from source to mouth? Surely the river should start normal and become large at some point further down.

I'm not clear on this concept. Would the large river be a full tile feature allowing ships to access it, rather than existing between tiles?
 
The screenshot doesn't work for me.
I have no idea why. :dunno:
It is attached to the post and seems to be working / displayable perfectly.

@community:
Can the rest of you see the picture?

Surely the river should start normal and become large at some point further down.
I'm not clear on this concept.
It would be clearer to you if you could see the screenhot. :c5unhappy:
Basically "normal rivers" flow into a "large river" and thus what you discribe is possible.

Would the large river be a full tile feature allowing ships to access it, rather than existing between tiles?
It is not a new "Feature Type" (on Plots) and not a new "River Type" (between Plots) technically, it is a new "Terrain Type" (a Plot of its own).

Thus it can have Improvements, Features, Units, Bonus Resources ... on it.
And yes, it will allow "Coastal Ships" / "Large Coastal Ships" to travel on it.
 
Last edited:
I am a bit worried that adding "Large Rivers" to the game does the opposite of what it should do.
Don't worry. :)

So a river should enable small ships/canoes to travel up and down, essentially making waggons far less useful as they are slower overland than small ships on a large river.
That is exactly what it will do. :)

And if a "large" river would be something that scouts and hunters could not cross it would serve as an ahistorical barrier for exploration and colonization instead of drawing colonization up the river. Normal units should be able to cross even large rivers.
Since it is a Terrain Type, we can exactly configure easily which Units might enter / cross or not.

For the beginning, I will allow specific Units like Scouts, Pioneer, Natives, Native Mercenaries, Wild Land Animals, ... to always enter and thus cross it.
(If there is no Improvement like a "Ferry" and no Terrain Feature like a "Ford" on it.)

On "Large River Plots" with Improvements "Ferry" or "Bridge" or Terrain Feature "Ford" or "Sandbank" all Units can cross it.

--------

Please guys, take the time and read the original concept (from RaR). :thumbsup:
 
Last edited:
I'm very sorry - I worded my post badly again. I meant it doesn't work in my brain, not the screen. I can see the screenshot just fine.

What I meant is, from looking at the screenshot, it looks like the graphics for a large river is displayed as a large river from source to mouth, not a normal river becoming a large river further down, although your response suggests that it would indeed only become a large river further down its course.

Edit: I see a lot of this is already discussed in the original thread you linked, which I managed to miss before.
 
Last edited:
What I meant is, from looking at the screenshot, it looks like the graphics for a large river is displayed as a large river from source to mouth, not a normal river becoming a large river further down, although your response suggests that it would indeed only become a large river further down its course.
All of this depends on
  • Graphics
  • Map Scripts
These are infact the biggest problems. :dunno:
 
Just for clarification:

This is not even close to being ready for release yet.
(So the picture should only give a rough idea of the direction this can take.)

This requires a lot of prototyping, experimenting and many improvement loops.
(And it will need a lot of time, effort and also support from skilled people from community, e.g. considering graphics).

But since it is a new Terrain and will add many other things (e.g. Terrain Features, Improvements, ...)
it simply should to be done as one of the first new features because it will affect the mod a lot.
(Maps, MapScripts, AI, Balancing, ...)
 
Would a large river tile act differently to a normal square with a river on it if a city is founded next to a large river?
Like Ocean with fish for a fisherman to be placed on? Would it still give the +1 bonus like the normal river square?
 
Would it still give the +1 bonus like the normal river square?
Nope, it will in many aspects act like an "Coast" plot (Water Terrain) considering that aspect.
Also:
  • It is not possible to found a City directly on top of it
  • The only Yield you can get of it is "Fish / Food" (unless you have other Water Bonus Ressources on it, e.g. Pearls or Sea Otters)
  • It will only have Bonus Ressources like "Coast" Terrain
  • Allowing Coastal Ships to use it (but no other Ships)
  • Having normal Rivers flow into it
  • Allow Cities built next to it to build "Piers" (but no Upgrades of that, unless they also have Ocean access directly from another Coast Plot)
  • ...
But in other aspects it will act like a "Land" plot.
  • Allowing (specific) Land Units to always enter / cross
  • Having (new) Terrain Features (to allow other Land Units to enter / cross)
  • Having (new) Improvements (to allow other Land Units to enter / cross)
  • Having normal Rivers not directly affect it (e.g. no Yield modifiers)
  • ...
So it basically combines some aspects of "Water" plots with some aspects of "Land" plots.
(That is one reason why implementation is challenging.)

Something like this simply does not exist yet. :)
But we modders are pretty sure it is technically doable.
 
Last edited:
The mechanics involved would seem to allow for introducing canals.

Large bridges and canals could open up some very interesting late game possibilities.
 
I mean man-made canals as an improvement to a plot. With large rivers allowing coastal ships, could it not be expanded to a canal improvement.

It would be limited to needing a coastline or an adjacent canal. It should not be built on hills or mountains or 90 degree turns, but over flat tiles it could be constructed to connect oceans.
 
Just some small infos for mod-modders:
(I will leave such infomation pieces in this thread.)

TerrainTypes need to be hardcoded in DLL currently as well.
(It is not possible to add them in XML only currently.)
Spoiler :

Code:
enum DllExport TerrainTypes
{
    NO_TERRAIN = -1,
    TERRAIN_GRASS,
    TERRAIN_SAVANNAH,
    TERRAIN_PLAINS,
    TERRAIN_DESERT,
    TERRAIN_MARSH,
    TERRAIN_TUNDRA,
    TERRAIN_SNOW,
    TERRAIN_COAST,
    TERRAIN_OCEAN,
    TERRAIN_PEAK,
    TERRAIN_HILL,
    TERRAIN_LARGE_RIVER,
    TERRAIN_FORD,


Since this also needs to generally have a different behaviour, you also need to adjust PlotTypes.
(You will need it to check for e.g. "plot->isLargeRiver()")
Spoiler :

Code:
enum DllExport PlotTypes
{
   NO_PLOT = -1,

   PLOT_PEAK,
   PLOT_HILLS,
   PLOT_LAND,
   PLOT_OCEAN,
   PLOT_LARGE_RIVER,


For Python you will also need to do make the PlotType "Large River" accessible.
Spoiler :

Code:
python::enum_<PlotTypes>("PlotTypes")
       .value("NO_PLOT", NO_PLOT)
       .value("PLOT_PEAK", PLOT_PEAK)
       .value("PLOT_HILLS", PLOT_HILLS)
       .value("PLOT_LAND", PLOT_LAND)
       .value("PLOT_OCEAN", PLOT_OCEAN)
       .value("PLOT_LARGE_RIVER", PLOT_LARGE_RIVER)
       .value("NUM_PLOT_TYPES", NUM_PLOT_TYPES)
       ;
 
Last edited:
I mean man-made canals as an improvement to a plot.
With large rivers allowing coastal ships, could it not be expanded to a canal improvement.
Technically possible, just like my feature "Dry Swamp", which also changes the Terrain Type.
But I have no intention to implement something like that because I feel it is not realistic for this time period to create something like "Panama Canal".

Also in this case there are a lot of risks of bugs.
Because "Large Rivers" behave very differently than "Water" or "Land". (They are something in between.)
 
That is reasonable.

Canals were well established in Europe in the period, but I think you are correct that they were not built in America until much later.
 
Reminder to myself:
(Maybe also a question to community.)

I still need to figure out what I will do considering combat modifiers? :think:

Should land Units on a "LargeRiver" get a massive combat malus (negative Combat modifier)?
Of course this needs to be configured in Civ4UnitInfos.xml.
 
Just some small infos for mod-modders:
(I will leave such infomation pieces in this thread.)

To prevent "normal" Rivers to be placed parallel to "LargeRivers"
(Still need to checkt that thoroughly though.)
Spoiler :

Code:
bool CvPlot::isLargeRiver() const
{
   return (getPlotType() == PLOT_LARGE_RIVER);
}
Code:
bool CvMapGenerator::addRiver(CvPlot* pFreshWaterPlot)
{
   FAssertMsg(pFreshWaterPlot != NULL, "NULL plot parameter");

   // cannot have a river flow next to LargeRiver
   if (pFreshWaterPlot->isLargeRiver())
   {
       return false;
   }


To prevent Cities to be built on "LargeRivers"
(Unless you have some reason to allow it, but it might look really strange and could possible cause bugs - at least in my concept.)
Spoiler :

Add a check for isLargeRiver() where it checks for isWater()
Code:
bool CvPlayer::canFound(int iX, int iY, bool bTestVisible) const
{
   ...
   else
   {
       if (pPlot->isWater() || pPlot->isLargeRiver())
       {
           return false;
       }
   }
   ...


To allow Experts for Water Professions to get their Bonus Yields on "LargeRivers"
(And prevent Experts for Land Profession from getting their Bonus Yields on "Large Rivers.)
Spoiler :

Add a check for isLargeRiver() where it checks for isWater()
Code:
bool CvPlot::isValidYieldChanges(UnitTypes eUnit) const
{
   FAssert(eUnit != NO_UNIT);

   if (GC.getUnitInfo(eUnit).isLandYieldChanges() != (isWater() || isLargeRiver()))
   {
       return true;
   }

   if (GC.getUnitInfo(eUnit).isWaterYieldChanges() == (isWater() || isLargeRiver()))
   {
       return true;
   }

   return false;
}



By the way:
I strongly suggest to not change function isWater() of CvPlot.cpp, because it can have too many side effects.
Implement a new function isLargeRiver() as suggested above and use it wherever needed.
 
Last edited:
The mechanics involved would seem to allow for introducing canals.

Large bridges and canals could open up some very interesting late game possibilities.

The Panama Canal failed horribly on the first try by Lesseps. Only after Steam Shovel Excavators were invented did they manage to create it and that was a long time after the timeline of Colonization.
 
Reminder to myself:
(Still need to think about this properly.)

When checking for "LandAreas", LargeRivers should count as Land.
(e.g. pArea->isLand())

When checking for "WaterAreas", LargeRivers should not count as Water.
(e.g. pArea->isWater())
 
Top Bottom