So far, so close...

So you tried something and it slows down game performance to check all the tiles for units outside of their cultural sphere?

Yes, look at post #10.

(how about tagging units with a removable promotion as soon as they cross out of their cultural sphere?)

Why? To show the weakness in the wild?

Getting the AI to understand this will be fun!

:D.
The restriction itself should be no problem, the promotions maybe (i have an idea, but have to look, if it can be done).
 
Originally Posted by GoodGame
(how about tagging units with a removable promotion as soon as they cross out of their cultural sphere?)
Why? To show the weakness in the wild?

I was thinking that would improve performance if the program didn't have to search for units to apply the penalty. Searching all the map tiles as an array is a big source of slow down for an algorithm, from what I've read in the forums.

For example, as soon as a unit of civ A moves into a tile not culturally controlled by civA, give it a temporary, special promotion (call it 'wilderness' or whatever) and add it to a list of units that are outside of their culture sphere. And as soon as a unit changes back to a tile of its same culture, remove that 'wilderness' promotion and take that unit off of the wilderness list. Then each turn, the program can go directly to the wilderness list and apply the penalty (whatever it is).

It's different than a rule of 'no travel 5 tiles from your culture sphere', but then there's no computational burden of computing paths, or searching for tiles for units. Do that and use a similiar penalty---maybe 'wilderness' promotion equals -10% strength per turn and 1/2 movement for leaving the culture sphere, or something. (Actually, I think using promotions, and only changing the promotion status when the cultural value of the tile changes, I think the program wouldn't even need a list of units outside their square).
 
Here come some ideas, I hope they help somehow...

1 – I think have the cultural borders as mark would be better, but, if programming with cities as base points is more easy, let´s think in that way.

2 – In the beginning of the game, the “normal” unit cannot go more than 4 squares of distance from your own cities (or your vassal’s cities);

3 – There would be a Tech element that increases that range, so it would be XML regulated. By default, Hunting, Writing, Calendar, Compass, Optics, Paper and Astronomy would increase that range by 1. Other element would eliminate that range limit, by default: Combustion.

4 - There would be a Bonus element that increases that range by 1. By default, Salt and Lemmon.

5 - There would be an Unit element that multiply that range for that unit only. By default:
X1,5 Scout and Great Spy.
X2 Galley, Trireme, Explorer and Iron Clad.
X3 Caravel, Privateer, Galleon, Frigate and Ship on Line.
Great Merchant could be x2 until Optics and x3 after that (so he would be a “great recon” too).
(maybe some UU, like Conquistador and Carrack, could have more range, but it is for future)

6 - There would be a “Promotion line” (Extra Supplies I, II and III) that increase the basic range (before the multiply) 1. It would be for recon and naval units only.

7 – The Great Merchant could be used in order to give a Great Explorer Promotion for one wood ship. It would increased the basic range (before the multiply) by 5 and Move by 1. I don’t know if other Great People like Engineer or Scientist could do the same.

8 – One Wonder could increase the range of all or only naval units by 5. Maybe Belem Tower or Trafalgar Square.

9 – The Trade Routs could be limited in the range too.



Some possible problems:

- Imagine one of your units is in the maximum range and you lose the city that permits that location. What would happen?

- The range of the ships is greater of the ground units, so the ground units could not unload the ships in the maximum range.

For that I suggest:

- All units could unload the ships regardless the range limit.
- The units cannot go after the range limit, but once they are there they lose 10% of their life and cannot heal.


That's all, folks! :rockon:
 
2 – In the beginning of the game, the “normal” unit cannot go more than 4 squares of distance from your own cities (or your vassal’s cities);

The computational problem with an idea like this, and most of your ideas which involve calculating ranges/distances is that the program has to trace a path between each unit first, and then plot an overlay of legal moves in advance (like the Rebase mode overlay for aircraft); I believe to the computer that it's like calculating trade routes, but with the extra problem that there's even more 'cities' which even move every turn. So I think that would cause some program slow down.

I guess if really want to do it that way, it might work efficiently if at the start of each turn, one legal move overlay per civ is calculated based on all cities (using your city + 4 squares rule). Then, for the rest of the turn the units can only move within that overlay. Excepting units that have some kind of explorer/supply promotion, that might let them ignore the overlay. Not sure how computationally efficient it'd be, but my hunch is that'd be the most efficient way to implement it.



1 – I think have the cultural borders as mark would be better, but, if programming with cities as base points is more easy, let´s think in that way.

I think this would be the more efficient way too, since tiles already have cultural info stored for them, AFAIK. So all that would be needed would to get that cultural info from the tile array, and compare the tile's cultural info (who owns the tile) to the owning civ's at the end of each move, apply the 'wilderness' promotion to that unit when cultural info is barbarian/unowned; It could just do that check at the end of that unit's move, and add/remove the 'wilderness' promotion, and add that unit to a list of units in 'wilderness'.
Then the rule would be if 'wilderness' then whatever effect you want: slower movement, takes some damage, etc... and also have counter promotions like'supplies I' or 'Explorer I'.



But maybe even simpler way of simulating range would be to increase the movement costs of walking through unimproved tiles. That'd be done by simultaneously making improved tiles (mines, farms, cottages, etc.. ) decrease the movement costs of walking through a tile, and increasing the costs of walking through all of the tiles. E.g. Set improvements so they decrease movements costs of a tile by N, and set all tiles so they cause +N more than currently, to walk through. The effect would be that improved tiles (i.e. ones in your cultural borders, since those already are the only ones that you can build improvements on) would be quick to travel through, and it'd take even longer now to travel through wilderness.

I think that'd work pretty well for land travel. But it'd make the problems with unrealistically long sea travel even more annoying, so I wouldn't use it for naval units and coast/ocean tiles. If you go with a quest and 'wilderness' promotion system for naval units, then naval units outside of cultural areas might run the risk of being lost at sea as a quest event (e.g. lost to storm, say 20% of the time they're outside of cultural areas). The cool thing about that is that is similiar to how earlier civs did seas travel (I think Civ3), where a galley could cross oceans, but there was a risk it would sink randomally (about 50%, IIRC).
 
I was thinking that would improve performance if the program didn't have to search for units to apply the penalty. Searching all the map tiles as an array is a big source of slow down for an algorithm, from what I've read in the forums.

It would be a problem, if the modcomp worked in this way.

Atm, when moving a unit, the plot where the unit wants to move to, is grabbed, and every plot in a range of 4 around it is checked, if there's any culture, and if yes, the function breaks and the unit can move (if not, not).
So this is more performant than your suggestion (which is also good), but the most time of the game, you or the ai moves around units, so it's a dramatical slowdown :(.



Here come some ideas, I hope they help somehow...

1 – I think have the cultural borders as mark would be better, but, if programming with cities as base points is more easy, let´s think in that way.

2 – In the beginning of the game, the “normal” unit cannot go more than 4 squares of distance from your own cities (or your vassal’s cities);

Atm the cultural borders of every AI are the marks, so no problem, but AIs without open borders should not count.

3 – There would be a Tech element that increases that range, so it would be XML regulated. By default, Hunting, Writing, Calendar, Compass, Optics, Paper and Astronomy would increase that range by 1. Other element would eliminate that range limit, by default: Combustion.

4 - There would be a Bonus element that increases that range by 1. By default, Salt and Lemmon.

5 - There would be an Unit element that multiply that range for that unit only. By default:
X1,5 Scout and Great Spy.
X2 Galley, Trireme, Explorer and Iron Clad.
X3 Caravel, Privateer, Galleon, Frigate and Ship on Line.
Great Merchant could be x2 until Optics and x3 after that (so he would be a “great recon” too).
(maybe some UU, like Conquistador and Carrack, could have more range, but it is for future)

[...]

8 – One Wonder could increase the range of all or only naval units by 5. Maybe Belem Tower or Trafalgar Square.

This can be all done, but it takes some time.
I have some more things in my "pipeline", so i will not be able to do it this weekend :(.


6 - There would be a “Promotion line” (Extra Supplies I, II and III) that increase the basic range (before the multiply) 1. It would be for recon and naval units only.

7 – The Great Merchant could be used in order to give a Great Explorer Promotion for one wood ship. It would increased the basic range (before the multiply) by 5 and Move by 1. I don’t know if other Great People like Engineer or Scientist could do the same.

After thinking a bit about it: No, not a good idea.
Promotions would be to difficult to teach the AI, how to use it (yes, i said something other above, i know), and i don't know, if the second thing could be done.

9 – The Trade Routs could be limited in the range too.

No, this can definitly not be done.

Some possible problems:

- Imagine one of your units is in the maximum range and you lose the city that permits that location. What would happen?

Would be no problem to move them to a valid plot.

- The range of the ships is greater of the ground units, so the ground units could not unload the ships in the maximum range.

For that I suggest:

- All units could unload the ships regardless the range limit.
- The units cannot go after the range limit, but once they are there they lose 10% of their life and cannot heal.

To difficult to implement, sorry :(.
 
This would go well with the idea that someone had for a Great Explorer. I would say that Explorers should have a range which was equal to the amount of :food: that you spent on them (when you build them, your :food: should set to 0)
 
This would go well with the idea that someone had for a Great Explorer. I would say that Explorers should have a range which was equal to the amount of :food: that you spent on them (when you build them, your :food: should set to 0)

Interesting idea, but i don't know, how to save the value :(.



A bit progress:
- You can now move your units on every tile in the radius of 3 around every plot which is owned by you or an AI with open borders
- Explorers and scouts have double range
- Ships also
- Double range when you reach the middle ages
- No limitation when you reach the industrial age

It has a big impact on performance, if you have more units, and units with longer range. One galleon caused in my testgame some serious lags.
The other things have to be added, and the check for a valid plot has to be improved, which is possible at some positions, and will, i hope, fasten it a bit up.
 

Attachments

I was thinking a Great Explorer could be popped with logic parallel to Great Generals system, except each unknown tile revealed (culture revealed, explored, or revealed through a map trade) increments a GE bar similiar to combat experience gained.
 
I am trying it, and I like it!!!

I am only in the medieval times, but, at least in my computer, it is (enough) fast. I think the concept is working. I just don’t like the fact of the open borders makes you use the other civilization’s culture as “base point”. It is just too soon, with “defensive pact” would be better.

IT IS A WELL DONE JOB !!!
 
Hmmm, I've been thinking about this issue myself. Some quick and dirty things I was considering is that certain terrains-like deserts, forests, tundra and jungles-are much harder to traverse in the Ancient Age-and possibly even impassable for some units.
For example, I was thinking that forests et al could have a movement cost of 3 (or even 4) for scouts, workers and settlers-and be impassable for military units if there is no road. Then certain techs would make each terrain more passable.
Another option is to create new terrain types, each one impassable. For example-as well as forests, you'd have "Primeval Forests", for Deserts you'd have "Dune Seas", for Jungles you'd have "Trackless Jungles" and for Tundra you'd have "Glacial sheets". Such terrain would be impassable to *all* units-just as mountains are-but that techs make these terrain passable over time. This way you could have truly "historical" barriers between continents and distant civilizations.
Anyway, just a thought.

Aussie.
 
Some problems:

- Move a galleon causes a lag, but it is not a BIG lag;

- The galleon can go to other continents, but their cargo cannot unload. Suggestions:

a) Give a settler the biggest range. So you can unload a settler, make a city and unload the troops. But I think the AI wouldn’t do that;

b) Make the unload a movement free of range limit.

Hmmm, I've been thinking about this issue myself. Some quick and dirty things I was considering is that certain terrains-like deserts, forests, tundra and jungles-are much harder to traverse in the Ancient Age-and possibly even impassable for some units.

I don’t think that is reasonable. Some Stone Age humans lived in the forest.

I have some ideas that could match with this Mod Component and your suggestions. The culture could spreads better as good is the movement cost low. So it would be slow inforest, jungles and hills (in slow and desert too in many MODs); it would be faster with roads and railroads; and it would be impassable with a chain of peaks (like in tectonics maps). But it is for future, we have enough work here.
 
I am trying it, and I like it!!!

I am only in the medieval times, but, at least in my computer, it is (enough) fast. I think the concept is working. I just don’t like the fact of the open borders makes you use the other civilization’s culture as “base point”. It is just too soon, with “defensive pact” would be better.

IT IS A WELL DONE JOB !!!

Thanks :).

But it would not be logical, if the open borders would not allow the unit movement.
Also i think, defensive pacts are too late.

Hmmm, I've been thinking about this issue myself. Some quick and dirty things I was considering is that certain terrains-like deserts, forests, tundra and jungles-are much harder to traverse in the Ancient Age-and possibly even impassable for some units.
For example, I was thinking that forests et al could have a movement cost of 3 (or even 4) for scouts, workers and settlers-and be impassable for military units if there is no road. Then certain techs would make each terrain more passable.

Impassable terrain/features are only a matter of .xml, and can simple be done.
But like Melendor says, it would not be logical, and also too hard imho.

The road thing could be interesting.

Some problems:

- Move a galleon causes a lag, but it is not a BIG lag;

Are your galleons automated?
If yes: Just don't do that :D. The re-computing of a route, especially long routes, like for galleons, sucks performance.

- The galleon can go to other continents, but their cargo cannot unload. Suggestions:

a) Give a settler the biggest range. So you can unload a settler, make a city and unload the troops. But I think the AI wouldn’t do that;

b) Make the unload a movement free of range limit.

What do you think about using the ships equally to owned terrain?
You units could move in a range X around the ships.

I don’t think that is reasonable. Some Stone Age humans lived in the forest.

:yup: agree.

I have some ideas that could match with this Mod Component and your suggestions. The culture could spreads better as good is the movement cost low. So it would be slow inforest, jungles and hills (in slow and desert too in many MODs); it would be faster with roads and railroads; and it would be impassable with a chain of peaks (like in tectonics maps). But it is for future, we have enough work here.

Culture is a more difficult thing, because it's not really controled by the plot, but by the cities.
 
But it would not be logical, if the open borders would not allow the unit movement.
Also i think, defensive pacts are too late.

I don’t like it. It is very easy do some Open Borders agreements in the beginning of the game, so the restricted movement is almost useless inside your continent, even in BIG continents. In that way, a unit from South Africa could go to Japan without problems.

I think you are looking that restriction only because of the food problems and you are not considering the communications problems. A roman legion in china could not receive orders, give reports, replace casualties or get salary. It cannot be there and, if it were, it would not be part of the Roman Empire anymore.

One suggestion is make Open Borders treat valid for “base points” only with some Tech. It could be Paper, maybe. (Because of the maps)


What do you think about using the ships equally to owned terrain?
You units could move in a range X around the ships.
I don’t think it is necessary. Just make the units unload and it will be fine.


I still think that Mod Component should be customized by XML.
 
I don’t like it. It is very easy do some Open Borders agreements in the beginning of the game, so the restricted movement is almost useless inside your continent, even in BIG continents. In that way, a unit from South Africa could go to Japan without problems.

I think you are looking that restriction only because of the food problems and you are not considering the communications problems. A roman legion in china could not receive orders, give reports, replace casualties or get salary. It cannot be there and, if it were, it would not be part of the Roman Empire anymore.

One suggestion is make Open Borders treat valid for “base points” only with some Tech. It could be Paper, maybe. (Because of the maps)

:hmm: sounds logical.
I'll think about it.

I don’t think it is necessary. Just make the units unload and it will be fine.

But if you do not have a settler...


I still think that Mod Component should be customized by XML.

Sorry, is beyond my abilities atm :(.
 
I don't think it can be done in XML - too complex. If it can, it would be great.

It can be done by separate files (could be .xml, but not necessary), and i have also seen it in other modcomponents (from Zebra9 for example), but i do not have the time to try it out atm :(.



Next attempt:
- You can only move your units on the territory of civs with open borders when you have the technology "paper" (i agree, it is logical)
- You can load and unload your units from/into ships, when they are out of the normal range
- removed the movement restriction for great spies and merchants.
 

Attachments

Back
Top Bottom