Redox Code

Ulixes

Prince
Joined
May 2, 2010
Messages
312
Hi Gazebo.
There's something on which I'd like to have your opinion,
and, maybe, if you want and can, a request.

There's code created by Redox that many modders, included me, use.
Here's an example of it: link

It allows improvements to produce a resource, a feature that can be used in many ways and that it is used, as far as I know, by mods like Hulfgars Modpack, Community Call to Power project and surely some other I don't remeber right now.

The question is: can a code like this, if used massively (on every lumbermill, for example or on many improvements) slow down significantly the performances or cause any other trouble?

If yes, and if this can help, could you consider the possibility of including it in the DLL ?
It seems a very useful feature with a lot of potential, in my opinion.

Anyway, thank you for your irreplaceable work and, as always, for your time.

Cheers, Ulixes.
 
First time I see this mod! Nice Idea! Stone in Quarry can also become a strategic resource similarly.

Maybe some of the pre-industrial wonder now need 1 timber or 1 stone to build and it will be permanently consumed.
This is to avoid players building all the wonder in one city without the need for expand. If the player is competing for a cultural victory, he still need to expand his territory in order to acquire enough resources for the buildings and wonders.
 
I thought something similar some time ago, though still not sure on how to implement it.

With a code like this the possibilities are endless but, as I said, I'm worried about the performance impact.
If Gazebo confirms my worries, he is the only one, as far as I know, who can find a solution.

So let's hope Gazebo see a potential in it too.
 
It is LUA-heavy, to be sure, but from what I can tell the lua only fires when the improvement is built, so it shouldn't hurt performance too much. It is an interesting idea, but I fear that humans will benefit far more than the AI with regards to this. I guess the other question you have to ask yourself is, does this additional complexity make the game more fun? I'm not sure that it would. More complex, sure, but not necessarily more fun.

G
 
It is LUA-heavy, to be sure, but from what I can tell the lua only fires when the improvement is built, so it shouldn't hurt performance too much.

Happy to hear that, thank you for your analysis!

It is an interesting idea, but I fear that humans will benefit far more than the AI with regards to this.

Not necessarily: it depends on how it is used, what kind of improvement are affected by it, which kind of resources are produced.

Let's say, for example, I want to give Great People Improvements a Special Luxury Resource: it will be like any improvement on resource.
I know the AI don't evaluate the importance of that tile, but it doesn't do that neither for Silk, Sugar or every other resource tile, so what's the difference?

What if an improvement give a resource (or resources) when a certain tech is discovered or a certain policy is adopted? How many scenarios could be opened by those features?

However, those are just examples. This code give us just another possibility.
All the features already included in the DLL (including the vanilla ones) can be used to give unfair advantage to the human or to the AI

I guess the other question you have to ask yourself is, does this additional complexity make the game more fun? I'm not sure that it would. More complex, sure, but not necessarily more fun.

G

Well, that depends of what you mean by "fun", it's a highly subjective word.
It is so subjective that every discussion on it is pointless because each one of us put on the table what he/she like and stays with it: "De gustibus non disputandum est" "In matters of taste, there can be no disputes". ;)

Anyway, personally, I consider "fun" the challenge and the immersion: this can be achieved (also) by raising complexity in the gameplay, diversity in its elements (like resources, buildings, improvements, units) and, when possible, "realism", a sort of "hypothetical history" approach.
Give the Improvements at least the possibility of producing resources can be another step in this direction.

I could make many other examples, especially if we want to create new improvements, but I think the most important thing is that this could be a very useful instrument, which could be used in so many ways that, in my opinion, it could be worth the effort including it, or even improving it, in the DLL.

I hope you'll consider it, at least, in the future.

Anyway, as always, I'm just thankful for what you and Whoward have done till now. Without the features provided by this DLL, modding would be faaar more boring. :hatsoff:
Ulixes
 
Happy to hear that, thank you for your analysis!



Not necessarily: it depends on how it is used, what kind of improvement are affected by it, which kind of resources are produced.

Let's say, for example, I want to give Great People Improvements a Special Luxury Resource: it will be like any improvement on resource.
I know the AI don't evaluate the importance of that tile, but it doesn't do that neither for Silk, Sugar or every other resource tile, so what's the difference?

What if an improvement give a resource (or resources) when a certain tech is discovered or a certain policy is adopted? How many scenarios could be opened by those features?

However, those are just examples. This code give us just another possibility.
All the features already included in the DLL (including the vanilla ones) can be used to give unfair advantage to the human or to the AI



Well, that depends of what you mean by "fun", it's a highly subjective word.
It is so subjective that every discussion on it is pointless because each one of us put on the table what he/she like and stays with it: "De gustibus non disputandum est" "In matters of taste, there can be no disputes". ;)

Anyway, personally, I consider "fun" the challenge and the immersion: this can be achieved (also) by raising complexity in the gameplay, diversity in its elements (like resources, buildings, improvements, units) and, when possible, "realism", a sort of "hypothetical history" approach.
Give the Improvements at least the possibility of producing resources can be another step in this direction.

I could make many other examples, especially if we want to create new improvements, but I think the most important thing is that this could be a very useful instrument, which could be used in so many ways that, in my opinion, it could be worth the effort including it, or even improving it, in the DLL.

I hope you'll consider it, at least, in the future.

Anyway, as always, I'm just thankful for what you and Whoward have done till now. Without the features provided by this DLL, modding would be faaar more boring. :hatsoff:
Ulixes

I'm happy to make such an addition to the lua, however my points regarding 'fun' were referencing the CBP, and whether such mechanics have a place in the CBP.

G
 
I'm happy to make such an addition to the lua,

Happy to heart that, thanks! :worship:

however my points regarding 'fun' were referencing the CBP, and whether such mechanics have a place in the CBP.

Here are some examples:

1) The most obvious thing I was thinking about was the Wood resource from lumbermills.
Of course, lumbermills should be built on jungles too.
The Woud should be required to build wooden sea units and early artillery units (like catapults, trebuchets, ballista, siege towers) and maybe some kind of buildings (but I still don't have a clear idea on this).

About the AI: the ability to build lumbermills on jungle should help, besides, you could set more than one resource of wood per lumbermill (2, 3).

Before Industrial age, wood was an extremely important strategic resource. It is weird that is completely excluded from Civ. Besides, when I tried it, I experienced an increased depth in the gamplay.

2) I was also thinking, as I mentioned, to special resources from GP improvements: I still don't know what resource could be but the fact that a civilization has a special resource thanks to a great merchant, or a great engineer, seems an idea worth to be improved.

3) Another thing I was thinking was an additional luxury res. on already improved luxury at a certain tech or policy.
Example: Discovering the "Metallurgy" tech could add some additional mineral luxury to iron or copper mines, like Manganese, Lead, Obsidian.
As far as I know, usually mines don't provide one single mineral but more than one.

The same could be done for plantations and farms, tough I should do some research before to be more specific.

Both technology and politics change the way resources are exploited, so there's a lot of things that could be implemented.

4) Let's say that the "Fur camp" (built on fur res.) produce 2 res of furs instead of one. Than we adopt an environmentalist policy and the resource get reduced to one.
(of course the policy must have other benefits to compensate :) )

5) The discovery of Fertilizer could give to agricoltural luxuries an additional one.
"Sugar" plantation, for example, produces 2 sugar instead of one

6) A similar effect could be produced by a policy, like "landed elite" or a new one created for this purpose (maybe a sort of agricoltural reform) that could raise the number at least of certain luxuries.
Or, like as I supposed for luxury mines, they could produce a "secondary luxury";
for example: spice plantation, at discovery of a tech or at adoption of a policy could produce an additional "Nutmeg" or "Pepper" res.

7) As WileyNg mentioned quarries and mines could produce "stone" resource required to build wonders or buildings. It is something I thought too, but not sure on how to implement the mechanic.

I forgot to mention that, to implement 3-7 examples with this code, you have to set a special improvement for luxuries, like "IMPROVEMENT_PLANTATION_SUGAR" with the same art of plantation, but this is really easy to do.

I hope you'll find some of those ideas interesting!

Cheers, Ulixes
 
My general thought after finally reading the whole thing is that it just seems overly complicated. That isn't necessary a bad thing but it shifts focus of the gameplay. What I'm trying to say is that it would probably be better as its own thing, CPP is already complicated enough with the weird happiness/growth-system, hidden modifiers and how you have to personally control every worker and every citizen or they screw up.

But hey, take my analysis for what it is, an analysis.
 
My general thought after finally reading the whole thing is that it just seems overly complicated. That isn't necessary a bad thing but it shifts focus of the gameplay. What I'm trying to say is that it would probably be better as its own thing, CPP is already complicated enough with the weird happiness/growth-system, hidden modifiers and how you have to personally control every worker and every citizen or they screw up.

But hey, take my analysis for what it is, an analysis.

I added the code for this to work to the CP, but I didn't implement any of it. If anyone wants to fiddle with it, they're welcome to.
G
 
CPP is already complicated enough with the weird happiness/growth-system, hidden modifiers and how you have to personally control every worker and every citizen or they screw up.

Weird? I strongly disagree. The Happiness system Gazebo implemented is one of the best things I ever seen in modding, it really gives a meaning on what happens in game and boost immersion at an entire other level.

Civilization is not an action game. It requires thought, patience and attention to the details.
I'm sorry you don't enjoy it but if we should avoid every more complicated feature, we might just as well quit everything and play the vanilla game.

I added the code for this to work to the CP, but I didn't implement any of it. If anyone wants to fiddle with it, they're welcome to.
G

You did it already?! I've no words.. :eek:


:bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown: :worship: :bowdown:
 
IDEA: Elephants Resource

I think this could really interest you.

Some time ago I read somewhere that you wanted to do something with the elephant units, and I think you meant the use of 'resourcetype' entry in the units table you did with the War Elephant.

Why don't we give to Ivory a specific improvement "IMPROVEMENT_CAMP_ELEPHANT",
then we give this improvement the ability to produce "RESOURCE_ELEPHANT" (strategic), required to build elephants units (including the 'War Elephant' you created).

This would allow also to trade this new strategic resource allowing other civs to build War Elephant. Otherwise only 2 or 3 civs would build it.

It wouldn't be a bad idea, in my opinion, to add another elephant unit avalaible to all too. Maybe using this model (link)

The only problem I see is that the Elephant resource avalaible should probably be more than one per Elephants Camp, so you should find a way to give to 'ImprovementResource' a "quantity" (in this case, I think 4 or 6 would be balanced, like horses)

It's an idea I had working on my project. I thought, given your intentions about elephants units, it could interest you.

What do you think?

Cheers, Ulixes.

P.S.: I've just to find a smart way to create a wonder dedicated to you! :hatsoff:
 
Weird? I strongly disagree. The Happiness system Gazebo implemented is one of the best things I ever seen in modding, it really gives a meaning on what happens in game and boost immersion at an entire other level.
Most of the numbers are out of your control, the only thing you can really do about unhappiness is build all the unhappiness-reducing buildings and pray it will be enough. With more added unhappiness-reduction-buildings added you can usually handle your unhappiness which makes the system even weirder. Don't get me wrong, I don't dislike the system, but it is weird, and it is complicated.

Civilization is not an action game. It requires thought, patience and attention to the details.
If i wanted action I would be playing an actiongame. Civ is about thought, patience and attention, but making things unnecessarily complicated and timeconsuming isn't a good thing.
Think of it like this: Playing chess is fun, playing chess without a stopwatch is even more fun, but having a system where you're forced to solve a jigsaw puzzle or run a kilometer every time you move a piece isn't a improvement on the game, it just makes it more timeconsuming.

I'm sorry you don't enjoy it but if we should avoid every more complicated feature, we might just as well quit everything and play the vanilla game.
I enjoy it, I thought that was apparent from all the time I put into reporting bugs and trying to argue for balancechanges on the forum. I'm all for complicted stuff for a good reason, for example the new happinessystem was created to balance tall vs compact gameplay, that was fine. The new policytrees were created to balance out earlygame, that was fine. The new religionsystem was created to make religion relevant and create a balance between religion and non-religion, that was fine.

I just don't see any strong reason for your suggestions at all, it just sounds like a lot of work to make the game a lot more complicated for the players and probably a nightmare for the AI.
 
IDEA: Elephants Resource

I think this could really interest you.

Some time ago I read somewhere that you wanted to do something with the elephant units, and I think you meant the use of 'resourcetype' entry in the units table you did with the War Elephant.

Why don't we give to Ivory a specific improvement "IMPROVEMENT_CAMP_ELEPHANT",
then we give this improvement the ability to produce "RESOURCE_ELEPHANT" (strategic), required to build elephants units (including the 'War Elephant' you created).

This would allow also to trade this new strategic resource allowing other civs to build War Elephant. Otherwise only 2 or 3 civs would build it.

It wouldn't be a bad idea, in my opinion, to add another elephant unit avalaible to all too. Maybe using this model (link)

The only problem I see is that the Elephant resource avalaible should probably be more than one per Elephants Camp, so you should find a way to give to 'ImprovementResource' a "quantity" (in this case, I think 4 or 6 would be balanced, like horses)

It's an idea I had working on my project. I thought, given your intentions about elephants units, it could interest you.

What do you think?

Cheers, Ulixes.

P.S.: I've just to find a smart way to create a wonder dedicated to you! :hatsoff:

It was fairly easy to make, though it may need some testing to perfect it. I like it, though we'll have to make a unique camp for elephants so that all camps don't give elephants. I've already added the quantity bit, it is in the code. Probably 4 per elephant camp makes sense, though it does make elephants unique in that they're the only luxury to also be strategic. I guess that's fine, though. :)

G
 
It was fairly easy to make, though it may need some testing to perfect it. I like it, though we'll have to make a unique camp for elephants so that all camps don't give elephants. I've already added the quantity bit, it is in the code. Probably 4 per elephant camp makes sense, though it does make elephants unique in that they're the only luxury to also be strategic. I guess that's fine, though. :)

G

At that point it would probably be better to remove ivory as a luxury or just add elephants as a strategic resource seperately? Out of a complete balance perspective ofc.
 
It was fairly easy to make, though it may need some testing to perfect it. I like it, though we'll have to make a unique camp for elephants so that all camps don't give elephants. I've already added the quantity bit, it is in the code. Probably 4 per elephant camp makes sense, though it does make elephants unique in that they're the only luxury to also be strategic. I guess that's fine, though. :)

G

Yes, as I mentioned earlier: we give to Ivory a special improvement ("IMPROVEMENT_CAMP_ELEPHANT") with the same art, requisites and stats of the Camp and give it the elephent resources through the 'ImprovementResource' entry. Nice and easy. ;)

As I already said I'm not a fan of "uniques" mechanic but you could use something like 'GrantsRandomResourceTerritory' (but without the unique resource limitation) to give elephants to Siam, India and Carthage (as long they keep their UUs).

If the necessary additional ivory luxury for those civs is a problem, you could simply give them some elephants resource for free in their trait or rework their trait replacing uniques and turning elephants units in standard, buildable by all.
(I don't consider creating a new resource on the ground with 'Ivory' 3D model but with only elephants because it would be too much weird and unnecessary, in my opinion).

Just a note: considering the rarity of Ivory resource, maybe the quantity of elephants should be raised to 6 or even 8?
I suppose that depends on how much do you want elephants units to be used during the game, I just think this is something you should evaluate.
 
At that point it would probably be better to remove ivory as a luxury or just add elephants as a strategic resource seperately? Out of a complete balance perspective ofc.

Removing a resource (or reworking the luxuries distribution) would be probably a nightmare.
As far as I know you should modify 'AssignStartingPlots.lua' (notoriously tricky) and cause a MAJOR compatibility issue with mods like More Luxuries by Barathor (it would be a pity, it is a very good work) and probably some other very good mod I can't remeber now.
For more informations on how it works go to the More Luxuries Thread

Besides, why? PERFECT Balance is not required, in my opinion. A map is a geographical reality not a geometrical dream.
Ivory/Elephants is something peculiar of certain regions in the map and I personally think it is just fine.
(at most, we could think to similar bonus to some other resouces)
So, please don't do it :please:
 
For the Record:

I did a playtest specifically to test the 'ImprovementResource' feature.
It works just fine! :D

I didn't notice any bug or slowdown.
The new resource is connected when the improvement is built, disconnected if the improvement is deleted or pillaged.

I created a new resource, "Elephants", required to build War Elephants.
Both Me and the AI built and used it during the game.

The only problem was that the number of War Elephant was very low because I couldn't add more than '1' resource of Elephants per Ivory Camp.
An integer that allow to set more than 1 resources would make it perfect (:please:)

Anyway, good job, Gazebo, thank you! :worship:

Ulixes
 
Most of the numbers are out of your control, the only thing you can really do about unhappiness is build all the unhappiness-reducing buildings and pray it will be enough. With more added unhappiness-reduction-buildings added you can usually handle your unhappiness which makes the system even weirder. Don't get me wrong, I don't dislike the system, but it is weird, and it is complicated.

They're not under control. You can predict how many :c5gold:, :c5science:, :c5culture: you will have from city before settling it. And there are few ways to solve problems. You can improve your income to handle unhappiness or you can simply build things that reduce it. But then you only reduce unhappiness, without real benefit for your empire.

But that's my opinion.


I'm not sure about timber&stone idea but elephants as strategic resource sounds OK :) But I think that there should be rather rare, 2-6 per stack like horses but less stacks on map. Just elephant's shouldn't be so common as horses.
 
I'm not sure about timber&stone idea but elephants as strategic resource sounds OK :) But I think that there should be rather rare, 2-6 per stack like horses but less stacks on map. Just elephant's shouldn't be so common as horses.

Well, thanks to Gazebo, now it is possible! :)

Anyway, I'm playing with '6' Elephant resources for every Ivory Camp.
Ivory is rare enough, in my opinion but, if owned, it allows the production of 6 War Elephants (or, if in economic troubles, the Elephant resources can be traded).

Anyway, if you guys decide to integrate this feature, the numerical value is easy to tweak according to each one preferences.
 
Back
Top Bottom