My website just hit its quota limit (free hosting that i need to upgrade to a paid service), so here's two relevant screenshots i uploaded here:
What a (medium sized) game map tend to look like after a few hours (each color = one faction). With the default settings they start with a 3x3 cluster which is considered their home system, the rest of the map is considered unexplored.
[sharedmedia=gallery:images:5019]
Factions decide what sector to invade / colonize based on the resources it can produce compared to what a faction already has. Solar energy (if there's a sun), one/multiple ores if the sector has asteroids. raw resources are gathered by factories then transformed into more useful stuff (trading wares, ships parts, stations parts) by others. It also take the military cost of the operation into account. Clusters of sectors are more resource packed than lanes, and as you can see blue is rushing to take that from orange in the top right corner.
The actual diplomacy screen showcasing some positive diplomatic modifiers. If you've played Civ4, you can guess the rest.
[sharedmedia=gallery:images:5025]
The "neutral (friendly)" thing is indicating in fact that the faction is neutral toward us, and that it doesn't see the player as a threat either because their fleet largely outclass ours (otherwise it would be written neutral or threatened) or because the player hasn't reached the point where he become a faction on his own. Actual strength of the modifiers depend on the faction (on a data level). Pirates for example don't care much if you blow up a few of their ships. "Accidents" happen between friendly factions at the unit AI level, when for example a ship is transporting stuff considered illegal by one of them, police may (or may not) intercept it causing a small diplomatic hit "you blow up our ship (-2)" / "you smuggled illegal stuff (-4)". A* pathing tend to counterbalance that so there's no loop of such thing, but if there's too much hostiles on the only other available route, well then it happens.
-
@Alvaro :
Yes that's some really good ideas. I also thought about giving a strong negative diplomatic modifier (with 3rd parties) to strong factions for bullying much lesser ones, so there's at least a negative impact for an action that otherwise would have none when I run the decision making algorithm. Some "good" factions would also refuse altogether to completely raze the home sector cluster of another one, because, well, genocide is not considered acceptable. Now that i think of it, such rules also flesh out the lore of the game, that's good
Otherwise you could end up with diplomatic actions that make little sense, where the dominant faction helps a weak faction without much justification, or where it becomes too transparent that they are collaborating to keep a healthy ecosystem of factions.
Yes. The most important thing for me is to have a system where the player won't think "ohh this is gamey!" It has always been my design method to avoid artifices. Mostly because being both a coder and a gamer I tend to see right through them myself too quickly causing me to loose all interest in the said game.
When i was designing mods for space games (X3 from Egosoft), for player missions, i never relied on "click me to spawn 10 targets out of thin air" scenarios, instead I used targets that were existing in the game. If faction X ask the player to kill something from faction Y, the thing in question had really caused some damages. That's a philosophy I'd like to keep when dealing with diplomacy and war too.
-
@LorenzoGatti :
The major problem I see in this description of diplomacy is that most of it consists of arbitrary abstractions and ritual behaviour and it doesn't lend itself to translation into rules and game theory (which you need to have an AI that reasons in meaningful ways).
I do not necessarily agree, In the real world maybe (and even then) but in a game not so much. With a well structured enough system (and that's the system I am trying to determinate), each diplomatic action has pro and cons for the well being of the factions. Trade agreements mean more money for both so they can build more infrastructure. Selling sectors avoid greater material loss at the hand of an enemy. And so on. With the right rules and logic it can be quantified. It's no more arbitrary than all out warfare in my opinion.
If factions are interested in their own prosperity (as opposed to hurting themselves to hurt others more, e.g. going to war) they can simply be friendly with everybody: reciprocal trade and passage agreements, occasional fair exchanges of territories for good reasons, massive military alliances [...]
I may have badly worded my post by speaking too much of peace, sorry i was tired i should have known better. Enforcing global peace isn't an issue. going to war neither. Keeping factions somewhat alive is a bit tricky but manageable with a few additional rules. Achieving something that look coherent is my problem, modifiers by themselves help to keep peace or to choose between 2 possible targets, but not much else. Currently when two factions go into an all out war for 3 poor asteroids, they have no reason to stop. If you look at a Civilization game, most of the time they tend to act with a bit of reason, 2 allies don't go at war for petty things, the situation has to deteriorate before they declare war on each other (same goes in reverse), and wars tend to stop when an objective has been achieved.
This said, yes, using a Monte Carlo simulation to find what is an optimal/good agreement between 2 factions is an interesting idea, and I will look into it.
This style of AI would have to evaluate the economical benefit from trade and passage agreements (maybe a Monte Carlo simulation of commerce and travel with and without the agreement) and the best selection and deployment of military forces (maybe more suitable for thorough searching over move trees containing fleet movements, battles etc.).
As a side note, war deployment and AI is already written. The defensive part works with a basic but effective algorithm that sort owned sectors by strategic value, then for each of those sectors send enough ships to defend according to its "menace" value (how strong are hostile fleets at the borders) until all defensive military ships are assigned. The most important sectors are adequately defended, the lesser ones not so much, but given the usual map layout, there's not that many points of entry into a territory anyway. The offensive part check the current defenders of the sector + what can join + some margin if available. A faction AI won't switch into war mode if it hasn't roughly enough forces. But between the obvious disadvantage of entering a sector from a singular location not exactly simultaneously to fleet strength estimates being, well, estimates, the attacker doesn't always win.
-
Um, "rubber duck problem solving" theory in action. I completely overlooked the "war weariness" factor used in Civ and other 4X games.. The longer the war and the bigger the strength difference between 2 warring factions the higher it would be. This rule could reduce factories output and money generation mechanism of the aggressor. It's not a solution for everything, but it would at least give a reason to end a war that's going well military speaking without relying on purely artificial reasons.
Thank you both