MPMPM - Multiplayer Mod DLC-hack (Updated!)

I couldn't find it in the thread, is it possible to add or remove singular mods from the mpmodpack without having to recompile it? My modpacks in the 2.5 - 3 gig range, to reallocating it to my players is a bit tedious.

I remember reading it should be possible. Just hoping for some guidance to do so.
All XML/SQL code is written in the override folders. CityView.lua, InGame.lua and LeaderHeadRoot.lua are also copied in UI folder.

All other files can be changed in the Mods folder without problems ;) (all .lua files in the mods folder are active, regardless of what is written in modinfo!)

If you want to change just one xml/sql value, you can search and change the line in Override folder in Civ5Units.xml or if it is a text in CIV5Units_Mongol.xml.
But this is not very userfriendly and if not done correct, it could mess up things.


Hi, I'm trying to get Communitas to work (the whole pack, but nothing else), and I keep getting a Runtime Error: "...MPM_Maker.lua:224: attempt to compare with nil" followed immediately by "...MPM_Maker: InGame.lua has been overwritten!"
Sorry, I have no knowledge about communitas pack =/

Edit:
BUT I can help you! I took a look at MPMPM and in line 224 is a coding error!
Just open the MPMP_Maker.lua with Notepad++ or any texteditor and scroll down to line 224, which says:
Code:
if inGameOverriden>1 then
This is a typo. Change it into:
Code:
if inGameOverridden>1 then
 
All XML/SQL code is written in the override folders. CityView.lua, InGame.lua and LeaderHeadRoot.lua are also copied in UI folder.

All other files can be changed in the Mods folder without problems ;) (all .lua files in the mods folder are active, regardless of what is written in modinfo!)

If you want to change just one xml/sql value, you can search and change the line in Override folder in Civ5Units.xml or if it is a text in CIV5Units_Mongol.xml.
But this is not very userfriendly and if not done correct, it could mess up things.

Would it work then to say, Generate a new override folder, bundle that with the new added mods, and send the two groups together?

I.e. Run afterburner, CreateMP(), Copy the Override & New mod folders, zip them, and send them to friends in our multiplayer group?

Should prevent issues as its a full override replacement with all relevant content.
 
Would it work then to say, Generate a new override folder, bundle that with the new added mods, and send the two groups together?

I.e. Run afterburner, CreateMP(), Copy the Override & New mod folders, zip them, and send them to friends in our multiplayer group?

Should prevent issues as its a full override replacement with all relevant content.

ehm... I don't know since I do not understand the steps you suggest...

If you plan to add new mods (with new xml files) I don't think it is that easy. Just have a look at the Civ5Units.xml override file, search for an entry of one of your mods and compare it to the lines from the mod.
In the mod version, you only have to set some specific values. All other values are default. In the override file, every single thing is set, since there is nothing like a default value -> the entries in override file looks different to the entries in your mod files.

If you can handle this, then it should work.

You also can write your own little script. "Just" study the MPMP_Maker.lua and the override files and you may be able to add something to an existing modpack.
But even if you have such a script, it could be very error-prone.
 
Sorry, I have no knowledge about communitas pack =/

Edit:
BUT I can help you! I took a look at MPMPM and in line 224 is a coding error!
Just open the MPMP_Maker.lua with Notepad++ or any texteditor and scroll down to line 224, which says:
Code:
if inGameOverriden>1 then
This is a typo. Change it into:
Code:
if inGameOverridden>1 then

Derp! I can't believe I didn't think of that (I'm a programmer by trade, so yeah....). I was trying to look for source code on the front page to look for the error in the mod with no luck till you posted that, lol. It looks like it worked; I'll post the communitas pack (with a couple other on-theme mods included, but nothing big) so that people can enjoy Communitas Expansion for Civ 5 multiplayer! (assuming it passes testing)

Thanks for your help! At least I helped find a bug though ;)
 
An update on my efforts with Communitas: I've gotten it to 'work', and now it loads, all the factions are altered, buildings and research adjusted, etc. However, I have encountered numerous bugs; none of them completely prevent playing, but they do degrade the experience somewhat. The most glaring is the broken UI; essentially, all building/wonder/unit tooltips are completely broken in multiplayer, giving no information at all; not even a popup besides when prerequisits aren't met. Also, the top bar is a mix of misinformation; GPT is incorrect (even though the tooltip for it shows the right income/expense numbers, the total is always 8 GPT), and similar for the others.I'm not sure why this is, as it works fine in single player with the modpack just fine. After that, many of the scripts seem to randomly fail; the reveal of the starting area, the blitz promotion, the random events, all of them non-functional. Finally, many aspects are mash-ups of vanilla and Communitas traits; India has both vanilla's traits and communitas'. Pantheon choices are vanilla choices with Communitas stats where relevant.

Despite all this, my friends and I already enjoy the game a lot more than vanilla; we have had a lot of major gripes for a long time, and this helps a lot. The most frustrating aspect is the missing/incorrect information displays. Any idea how one could possibly fix this? It all works flawlessly in single player, and multiplayer doesnt seem to connect to Fire Tuner, so I have no debug trail to follow.....

I have tried disabling all but the base Communitas mod, and the problem still persists.

EDIT:
I examined the Database logs, and currently am getting a few errors, but not many. Here's the log, it's not too long:
http://pastebin.com/c2xEXU55
I'm guessing the "no such table: ContentPackage.LocalizedText" errors might be why the UI tooltips are failing? Any ideas on how one would fix this?
 
@Dreadicon:
I have not experience with database log, just with lua log ^^
The MPMPM modpack really works in singleplayer without problems and only in multiplayer everyhting is meesed up??

The first things I would suggest, is to check, if some files are twice in your modpack (especially files also used by the base game). Also check in the modpack the UI CityView.lua and InGame.lua. If Communitas contains such files, the files in UI should be the Communitas files.

You also can check the xml log. I had some issues with mods with wrong txt tags. The tags were "TXT_BUILDING" but should be "TXT_KEY_BUILDING". Sometimes these mods load without problem and sometimes they did not load, until I fixed this.

About Communitas itself:
I only tried it once in singleplayer. Just a few turns after the start, rome started conquering all city states! After ~ 30 turns he conquered 4 city states and kept conquering. After this experience, and the strong barbarian promotions(I don't like when barbarian can move more than me), I never played it again :D But maybe it was just bad luck, that I played with such an aggressiv AI.
 
@Serp:

Concerning Communitas: it's designed to augment/adjust the base game without adding onto it too crazily. The AIs are substantially smarter for both barbarians and AI Civs, and the barbarians mostly got special movement abilities (woodsman, mountaineer, etc) which let them move faster in specific terrain types, based on where their camp spawns. They give a not-inconsequential amount of gold for capping their bases too. The huge difference between the base game and Communitas though is gold. In Communitas, you get a real economy; not a delicate maintenance dance, so you will be buying a lot of stuff. Rome likely got a lucky start location in your game, and rushed military (a solid player strategy that is often used). I kindof find those things neat, like Rome behaving like Rome ;) but to each his own. Communitas is ultimately for those who want 'oldschool civ' style back from the previous titles, rather than adding to Civ 5's new style.

Thanks for the advice again! Turned out to be a combo of two things; there was a typo in one of the Communitas files, and some things for other mods that weren't having their dependencies proplerly checked. I fixed those, and then found an InGame.lua in the Communitas folder, which per-instructions I deleted (replacing the one generated by MPMPM just made things worse).

The game runs a lot better now; scripts mostly work, tooltips function correctly, etc. I'm stuck with two caviats however. First, while the revised start biases work in single player perfectly, they appear to be non-functional in multiplayer. Additionally, the start location reveal still doesnt work specifically in multiplayer, though that's less important.

The other bug is some kind of corruption of the cache if one ever tries to re-start/join a game after starting one, unless I exit the game entirely. I've repeated this multiple times and circumstances. It only occurs when you exit to main menu, then start another game (mp or sp). Once corrupted, it will remain so until you wipe the cache or reload without the modpack, then reload again with it (forcing a core game/dlc cache refresh). It's easy to work around, but odd, none the less.

If anyone happens to have any ideas about the remaining bugs, let me know! I'll probably be poking around in the Communitas source trying to figure out what's breaking the start conditions in mp. I'll post the modpack I have so far soon as I've played through a game with friends to ensure both stability and reload/rejoin functionality
 
Upon playing with friends, it turns out that the problem of the corrupted cache is a lot more serious than I first thought. Occasionally the game desyncs with the mods. It's not too often; between 5 and 30 turns. The game just takes a minute to reload and then normally would be fine. However, due to the cache corruption, soon as the game reloads from the desync, it has corrupted the cache and is no longer playable. I'm kindof at a dead end at the moment as I have no idea what might be causing either the desyncs or the cache corruption (as none of the logs or errors available are very useful). Anyone got any ideas?

In the mean time, I guess it's back to my indie 4x game I'm making explicitly to be extremely multiplayer and mod friendly.
 
The desyncs only happens after a specific action that causes the desync.
So you have to find aout, what exactly you / the game did in the turn before the reload happens.

I have no idea about the cache.

But the best thing you can do is searching the lua scripts from the things you think they might causing problems.
You have to look for any lines, that could be executet different for human players.

E.g
the Event "OnImprovementCreated" is rubbish in most cases. Use the BuildFinished event instead. And use "OnPlayerDoTurn" Event instead of other events that are fired each turn (keep in mind that PlayerDoTurn is fired for all civs, while other events like this only fired for humans, so maybe you have to adjust the function a little bit).
Look for "GetActivePlayer()". This will always only return the player whos computer it is (don't know about hotseat). GetActivePlayer() can only be used, when do somehting UI like (e.g. show a popup). But if you do some game changes with ActivePlayer, you get a desync.
 
So, I'm planning on creating, maintaining, and updating pure Civ packs, and perhaps some other stuff. I have one being uploaded to Dropbox right now, and I was wondering how do I link it onto the first post? Also, are there any recommendations for uploading sites, or is Dropbox good enough?
 
JFD Civs Multiplayer Pack: [DEFUNCT]

It was fun learning how to make a modpack, but with JFD on the way with his own modpack, I recommend you wait until he publishes it. And as such, I've removed the link to my own version of the JFD Civ MPP.

Thanks to those who did download it, and tried to work through the bugs. :)

Latest Civ Release: The Turks (Mehmed II)
Latest Mod Update: (Ver 2.0) 06/27/2015
 
I am moving forward bit by bit in creating a smooth and functional modpack that would create no issues, but I still have some problems.

I have applied the advise of removing all the print, dprint, logger statements, and it did help in shortening the break when other civs and barbarians make their turns, but I am wondering whether there is any other way to improve it even further.
Would you guys have any suggestions? From your experience what has the biggest impact on the speed of computer turns?

I was also wondering whether it's possible to use "Quick Turns" rather as a global setting than a mod available for all the players (caused desyncs and overall mess in my game, when two players starting modifing it's settings). Would anyone have the knowledge on how to implement it as a set rule instead of menu?



The desyncs only happens after a specific action that causes the desync.
So you have to find aout, what exactly you / the game did in the turn before the reload happens.

I have no idea about the cache.

But the best thing you can do is searching the lua scripts from the things you think they might causing problems.
You have to look for any lines, that could be executet different for human players.

E.g
the Event "OnImprovementCreated" is rubbish in most cases. Use the BuildFinished event instead. And use "OnPlayerDoTurn" Event instead of other events that are fired each turn (keep in mind that PlayerDoTurn is fired for all civs, while other events like this only fired for humans, so maybe you have to adjust the function a little bit).
Look for "GetActivePlayer()". This will always only return the player whos computer it is (don't know about hotseat). GetActivePlayer() can only be used, when do somehting UI like (e.g. show a popup). But if you do some game changes with ActivePlayer, you get a desync.

Serp - a lot of questions :) Do you think that editing all the lua files in Notepad++ and replacing the commands above by the less risky ones will always work, or can it create issues in some cases? What commands and in which situations would you replace by "OnPlayerDoTurn"? And can you give me some examples when GetActivePlayer will mess the game up, and what to do in such cases? Are there any other commands you know that always cause problems in multi?

There is one thing more I'm fighting with - I have managed to get rid of most of the desyncs, but there is one very annoying thing happening still from time to time. If we loose the connection and reload the last autosave, all the human player lose one turn (the loaded one), and AI executes their turn with no problems. Any ideas on what can cause it? I couldn't track the problem in the logs and recreating this issue for every mod separately and for combinations of mods is going to take years...
 
Would you guys have any suggestions? From your experience what has the biggest impact on the speed of computer turns?
Did you test every mod separately? Maybe you can see already a huge delay with a specific mod.
But you say the thing that needs to most time, is when AI/barbarian/citystaes do their turn, right?
Then it might be caused by PlayerDoTurn functions. If you have alot of mods that add alot of functions to this event, all were executed for every player.
That could take much time.

You could take a look at your lua scripts and search for the functions that were added to the event. Then you should try to understand what is happening in that function. Is it really important, that this function does all the stuff for every player in every round? Or are they only for human players important, or only when a special building is built or when the player is a specific Civ? Try to shorten the function. E.g when it is only needed for human players, then add (if it is not there already):
Code:
    local pPlayer = Players[iPlayer]
	if (not pPlayer:IsHuman()) then
	  return 
	end
This will end the function immediately, if the player is no human.. and will save alot of time, depending on the things that would be executet otherwise.



I was also wondering whether it's possible to use "Quick Turns" rather as a global setting than a mod available for all the players (caused desyncs and overall mess in my game, when two players starting modifing it's settings). Would anyone have the knowledge on how to implement it as a set rule instead of menu?
There is already a quick movement/quick combat option. Why do you thing you need quick turns? It won't speed up turns more than the quick options mentioned above. The only thing it does is, that you can set the movement speed from specific players seperatly.
I don't think it is worth the trouble of rewritting it.


Serp - a lot of questions :) Do you think that editing all the lua files in Notepad++ and replacing the commands above by the less risky ones will always work, or can it create issues in some cases? What commands and in which situations would you replace by "OnPlayerDoTurn"? And can you give me some examples when GetActivePlayer will mess the game up, and what to do in such cases? Are there any other commands you know that always cause problems in multi?
One example for a ActivePlayer problem you can see here:
http://forums.civfanatics.com/showthread.php?t=548614
It is not only the GetActivePlayer() function, but also the PopUp event itself, which is only fired for the active player, not for others.
So I had to find a way to circumvent this and found it in the second post ;)

The really important thing, when changing scripts, is to understand what it does!
If you have no clue, what is done with the "GetActivePlayer()", you won't be able to say if this can cause desync or not.
And for the other Events I mentioned, they use different paramaters. You can't simply replace the name, without adjusting the rest of the function.

This wiki helps a bit to understand things (see the objects section):
http://modiki.civfanatics.com/index.php/Lua_and_UI_Reference_(Civ5)
At least there you can see, what commands and events exist. Unfortunately you don't see an explanation in most cases.

There is one thing more I'm fighting with - I have managed to get rid of most of the desyncs, but there is one very annoying thing happening still from time to time. If we loose the connection and reload the last autosave, all the human player lose one turn (the loaded one), and AI executes their turn with no problems. Any ideas on what can cause it? I couldn't track the problem in the logs and recreating this issue for every mod separately and for combinations of mods is going to take years...
I don't have experience with loading issues, but I read somewhere about game crashes when clicking the load button... I can't remember where and waht exactly solved it... I think it was something with steam cloud. Maybe try to disable it and delete the cache folder?
 
I don't have experience with loading issues, but I read somewhere about game crashes when clicking the load button... I can't remember where and waht exactly solved it... I think it was something with steam cloud. Maybe try to disable it and delete the cache folder?

I can actually sort of answer that. When there is certain Lua code running, and the game tries to halt it to load a save file, it will crash Civ. It happens for a lot of mods.
 
A lot to read, thanks :)

But regarding one thing maybe I have to make myself more clear.

The game doesn't crash on pressing the load button. It loads fine. The problem is that after any random crash (internet connection, mod related, desync), when you load your game and the map appears, it skips one turn for the human players, plays the AI turn, and only allows you to make the next turn. I will still try to track it down to a specific mod, but no trace in logs doesn't help.
 
A lot to read, thanks :)

But regarding one thing maybe I have to make myself more clear.

The game doesn't crash on pressing the load button. It loads fine. The problem is that after any random crash (internet connection, mod related, desync), when you load your game and the map appears, it skips one turn for the human players, plays the AI turn, and only allows you to make the next turn. I will still try to track it down to a specific mod, but no trace in logs doesn't help.
yes I know that I did not describe the bug you talked about. But since I have no clue how to solve your bug, I mentionend it... maybe it has a simular solution.
 
So I've been stuck on the previous page this whole time, and refreshing the page to check if there's been any new posts...without remembering to check if there's any new pages. Wow I'm good at this forum thing. :lol:

I couldn't find it in the thread, is it possible to add or remove singular mods from the mpmodpack without having to recompile it? My modpacks in the 2.5 - 3 gig range, to reallocating it to my players is a bit tedious.

I remember reading it should be possible. Just hoping for some guidance to do so.

All XML/SQL code is written in the override folders. CityView.lua, InGame.lua and LeaderHeadRoot.lua are also copied in UI folder.

All other files can be changed in the Mods folder without problems ;) (all .lua files in the mods folder are active, regardless of what is written in modinfo!)

As Serp has implied/stated, the safest thing to do if you want to save upload/download time is to

1) Recompile the modpack (this has to be done each time, unfortunately)
2) Distribute ONLY the Override folder, and rely on your other players to keep the right mods in the Mods folder (which just contains carbon copies of the mods off of Steam Workshop or wherever you got it from). Since the Override folder is only like 15 mb, this alleviates most of the uploading/downloading. If you're adding more mods, you can of course just send them the new mods only.

This of course relies on people accurately making sure they've included exactly the correct mods in the Mods folder and nothing else. I was hoping to make a tool to do it automatically, but never got around to it.

(Disclaimer: I have never actually tried this...but in theory it should work.)

Edit:
BUT I can help you! I took a look at MPMPM and in line 224 is a coding error!
Just open the MPMP_Maker.lua with Notepad++ or any texteditor and scroll down to line 224, which says:
Code:
if inGameOverriden>1 then
This is a typo. Change it into:
Code:
if inGameOverridden>1 then
Doh. Well I patched that.

@Serp:

Concerning Communitas: it's designed to augment/adjust the base game without adding onto it too crazily. The AIs are substantially smarter for both barbarians and AI Civs, and the barbarians mostly got special movement abilities (woodsman, mountaineer, etc) which let them move faster in specific terrain types, based on where their camp spawns. They give a not-inconsequential amount of gold for capping their bases too. The huge difference between the base game and Communitas though is gold. In Communitas, you get a real economy; not a delicate maintenance dance, so you will be buying a lot of stuff. Rome likely got a lucky start location in your game, and rushed military (a solid player strategy that is often used). I kindof find those things neat, like Rome behaving like Rome ;) but to each his own. Communitas is ultimately for those who want 'oldschool civ' style back from the previous titles, rather than adding to Civ 5's new style.

Thanks for the advice again! Turned out to be a combo of two things; there was a typo in one of the Communitas files, and some things for other mods that weren't having their dependencies proplerly checked. I fixed those, and then found an InGame.lua in the Communitas folder, which per-instructions I deleted (replacing the one generated by MPMPM just made things worse).

The game runs a lot better now; scripts mostly work, tooltips function correctly, etc. I'm stuck with two caviats however. First, while the revised start biases work in single player perfectly, they appear to be non-functional in multiplayer. Additionally, the start location reveal still doesnt work specifically in multiplayer, though that's less important.

The other bug is some kind of corruption of the cache if one ever tries to re-start/join a game after starting one, unless I exit the game entirely. I've repeated this multiple times and circumstances. It only occurs when you exit to main menu, then start another game (mp or sp). Once corrupted, it will remain so until you wipe the cache or reload without the modpack, then reload again with it (forcing a core game/dlc cache refresh). It's easy to work around, but odd, none the less.

If anyone happens to have any ideas about the remaining bugs, let me know! I'll probably be poking around in the Communitas source trying to figure out what's breaking the start conditions in mp. I'll post the modpack I have so far soon as I've played through a game with friends to ensure both stability and reload/rejoin functionality

There are known conflicts between multiplayer mods and some of the lua functions that fiddle with the save/load process. It's never been fully explored just what the problems are or how to fix it, but it causes a lot of the save/load flukery you see (cache corruption, losing turns after desyncs, game crashes when trying to reload a save from within the game)

Also, nothing in your database.log looks out of order (the contentpackage.localizedtext error happens for everyone, I think, and the rest is standard stuff you see for every MPMPM package...).

I added you to the first post. If you want, you can your post to include more details for people passing by.
 
A lot to read, thanks :)
The game doesn't crash on pressing the load button. It loads fine. The problem is that after any random crash (internet connection, mod related, desync), when you load your game and the map appears, it skips one turn for the human players, plays the AI turn, and only allows you to make the next turn. I will still try to track it down to a specific mod, but no trace in logs doesn't help.
So, that issue actually plagues a lot of vanilla multiplayer games. It's a known bug around some of the forums; apparently was introduced by one of their more recent patches. Your civ shouldnt fully loose the turn; build progress/move progress/research/etc all advance, but you cannot issue any orders whatsoever for a single turn. No thread i've seen knows why, or has a good workaround for it, unfortunately.

Serp said:
But the best thing you can do is searching the lua scripts from the things you think they might causing problems.
You have to look for any lines, that could be executet different for human players.
Thanks, I have taken a look at the code; only GetActivePlayer is used of the ones mentioned, but it's used......ALOT. mostly in interface stuff, but there are over 100 occurrences of it, so that's going to be a long battle. I'll have to work on it over a few weeks most likely.

cicero225 said:
There are known conflicts between multiplayer mods and some of the lua functions that fiddle with the save/load process. It's never been fully explored just what the problems are or how to fix it, but it causes a lot of the save/load flukery you see (cache corruption, losing turns after desyncs, game crashes when trying to reload a save from within the game)

Also, nothing in your database.log looks out of order (the contentpackage.localizedtext error happens for everyone, I think, and the rest is standard stuff you see for every MPMPM package...).
Thanks for taking a look at the log. Concerning the cache corruption, it actually doesnt happen just when loading/saving; it also happens when I start a new game/load a game (which works fine), then return to the main menu, and start another game (new or loaded; doesnt matter which I do). It somehow corrupts the database entries for displaying building and tech information, so that the entries are there, but all information used for display is nil. I'll have to dif the cache some time here; that might reveal some useful info. Thanks for the help so far everyone!
 
With few friends we're trying to play Communitas mods in multiplayer by using MPMPM and we have the same desync problems as Dreadicon. We're looking for a way to fix these issues too.
So, if you need help we're here, even if our knowledges in modding are a bit more limited.
 
Back
Top Bottom