For a forum that prides itself on trying new things, for the love of all that is novel and interesting, please can we have a new QotM? - Krill

Create an account  

 
Pink Dot IT Office - Email and technical issues thread - All welcome, all the time

Well, I was able to compile it. It's VS 2003 natively (the project file says version 7.10) which I also have. And for where to insert that line, I think in CvGame::IsMPOption will get the job done. May be overkill, but we know that IsMPOption will get called at the right time and has scope visibility to SetMPOption.

I am not sure what kind of test case to prove this works, though. I started a Pitboss to test, with the unchanged DLL. Even without Takeover AI selected, the Kick button was available on the Pitboss control screen, once one player logged in and claimed a civ. Then the other player could play turns continuously and I saw the AI moving the first player's units.

I've never hosted a pitboss myself, so what's the behavior on the control screen that sunrise sees? Is the Kick button not available?
Reply

T-hawk Wrote:Well, I was able to compile it. It's VS 2003 natively (the project file says version 7.10) which I also have. And for where to insert that line, I think in CvGame::IsMPOption will get the job done. May be overkill, but we know that IsMPOption will get called at the right time and has scope visibility to SetMPOption.

I am not sure what kind of test case to prove this works, though. I started a Pitboss to test, with the unchanged DLL. Even without Takeover AI selected, the Kick button was available on the Pitboss control screen, once one player logged in and claimed a civ. Then the other player could play turns continuously and I saw the AI moving the first player's units.

I've never hosted a pitboss myself, so what's the behavior on the control screen that sunrise sees? Is the Kick button not available?
The kick button is visible to me. However once a player is kicked we would like a new player to be able to once again select that civ, but as things currently stand the civ in question isn't even visible on the player side.

EDIT: If you want to send me a save T-Hawk, I can host it. We just need a player to grab an open spot, then I'll kick them, and then we'll see if another player can take the spot over.
Reply

Aha, I understand now. "AI Takeover" really means the ability for a player to claim a civ from the AI. Kicking a player into AI status is always possible.

So I think my test worked! Here's what I did:

- Started a Pitboss game with the original DLL and AI Takeover turned off.
- Started Civ 4 proper and connected to localhost.
- Claimed a civ and set a password.
- Closed Civ 4.
- Saved in Pitboss.
- Kicked that player in Pitboss. The score jumped showing the AI settled.
- Started Civ 4 and the now-AI civ was not available to select. This replicates the problem case in the real game.

- Closed Pitboss and put in my new DLL. (I swapped the DLL in-place, I didn't load a game mod.)
- Ran Pitboss again and loaded the save.
- Kicked the player again. The score jumped showing the AI settled.
- Started Civ 4 and connected to localhost.
- The now-AI civ is available to select! And it prompts for a new password - the civ's original password is not needed!

So, find our salvation here!

http://www.dos486.com/civ4/CvGameCoreDLL...keover.zip
Reply

Great stuff, guys.

So for the dumb masses:
All of us have to download the zip file, make a back up of the original dll and replace it with yours and then game on?

mh
"You have been struck down!" - Tales of Dwarf Fortress
---
"moby_harmless seeks thee not. It is thou, thou, that madly seekest him!"
Reply

I would think that having the different dll only matters for the host for the first time he loads the save, after all all it's doing is reseting the AI civ, correct?
Reply

Great job!

Did you check putting the normal dll back after taking over and playing another turn to make sure everything still works?
Reply

that is great news. I seem to remember Gyathaar (author of that dos savegame edit program) postulating that you might be able to change options via a modified DLL (cannot find that reference now). Good to know that it works. I'll talk to EmperorFool to see if we can create some form of option screen in BULL to do this. It was really handy in vanilla and warlords and lots of people missed it in BtS.
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.

(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.
Reply

This seems like great news. Now to remember what I was doing smile Glad there are people out there smarter than me.
Reply

MH, only the host should need the DLL. Next step is for sunrise and Elkad to coordinate and get Elkad going. Do note that the AI plays the entire turn as soon as you click the Kick button, so Elkad will have to deal with that bit of mismanagement. smile

Theoretically all that should be needed is for Pitboss to load and save with the modified DLL, though I didn't test that way. And no I didn't re-test by putting the original DLL back afterward. Will do so if sunrise and Elkad run into any problems.

BTW, here is the code, forgot to post this before. In CvGame.cpp :
Code:
bool CvGame::isMPOption(MultiplayerOptionTypes eIndex) const
{
    //By T-hawk for Realms Beyond Pitboss game.  Set Takeover AI to true.
    GC.getInitCore().setMPOption(MPOPTION_TAKEOVER_AI, true);
    //
    return GC.getInitCore().getMPOption(eIndex);
}
Reply

Awesome work T-Hawk. I'll get this loaded today. Also, since the AI is going to screw up the moves anyways, does it make sense to reload to last turn (since ZPV missed that turn) or will it be a wash?
Reply



Forum Jump: