starting at war
Moderator: Oberlus
starting at war
Say, thought I'd mention, I much prefer changing EmpireManager::ResetDiplomacy() so it starts us all off in a state of war. I know the player can go ahead and declare war on the AI's right off anyways, but it seems to me they ought to start off at war with each other also Perhaps there should be a checkbox in the galaxy setup dialog to specify if all the players start off at war or peace.
I expect I'd be able to write up the code for a starting_war checkbox if it's something that would be desired. What do you guys think?
I expect I'd be able to write up the code for a starting_war checkbox if it's something that would be desired. What do you guys think?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: starting at war
When diplomacy gets more interesting, it might make more sense to start at peace, but for now I don't object to defaulting to at war. Alternatively, the AI scripts could be modified to declare war on the player when they meet, or when they want to attack.
Re: starting at war
If you just want the AI empires to declare war on everyone, you could do something like the following:
Code: Select all
def declareWarOnAll():
my_emp_id = fo.empireID()
for emp_id in fo.allEmpireIDs():
if emp_id != my_emp_id:
msg = fo.diplomaticMessage(my_emp_id, emp_id, fo.diplomaticMessageType.warDeclaration)
fo.sendDiplomaticMessage(msg)
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: starting at war
Something should be done, as I'm presently getting this in the AI log files:
Code: Select all
2012-09-23 12:32:51,742 ERROR AI : InvadeOrder::ExecuteImpl given planet owned by an empire not at war with order-issuing empire
Re: starting at war
this simplest change is to modify EmpireManager::ResetDiplomacy() -- it is only called at the start of a game so establish diplomatic status across the board. Changing line 256 of EmpireManager.cpp to refer to DIPLO_WAR instead of DIPLO_PEACE does the job.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: starting at war
I don't think a check-box is warranted. The player currently can easily change the diplomatic state in game.Dilvish wrote:Perhaps there should be a checkbox in the galaxy setup dialog to specify if all the players start off at war or peace.
Starting at War is probably a bit more interesting, though not hugely significant. (see previous sentence)
Re: starting at war
The player can set themselves to war with the AI's, but currently has no way to make them war each other, and they currently suffer from incompetent diplomats. As Geoff noted above, the current status of AI warmongering seems to lead to them wasting effort trying to wage war while still actually at peace. Until someone revamps the AI diplomacy code, seems starting all at war would be best (or at least, there's a non-trivial reason to give the player a way to force that).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: starting at war
Good point, i missed that in your first post.Dilvish wrote:...but currently has no way to make them war each other...
Re: starting at war
Why not just add a few lines to the python AI scripts letting the AIs declare war on everyone? Unless you start a multiplayer game, this has everyone at war with everyone. Quick, easy, and should be sufficient for the time being...
Re: starting at war
Wouldn't it result with a spam of something like "[UNKNOWN] empire declares war on you!"? I don't know if diplomacy goes to SitRep yet, but...Vezzra wrote:Why not just add a few lines to the python AI scripts letting the AIs declare war on everyone? Unless you start a multiplayer game, this has everyone at war with everyone. Quick, easy, and should be sufficient for the time being...
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: starting at war
AFAIK empires are never "unknown". See the empires list at the start of the game; your client has the info.em3 wrote:Wouldn't it result with a spam of something like "[UNKNOWN] empire declares war on you!"?
Re: starting at war
Geoff is right, all empires "know" each other right from the start. I've actually already tested the little script I've posted, works like a charmem3 wrote:Wouldn't it result with a spam of something like "[UNKNOWN] empire declares war on you!"? I don't know if diplomacy goes to SitRep yet, but...Vezzra wrote:Why not just add a few lines to the python AI scripts letting the AIs declare war on everyone? Unless you start a multiplayer game, this has everyone at war with everyone. Quick, easy, and should be sufficient for the time being...