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

War and Peace

Discussion in 'Community Patch Project' started by psparky, Feb 22, 2019.

  1. psparky

    psparky Chieftain

    Joined:
    Feb 24, 2011
    Messages:
    339
    Gender:
    Male
    1. Playing with a version almost a year old. I added a symbol and count to the UI to show when war was locked and the remaining duration. You can tell by taking to the leader and if the Negotiate Peace button is missing then it's locked, but I find this more convenient.

    What I'm seeing is that sometimes a civ that I've been at war with for a few turns will suddenly become locked for a further 15 turns. It's as if they are able to trade to declare war when they are already at war. Is there some mechanism where that should be happening? If so, I need to remove the count from my display I guess. If not, is it useful to report this on github when the game version is so old? Also, can anyone reproduce this with the latest version (when war is declared and not initially locked make a note, then check, say, 10 turns later to see if it became locked in the meantime)?

    2. This is also with the old version, but it looks the same in a more recent version (12-18). My game is bogged down with constant wars. My three neighbours each declare war soon after the last treaty expires. The timing is such that I'm always at war with at least one of them. I don't want to get too aggressive with them as I want to be friends with civs on other continents and warmonger score seems crucial in this. Any tips?

    Anyway, I was thinking, does it make sense that wars are locked for 15 turns but peace only lasts 10 turns? I thought maybe reduce lock to 12 turns and increase treaty to 15 or 20. Any thoughts? I looked at how I could change this and it appears that peace treaties already should be 20 turns according to the sql define (I raised an issue for this).
     
  2. Cat-du-fromage

    Cat-du-fromage Chieftain

    Joined:
    Nov 17, 2018
    Messages:
    67
    Gender:
    Male
    I'm all in! I like the the idea of the ui, how many times did I create a diplomatic incident thinking I could help someone for a war when the peace treaty was still on XD.
     
  3. vyyt

    vyyt Chieftain

    Joined:
    Jan 28, 2005
    Messages:
    1,538
    Location:
    Czech Republic
    Did you conquer a city? I think the war was locked for some set number of turns after conquering a city in the ancient times of VP. It is more dynamic in the current versions, e.g. AI will sue for peace even after they lose a city when they see their situation is hopeless.
     
  4. psparky

    psparky Chieftain

    Joined:
    Feb 24, 2011
    Messages:
    339
    Gender:
    Male
    Cat, I could give the code fragment that I'm using if you are interested. You would need to edit it into your version of NotificationPanel.lua - oh and it's for the EUI version. However, you can see the information by mousing over the 'war' symbol on the leader in any case.

    Vyyt, I hadn't conquered any cities in the wars that became locked after initially not being so, but thanks for the suggestion.
     
  5. civplayer33

    civplayer33 Chieftain

    Joined:
    Sep 11, 2017
    Messages:
    586
    I'm also interested in that code; even seems like a nice UI addition for VP in general, as I've often felt that this info should be more easily accessible and started writing down the turn numbers of DOW on me since those are not recorded anywhere, it seems.
     
  6. psparky

    psparky Chieftain

    Joined:
    Feb 24, 2011
    Messages:
    339
    Gender:
    Male
    This is my current code:

    Code:
                elseif isAtWar then
    -- afw                instance.Gold:SetText( "[COLOR_RED]" .. L("TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_WAR") .. "[/COLOR]" )
                    local peace = player:IsWillingToMakePeaceWithHuman(g_activePlayerID) -- afw
                    local lockedWarTurns = g_activeTeam:GetNumTurnsLockedIntoWar( player:GetTeam() )
                    local enemyTeam = Teams[player:GetTeam()]
                    local enemyLockedWarTurns = enemyTeam:GetNumTurnsLockedIntoWar( g_activeTeamID )
                    local lockedTurns = math_max(lockedWarTurns, enemyLockedWarTurns)
                    instance.Gold:SetText( (lockedTurns>0 and "[ICON_LOCKED]"..lockedTurns or "") .. (peace and "[ICON_PEACE]" or "[ICON_WAR]") .. g_activePlayer:GetWarScore(playerID) )
                else
    
    If you search for the second line (that I commented out with --afw ) you should see where it goes.

    Instead of the word "WAR" you get a war symbol followed by the latest calculated war score (only gets updated at start of turn and if you talk to the leader). If the civ is prepared to negotiate peace the war symbol turns into a peace dove - but beware, sometimes they won't make peace until the next turn. If it shows the war symbol they never make peace - saves on talking to them every turn to see if peace is possible.

    If the war is locked you also get a lock symbol and a turn count before the war symbol.
     
    vyyt, ryanmusante and civplayer33 like this.
  7. HorseshoeHermit

    HorseshoeHermit 20% accurate as usual, Morty

    Joined:
    Apr 5, 2013
    Messages:
    1,270
    Location:
    Canada
    Removing a button from a screen creates misclicks. Not a great implementation.
     
  8. psparky

    psparky Chieftain

    Joined:
    Feb 24, 2011
    Messages:
    339
    Gender:
    Male
    Not sure what you are specifically referring to here, but I'd certainly accept that my code is not a shining example of software engineering :mischief: Use with caution!
     
  9. civplayer33

    civplayer33 Chieftain

    Joined:
    Sep 11, 2017
    Messages:
    586
    Your code seems fine, I think he's just confused. The missing peace button for negotiated wars is part of VP and has been for some time now, so this isn't the thread to comment about that; he probably thought that you implemented some feature like that, which you didn't since your code only changes the displayed text.
     
  10. psparky

    psparky Chieftain

    Joined:
    Feb 24, 2011
    Messages:
    339
    Gender:
    Male
    Returning to the original issue, I've identified what causes a civ that I've been at war with for a few turns to suddenly become locked for a further 15 turns. It happens if the civ agreed to declare war in 10 turns time, then declared war anyway before the time expired. When the time does expire, the existing war becomes locked for 15 more turns. Personally, I don't think it should work that way - do people think it's an issue worth raising?

    In any case, it's contributing to the situation where I'm constantly at war with one or more of my neighbours, which is sucking the fun out of my game. The wars are fairly pointless - they do very little damage to me and I'm not interested in attacking them. It just makes the game very slow to play. I tried quite hard to make friends with one of them in the early game, giving favourable trades, sending trade routes and converting them to my religion (which they liked), but they still became friends with my enemies and keep warring on me.

    Do you think 15 turns is too many for locked (co-op, traded) wars when playing at standard speed? The number isn't game speed dependent BTW. I'm considering changing it for myself, but would be interested to hear arguments for leaving it as is. Specifically, I'm thinking of changing both this and the peace treaty duration (at standard speed) to 12 turns. More Peace, Less War!
     
  11. civplayer33

    civplayer33 Chieftain

    Joined:
    Sep 11, 2017
    Messages:
    586
    I don't think it's a problem, personally, though I also wouldn't object to lowering it to 12. I kinda don't think it should be game speed dependent, though, since there are basically two different "speeds" in the game IMO, which is the speed at which the artificial time progresses (tech, eras, social progress, infrastructure) and the speed at which tactical engagements progress. The latter isn't affected that much by the former and it also depends on map size; this is why I like playing on Epic, because it makes the two speeds more plausible with respect to one another; Marathon is probably closest to a real "synchronization", though a speed even slower than Marathon would be best, but of course that means games go on forever and so that's not an option.
    Long story short, while some slight scaling might make sense, I don't think it's super important or even warranted to make it dependent on game speed.
     

Share This Page