RevolutionMP

@Init
Thank you for the find. I have modified the code for the spawnList check. I see your point and I do not understand it myself as yet either. At least the code now catches the error. I'll let Jdog5000 the author know.
Cheers
 
I have released a new version with the latest Revolutions mod included which will have extra bug fixes. Also includes Init's suggestion bug fix. It tests in the lab ok so go to it.

Here are the test conditions:
1) Direct IP
2) Barb Civ off (may not need to be)
3) Barbarian World off' (may not need to be)
4) Start as minors off (may not need to be)
5) Revolutions on
6) Dynamic civ on
7) Tech diffusion on

This is what will cause OOS:
1) A player dies (A player dies (defeated - just get the the host to reload the game)
2) A player chooses accept and lead the rebels
3) A player chooses to hand over control

This should work:
1) A player chooses to recognise independence
2) A player chooses to reject terms
3) A player chooses to bribe
4) AI suffers revolts of any type - if AI dies does this OOS? (if so get the host to reload)

If I get more feedback, I will next upgrade to the latest Better BTS AI and possibly BUG in order to generate more testing activity.

Cheers
 
Here are the test conditions:
1) Direct IP
2) Barb Civ off (may not need to be)
3) Barbarian World off' (may not need to be)
4) Start as minors off (may not need to be)
5) Revolutions on
6) Dynamic civ on
7) Tech diffusion on

This is what will cause OOS:
1) A player dies (A player dies (defeated - just get the the host to reload the game)
2) A player chooses accept and lead the rebels
3) A player chooses to hand over control

This should work:
1) A player chooses to recognise independence
2) A player chooses to reject terms
3) A player chooses to bribe
4) AI suffers revolts of any type - if AI dies does this OOS? (if so get the host to reload)

In my tests a few days ago, we had 2 and 4 on (3 is the one that gives a barb city for every civ right??? We had that one off)

As for the AI dying, we didn't get any OOS when he killed off a civ the first time.
 
I am sorry than but I can't be of any help.
My connection just prohibits me from doing any non hotseat mp games :(
 
Yeah in testing I didn't find any problems with Barbarian World, Start as Minors or Barbarian Civ either. Now that I think of it, of course the game did not OOS when an AI player dies during testing. That phenomenon is unique to players dying.

Test this mod whenever you can. Upload the entire log directory as a zip if it does OOS. Save yourselves having to pick through the log directory. I totally realise that it is very time consuming to test this mod without an MP autoplay facility. I would tend to play quickly and less competitively at first. We are trying to work out the stability of this mod as a first objective.

Cheers
 
Hello. I'm getting a python error caused by:

AIAutoPlay.py line 176:

gc.getActivePlayer().isAlive()

which surely wants to be:

gc.getPlayer(gc.getActivePlayer()).isAlive()

I found this while hunting for an OOS bug caused by:

Rand = 2049113471 on 292 (Rev: Naming)

call to onSorenRand that wasn't happening on one of the two PC's, I'm guessing AIAutoPlay isn't calling the event manager OnBeginPlayerTurn since it bugs out at the above line.

EDIT: Ahh no, there's two different calls, gc.getActivePlayer and game.getActivePlayer.. still I was getting an error, hang on I'll let you know. (You've possibly fixed this already anyway)

EDIT 2: I *think* the problem may be that I'm on pitboss and there is no active player....

EDIT 3:

Fixed with adding the following to the offending if statements before calls to isHuman:

and not gc.getActivePlayer() is None

I've just got the OOS from taking control of the rebels, will keep you posted.
 
The changeHuman has a bug in multiplayer, only passing in the new player and assuming the old one is the active player, which if the other human players receive this will be incorrect. I've changed this to:

Code:
void CvGame::changeHumanPlayer( PlayerTypes eOldHuman, PlayerTypes eNewHuman )
{
	// It's a multiplayer game, eep!
	if(GC.getInitCore().getMultiplayer())
	{
		int netID = GC.getInitCore().getNetID(eOldHuman);
		GC.getInitCore().setNetID(eNewHuman, netID);
		GC.getInitCore().setNetID(eOldHuman, -1);
	}

	GET_PLAYER(eNewHuman).setIsHuman(true);
	setActivePlayer(eNewHuman, false);
	
	for (int iI = 0; iI < NUM_PLAYEROPTION_TYPES; iI++)
	{
		GET_PLAYER(eNewHuman).setOption( (PlayerOptionTypes)iI, GET_PLAYER(eOldHuman).isOption((PlayerOptionTypes)iI) );
	}

	for (iI = 0; iI < NUM_PLAYEROPTION_TYPES; iI++)
	{
		gDLL->sendPlayerOption(((PlayerOptionTypes)iI), GET_PLAYER(eNewHuman).isOption((PlayerOptionTypes)iI));
	}

	GET_PLAYER(eOldHuman).setIsHuman(false);
}

Adding a new parameter passed from python.

Still getting OOS though, it seems the AI of the previously controlled civ is getting to do a turn on one PC and not the other. My guess is the message to change control is not getting through in time since it's reported at the end of the turn. A solution might be to send these messages *pre* end of turn so that they are ensured to arrive before the new turn begins and the AI move...

I've shifted all the Revolution stuff into a PreEndGameTurn event, to ensure that any messages are sent prior to each of the clients getting the EndGameTurn message and starting the next turn. See how it goes. :)
 
YAY!

Taking control and handing over control of rebel city now stays in sync. :) Well it does on pitboss will test a true multiplayer game, but no reason why it shouldn't work...

Another change to the changeHumanPlayer method:

Code:
void CvGame::changeHumanPlayer( PlayerTypes eOldHuman, PlayerTypes eNewHuman )
{
	// It's a multiplayer game, eep!
	if(GC.getInitCore().getMultiplayer())
	{
		int netID = GC.getInitCore().getNetID(eOldHuman);
		GC.getInitCore().setNetID(eNewHuman, netID);
		GC.getInitCore().setNetID(eOldHuman, -1);
	}

	GET_PLAYER(eNewHuman).setIsHuman(true);

	if(getActivePlayer()==eOldHuman)
		setActivePlayer(eNewHuman, false);

	for (int iI = 0; iI < NUM_PLAYEROPTION_TYPES; iI++)
	{
		GET_PLAYER(eNewHuman).setOption( (PlayerOptionTypes)iI, GET_PLAYER(eOldHuman).isOption((PlayerOptionTypes)iI) );
	}

	for (iI = 0; iI < NUM_PLAYEROPTION_TYPES; iI++)
	{
		gDLL->sendPlayerOption(((PlayerOptionTypes)iI), GET_PLAYER(eNewHuman).isOption((PlayerOptionTypes)iI));
	}

	GET_PLAYER(eOldHuman).setIsHuman(false);
}

Also, to stop pitboss admin console from crashing when the number of players changed I had to add a return to the start of PBAdmin.update. I'll look into a better fix for this so it updates the list properly...

Otherwise, HURRAH!

Link to updated SDK / python files here:

http://theindiestone.com/lemmyandbinky.com/RevolutionMP.rar

Search for LEMMY 101 for merging. I'm pretty sure I got all the changes wrapped in them... there are a few python files I had to pull in from Civ4/BTS assets though so look out for those.

Fingers crossed, this should solve both:

2) A player chooses accept and lead the rebels
3) A player chooses to hand over control

...on your list. I couldn't possibly say about the first one.
 
WOOOOW thanks Lemmy :eek: I'll check it out and Mr Jdog5000 the author of Revolutions will be be most happy as well!

As a gesture in return, what would you like me to do with this mod? Keeping adding stuff to it, or do you prefer to work in the RevolutionDCM context, which now has all these MP changes (except your latest?).

The main issue with RevDCM is that it seems to only have a 50/50 chance of connecting, while this more pure mod is much higher.

Your thoughts would be appreciated. Thanks heaps. Makes working in the salt mines easier with some help. :)

Cheers
 
Just keep doin' what you doin' :D

and you're welcome! let me know if there's anything else I can do. I think RevDCM is awesome can't do without my BUG personally :D That's also used in many mega mods which are therefore non multiplayer compatible so getting that running perfectly in multiplayer seems like the biggest deal to me... Does Better AI / DCM etc all stay in sync okay?
 
Tits. Just had an opportunity to have a 3 player game and it OOS when the American rebels rose in one of the human civs. Will look into a fix tomorrow.

It definitely worked two players though, so shouldn't be too hard to figure out what went wrong. i'm guessing pitboss + two humans will probably have the same fail.
 
It can be an absolute pig at times can't it? Keep up the good work and thanks for helping. I'm thinking of including your code into RevDCM 2.72 with acknowledgements, but that won't be for another week. Here's my thoughts over at the RevDCM forum:
http://forums.civfanatics.com/showthread.php?t=262937&page=131

Cheers
 
Holy crap! I'm AIAutoPlaying on Pitboss!! 200 turns in and so far fine!

Will try 2 players on pitboss later to approximate 3 players and let you know how it goes...

What I've done basically is:

1) Added an iPlayer parameter to the SDK AIAutoplay functions, and stored an array of the AIAutoplay settings per player.
2) Updated AIAutoplay to pass these parameters.
3) Added a delay so activating AIAutoplay doesn't happen until the start of the next turn if in multiplayer.
4) Sent a mod net message to all other players telling them you've enabled / disabled autoplay, passing number of turns etc. 3) above is to ensure all players know that you've started autoplay before the AI changes anything your end.
 
Back
Top Bottom