[WIP] Madoka Magica: Wish for the World

Does Write Home remove the Magical Girl for 3 turns no matter what the game speed is?

Yes. This reflects how Game Speed has no effect on most Unit attributes such as movement, hit points, Experience gain, Level requirements, and strength.

If Home has not been razed but is under the ownership of another civilization, does that affect the effectiveness of Write/Phone Home (and visiting)? I suppose it would depend on whether the other civilization is friendly or hostile?

You can still write or phone home if an enemy controls the home city. For visiting it, you'll have to either gain open borders...or have her sneak in during war!



Edit: New Feature incoming!

 
This mod has been crashing to desktop for me in each game I play around turns 70 to 100, and I noticed that a couple of people commenting on the steam page for it had the same problem, so I looked a little further in to it using the Ingame Editor mod.

The crash in the save attached to this post happens on Sidon's next turn. If you delete Sidon's magical girl before they take their next turn, the crash doesn't happen. Their magical girl doesn't appear to be doing much so I have two hunches as to what's happening:

1. Sidon has a central post office. Its most advanced tech is Mathematics, the prereq for that. The current production project in Sidon (a wall) has only just begun.
So it stands to reason that Sidon completed that central post office last turn. If deleting the magical girl prevents a crash that happens on their next turn, it could be because she's trying to write home and somehow causing an infinite loop or something.
2. It's turn 74, so this is about when a leader magical girl would develop a second like/dislike. Sidon's magical girl could be causing the crash that way.

I hope this helps you fix this bug so I can finally get around to playing a full game of your mod :)
 

Attachments

  • Pocatello_0074 BC-1040.Civ5Save
    996.5 KB · Views: 61
This mod has been crashing to desktop for me in each game I play around turns 70 to 100, and I noticed that a couple of people commenting on the steam page for it had the same problem, so I looked a little further in to it using the Ingame Editor mod.

Thanks for the detailed post; I was able to isolate the issue and it was indeed related to City-States and their use of Write Home/Phone Home. Disabling these actions for City-States fixed the problem (it's not like CS MGs stray very far from home). An update was posted to the workshop; the only change is this fix.

Now that I've spent entirely too much time in the past week playing Neptunia Rebirth 1, I can get a more substantial update out hopefully within the next few days. I plan on reworking a lot of the Like/Dislike fulfillment requirements so they make much more sense. They will also no longer be binary; you can partially fulfill them for a smaller bonus.
 
Patch uploaded:

  • When Community Patch is loaded, it causes Magical Girls, Witches, Familiars, and Incubators to be unable to be captured by means such as Suleiman's trait or by the "Nanoha's Patented Befriending Method" promotion. (Only requires the Community Patch; does not require the Community Balance Patch.)
  • Additional CTD Fixes.
  • Likes and Dislikes revamped:
    • Mood changes are now incremental, depending on various factors related to the Like/Dislike. They will no longer be binary.
    • Removed Wonders and Great Works from potential Likes/Dislikes.
    • Policy Likes/Dislikes are now Policy Tree Likes/Dislikes, and increase their Mood bonus based on how many Policies you have from that tree.
    • More weighting factors added to which Likes/Dislikes are chosen.
    • Leader Magical Girls should almost always adopt Likes/Dislikes which correspond to how you are currently playing. For example, they will always Like or Love a Policy tree you've already adopted, or a Luxury Resource of which you have a direct source.
    • Significantly increased the chances of Socializing spreading a Like/Dislike from one Magical Girl to another.
    • Magical Girls now have their preferences for each Ideology tracked individually, and these are now also affected by Socializing.
    • Magical Girls will become more preferential to your Ideology each turn if they remain loyal to your Empire.\
    • Fixed an issue which could cause Magical Girls born before Ideologies were adopted to never adopt an Ideological preference.
  • Mood modifiers adjusted:
    • There is now a greater focus on "active" modifiers rather than "passive" ones.
    • Positive modifiers increased for: Socializing, Killing Witches, Empire Happiness.
    • Positive modifiers decreased for: Policy finishers, Golden Ages.
    • Penalty values for Homesick, Lack of Socializing increased. However, it takes longer for the penalties to begin accumulating.
    • Penalty for Incubator Emotional Abuse and Friendly Units killed increased. Spawn rate of Incubators increased.
    • New negative Mood penalties:
      • Inadequacy: Occurs when a Magical Girl is much lower level than other ones in your Empire (excluding your Leader). Begins occurring 30 turns after the Magical Girl makes her contract.
      • Restlessness: Begins accumulating if the MG goes 20 turns without entering combat. Cured upon entering combat.
  • Should no longer be able to select Magical Girls who are on a cooldown period for Sparring if the Spar was initiated from one who was not on cooldown.
  • Magical Girls, upon defecting to another Empire, will have these Mood penalties reset: Homesick, Lack of Socializing, Restlessness, Lack of Vacation.
  • Magical Girls will now merely gain +40% (or whatever the amount a Grief Seed recovers) Soul Gem upon defecting, instead of being reset to 100%.
  • Leader Magical Girls, when Socializing, grant double the bonuses to the other Magical Girl (both the Mood bonus and the influence towards future Likes/Dislikes).
  • Loyalty is now significantly less affected by Mood, and significantly more affected by Cultural Influence, Likes, and Dislikes.
  • More values used for Loyalty calculations have been moved to WFTWGameDefines.xml, instead of having them coded directly into the Lua.
  • Mission button for Spar will now tell you how many turns the Magical Girl has before she may Spar again.

Additionally, I would like to gauge user response regarding which of the next planned features should be implemented next.

Strawpoll

The Relationships System will involve individual MGs developing Relationships with each other. High Relationships will provide Mood bonuses and will greatly strengthen both MGs if they fight alongside each other...but just don't let one of them die. However, Relationships can also turn quite sour! Combat between Magical Girls who hate each other is bound to be bloody. Relationships respect no country's boundaries; you may develop positive relationships with foreign Magical Girls, which may cause said foreign Magical Girls to defect to your Empire more quickly! Alternatively, spend time developing hostilities between your Magical Girls and those of a country you intend on conquering soon. Relationships between Leader Magical Girls will directly correspond to increased or decreased diplomatic relations between their respective Empires. This will also come with a greatly expanded version of the Socialize option, which will split Socialize into various Chat options, as well as some other social actions like Cheer Up (improves Mood of MGs who are in a very bad mood), Insult (severe negative Relationship level change, and can cause a MG to be forced into attacking the insulter on their next turn), and Strategize (grants a small number of Skill Points or XP, depending on whether or not I have implemented the Skill Tree at the time).

The Skill Tree System will involve a complete overhaul of the existing promotion system, adding a total of 420 Promotions and Activated Abilities! All Magical Girls will have a Common Skill Tree, a Class Tree, and a Role Tree. The Class Tree is directly determined by which sort of Prodigy was contracted to create the Magical Girl; Leader Magical Girls will get to choose this tree, and Magical Girls obtained in unorthodox ways (Terracotta Army) will receive one at random. The Role Tree is selected upon a Magical Girl earning her first Skill Point, and cannot be changed once chosen. These will correspond to the existing Promotion specializations (Siege, Skirmish, Sentry, Support). Additionally, there will be a rework of how Magical Girls gain experience. XP will be replaced by Skill Points, which are earned via combat, sparring, and other means. Skill Points will be distributed much more liberally than XP. Each Skill will have a corresponding Skill Point cost, as well as a requirement of a certain number of Skill Points already being spent on Skills in that Tree.

3D Models are quite self-explanatory. This will, first and foremost, focus on adding some 3D (and corresponding 2D) art to the existing Unique Units. After that, it will focus on adding some alternative unit models for Magical Girls and Witches.
 
I'm quite sure latest Community Patch update broke the mod.

Clicking Socialize does nothing (doesn't show the targeting AoE), all Magical Girls lack Spar button, and also when playing Kirika and Oriko I couldn't find their special ability, but maybe it only appears after hidden witches start appearing.
 
I'm quite sure latest Community Patch update broke the mod.

Clicking Socialize does nothing (doesn't show the targeting AoE), all Magical Girls lack Spar button

Testing it showed no problems on my end, including with the latest Community Patch. Try clearing your mod cache.

and also when playing Kirika and Oriko I couldn't find their special ability, but maybe it only appears after hidden witches start appearing.

Correct -- Oriko's Danger Divination will not appear on the action bar until Hidden Witches begin spawning.
 
I cleared cache once more and now it works.. So either it was conflict with some other mod (but I was only using this, CP, EUI, InfoAddict and Really Advanced Setup) or I forgot to clear cache when updating something.
 
I found what caused the previous problem.

It was the mod "Really Advanced Setup".

Could you check why it might conflict? It's awfully handy (as for example I can exclude all civs except for Madoka civs for randoming) and it's a shame it breaks this mod.

EDIT: Also either the last update didn't install properly (but I cleared cache since then) or the perpetual socializing with city-state MG still exists. And it still doesn't fix "lack of socializing".

My version shows as v25 (so newest, I think) on mod list.

EDIT2: After restart it fixed itself, even though I'm using same mods (Madoka, InfoAddict, Madoka Soundtrack, CP). I love Civ 5 consistency with mods.

The Really Advanced Setup issue still stands tho.

EDIT3: I can also apparently confirm the thing someone mentioned in comments. Currently only my main two MG lose soul gem percentage, even though the one non-main is currently "Depressed". Her soul gem is still at 100% even though she is exploring for like last 50 turns.
 
Really Advanced Setup

Ah yes, one of the banes (get 'em on board, I'll call it in) of my mods.

Temporary answer: don't use RAS not just with WFTW, but several of my other mods like Nanoha. It's been several months since I reported the conflict to the author; doesn't look like it'll ever be addressed, so I'm going to do something on my end to fix it. Should be up sometime soon.


Edit: Better answer now that I'm at my computer. Go into RAS's Lua folder, open up GTAS_PlotIterators.lua, delete all of its text, and paste this code into it instead.
 
Edit: Better answer now that I'm at my computer. Go into RAS's Lua folder, open up GTAS_PlotIterators.lua, delete all of its text, and paste this code into it instead.

Ok, that did help. Thanks!

But as a programmer, I have to ask: How the hell something that deals with iterating over plots breaks unit abilities? How?

Also, have you looked into something (probably embarking) stopping gem corruption permanently that people are mentioning on the workshop?

EDIT:Also I think luxury likes might be screwy. I have -100 from "lack of horses while other civ has them" while I indeed have horses. Also horses aren't "luxury resource" in game I think, but that's not really important.

Oh, also AI randomed Oriko and Kirika (I know, not recommended, I forgot to turn them off) and I must say their diplo responses are hilarious.

EDIT2: Ok, it's not embarking (well, doesn't mean embarking works ok or not) since I just played new game, and first non-leader girl I got (from prophet) didn't get corrupted at all from beginning, even after I put her in jungle till she dropped to very low mood (depressed I think).
 
But as a programmer, I have to ask: How the hell something that deals with iterating over plots breaks unit abilities? How?

From what I recall, it's a combination of factors:

a) The creator of the RAS mod created their own "PlotIterators" lua file with their own plot iteration functions. They did at least name it differently from the default PlotIterators file used by most people, but...

b) The Civ 5 database is highly permissive when it comes to filenames. I can't remember exactly what DarkScythe managed to find out, but at the very least, if you have two lua files with "PlotIterators" anywhere in the filename, they'll overwrite each other.

c) This means the RAS PlotIterators file ends up overwriting the default PlotIterators file which most mods refer to, removing functions that they're using. This typically leads to some lua functions simply not working. With my Marisa civ, I used PlotIterators to scatter the mushroom patches when she founded a city, so with RAS active that code simply crashed and her cities never got mushroom patches. In WFTW, I'm guessing functions like the Spar code use PlotIterators, and thus crash whenever RAS is active.

For the time being, with my Marisa civ I've renamed PlotIterators.lua to avoid a potential conflict with other PlotIterators functions.
 
EDIT:Also I think luxury likes might be screwy. I have -100 from "lack of horses while other civ has them" while I indeed have horses. Also horses aren't "luxury resource" in game I think, but that's not really important.

I posted a small update which fixes this issue, and should also fix some oddities with LDs which would cause the rest of the "Magical Girl upkeep" stuff to function again. It has the same version number (v25); if it's not downloading from the Workshop, use the Mediafire link on the workshop page. (It's not linked here due to copyright sniffer bots.)

And mischa explained what the problem is with RAS. I use PlotIterators for no small number of functions in this mod, including every single mission which requires target selection, checking if an MG moved near their home city, at least 3 of the UU abilities, determining if an MG has "adapted" to certain hostile terrains...


The next update will have my PlotIterators renamed to avoid conflict. Shame we'll have to have so many differently-named copies of the same file floating around in the VFS, but hey.
 
But as a programmer, I have to ask: How the hell something that deals with iterating over plots breaks unit abilities? How?

I can't remember exactly what DarkScythe managed to find out, but at the very least, if you have two lua files with "PlotIterators" anywhere in the filename, they'll overwrite each other.

There are, unfortunately, multiple issues involved here, but most of the fault lies with Firaxis.

To start off, Firaxis gives us, instead of Lua's own file-inclusion methods (I think they're disabled, but I never double-checked this,) Firaxis has us use their own method called include().

When we call include(), it writes whatever is in that file into the context that it was called in, since each mod's Lua scripts are in their own context.

This works in tandem with Firaxis' VFS system, which seems to overwrite files if they are of the same name. This in itself is not strange -- if you dropped two files called test.txt into the same folder in Windows, Windows would ask if you wanted to overwrite the previous file. VFS does not automatically rename files on-the-fly to avoid such conflicts. As such, effectively only one copy of any particular filename will be able to exist in VFS at any given time. (I am making some assumptions here, as I've not delved deeply into the technical details of how VFS is implemented. If I have made any mistakes here, do let me know.)

However, if you look at it this way, the author of RAS actually did try to avoid conflict, by renaming his PlotIterators file. Following his edits of whoward's original code, he saved the file as GTAS_PlotIterators.lua which is different from PlotIterators.lua -- the latter being a sort of default name that everyone who uses whoward's code without modification tends to use. This should mean that in theory both versions exist in VFS at the same time.

So, what's the problem?

include()!

Some people may notice that, for example, include(PlotIterators) and include(PlotIterators.lua) will both work fine. (Let's set aside conflicts for the time being.) This is because of the way Firaxis designed their include() to work.

It doesn't search for an exact filename match!

It searches for a partial match using string.find() -- that's why those two different includes work to pull up the same file. PlotIterators.lua contains the phrase PlotIterators and becomes a valid match for include() to use.

I first ran into this problem with a conflict with TableSaverLoader and one of ViceVirtuoso's Civs running an older version of TSL than my mod. As whoward responded here, it's intentional on Firaxis' part. This was the reason that Pazyryk changed the filename of TableSaverLoader to include the version number after my report of the issue.

In this particular case, GTAS_PlotIterators.lua contains the phrase PlotIterators.lua and becomes a valid match for what the game assumes we're looking for, and writes that code instead of our original PlotIterators.lua!

Of course, not all the blame is on Firaxis -- If this was all that was happening, it should still be fine. However, recall why the file was renamed in the first place -- RAS' author modified it!

Most of our Civs who run into such conflicts rely on one major function -- PlotAreaSpiralIterator() which RAS' author has modified.
Again, though, he tried to avoid conflict by renaming his modified function GTAS_PlotAreaSpiralIterator(). Unfortunately, this is also exactly why it broke everything. In doing so, he essentially removed the stock PlotAreaSpiralIterator() function.

Unfortunately, since include() decided to use his version of the file, whenever our mods attempt to use PlotAreaSpiraliterator() they fail, because it doesn't exist!

For the time being, our solution is to completely rename our PlotIterators files to avoid such conflicts in the first place, but at the expense of having multiple versions of the exact same file in VFS. Alternatively, as I've seen ViceVirtuoso do with his last update to his Civs, he can attempt to re-replace GTAS_PlotIterators.lua with a version that contains the original PlotAreaSpiralIterator() function alongside RAS' modified one. They have different function names, so they have no problem existing together in this way.

However, I'm not entirely sure this would be a solution that works 100% of the time, as I believe it relies on mod loading order to ensure that RAS' version gets replaced. I suppose one can set RAS to be a referenced mod, but I am not sure.

Anyway, lengthy explanation, but that's what's happening behind-the-scenes, and the headaches that we have to deal with so people can simply enjoy playing with our mods.

Hope that helped.
 
Yes there seems to be a problem with Homura's Stop Time ability in which it causes a hang and eventual game freeze/crash whenever I use it. The AI after me does not seem to know how to finish it's turn. It's rather odd to me since it worked just fine in the non-DLL modded version of this mod.

I feel I should add I am at war currently and there is a large engagement spanning at least 20 units and 3 cities.

ITT: I use Time Stop. Everything goes fine till I hit Next Turn. AI does not seem to know what to do and it crashes the game.
 
I took a pass at Homura's Time Stop and fixed a few problems with it. Give the newest version a shot.



Update:

Should be compatible with previous v25 saves.

Note: I have received reports that the mod now experiences issues if you are playing with DLL Various Mod Components instead of Community Patch. I would strongly recommend moving to Community Patch if you haven't already!

  • Fixed issue which caused Magical Girls other than Leaders to not lose Soul Gem per turn until Ideologies were in place.
  • All Magical Girls will now receive a minimum of 1% Soul Gem Corruption per turn, even if they are in a positive mood. However, positive moods will still reduce the amount of Soul Gem corruption caused by being injured.
  • Good Mood (+100 to +199 Mood) provides a 1% decrease in the amount of Soul Gem Corruption suffered from regenerating. This was removed in v25, but due to the above change, has been reinstated.
  • Since one of the major boons to having positive Moods (essentially immortal Magical Girls) is now gone, the effects of Mood on Combat Strength have been significantly increased to compensate:
    • Despair (-500): -100% Combat Strength
    • Depressed (-499 to -400): -75% Combat Strength
    • Sad (-399 to -300): -50% Combat Strength
    • Upset (-299 to -200): -30% Combat Strength
    • Grumpy (-199 to -100): -15% Combat Strength
    • Neutral (-99 to 99): No change
    • Good (100 to 199): +15% Combat Strength
    • Happy (200 to 299): +30% Combat Strength
    • Elated (300 to 399): +50% Combat Strength
    • Blissful (400 to 499): +75% Combat Strength
    • Ecstatic (500): +100% Combat Strength
  • The AI no longer receives Homesick penalties. This is a temporary fix until I have a better understanding of how to control the AI through Lua. As a result, it no longer gains free Mood from the game's Difficulty Level.
  • The AI now gains bonus Loyalty per turn based on Difficulty Level. This may be altered in WFTWGameDefines.xml, under the row name "AI_MG_LOYALTY_BONUS_PER_TURN". It accepts decimal values, and will round down if the final value is a decimal after being multiplied by game difficulty.
  • Familiars now become Witches after 25 turns, instead of 30 (on Standard speed). This number has also been moved to WFTWGameDefines.xml under the row name "FAMILIAR_CONVERSION_TO_WITCH_TURNS".
  • Fixed an issue with AI handling of Homura's Time Stop which would cause her to perform the action before the start-of-turn routines for handling the effects would be processed. This would cause her turn of time stop to decrement on the turn she activated it. In other words, this would cause an AI's Time Stop to have no effect on units.
  • AI Homura Akemi will now use Time Stop if it is within 5 turns of completing a World Wonder.
  • Fixed issue with Time Stop's action button displaying incorrect text after it was used.
  • If you are frozen by an enemy Homura's Time Stop, new Units you create will have 0 movement, until the Time Stop wears off. (The initial plan was to prevent Cities from building or training anything during stopped time. However, this would cause signficant frustration due to it forcing City build queues to be emptied with each time stop, so the idea was dropped.)
 
Good evening and apologies for returning again so quickly, but there seems to be a problem with the Vacation bonus not dissapearing with the Pleiades Saints, but the "Not had a vacation in a while" negative still appears and since I can't make her take a vacation it ends up getting to something like -500 while my Vacation bonus is only +40. (And yes I'm using the Community Patch)

I again apologize if there is a dedicated bug reporting thread of some sort somewhere around. I'm uncertain if this affects other nations since I usually play as Demon Homura.

I would like to add that upon further testing the soul gem levels also seem to freeze after a while, and that the mood bug is reoccurring after some turns.
 
Top Bottom