Announcement

Collapse
No announcement yet.

The revised Diplomacy Model: Coding Discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lord God Jinnai
    replied
    Originally posted by LDiCesare
    I can set a threshold but I'd rather avoid it because the player would see a big difference about being at 74% or 75% for instance.
    Thresholds are never imo good ideas for these type of things just because of what you mentioned.

    Leave a comment:


  • LDiCesare
    replied
    Having a moderately aggressive civ fight only if the other looks weaker is a nice idea. Done:
    if (aggressiveness*strength[i] > 2*strength[j])
    enemies = true;
    There will be a fight if the sum of aggressiveness id >=1 (1=100%). If lower, then a civ with 66% aggressiveness will fight if its strength is 3 times that of the opponent, one with 33% will fight if its strength is 6 times that of the opponent. I can set a threshold but I'd rather avoid it because the player would see a big difference about being at 74% or 75% for instance.

    Leave a comment:


  • Lord God Jinnai
    replied
    Originally posted by LDiCesare
    Thinking about it a bit more, I think that the foreign policy would fit the bill quite well: If the sum of both civ's foreign policies is 1 or more (aggressive) then they fight, otherwise they don't. What do you think of this?
    This would be the way I would go, but with a 3rd mode.

    If the sum of both civs' aggresiveness is 1 or more (aggressiveness) they fight; or

    If one civ's aggressiveness is max (or maybe close to maxed) or more they fight; or

    If one civ's aggrssiveness is 1 or more (reguardless of the other civs) and the strangh of that civ's unit is 2x that of the other civ's; or

    else they don't fight.

    X = a fairly high number...atleast 75 maybe higher.

    Leave a comment:


  • LDiCesare
    replied
    Delay for treaties: The treaty will only take place on next turn. That's the way units work: You give them orders, and then when you hit next turn things change. I must rewrite some code but that's a good way to do it, though the ai will be a bit harder to implement.

    I would say both sides get a chance to call off hostilities.
    Yes, but how do you present that info to the player? My issue here is that we'd have to popup a warning and ask the player whether to call off hostilities in the middle of a turn, which is a bit annoying for me, as I'd have to prevent all other actions from being performed at that time. It's possible but bus may easily creep in if I make any listake therein. Besides the coding issue, which is only my problem after all, contact means the units act on their own until they are given orders. Another way, without popup would be to set a preference in some screen, and decide of the attitude of units confronted to unknown civs: Fight or Hold. Thinking about it a bit more, I think that the foreign policy would fit the bill quite well: If the sum of both civ's foreign policies is 1 or more (aggressive) then they fight, otherwise they don't. What do you think of this?

    Leave a comment:


  • Lord God Jinnai
    replied
    Originally posted by LDiCesare
    I'm coding Contact. This is what happens when you haven't signed a peace treaty, war or alliance (well, war is not a treaty but you get the idea).
    Units of 2 civs with contact will fight one another in neutral territory. That means it's effectively war except the civs don't actively fight one another, and won't claim territory. I'm unsure how it plays out though.
    I would say both sides get a chance to call off hostilities. I'm not sure which would go first though, but if neither side attacks both units can occupy the same area. If one side decides to initiate combat, then it would go to normal combat. This wouldn't cause a war or anything, but it would lower relations between both civs and might also lower relations for the agressor with other various civs depending on how reputation is coded.

    Leave a comment:


  • alms66
    replied
    I know I suggested this before, and in much greater detail than I'm about to post, though I'm not sure where, and don't have the time to look it up at the moment...

    Diplomacy in Civ-like games has always been instant. When a treaty is proposed, it is either immediately accepted or not. This is a horrible way to conduct diplomacy. When a treaty is proposed, it should be named (CivA-CivB Treaty 1 - assuming it's the first treaty, otherwise the number follows the set progression), but not take effect until the following turn (at a minimum - and we should enforce this now but get a little more fancy later, incorporating tech levels and whatnot). The name should be able to be changed by the player, and is useful for tracking existing treaties (the player can pull up a list of all existing treaties or all existing treaties with a certain civ - as well as all proposed treaties). The reason for not taking effect until the following turn is to have a delay which grants players enough time to cancel the treaty before it takes effect. The reason to have a delay is that there have been countless times in civ2 and civ3 (and I suppose the few times I've played civ4 as well) that I can recall accidentally hitting the wrong response and signing a treaty I didn't want - and I know I'm not alone in this. For example, in Civ the "please accept this gift" and "what will you trade for this?" buttons are easily jumped between with just a slight movement of the mouse.

    Leave a comment:


  • LDiCesare
    replied
    I'm coding Contact. This is what happens when you haven't signed a peace treaty, war or alliance (well, war is not a treaty but you get the idea).
    Units of 2 civs with contact will fight one another in neutral territory. That means it's effectively war except the civs don't actively fight one another, and won't claim territory. I'm unsure how it plays out though.

    Leave a comment:


  • alms66
    replied
    Originally posted by LDiCesare
    As for embassies, I don't know. Emissaries have been important historically and more common than embassadors. I'd like emissaries and embassies to allow for the same options, but embassies would provide some bonus in terms of trust and spying. I haven't thought much about embassies or the benefits they could provide.
    My mistake. I meant that sending the first emissary established formal diplomatic relations and unlocked the clauses. At this point, the clauses will forever be available with that particular civ. But an embasy, as you said, would provide extra benefits - not extra clauses. However, you have to know where the nation is by seeing it or having the knowledge of it's location (maps from another civ) to send that first emissary.

    Originally posted by LDiCesare
    I also think that units should be allowed in certain circumstances to battle in neutral territory without being at war. This would require a new kind of treaty between peace and war. If you find a good name for it, I'll code it .
    That's what Contact is. You are not at war or peace. You can cancel a peace treaty without declaring war on another nation. A peace treaty, afterall, is just a guarentee that we will not invade - just removing the guarentee doesn't mean that you've declared war.

    Originally posted by LDiCesare
    Of notice too, right of passage exists. The ai, when it sees your units into its territory, will either propose a right of passage or declare war.
    This is good to know.

    Leave a comment:


  • LDiCesare
    replied
    I just coded the fact that seeing someone else's borders triggers contact, and peace by default. I agree that meeting units should trigger some kind of contact too.
    As for embassies, I don't know. Emissaries have been important historically and more common than embassadors. I'd like emissaries and embassies to allow for the same options, but embassies would provide some bonus in terms of trust and spying. I haven't thought much about embassies or the benefits they could provide.
    I also think that units should be allowed in certain circumstances to battle in neutral territory without being at war. This would require a new kind of treaty between peace and war. If you find a good name for it, I'll code it .
    Of notice too, right of passage exists. The ai, when it sees your units into its territory, will either propose a right of passage or declare war.

    Leave a comment:


  • alms66
    replied
    In civ, when you meet another civ's unit, contact is established with the other civ and all diplomatic options, available at your tech level, are then at your disposal. I do not believe that it should work this way. Contact should be made at this point, yes - you know of the civ and are not at war or peace with it (in fact I'd say your units should be able to do battle without triggering war at this level). Though, at contact level the only treaty clauses available to you are "peace" and "war" until you establish formal relations. Formal diplomatic relations should only be possible once you have "seen" the other nation's border. You have to have been there either with a unit or an emissary. Sending an emissary is not the same as establishing an embassy, it simply unlocks the clauses of diplomacy and allows you to establish an embassy. Establishing an embassy is the next level in diplomatic relations and shows much more goodwill and trust than diplomacy by emissaries alone.

    Leave a comment:


  • Lord God Jinnai
    replied
    Originally posted by alms66
    Score/rank, whatever you want to call it, and whatever numbers you want to use is fine, just so long as a player/AI can quickly tell who is #1 and what their position in the world is. It's may not be historically accurate to have that sort of immediate information available, but it's the sort of information players will demand - plus it greatly helps increase the AI's performance. I can agree with spending skewing the accuracy of the results, but their should always be results. Even in ancient times kings would pay poor people of neighboring kingdoms to join the army of that kingdom and, for a few measly gold (to a king), get information on the enemy/neighbor's army in the region. Do this two or three times, and you could have very accurate information on a kingdom's forces.
    Well it should cost something then. A few gold coins here, a few there, plus toll fees and whatnot, and it starts to add up. And this should take atleast on turn (it can be accurate for that turn. That might be asking a bit too much realism otherwise).

    And not give information on any nation you don't know about or really any nation you don't have continuous contact with. It doesn't have to be friendly contact, just continuous.
    Originally posted by alms66 Isolationism sounds like a good misc. variable to track. IMO, that's almost always dependent on the ruler, rather than the civ, but once started a traditional civ might continue with the isolationist policies, even when the leader that started it is gone. That's probably too much nuance for the first run at diplomacy, since the characters model needs to be coded for that.
    I can understand that.

    Leave a comment:


  • alms66
    replied
    Score/rank, whatever you want to call it, and whatever numbers you want to use is fine, just so long as a player/AI can quickly tell who is #1 and what their position in the world is. It's may not be historically accurate to have that sort of immediate information available, but it's the sort of information players will demand - plus it greatly helps increase the AI's performance. I can agree with spending skewing the accuracy of the results, but their should always be results. Even in ancient times kings would pay poor people of neighboring kingdoms to join the army of that kingdom and, for a few measly gold (to a king), get information on the enemy/neighbor's army in the region. Do this two or three times, and you could have very accurate information on a kingdom's forces.

    Isolationism sounds like a good misc. variable to track. IMO, that's almost always dependent on the ruler, rather than the civ, but once started a traditional civ might continue with the isolationist policies, even when the leader that started it is gone. That's probably too much nuance for the first run at diplomacy, since the characters model needs to be coded for that.

    Leave a comment:


  • Lord God Jinnai
    replied
    I also think a variable for a particular nation based on past instances should be used. FE: If you've always lost to Civ A in a war, then this should be reflected in diplomacy.

    Also how Isolationist you are should be in there.

    I do not agree with a ranking sytem, atleast as you currently propose it. Some of that isn't exactly very low-level espionage ability in certaine eras.

    Leave a comment:


  • LDiCesare
    replied
    I generally agree with attitude variables, but I don't like rankings. I would rather get a score system than a rank system, but even then, the perceived score (military might:1000) is something that would depend on spendings.
    The current system I have keeps track of all values of a civ that another civ saw, but doesn't extrapolate in time. I mean: Economic value of a square is known if the square is seen. If it has been seen once, then the value is know, and an extrapolation can be made, which, averaged over all squares, provides the economic value of a given civ.

    Leave a comment:


  • alms66
    replied
    Diplomacy AI

    I'm just writing to get some discussion on how to handle the diplomacy AI. To have any sort of realism and intelligence in diplomacy, you're going to have to track several "attitude" variables, in addition to ranking variables and a few other misc. variables. Some will need to be tracked locally by each civ, some globally for all AI civs to use, and some tracked both locally and globally

    Attitude Variables
    Attitude variables are used to measure the AI's “feelings” towards other civs. The variable names are pretty self-explanatory. Following are some obvious ones:
    Generosity
    Aggressiveness
    Trustworthiness
    Loyalty

    Each AI civ will need to track these for each civ they have contact with. These variables will be biased by the civ in question. For example a non-generous civ will view other civ's generosity less favorably than a civ with high generosity would. Because of the bias, we need to track a “second opinion” as well – that is an unbiased global record of these “attitude” variables. Therefore each civ will store it's own, accurate, global record, with aggressiveness rising for each aggressive action, generosity rising for generosity, trustworthiness lowering for traitorous acts, etc. This will allow CivA, a non-generous civ (which it gets from the global generosity variable it stores of it's own actions), to view another civ's generosity (a gift in diplomacy, for example), less favorably than a civ with high generosity would (i.e. It now sees the gift giver as +1 generosity than it did the turn before, whereas a more generous civ would see the gift giver as +5 greater than the previous turn). Access to the global variables should probably be considered 'low-level' spying by the diplomacy model, and there should be some minimal charge for it. If the AI has contact with only one civ, it should not be able to access (nor get charged, obviously) the global variables, since it knows of no other civ to ask, “Hey, is that other civ loyal? Aggressive?” etc. The human player should have access to these values as well.

    Ranking Variables
    Ranking variables simply give the power level of a civ in a single area. For example, a civ might rank #1 in military, #3 in economy, #9 in unrest, etc. This gives the AI (and players for that matter), a single variable to look at to judge relative differences between civs. If you've ever played a RTS game, you've seen ranking before. These are global variables, tracked once in the game. The number of areas ranked, should be relatively small (Military, Diplomacy, Economy, Technology, etc.), and these ranked areas should also be broken into ranked sub-areas (Military – Air, Navy, Army, etc.). This information should probably be considered 'low-level' spying by the diplomacy model, and there should be some minimal charge for it.

    Misc. Variables
    I've only got one at the moment, though I'm sure there are others I'm forgetting.

    Priorities
    Priority variables are very important to giving each Civ (can be extended to leaders as well) it's own personality. Basically, each civ will start with a set of priorities for each of the Attitude Variables, but they change throughout the course of the game based on in-game conditions. So at the start, CivA might rank Generosity 5, Aggressiveness 0, Trustworthiness 3 and Loyalty 4. This civ would naturally gravitate towards a friendly relationship with civs that share these “values”, or priorities. Priorities will act as multipliers to the bonuses and minuses given as explained under Attitude Variables. These can be, initially, derived from a civs cultural & religious values, sometimes directly, sometimes indirectly.

    Leave a comment:

Working...
X