Mod that stops the AI from spamming "ban luxury" decisions

Jinavajra

Chieftain
Joined
Oct 24, 2014
Messages
43
Unless I'm the supervillain and they want to cripple me economically I don't see the point in trying to press one of these "diplomatic decisions", but even if I am, there are better ways to shut me down (Embargo, Pass world ideology different from mine, etc.)

So is there a mod that kills this incredibly annoying AI behavior? Maybe a mod that makes the whole WC decision-making better? (When Cathrine has 28 delegates and is trying to pass her World Ideology you do NOT vote for Cultural Heritage sites, especially since she's the only one following that ideology....)
 
I like it when they try to ban things that make sense, like whales or deer or something.
Because people don't like hunting it reality. So if you could mod in a "Animal rights" decision that would be good.
Anyway, i think it should be as easy as XML coding right? I might quickly look into it.
 
Don't know if there's a mod that does the action specifically, but I can definitely point you in the right direction for DLL modders out there and/or if you're willing to do the edits yourself.

Once you have your DLL modding setup (tutorial), the function you're looking for is CvLeagueAI::ScoreVoteChoiceYesNo() inside CvVotingClassses.cpp. Within that function, the necessary code is under the conditional that starts with:
Code:
if (pProposal->GetEffects()->bNoResourceHappiness)
Inside you'll find everything there is to how the AI scores Luxury Resource bans.
 
Don't know if there's a mod that does the action specifically, but I can definitely point you in the right direction for DLL modders out there and/or if you're willing to do the edits yourself.

Once you have your DLL modding setup (tutorial), the function you're looking for is CvLeagueAI::ScoreVoteChoiceYesNo() inside CvVotingClassses.cpp. Within that function, the necessary code is under the conditional that starts with:
Code:
if (pProposal->GetEffects()->bNoResourceHappiness)
Inside you'll find everything there is to how the AI scores Luxury Resource bans.

Isn't that the guide to set up the Civ4 .DLL though?
 
Whoaa! Thanks for the help guys, but I'm not a coder at all or anything. I once watched my ex gf code C#. Not fun.

Or is it something a layperson can do? The last thing I want to do is reinstall the whole game because I skipped a space somewhere and now the whole game crashes, lol.
 
You don't have to worry about messing things up to the point of having to reinstall your game. Unless you do something that online tutorials specifically tell you not to do, the worst you can do is have the game crash when it loads up your mod.

A layperson can definitely get into programming; however, unless you're particularly logic- or systems-inclined (not to be confused with math-aligned: programming is much more about seeing how systems work with each other and how you can break down an idea into elementary, logical steps), you'll probably need quite a bit of time and practice with the basics before you can understand the actual code for "scoring" luxury resource bans in Civ5.

Your first programming language is vital, as it'll essentially act as your programming "mother tongue". Until you've spent enough time with other programming languages to abstract your programming knowledge, you'll tend to fall back on knowledge from your programming "mother tongue" whenever you delve into another language. It's sort of like real languages.
Everyone's opinion is different on which programming language is the best for beginners. I maintain that the best first programming language is Python, runner-up is Lua. Java and C# are excellent for beginners, but it's very easy to get caught up with more advanced topics before you've even got your basics down ("advanced topics" = anything object-oriented); I've encountered my fair share of C# and Java newbies who knew about all the "weird" stuff, but couldn't create even the most basic of programs without outside help. Javascript, while very idiot-proof and clean, has some very unorthodox syntax; while you might be able to get far in it, it makes for a very poor "mother tongue". C and C++ are powerhouses, surprisingly easy to learn, and also translate well, but finding mistakes you've made in your code can be a nightmare, so the learning process for a programming newbie will be incredibly frustrating compared to other languages (once you've got a bit more practice and don't tend to make as many mistakes, there's no reason not to learn C or C++).
 
Well, to be honest, I might as well try this out eventually, since I want to be a game designer anyways, soooo, why not? :D

I'm not entirely sure if this is something that would suit me, but I will never know until I try. I think this "ban luxury thing" isn't probably particularly difficult, so it might make for a relatively easy start.

So, first thing to do?
 
Indeed, the scoring mechanism for banning luxuries is relatively straightforward, but the way information is retrieved, checked, and stored is deceptively more complex. Sure, you might be able to deduce that "if (kPlayer.isAlive())" checks to see if a player is alive, but what about a simple "if (kPlayer)"? How can the "PlayerTypes" variable e be given an integer value when it is not an integer type? How come the condition "GET_TEAM(GetPlayer()->getTeam()).isHasMet(GET_PLAYER(e).getTeam())" has both periods and arrows?

Getting started:
For programming, look for programming tutorials online, preferably written ones (videos should only be used if you want to look up something very specific); the first article is usually about setting up the necessary tools. Don't go for ones that advertise speed: learn the basics well, not quickly. I emphasize, be patient: advanced concepts rely heavily on the basics, so rushing ahead without a proper foundation is a waste of time. Though you can easily set up a working programming within minutes of starting a tutorial series, it can take months of practice before you can do the basics in your sleep.

For designing games, that's a completely separate matter entirely. First and foremost, you'll either need a lot of time and/or a lot of math knowledge. Start practicing with house rules for board/card games, since all you need is a sheet of paper and a writing utensil. Time is needed because the you'll constantly be in a design-test-redesign-retest cycle to hammer out kinks in both your actual design and your designing process. Math, on the other hand, is useful because it gives you both tools to work with and pointers for future design: eg. knowing that a particular mathematical relationship in your design has a certain behavior (this can be as simple as knowing that if you get an odd number from multiplying two integers, the two numbers you multiplied must be odd as well) can often save you hours, days, possibly weeks of redesigning-retesting.
If you live in an English-language, first-world country, you're at a disadvantage, as the educational systems in these countries teach math in an undesirable fashion: they teach you how equations/relationships work, not why equations/relationships work. There's a reason why so many good programmers and mathematicians come from Eastern Europe. You have to be picky with (English) online articles as well, since most of the people who write those online articles grew up with the same, faulty system as you did (or are in).
 
Top Bottom