[Mini MOD _ MOD Comp] Alignment Options

Files updated for patch e .

Tcho !
 
This is absolutely awesome, too bad the main mod doesn't have it.
Oh heck yes, it beats playing a good leader and then getting stuck a whole bunch of other good leaders, where all I really wanted was a good rollicking holy war!

If I could make a suggestion, it would be nice if we could select the alignment of our opponents via the leader selection drop-down menus instead. What I mean is that just between the "Random" option and the actual leaders in the drop-down, you'd also have the options "Random - Any Good", "Random - Any Neutral", and "Random - Any Evil". Thus you could set the first, second, and third AIs to be Evil so you get a challenge, but keep the fourth AI Good or Neutral so you have a potential ally. Of course, maybe this is impossible, I really don't know, so it's just a thought.

Anyhow, thanks for all your work on this!
 
heh, i haven't even got the vanilla FFH linked to my desktop anymore, it's eighter FF or FFH: AO. I love the holy war option on this, expecially when used in combination with varied world.
 
Super! Thanks for telling me about it. I'm glad that vassals should be do-able. And I'm really looking forward to trying your mod even without any further changes. Anything else is just gravy. Well, _more_ gravy. :)

I've still not checking that. But i will do that after the map script, when all options will be finished. Especially ffh options (lair, unique improvements, cultural linked positions)

Oh heck yes, it beats playing a good leader and then getting stuck a whole bunch of other good leaders, where all I really wanted was a good rollicking holy war!

If I could make a suggestion, it would be nice if we could select the alignment of our opponents via the leader selection drop-down menus instead. What I mean is that just between the "Random" option and the actual leaders in the drop-down, you'd also have the options "Random - Any Good", "Random - Any Neutral", and "Random - Any Evil". Thus you could set the first, second, and third AIs to be Evil so you get a challenge, but keep the fourth AI Good or Neutral so you have a potential ally. Of course, maybe this is impossible, I really don't know, so it's just a thought.

Anyhow, thanks for all your work on this!

This is a good idea. I will think about that (try to add six phantom leaders). I still don't know if this is possible, that will requires some work and tests ... and also to redesign the options . That should be not so hard, but that depend on civilization initialization (the part that is not in the sdk).

heh, i haven't even got the vanilla FFH linked to my desktop anymore, it's eighter FF or FFH: AO. I love the holy war option on this, expecially when used in combination with varied world.

For the 0.32 , i will try to compile also a version for Fall Further (because this is the most played MOD that require a dll (if not mistaken), other MODs are easy to merge). But I've still not played a game with it. I usually don't play very much SG games and I've added a lot of stuff in my personal MP version (python _ SDK) that take a lot of time to combine with other patch and MODMOD ... like birds selected first, most of wonder national , timed settler at the beginning of the game, alternative armaguedon events ,a lots of python and xml "details" we like to change to balance the game for conquest games only.

Tcho !
 
Thus you could set the first, second, and third AIs to be Evil so you get a challenge, but keep the fourth AI Good or Neutral so you have a potential ally. Of course, maybe this is impossible, I really don't know, so it's just a thought.

Anyhow, thanks for all your work on this!

I was just thinking there is a way to play like that I use sometimes. Instead of launching a SG game, set up a hotseat game with 2 human , 3 AI. Select the options to have human good or neutral (varied world or not as you wish), AI evil . Then at the start of the game, simply retire the human player you want to be your ally (be carefull , i think you need to construct the city to prevent a WOC and don't move all the player units or you will loose a turn).

Tcho !

Edit : There is something else to notice very important : when you are the last player in an hotseat game , the event aren't noticed anymore on the top of the screen . You need to check the event log window every turn. They are printed in.
 
will this still work with 0.32?

No the current version doesn't work with 0.32. By now, I rewrite the function. I wanted to do that today but I've not finished . All is ready, I need to do the main function now. Because of Decus, i can't compile the last version, this should have make some bugs (the last version doesn't take in count a leader available with multiple civ). So I've decided to change a lot the way of the mini MOD. I've created a random civ and 6 random leaders (random good, random good or neutral, ...), Like Corlis suggestion. And I've also move the 2 MP options to SG options to make them available in HotSeat games. I will give it a shot tonight i think. But the function get more complicated with this. I also need to check some options and change some other to prevent this leaders and civ to appear during the game. The result should be great instead of having all AI no good etc ...

Tcho !
 
It will be a touch tricky deciding how to use Decius. On turn 1 he is offered an option to select his alignment, so he is technically not aligned at all and can mess up your selection schema. Though only having 1 wildcard shouldn't cause any major complaints.
 
Before the event, he is neutral. Although he could slip though as good or evil in a game where you waned him to be neutral, I don;t think it is that big of a deal. It woule be more of a problem in a modmod using broader alignments (I don't think the event would work)
 
It will be a touch tricky deciding how to use Decius. On turn 1 he is offered an option to select his alignment, so he is technically not aligned at all and can mess up your selection schema. Though only having 1 wildcard shouldn't cause any major complaints.

Before the event, he is neutral. Although he could slip though as good or evil in a game where you waned him to be neutral, I don;t think it is that big of a deal. It woule be more of a problem in a modmod using broader alignments (I don't think the event would work)

Thank you for the info. I didn't know , I've not played a 0.32 game yet. I think I will let Decus neutral and don't disable the event. Perhaps if someone want Decus to be forced neutral, I will add an option. But for now , i have a big headache and still don't know how I will structure the function :cry:.

I want to add also a new event (optional) that add a player during the game, if the alignment balance is too much on a side. That will be also to test a lots of stuff to make the random leader and civ unavailable during the game. But I need to finish this main function first.

Tcho !
 
The version for 0.32a is out.

There are only 5 options (religious war, varied world, team same alignment, humans different alignment, humans same alignment). 6 "random leaders" have been added to randomly choose alignment. They are available in "custom game" or "play now" menu (I love the play now menu :love:) or even for a scenario .

The 2 MP options has been moved to the SG options, so they are available for HotSeat games.

A little fix included : Hyborem, Basium and Kourt can't be selected at random anymore if you let random with the option "unrestricted leaders".

Yeah , I can play now :)

Tcho !

PS : the next time , I will try to export this function to python to make the changes and selections more simple and accurate. This way anyone will be able to make its own changes.
 
Awesome!

I was wondering how Decius could possibly be handled, and I guess there isn't really any easy way to do it. Ah well, thanks for your work on this!
 
Awesome!

I was wondering how Decius could possibly be handled, and I guess there isn't really any easy way to do it. Ah well, thanks for your work on this!

I've let Decus neutral (like in the xml). There is no special choice for him. I don't think this is a major issue. The biggest problem was to consider a leader that is available for more than one civilization.

Tcho !
 
Reactions:

Sto made a modmod, neat
What in the world?
How in the world!?!
...Oh my god this is awesome!

Very cool Sto, do you mind if I integrate this in patch "b"?
 
I think you should take his silence as "I would be much more upset if you do not add it to the main mod!" :D :p

I haven't actually had time to play this modmod yet, but it is something that I (among others) have been requesting for quite some time. I was planning to integrate it in my modmod (along with xienwolf's xml modcomp, broader alignments, etc), but I'd rather you do all the work for me. (Well, maybe not all the work. Not that I'd mind if you added those other mods too, but since Vehem added them to Fall Further I can rip off his .dll just as easily)



You may want to consider implementing FFHBUG too. Unfortunately, the mouseover bug that vanilla FfH had (inherited from PLE) is stil present. Also, renaming the mod causes problems.
 
Reactions:

Sto made a modmod, neat
What in the world?
How in the world!?!
...Oh my god this is awesome!

Very cool Sto, do you mind if I integrate this in patch "b"?

Yes, sure that will be pretty cool :).
Some things to notice if you want to integrate it with patch b or for future. Like you can see ,if you have taken a look at the main function in CvGame::init , I'm still not very good with C++, but everything is tested and functional. The problem I've got was to define a list of numCiv or numLeader lenght. That's not a big issue i've put 100 and 300.
The main problem is that I can't do some quality test in C++ (too boring and hard to manage list and arguments with C++). It result that the function will ever found a solution if possible, but not the better in some cases , ie :

_ The civ with more leaders have more chance to appear.
_ Because of some combinations, sometimes all leaders can't match all conditions. In some few cases, even if that would have been possible. Especially when there are a lot of players.

I will try to rewrite the mini MOD and export this function to python. I think that will be better to do some quality and make the changes more accurate. Anyway that's great if you integer the mini MOD to FFH :). I'll tell you if i achieve to export the function to python.

Tcho !
 
I've forgotten a little thing to fix i wanted to integer with patch b : in CvGame::init : line 1124
Code:
				//leader assignment
				if (iBestLeader != -1)
				{
					if (!isLAC)
					{
[COLOR="Red"]						if (!bCivSelected)
						{
							nCivAssigned[iBestCiv] += 1;
						}
[/COLOR]						GC.getInitCore().setCiv((PlayerTypes)iPlayer, (CivilizationTypes)iBestCiv);

If not that can prevent a civ to have a second leader if the civ is selected by the player but not the leader (when there is lots of player and a lot of same alignment requested). Since this is not a big issue , i wanted to fix it with patch b.

Tcho !
 
I just started thinking that it would be good if the mod (or, after the next patch, the main game) addressed Colonies too. Adding another game option that makes sure colonies are of the same alignment as the civ from which they broke away (when possible) would be good. When that can't be done (or as a less extreme option), it might be good to block evil civs from releasing good colonies, and vice versa (neutral civs could still liberate or be liberated by civs of any alignment)



This last part is unrelated to the main point of the modmod, but it would probably be found in the same part of the code so I'll mention it anyway: could you remove the "Two cities on the same seperate continent" requirement from colony liberation? I've never liked or understood this requirement, and think it is even worse in FfH. (The Lanun should really be able to liberate their landlocked cities and keep the coast, for example.) I tried removing this requirement myself (making so you can liberate any individual city, but only single cities, as colonies. Other cities could then be gifted/liberated to the colony.) about 6 months ago (based on this), but it didn't work (no colonies could ever be liberated). Oh, and you should really be allowed to just gift a city to your vassal (with do diplomatic bonus, the same way as to any other civ) instead of being limited to liberating cities to them.
 
This is my take on your code in CvGame::init:

Code:
    int iRndCiv = GC.getInfoTypeForString("CIVILIZATION_RANDOM");
    int iRndLeaderGood = GC.getInfoTypeForString("LEADER_RANDOM_GOOD");
    int iRndLeaderNeutral = GC.getInfoTypeForString("LEADER_RANDOM_NEUTRAL");
    int iRndLeaderEvil = GC.getInfoTypeForString("LEADER_RANDOM_EVIL");
    int iAlignment;
    int iBestLeader = -1;
    int iBestCiv = -1;
    int iBestValue = -1;
    int iValue = 0;

	for (int iPlayer = 0; iPlayer < MAX_CIV_PLAYERS; iPlayer++)
	{
		if (GC.getInitCore().getCiv((PlayerTypes)iPlayer) == iRndCiv)
		{
            if (GC.getInitCore().getLeader((PlayerTypes)iPlayer) == iRndLeaderGood)
            {
                iAlignment = ALIGNMENT_GOOD;
            }
            if (GC.getInitCore().getLeader((PlayerTypes)iPlayer) == iRndLeaderNeutral)
            {
                iAlignment = ALIGNMENT_NEUTRAL;
            }
            if (GC.getInitCore().getLeader((PlayerTypes)iPlayer) == iRndLeaderEvil)
            {
                iAlignment = ALIGNMENT_EVIL;
            }
            for (int iCiv = 0; iCiv < GC.getNumCivilizationInfos(); iCiv++)
            {
                if (GC.getCivilizationInfo((CivilizationTypes)iCiv).isAIPlayable())
                {
                    for (int iLeader = 0; iLeader < GC.getNumLeaderHeadInfos(); iLeader++)
                    {
                        if (GC.getCivilizationInfo((CivilizationTypes)iCiv).isLeaders(iLeader))
                        {
                            if (GC.getLeaderHeadInfo((LeaderHeadTypes)iLeader).getAlignment() == iAlignment)
                            {
                                iValue = 40000 + GC.getGameINLINE().getSorenRandNum(1000, "Random Leader");
                                for (int iI = 0; iI < MAX_CIV_PLAYERS; iI++)
                                {
                                    if (GC.getInitCore().getLeader((PlayerTypes)iI) == iLeader)
                                    {
                                        iValue -= 1000;
                                    }
                                    if (GC.getInitCore().getCiv((PlayerTypes)iI) == iCiv)
                                    {
                                        iValue -= 250;
                                    }
                                }
                                if (iValue > iBestValue)
                                {
                                    iBestCiv = iCiv;
                                    iBestLeader = iLeader;
                                    iBestValue = iValue;
                                }
                            }
                        }
                    }
                }
            }
            GC.getInitCore().setCiv((PlayerTypes)iPlayer, (CivilizationTypes)iBestCiv);
            GC.getInitCore().setLeader((PlayerTypes)iPlayer, (LeaderHeadTypes)iBestLeader);
            iBestCiv = -1;
            iBestLeader = -1;
            iBestValue = -1;
		}
	}

It works pretty well. Its just to implement the 3 random alignment options of course and simplify it down as much as possible.

Again this is just a brilliant plan. Ive been wanting to do this for 2 years and could never find a way to do it, your design is brillant.
 
Top Bottom