[Religion and Revolution]: Winds and Storms

Robert Surcouf

Civ4Col Modder
Joined
Feb 21, 2011
Messages
665
Location
France
Ray has given me a little feedback about my Wind and Storm feature included in my Storm and Light mod. Maybe it's a good idea to discuss this here:

raystuttgart said:
Hi Robert,

I have taken a look at your feature "Wind and Storm".
(Just a short overview.)

Please excuse if I am critizising a few things. :)
(Also, please excuse if I get anything wrong.)

1. As far as I can see, "Winds" and "Storms" are only created once at first map-creation.

2. It is Python-based instead of DLL-based.


Thus the feature is a little boring, because "Winds and Storms" are very static.

It will not work for all types of game (Maps, Scenario and Mapskripts).

Also performance and possibilities of DLL are much larger.

Please let us create a feature that:

1. Will work for all types of games.

2. Will have dynamic placement of winds and storms every round.

Actually such a feature would be quite easy to do. :thumbsup:

Basic Concept:

We could just hook into this method:
void CvGame::doTurn()

At the beginning of every round, we first clear all "Winds" and "Storms" of the map.

Then we place them again randomly.

Would you like to create the feature like that ?
(It is your feature after all.)

I could also do it, if you want.

What do you think ?

Again, please excuse.
I really do not want to critizise your work.
I simply think we can create a much more interesting feature with DLL that will work for all kinds of games.
 
Ray has given me a little feedback about my Wind and Storm feature included in my Storm and Light mod. Maybe it's a good idea to discuss this here

As far as I can see, "Winds" and "Storms" are only created once at first map-creation.
It is Python-based instead of DLL-based.

As far as I remember we early discussed this question, please, look here:

There are at least 3 ways to include the weather/health (illness) effects in the game.

1. Python (as random events, I guess)
2. SDK as in "1492: Reefs and Weather" (full analog of Civilization IV)
3. SDK as in "Model: Mortally Dangerous Colonization" where I exchanged one of sea animals on Tornado (analog of Jeckel's "JAnimals A Wild Wilderness 1.001" mod).

I tested variants 2 and 3. Both are working correctly. Probably I will test also variant 1 with Python.

Unfortunately up to now I found no time to test the first technique, where weather/health (illness) effects would be implemented through Python. However, both SDK (DLL) variants are working perfectly.

Do I understand correctly that "Wind and Storm" is Python-based version of "Weather feature"?
 
@ Ray:
You're actually the first one to give me some feedback. :goodjob:So, no I don't mind. :lol:
Actually I figured out a few things weren't perfect.;)

By the way, you may have missed a few details, but basically what you say seems correct!

@ KJ:
Yes, it's a python and Xml based weather feature!
You can find some info here:
Storm and Light

@ everyone:
Basically, when I started modding Colonization, I didn't know how to program in C++.
So I started with simple Xml editing. So I added new features on ocean plots. The problem is they didn't appear on new maps, unless I added them manually!

So I changed python map generators... I showed the result to Dazio and M07 (from Dawn of a New Era). They told me they loved the idea.
A few weeks later, Dazio told me about another mod: 1492 Reefs and Weather by KJ Jansson(;)). M07 (I think?) told me it seemed really great ! He told me it was nearly perfect... but there was a major transparency problem...

I checked the code very quickly, but didn't understand much of it (it was mostly C++, and I didn't know any C++ at the time). It seemed much better than what I was planning to do... But even though, M07 and Dazio encouraged me to continue. Maybe it's time I (or we) look into it again.

Was the transparency problem ever solved?
 
Hi guys,

I really think a DLL-based feature (with XML for balancing) is the best solution.

1. It is no problem to have it work for all types of games.
(Maps, Szenarios, Mapscripts)

2. DLL is a lot faster / much more performant than Python.

3. We can easily trigger dynamic generation of the features "Storm" and "Weather" every round.
(Which would make the feature much more interesting than only having placement of these features at map-generation.)

4. We would have to go into DLL anyways, to teach AI at least generally how to handle these new features.
(Adapting of Pathfinding.)

----------------------

We can reuse a lot of the graphics (and also XML) that have been created for the features. :thumbsup:

----------------------

So ok, I would like to clarify a few things:
(Let us discuss these things again. :) )

1. Basic Concept

What kind of weather effects (terrain features) should be implemented ?

Will we have weather effects only on water or also on land ?
(In TAC we already have "Fire", "Tornados" and "Vulcanos" on land.)

Should we simply do a fresh regeneration of these weather effects every round ?
(Or should it work some other way ... :dunno:)

2. AI Concept

How do we ensure that this feature does not ruin AI ?
(Losing too many ships for example. Or having too many ships in repair to keep up transportation.)

What do we need to pay attention to considering AI ?
(Pathfinding. Anything else ?)

3. Balancing

How many of these new terrain features should we have on map at the same time.
(Only a few or is this a "mass"-feature ?)

Which XML-Settings do we need to ensure good balancing-possibilities later on.

Should a Storm (for example) be able to destroy a ship or only damage ?

----------------------

After we have clarified 1. to 3. we can discuss

4. Implementation concept (DLL)

Actually the concept I have in mind is very similar to my technical concept for "Wild Animals".
(But that is just an idea ...)

5. GUI (Messages, Warnings, ...)

Figuring out the exact texts, when "Ship damaged", "Mouse over Storm", ...

6. Work distribution

Who is going to create basic implementation, graphics, AI, texts, ...

----------------------

Let us put some effort into this, to create a really great feature. :)
(This is no minor feature, we should really take care here.)
 
1. Basic Concept

What kind of weather effects (terrain features) should be implemented ?

Will we have weather effects only on water or also on land ?
(In TAC we already have "Fire", "Tornados" and "Vulcanos" on land.)

Should we simply do a fresh regeneration of these weather effects every round ?
(Or should it work some other way ...
My proposal:

1. Reefs
2. Storms at Sea (Tornados)
3. Thunderstorm (both Sea and on Land),
4. Tailwind (Sea)
5. Sandstorm (Land if you have Deserts)

6. Fire (TAC)
7. Vulcanos (TAC)

As a starting point of Basic Concept we can use these data:

Negative effects:

1. Reefs:
- The ship, sitting on the reef gets 15% damage per turn.
- The speed of the ship is reduced by -5. The ship, sitting on the reefs, will not be able to move more during this turn.

2. Storms at Sea (Tornados):
- The ship caught in a storm gets 20% damage per turn.
- The speed of the ship is reduced to -4. The ship, caught in a storm, will not be able to move more during this turn.
- Storm at sea reduces the impact of food from the tile for 3 (-3 FOOD).

3. Thunderstorm and Rain on Sea and on Land:
- Unit, caught in a thunderstorm, gets only 5% of damage.
- The speed of the unit that has entered the thunderstorm , is reduced by -1. The naval unit can often continue to move and get out of the dangerous tile, the land unit will leave on this tile up to next turn.
- Thunderstorm slightly reduces the ouput from the tile:
for Sea tiles: -1 FOOD,
for Land tiles: -1 FOOD, -1 LUMBER, etc.
Weather phenomena do not affect the production of goods in urban buildings or mining in the mines.

Positive effects:

1. Tailwind (Fair wind) on Ocean and near Coast increases the speed of the naval units (+1 per turn).
2. Natural weather phenomena and coastal reefs make travel more dangerous, that adds a reality in the game.

2. AI Concept

How do we ensure that this feature does not ruin AI ?
(Losing too many ships for example. Or having too many ships in repair to keep up transportation.)

What do we need to pay attention to considering AI ?
(Pathfinding. Anything else ?)

I tested this moment in "1492: Reefs and Weather". I sent my caravel exploring the ocean in the automatic regime and checked how many turns my caravel could survive. Results are presented in the section "PATH_DAMAGE_WEIGHT parameter vs Caravel lifetime".

PATH_DAMAGE_WEIGHT tag is located in the GlobalDefines.xml file.

GlobalDefines.xml:

Code:
	<Define>
		<DefineName>PATH_DAMAGE_WEIGHT</DefineName>
		<iDefineIntVal>2000000</iDefineIntVal>
	</Define>

Table 1 show the PATH_DAMAGE_WEIGHT values and Lifetime (Turn) of a Caravel exploring the ocean in automatic regime before the death.

Value--------------Turn

0-------------------46
500000-------------97
2000000-----------118

As I remember it was a proposal to prevent a ship to enter on the tile with a danger feature at all. However, I don't like this idea. Why we add, for instance, a storm if a ship cannot enter in the storm? No, each unit can enter on the tile with danger feature! In a case of a ship it practically means something like "A strong storm began suddenly and my ship caught in this storm".

NB. Here I propose to add a new element.

Logic:
- if a unit lost more 50%HP,
- the unit must stop on the tile without danger feature (storm. tormado, reefs, etc) and
- restore HP up to 100%.
- The unit can continue the trip only if it has 100%HP.

Especially important to add:
a ship can leave a port to travel through ocean (Europe <-> New World) only with 100% HP!
Noone travel through the ocean on a ship with few HP.

This addition prevents the losing too many ships.

3. Balancing

How many of these new terrain features should we have on map at the same time.
(Only a few or is this a "mass"-feature ?)

Which XML-Settings do we need to ensure good balancing-possibilities later on.

Should a Storm (for example) be able to destroy a ship or only damage ?

I guess all balancing we could make through these parameters in CIV4FeatureInfos.xml

Code:
			<iAppearance>1000</iAppearance>
			<iDisappearance>10</iDisappearance>
			<iGrowth>10</iGrowth>
			<iTurnDamage>5</iTurnDamage>

Each danger feature could only damage (parameter <iTurnDamage>) a ship but not destroy it. Full destroy of a ship is very bad for both human and AI players. I believe a human player will replay this moment, but AI just lost a ship.
 
So ok, if I take a look at Robert's work, he has done the following:

- Favorable wind (1MP, -15% defense, 0.5 MP with sea explorer promotion)
- Unfavorable wind (3MP, +15% defense)
- Storm (4MP, +15% defense, 20% damage per turn)

--------------------------

I would like to have the following new terrain features:

1. Favorable Winds / Tailwinds (only on Ocean Plots)

-> positive effect considering movement

2. Unfavoralbe Winds / Headwinds (only on Ocean Plots)

-> negative effect considering movement

3. Storm (on Ocean, on Coast and on Land)

-> higher negative effect considering movement
-> moderate damage every
-> negative effect on production of certain goods (basically as KJ suggests)

4. Heavy Storm (only on Ocean Plots)

-> very high negative effect considering movement
-> higher damage every round


That is pretty much all I would like to have as new terrain features for this concept. :)

--------------------------

1. Too many new terrain features like that will not make the game better to my opinion.

Reefs:
Reefs are very static and at most unnayoing to my opinion.
Would this really make the game more fun ?

Sandstorms:
There really is not much desert on most maps.
Is it really worth the additional effort ?

2. I would like to adjust Pathfinding (Automization, which will also be used for AI)

Since these "features" will be placed at the beginning of every round, it is possible that they will be placed on top of a unit.

Otherwise I would like to teach AI to use "Tailwind" and to avoid the other features.

Also AI ships will stop and repair if they have less than 50% health.
(Or enter one of its cities if that city can be reached in one turn.)

3. Too many "specialties" of the features will only make it complicated.

-> no special promotions
-> not to many effect (like defensive bonusses, ...)
-> no new special rules when a ship is allowed to travel to Europe or continue its journey

4. I really think it will be the best solution to simply clean map of these features every round and randomly regenerate. :dunno:

-> no "growing" effects for these features
-> no "moving" rules of these features
-> no "lifetime" of these features

After all a round is typically something like a year.

5. Please let us not overexaggerate with the amount of these features !

I would really like to have a moderate balancing for this. :)

I would want at least 1 XML-setting in GlobalDefines_Alt.xml to control the general amount of these new features.
(A global "modifier" of creation chances.)

--------------------------

Let us not make this feature too complicated. :)
 
Is it possible to have this effect on multiple tiles for a wider area of effect? That storms is "1" tile is kind of very local? On the open sea storms are huge with more tiles.
 
Is it possible to have this effect on multiple tiles for a wider area of effect? That storms is "1" tile is kind of very local? On the open sea storms are huge with more tiles.

At generation we could have increased chances for one of these features if an adjacent feature already has the same feature. :think:

But I would only like to have that on "Ocean"-tiles, not on land.
 
Wait a little ! I haven't even explained everything... :eek:
I agree my feature isn't dynamic enough... But I partially disagree with what you said.

Actually I said I didn't change anything in the cpp files... But some of the code is in C++ (so things have already been implemented in vanilla C4C)
There are three xml tags (related to CvGameCoredll of course): Feature Appearance probability, Feature disappearance probability, and feature growth.
So it isn't 100% static...

I agree C++ is a lot faster than python, but the "dynamic" part is coded in C++... I don't fully understand your idea Ray, are we going to add wind totally randomly each turn?
To me it seems easier to generate winds at the beginning of the game, and change state every turn...

However I agree with the pathfinding part...
I'll give some feedback ASAP
 
There are three xml tags (related to CvGameCoredll of course): Feature Appearance probability, Feature disappearance probability, and feature growth.
So it isn't 100% static...

I don't fully understand your idea Ray, are we going to add wind totally randomly each turn?
To me it seems easier to generate winds at the beginning of the game, and change state every turn...

What "state" should be changed ?
(Either it is there or not :confused:)

See, with my idea we would only need:

Feature Appearance probability at every of these features (Civ4FeatureInfos.xml)
(And also a global modifier in GlobalDefinesAlt.xml for easier balancing of the complete feature.)

Spoiler :

Actually I might be better to have 2 probabilities:

Appearance probability on Land (and Coast)
Appearance probability on Ocean


As I said, I would simply clear all of these new features of the map every turn and regenerate them.
(Random using "Feature Appearance probability".)

So every round we have a totally new situation considering "Winds and Storms".

But that is just a suggestion of course. :)
(However I cannot imagine any solution that is easier to implement.)
 
Change every round would make sence since one turn = one month in game. Storms would not last for months?
 
Change every round would make sence since one turn = one month in game. Storms would not last for months?

Exactly. :)

(Actually sometimes a round is even something like a half a year or even a complete year.)
 
If I read correctly, no one likes my defense modifier.:faint: Each ocean/coast plot has the same defense bonus (+10%). With those extra bonuses, we have extra fun, and naval wars will be a little less dull.

Change every round would make sence since one turn = one month in game. Storms would not last for months?
The point is, should we regenerate EVERYTHING each turn or not. The three of you seem disagree with me, but I really thing storms and winds should seem to MOVE and not disappear randomly and reappear, at least not TOTALLY.

You didn't answer me KJ Jansson. Was the transparency problem solved or not?
Actually there was three major problems in my implementation:
1) Scenarios weren't considered (only mapscripts, although winds and storms may appear even in scenarios, if I'm correct)
2) Pathfinding
3) Damage was only considered at the end of a turn. So the basic idea was to avoid storms...
 
If I read correctly, no one likes my defense modifier.:faint: Each ocean/coast plot has the same defense bonus (+10%). With those extra bonuses, we have extra fun, and naval wars will be a little less dull.

For me, this is kind of hard to understand / explain. :dunno:

The point is, should we regenerate EVERYTHING each turn or not.

I say yes. :)

It is much more performant than considering any states.
It is more dynamic if you face a different situation every turn.
It is extremely easy to implement.
It is realistic considering the huge time span a round in the game stands for.

1) Scenarios weren't considered (only mapscripts, although winds and storms may appear even in scenarios, if I'm correct)
2) Pathfinding
3) Damage was only considered at the end of a turn. So the basic idea was to avoid storms...

These problems can be solved. :)
 
I dont disagree with you Robert. To be honest I dont know too much about this feature to even comment on it. But I do think effects should not last for several rounds nomatter what feature it comes from. This is the only thing I think on this matter. :p
 
For me, this is kind of hard to understand / explain. :dunno:
Gosh ! I really thought you liked it... I'm quite upset. :(
Here's the basic idea. Tailwinds increases a ship maneuverability
So, they increase your movements, and if you attack a ship on a tailwind, your ship (the attacking ship) will maneuver quickly and so it will surprise defending ship. So it's quite difficult to defend on a tailwind plot in my Storm and Light mod.

On the contrary unfavorable winds decrease maneuverability, so they will slow you down. But an attacking ship would be slowed down, and so, the defending ship will spot it easier, and could prepare his defense. So I gave a +15% bonus on those features.

I must say I was even quite proud of my idea. If I read correctly unfavorable winds (and storms of course) only have negative effects, and tailwinds only positive effects.
I really think this is a bad idea. And I don't like it at all...
The point is, we will do everything to avoid unfavorable winds, and we will do everything to seek tailwinds. So we will have to ensure (that is if my ideas are rejected of course) that we can't always avoid unfavorable winds and/or storms. So we would probably create big stormy areas. Why not?

The point is, tailwinds don't have a 100% positive effect. If you end your turn on a tailwind plot (meaning you have gained many movement points), you are more vulnerable to attacks. And sometimes, ending your turn on a unfavorable wind could be a good idea, since you get a defense bonus even though it slows you down...

By the way, I added two or three events (not much) only triggered on such plots...(winds and storms)

About total randomness
I say yes. :)
Well, I say no !

It is much more performant than considering any states.
It is more dynamic if you face a different situation every turn.
It is extremely easy to implement.
It is realistic considering the huge time span a round in the game stands for.
1) I don't see why?
2) More dynamic... Well I'd say more chaotic.
3) Is there a problem with iAppearence tag?
4) This is the most interesting part. Is it more realistic. I really think this is the point!
And of course I disagree. (see below)

These problems can be solved. :)
Thank you Ray! :goodjob:

raystuttgart said:
I could also do it, if you want.
:cry:
Actually I was kind of hoping you (you = team) would let me do that feature. :( But I may need your help. Thank you !

I dont disagree with you Robert. To be honest I dont know too much about this feature to even comment on it. But I do think effects should not last for several rounds nomatter what feature it comes from. This is the only thing I think on this matter. :p
Well, again, this is really about what is realistic and what is not. I really think some regions are quite windy (e.g. around Florida, Louisiana etc...) and some are not. Unless climate really changes in the next decades, I'll probably never see a hurricane, a flood or a tornado in my entire life (I'm not complaining :p).

So I really thing we shouldn't leave it static, but I actually like the idea of the feature growth/ feature disappearance/ feature appearance tags...
(Even though my version was probably way too unbalanced, I must admit it :blush:)
 
Gosh ! I really thought you liked it... I'm quite upset. :(

So ok, if the defensive bonus / malus is important to you, why not. :)
(But it really is not that easy to understand and explain.)

Edit:
This of course will be something we should consider for AI ...
I simply wanted to teach AI which features to avoid and which to use.
With your idea, this is not that easy anymore. :dunno:

By the way, I added two or three events (not much) only triggered on such plots...(winds and storms)

Great. :)
Did you use the pyhton/xml-event-system from TAC ?

Actually I was kind of hoping you (you = team) would let me do that feature. :( But I may need your help. Thank you !

@Robert:

I was just offering to do it, in case you would not want to or not have the time. :)
(You can of course programm this feature and I will support if needed. :thumbsup:)

1. It needs to be DLL-based, so it will work with all kind of games (Maps, Scenarios and MapScripts).
(So there should not be any code in MapScripts for this feature.)

2. As long as these "Storm and Wind"-features are somehow dynamic and not static, I am also ok with other concepts. :)
Maybe there can be a combination of "deleting", "generating new", "moving", "growing", ... but that will definitely be more effort. :dunno:

But since you want to implement the feature, I leave that up to you, of course. :thumbsup:

3. I really do not want to overexaggerate with that feature in terms of amounts of "Storms and Winds".
(Especially on land, I would really only want to have a few of these.)

Thus having good possibilities of balancing are really necessary.
Otherwise it would be a little like "Too much Salt in the Soup". ;)

4. I would really like to have AI understand this feature.
(Thus I wanted to keep it simple ...)

-----------------------------

Could you try to summarize your concept, so we have an overview and also can continue discussing the details then ?
(I had just tried to suggest a possible solution.)
 
about mod: "1492 Reefs and Weather" by KJ Jansson
..... there was a major transparency problem...

Was the transparency problem ever solved?

You didn't answer me KJ Jansson. Was the transparency problem solved or not?

Hi Robert!

I will check the transparency of some weather features in "1492 Reefs and Weather" when I return home. At the moment I'm in trip and have no games installed on my laptop. AFAIR, I corrected some details in this mod (including graphics), however it was more that one year ago and now I don't remember all details. I'll check later...

Tailwinds increases a ship maneuverability
So, they increase your movements, and if you attack a ship on a tailwind, your ship (the attacking ship) will maneuver quickly and so it will surprise defending ship. So it's quite difficult to defend on a tailwind plot in my Storm and Light mod.

On the contrary unfavorable winds decrease maneuverability, so they will slow you down. But an attacking ship would be slowed down, and so, the defending ship will spot it easier, and could prepare his defense. So I gave a +15% bonus on those features.

Now I understand that means "bonus on weather features" with +X % defense, -Y% damage per turn.

I have nothing againt if this feature would be implemented, however let me make couple remarks.

1. Tailwinds increases a ship maneuverability.

Agree, but only if your ship is moving on, for instance, West (W) and Tailwind is also directed on West, too.

Question: how will change your ship maneuverability if your ship is moving on other 7 directions: North (N), South (S), NorthWest (NW), SouthWest (SW), NorthEast (NE), SouthEast (SE), East (E)?

For a ship moving on East everything is clear. Instead tailwind we have unfavorable wind.

However what about other directions? Here maneuverability of your ship probably must have plus or minus 45% depending on the Tailwind and ship moving directions.

How easy to program these percents in the game? This question is directed more to Ray. I personally don't know.

2. Second remark is related to the probability of this event.
Where and when "bonus on weather features" with +X % defense, -Y% damage per turn can be used?

Let's calculate. Three simultaneous events must occur on one tile:

- weather feature (Tailwind or Unfavorable wind),
- your ship must be on the same tile,
- your military opponent ship (for instance, privateer) must also be on the same tile.

For our calculations we take the simpliest case "YES/NO". Thus, the probability of each event will be 0.5. The probability of three simultaneous events is equal 0.5x0.5x0.5=0.125, that is 12.5% in the best case. Really, taking into account the number of tiles with weater effect and the number of ships in the game the probability of three simultaneous events on one tile is about few percents or even less.
 
Guys, please let us not make this feature even more complicated. :)

So if you really want to have defensive bonus / malus on these "Wind and Storm"-features, that is ok for me.

But then these defensive bonus / malus are simply always there.
(No consideration of direction please.)

Tailwind and Headwind themselves do not have a direction. ;)

Maybe it is really better to call it "Favorable Winds" and "Unfavorable Winds" to avoid discussions about direction ? :think:
 
Top Bottom