1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Sengoku-mod - Fedual Japan mod preview/test

Discussion in 'Civ4 - Creation & Customization' started by embryodead, Dec 3, 2012.

  1. PinkPallin

    PinkPallin Warlord Supporter

    Joined:
    Apr 23, 2004
    Messages:
    227
    Location:
    Northern Italy
    I'm a little puzzled: in the text the three clan names are written in liliac, purple and red, but on the mini-map the three territories are shown in yellow, purple and blue. Which one belongs to whom?
     
  2. Opera

    Opera Deity

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    Gender:
    Female
    I assume yellow is whoever the player is, Takeda isn't shown, purple is purple and blue is lilac.
     
  3. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    This is correct (yellow is Oda). Uesugi text color is a bit off because player text colors are generally brighter so that they are more readable. It's the same as on the leaderboard, and it's a BtS setting.
     
  4. AbsintheRed

    AbsintheRed Deity

    Joined:
    Jul 27, 2009
    Messages:
    8,288
    Location:
    Szeged, Hungary
    The new diplomatic advisor looks perfect :goodjob:
     
  5. Matsuda123

    Matsuda123 Prince

    Joined:
    Jan 1, 2012
    Messages:
    440
    Yeah, at first I was pretty lost keeping track of all the clans, but with this, it will be easy.:)
     
  6. Folket

    Folket Deity

    Joined:
    Jan 7, 2010
    Messages:
    4,023
    Location:
    Sweden
    The new screen looks very impressive.

    I see you answered most of my comments. Any chance you want to comment on peace vassaling. At the moment you loose massive honor as you join all their wars. Also having the risk that the vassal will leave you.

    I think it is reasonable to have the honor lost from entering war because of a new vassal to be halved and give peace vassals the same requirements are capitulated for leaving the vassal relationship.
     
  7. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Vassals don't leave because of your Honor. The Loyalty penalty is applied only to retainers (generals) and the check is made only after a lost battle. Generals never leave on their own, no matter how low your Honor is.

    I can't agree because this is entirely under your control. If you don't want to get involved in war with 5+ civs, simply refuse. Reducing the penalty in such case isn't unreasonable, however, OK, though whether I implement it depends on the coding for it. It's not easy to determine past conditions during war declaration.
     
  8. Crossphazer

    Crossphazer King

    Joined:
    Jul 21, 2008
    Messages:
    698
    Location:
    Montréal
    I have to say, embryodead, this is one of the rare mods where even after having accumulated much power, the game stays interesting and challenging, and still keeps me on my toes. Very good job, sir, you've solved the biggest civ problem since the series' inception! I'm also fond of the ways you find to solve some of the new problems that arise, like dealing with the massive number of civs. There's a lot of new concepts to experience in this game. Keep up the good work!
     
  9. Matsuda123

    Matsuda123 Prince

    Joined:
    Jan 1, 2012
    Messages:
    440
    This Mod just keeps getting better. I was wondering, and don't worry about it too much, but after this mod, do ever think you would consider making a Boshin War scenario? It'd be pretty cool to see an industrialized Japan, and I'm looking to see if somepne would make an industrial Asian cityset, so you could use that if you did.
     
  10. Isabelxxx

    Isabelxxx DoaNE Explorer

    Joined:
    Sep 26, 2010
    Messages:
    381
    There are 2 bugs related to XPs given to heroes when they are the defender. The code is looking for a leader unit in the attacker side to apply the rest of the code to the defender which makes no sense. A leader unit defending didn't get any "Hero XP" after victories.

    In CvUnit.cpp, line 1504:

    Code:
    			if (isDead())
    			{
    				int iExperience = defenseXPValue();
    				iExperience = ((iExperience * iAttackerStrength) / iDefenderStrength);
    				iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));
    				pDefender->changeExperience(iExperience, maxXPValue(), true, pPlot->getOwnerINLINE() == pDefender->getOwnerINLINE(), !isBarbarian());
    				// edead: start armies & heroes
    				[B]if ([COLOR="Red"]pDefender->[/COLOR]getArmyID() != -1) [COLOR="Red"]//Isabelxxx: pDefender was missing here (!)[/COLOR][/B]
    				...
    
    And then:
    Code:
    				[B]if ([COLOR="Red"]pDefender->[/COLOR]getLeaderUnitType() != NO_UNIT && iExperience > 0) [COLOR="Red"]// pDefender was missing here (!)[/B][/COLOR]
    				{
    					if (pDefender->isHuman())
    					{
    						pDefender->changeHeroExperience(std::max(1, iExperience * GC.getDefineINT("WARLORD_XP_RATIO") / 100)); 
    					}
    					else
    					{
    						pDefender->changeHeroExperience(std::max(1, iExperience * (GC.getDefineINT("WARLORD_XP_RATIO") + GC.getGameINLINE().getHandicapType() * GC.getDefineINT("AI_WARLORD_XP_BONUS_PER_HANDICAP_LEVEL")) / 100)); 
    					}
    				}
    Apart from that the rest works as intended but.. I have made a minor change to the XP system so any unit within an Army will grant XPs to the leader when winning a battle. Previously it was only when the leader unit won the battle, now any victory by an unit within the army will count.

    EDIT: There is also other bug related to an event:

    Code:
    	<EventInfo>
    			<Type>EVENT_CATHEDRAL_FORTRESS_DONE_2</Type>
    			<Description>TXT_KEY_EVENT_CATHEDRAL_FORTRESS_DONE_2</Description>
    			...
    			<BuildingExtraCommerces/>
    [COLOR="Red"]			<BuildingExtraHappies>1</BuildingExtraHappies>[/COLOR]
    			<BuildingExtraHealths/>
    			...
    		</EventInfo>
    
    and it should be:
    Code:
    	<EventInfo>
    			<Type>EVENT_CATHEDRAL_FORTRESS_DONE_2</Type>
    			<Description>TXT_KEY_EVENT_CATHEDRAL_FORTRESS_DONE_2</Description>
    			...
    			<BuildingExtraCommerces/>
    [COLOR="Red"]			<BuildingExtraHappies>
    				<BuildingExtraHappy>
              				<BuildingClass>BUILDINGCLASS_BUDDHIST_MONASTERY</BuildingClass>
              				<iHappy>1</iHappy>
    				</BuildingExtraHappy>
    			</BuildingExtraHappies>[/COLOR]
    			<BuildingExtraHealths/>
    			...
    		</EventInfo>
    
    Attached here are the source code changes, the required DLL with the 2 bug fixes and the change to the XP system, and the event fix.

    @embryodead: Have you run the mod with a debug DLL through any debugger? The event bug provokes immediately an assert when loading any game and there is also another bug related to trait tags in the XML file which I have not found yet. There are a few more asserts here and there but I have not taken a look at them yet..
     

    Attached Files:

  11. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Thanks for the fixes. I'm not sure about the change, though. It may provide a very easy way for the human player to quickly farm leader XP, but it's a worth testing at least.

    I do it frequently, but mainly for the actual debugger. The original asserts that are left there are mostly harmless/useless, though obviously I might have missed some more valid ones. Some of these Asserts will fire even in an unmodded debug DLL (i.e. the one related to AI gold being >= 0, irrelevant) and the XML ones can fire if you put comments in the XML.
     
  12. Isabelxxx

    Isabelxxx DoaNE Explorer

    Joined:
    Sep 26, 2010
    Messages:
    381
    I have thought the same today, maybe just modifying the percentage of XP would work.

    Leader unit could obtain full XP from a victory and army units would give only 30% to the leader (or something else) instead of full XP rate.

    Other option would be allowing the leader to obtain full XP from victory when an army unit wins, but only once per turn. But that requires adding one variable more to the leader.

    At least in my games, I have to choose between adding promotions which improve the leader unit, improving leadership capabilities or improving the bonuses given to the army units. Note that the 2º path is needed for the 3º path, but most times I can not get both..

    On the other side I have seen the AI having super-heroes with too many promotions.

    That's why I added that change, it makes no sense that you spend all your XP to improve the bonuses given to army units and then you don't get anything from them.
     
  13. Isabelxxx

    Isabelxxx DoaNE Explorer

    Joined:
    Sep 26, 2010
    Messages:
    381
    Ok, here it is my 2º approach.

    Added a new global define to configure the XP ratio given by Army Units to the leader (independent of the Warlord/leader XP Ratio), so now everyone can just enable/disable that feature or configure the ratio to anything.

    But now there is a new problem, XP points are integers! In fact the warlords ratio you added to the code did nothing... it takes the max of 1 or the experience*ratio/100, and the first term is always the greatest. The warlord ratio had no use at all. The same for my added ratio, I put 25% but it always gives 1 XP to the leader.

    So... I rewrote the XP hero system and now saves decimals in other variable. Everytime XP are less than one after applying the ratio (or < 100 without dividing by 100), that quantity is saved for future use.
    When the stored quantity reaches more than 100, the hero promotes.
    This applies to any XP gained in battle by the Hero, with either the leader unit or army units.

    In other words, ratio now works as they should be. (this could be used for standard units too, but I left the XP system of standard units)
     
  14. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    But it does work and I don't think decimals are really necessary. Of course for 25% it will always be 1 because XP given for combat is 1-4. With my default Warlord XP ratio of 50%, the XP given to warlords is 1-2. Works exactly as intended.

    To be honest I'd rather not complicate things further by adding decimals to XP. It's not just the matter of code, but relevance and complexity. Adding a further 50% penalty for army units simply limits the default hero XP from non-leader army units to always 1, which is fine by me. The player just expects to receive XP, he doesn't need know or care that he "should" have received 0.5 and the code behind it rounded it up.

    For that matter, XP already works this way in Civ4 i.e. you 1-4 XP for victorious attack and 1-2 XP for defence, there's no 0.5.
     
  15. Isabelxxx

    Isabelxxx DoaNE Explorer

    Joined:
    Sep 26, 2010
    Messages:
    381
    In fact the code is now cleaner, really. Anyway, maybe I did not understood your previous post (?) but your statement about complexity is true.

    Non-leader army units will always give 1 point, that's how it works at 25%. But you said it was too much, and it could be true.
    Leader units also give 1 point most times with 50% ratio. Only in some exceptional situation it would give 2 points (that's the key, I wouldn't care about that anyway). In fact, most times, there is no real difference between using the leader unit or non-leader units and any player would prefer to not use the leader unit if possible with this system.

    That's why I wanted to make the ratios works as they should be.The only disadvantage is that adding the variable made previous savegames unplayable. I also fixed that by making the decimal part equal to zero by default if no data can be loaded from the savegame, so the system starts working at that point.

    I do prefer this but that's my opinion. Regular users would want what you say, but consider that now it's fully configurable with the addition of the new ratio and therefore it could work without the decimal part.

    If you wanna, I could simply add an option as global define to enable/disable the way the ratio works, this way (with decimals) or by rounding to 1 whenever the XP is less than one (as default). Of course, that's if you are interested in all this as a new option for the mod ;)



    Or I could throw all this and consider the other possibility which seems simple. The leader will get XP from the units only X times per turn. Where X could be one or something fixed. Or something variable according to the leadership capability.
     
  16. Isabelxxx

    Isabelxxx DoaNE Explorer

    Joined:
    Sep 26, 2010
    Messages:
    381
    This version adds 2 things:
    • Non-leader units give XP to the hero, configurable with a global define in XML. When XP*ratio < 1, then 1 XP is given (as before).
    • Leader can obtain XP from the army units only a limited number of times = Leadership capability/2. So leadership 2 gives the opportunity to obtain XP from 1 army unit per turn.
    • Times a leader has get XP from the army this turn is saved in save-games. It resets to zero every turn.
    • This versions has a change which makes it -in theory- not save-game compatible, but I have added a solution for that.
    • There is no other difference with the previous version, includes the bug fixes et all.



    Copy all to the sengoku mod folder in BTS. You can either play a new game or continue your old save-game. Note the last requires some steps to works due to this patch not being save-game compatible.

    1. Load any save-game made with the mod previous to this patch.

    2. Make a new save-game and exit from BTS.

    3. Edit "SAVE_VERSION" Global define:
    Go to:
    ...\Sengoku\Assets\XML\

    And open the file:
    GlobalDefinesAlt.xml

    Look for the global variable:

    Code:
    	<Define>
    		<DefineName>SAVE_VERSION</DefineName>
    		<iDefineIntVal>[COLOR="Red"]302[/COLOR]</iDefineIntVal>
    	</Define>
    And change it to 303:

    Code:
    	<Define>
    		<DefineName>SAVE_VERSION</DefineName>
    		<iDefineIntVal>[COLOR="Red"]303[/COLOR]</iDefineIntVal>
    	</Define>
    

    Now you can play as usual with you new save-game, but old save-games will give errors. If you want to play other save-game made with an older version of the DLL, just revert the global variable to 302 and perform again all the steps.
     

    Attached Files:

  17. Silver_wizard

    Silver_wizard Chieftain

    Joined:
    Mar 8, 2009
    Messages:
    52
    Location:
    Netherlands
    After playing a game as the Uesugi (early start), i have a few comments:

    I really like the ability to obtain loads of vassals, currently i control most of Honsju, with only owning 14 cities outright, however, this playing style has it's drawbacks.

    First of all, with all these vassals having an army of there own they do what they could be expected to do in war-time: fight the enemy and conquer cities. While this is not a bad thing per-se, sometimes a city ends up being owned by someone else than intended. (I prefer vassals to be somewhat contiguous). Fixing this by dispossessing and then granting it to the intended recipient does not always work. You cannot grant a city to any random vassal and creating new vassals is not possible this way.

    Secondly: subduing a small clan can be difficult because of the "Surely, you must be joking" response.

    Now the solution to these two problems is simple. To fix the first you have to send in a huge ashigaru army and overwhelm the enemy before your vassals get there. To fix the second you have to send in a small elite samurai army that kills off the enemy without significant losses. These two solutions are mutually exclusive. Sending in an large samurai army isn't an option since most of the land we control is owned by a vassal.

    It would be nice to have (as shogun) the possibility to enact a few measures for all of your vassals such as prohibiting Christianity and outlawing firearms.

    Now i don't know it this is historically correct (and don't do this if it isn't), but what about some vassals uprising after the death of their master?

    Perhaps it would be an idea to convert the calendar to the Japanese one?
     
  18. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    @Isabelxxx
    Thanks. I'm not sure if I'll do it that way, but I'll think about it later - currently I'm having RL issues and haven't been able to mod at all. Currently it's just 1 XP on my working copy but I didn't test it or anything. One note, however - at this point of development I'm not concerned about savegame compatibility. There are other changes coming that break savegames, and there will be more later.

    @Silver wizard
    The code for creating new vassals and giving them cities is really complicated and full of hacks. In-game workarounds are fine, but I can't really make it completely "free" to manage as you want.

    About subduing: this is correct and realistic. You can convince some weaker clans to join, others won't surrender and have to be destroyed.

    You don't play as shogun - when you become shogun, the game ends :) Masters forcing their vassals' religion is OK, but can be done through diplomacy.

    Vassal uprising - it's in, actually, but only as a single historical event. It's rare - for this to happen AI Oda Nobunaga must successfully capture central Japan and die (Historical setting helps obviously). Depending on the situation several new clans may be created: Toyotomi, Akechi, Maeda, Shibata. Making it a generic event would be extremely difficult and crippling for the AI, so I'll probably leave it that way.

    Japanese calendar is already in-game but turned off (You can see it when your leader dies though, in the popup text). There are two problems with it:
    1. it's unfamiliar to pretty much everyone and non-linear, so it's difficult to track game progress
    2. Japanese calendar uses important historical events (like change of emperor or big wars) for eras and year numbering, therefore the actual calendar is simply wrong because it doesn't match in-game events; it could be made to match these events, but then it would be a made-up calendar...
     
  19. Jennvare

    Jennvare Prince

    Joined:
    Jan 10, 2010
    Messages:
    371
    Embryo,

    I hope you haven't give up on this mod. I finally got a machine that can handle it. Hope you have more updates coming.

    A couple of things I noticed;

    You cannot remove forests to make other improvements. When so many building structures require a castle or castle town, it's hard to get a city to size six to make it. I would like to be able to clear a forest and build a farm to help the city grow, a cottage to help with economy/research, or simply to use the trees as a means of quick production. (It was mentioned in an earlier post that someone would cheer when they got a random event that burned down a forest so he could build another improvement.)

    The other reason I like to remove forest is to keep the enemy from having more defense bonuses. In a couple of games, I got stymied because an invader would place his stack on a forested hill outside one of my cites. Stay there long enough, he gets fortified bonus. If there were promotions a unit could get that combat this, atleast that would be something.

    Combat Odds - I will need to play more games to check this, but first impression tells me the odds are not calculated correctly. I have had too many instances when I would have an 80% chance of victory with successive units; and not only would they lose, they didnt even hurt the defender!

    Cavalry - is there a national limit on all cavalry? With the Ashigaru, you can make tons of these if you so choose, but they are archery/melee units. Is there a cavalry unit like this?

    Medic units - I noticed that only your daimyo, great generals, and retainers are the only ones that can get the medic promotion. Would it be possible to add a purely defensive unit that has medic already? Where generals are hard to come by and tend to expire quickly, these can be very helpful especially when you are under durress.
     
  20. Folket

    Folket Deity

    Joined:
    Jan 7, 2010
    Messages:
    4,023
    Location:
    Sweden
    I'm not speaking for Embryodead I just wanted to give my view on your comments.
     

Share This Page