I've dug a bit more the idea about using roads mechanics in order to implement large rivers.
Actually, avoiding units to get on large rivers is really easy. This is managed in the file CivUnit.cpp on line 3012. We just need to add something like:
Code:
if (pPlot->getRouteType() == 3)
{
if (!(m_pUnitInfo->allowsMoveIntoPeak() || (getProfession() != NO_PROFESSION && GC.getProfessionInfo(getProfession()).allowsMoveIntoPeak()) && (pPlot->getImprovementType() != (ImprovementTypes)(GC.getDefineINT("RIVER_DOCKS")))))
{
return false;
}
}
Now it doesn't solve the map scripting which is a field I really know nothing about.
@raystuttgart has elaborated the maps scripts for RAR but he's retired now. Contrary to normal roads, the script should force all "large river tiles" to be connected up/right/down/left, and not diagonally. Otherwise this would creates holes in which normal units could sneak in.
Here's a little scheme to imagine different paterns.
- A large river begins with a small river and ends in the ocean.
- Tiles with river docks are pictured in green. They can be crossed by normal units.
- Large river tiles which can't be reached by normal units are pictured in brown.
Graphics look a bit tedious to create because there are tons of image to generate, but it looks like something which could be done. They are all defined in XML/Art/CIV4RouteModelInfos.xml.
@Schmiddie bumped this thread and he knows a lot about Civ4Col graphics, so his opinion would be valuable here.
As for the coding part, there are probably difficulties I've overlooked. The opinion of
@devolution,
@Nightinggale or any other experienced developpers would be appreciated regarding this.