Shutdown windows process (AI client) if defeated
Moderator: Oberlus
Shutdown windows process (AI client) if defeated
Hi all,
I searched for the topic, but I found nothing accurate...
Currently I am playing 500 stars 20 AI and I am running into performance issues, because I only have a medium sized system.
I found that each AI client has its own windows process.
So I had the idea not to attack them parallely.
I thought if I would kill them completely one after the other, I would get some free computer resources again.
But I saw that the AI client remains as windows process, even if AI empire is completely defeated.
For my big game this means around 100MB per AI client.
Is it possible / useful to implement something like this:
- if AI has no planets and no fleets any more -> shutdown process
This would release some resources, which could be reused for GUI or other AI processes.
What do you think about this?
Cheers,
schpidi
I searched for the topic, but I found nothing accurate...
Currently I am playing 500 stars 20 AI and I am running into performance issues, because I only have a medium sized system.
I found that each AI client has its own windows process.
So I had the idea not to attack them parallely.
I thought if I would kill them completely one after the other, I would get some free computer resources again.
But I saw that the AI client remains as windows process, even if AI empire is completely defeated.
For my big game this means around 100MB per AI client.
Is it possible / useful to implement something like this:
- if AI has no planets and no fleets any more -> shutdown process
This would release some resources, which could be reused for GUI or other AI processes.
What do you think about this?
Cheers,
schpidi
Re: Shutdown windows process (AI client) if defeated
Oh yeah, great idea!
Re: Shutdown windows process (AI client) if defeated
I'm surprised that the AI is slowing down the game after it's defeated. Is it actually using up CPU, or is it just holding on to memory?
Warning: Antarans in dimensional portal are closer than they appear.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Shutdown windows process (AI client) if defeated
It probably still is deserializing its latest known galaxy state info each turn, but I'd expect it's more of a memory issue. The downside of having independent AI processes is the extra memory use.Bigjoe5 wrote:Is it actually using up CPU, or is it just holding on to memory?
Re: Shutdown windows process (AI client) if defeated
I assume it is not wasting too much CPU, because no buildings, production, fleets calculation etc.Bigjoe5 wrote:I'm surprised that the AI is slowing down the game after it's defeated. Is it actually using up CPU, or is it just holding on to memory?
But for my big game it is still writing a 5-10MB AI log file for defeated ones, which is not necessary in my eyes.
And it still remains in the memory.
But isn´t it possible to end the process completely?Geoff the Medio wrote:It probably still is deserializing its latest known galaxy state info each turn, but I'd expect it's more of a memory issue. The downside of having independent AI processes is the extra memory use.
I assume currently there is working some kind of garbage collector which free up the memory by some time?
Couldn´t we call the same shutdown routines like on closing the game?
If an empire is dead, it doesn´t need any info about the galaxy any more
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Shutdown windows process (AI client) if defeated
Lots of things are possible, but require other stuff to be implemented first. In this case, there's nothing implemented to decide when an AI empire is defeated / can be excluded from future turns.schpidi wrote:But isn´t it possible to end the process completely?
Edit: Also, doing this during a game would likely require some adjustment of various other code to keep track of the reduced number of empires, on the server (so that it doesn't wait forever for not-coming empire turn orders) and on the client (so it knows to update the UI appropriately). Also, would the gamestate remember that the previous empire existed, or just remove all traces of it? Presumably the in-game pedia should have some record, and old sitrep messages would still need to have access to the old empire's info...
Re: Shutdown windows process (AI client) if defeated
Ok, then I misunderstood. When translating I found the message EMPIRE_DEFEATED and I assumed that this is an implemented event already.Geoff the Medio wrote:Lots of things are possible, but require other stuff to be implemented first. In this case, there's nothing implemented to decide when an AI empire is defeated / can be excluded from future turns.schpidi wrote:But isn´t it possible to end the process completely?
Edit: Also, doing this during a game would likely require some adjustment of various other code to keep track of the reduced number of empires, on the server (so that it doesn't wait forever for not-coming empire turn orders) and on the client (so it knows to update the UI appropriately). Also, would the gamestate remember that the previous empire existed, or just remove all traces of it? Presumably the in-game pedia should have some record, and old sitrep messages would still need to have access to the old empire's info...
Logically an empire is defeated for me if
- it is not transzendent (otherwise it would have won )
- it has no planets
- it has no fleets
But I don´t know the internal class structure of the game and what info is available and what not.
Re: Shutdown windows process (AI client) if defeated
You don't want to delete the logfile from disk in the middle of a game just because the respective AI was defeated. After defeat, an AI only adds about 100 lines per turn to the log file if you don't have verbose logging on, and takes about 0.2 seconds elapsed per turn (on my machine anyway) to review its situation and decide it has nothing to do.schpidi wrote:I assume it is not wasting too much CPU, because no buildings, production, fleets calculation etc.Bigjoe5 wrote:I'm surprised that the AI is slowing down the game after it's defeated. Is it actually using up CPU, or is it just holding on to memory?
But for my big game it is still writing a 5-10MB AI log file for defeated ones, which is not necessary in my eyes.
And it still remains in the memory.
Even though we don't have it currently, there easily could be some kind of Effect that gives ships to a "dead" empire, or to a random one, and revive it from apparent defeat.But isn´t it possible to end the process completely?
I assume currently there is working some kind of garbage collector which free up the memory by some time?
Couldn´t we call the same shutdown routines like on closing the game?
If an empire is dead, it doesn´t need any info about the galaxy any more
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: Shutdown windows process (AI client) if defeated
I think an empire can be considered defeated when said empire has no colonies, no colony class ships, and no troop ships remaining on the map. Basically all methods of colonization/invasion must be unavailable to that empire. Any remaining ships such as warships could remain on the map either as stationary objects in which they will get in the way of other players. Or, to make things more fun, the lost empire will receive a fleet of highly stealthed ghost warships for the sole purpose of seeking revenge and messing the other players up .there's nothing implemented to decide when an AI empire is defeated / can be excluded from future turns.
Re: Shutdown windows process (AI client) if defeated
There's also been some discussion of using diplomacy or other means to revive previously defeated empires, though I think if an empire is really defeated and has no assets whatsoever, it should probably be out of the game.
However, an empire could hypothetically survive without any planets or ships, and still be operating with spies in enemy empires, "stealing" or otherwise acquiring enough influence output to continue funding his espionage efforts.
However, an empire could hypothetically survive without any planets or ships, and still be operating with spies in enemy empires, "stealing" or otherwise acquiring enough influence output to continue funding his espionage efforts.
Warning: Antarans in dimensional portal are closer than they appear.
Re: Shutdown windows process (AI client) if defeated
I like that - at least in theory; I'm afraid that such burrowed empire would not have any means to stand on its own again, though, not to mention winning the game...Bigjoe5 wrote:However, an empire could hypothetically survive without any planets or ships, and still be operating with spies in enemy empires, "stealing" or otherwise acquiring enough influence output to continue funding his espionage efforts.
... well, unless the ultimate influence/espionage project would be "imperial takeover" .
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
Re: Shutdown windows process (AI client) if defeated
While "Imperial Takeover" is unlikely, there's a realistic possibility of being able to take over ships and planets via espionage. Furthermore, empire A, which has thoroughly infiltrated empire B, is likely to be of great utility to empire C, who is at war with empire B, and who might offer empire A ships, planets or resources in return for its services.em3 wrote:I like that - at least in theory; I'm afraid that such burrowed empire would not have any means to stand on its own again, though, not to mention winning the game...Bigjoe5 wrote:However, an empire could hypothetically survive without any planets or ships, and still be operating with spies in enemy empires, "stealing" or otherwise acquiring enough influence output to continue funding his espionage efforts.
... well, unless the ultimate influence/espionage project would be "imperial takeover" .
Warning: Antarans in dimensional portal are closer than they appear.
Re: Shutdown windows process (AI client) if defeated
That does sound awesome. I'm not sure if we can expect such scenarios outside multiplayer games with role-playing humans.Bigjoe5 wrote:While "Imperial Takeover" is unlikely, there's a realistic possibility of being able to take over ships and planets via espionage. Furthermore, empire A, which has thoroughly infiltrated empire B, is likely to be of great utility to empire C, who is at war with empire B, and who might offer empire A ships, planets or resources in return for its services.
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
Re: Shutdown windows process (AI client) if defeated
I'm sure Dilvish is up to the challenge of making the AI diplomatically savvy enough to make this kind of arrangement with a player - assuming we have an adequately robust diplomacy system. The concept of a "contract" will probably be very difficult to pull of.em3 wrote:That does sound awesome. I'm not sure if we can expect such scenarios outside multiplayer games with role-playing humans.Bigjoe5 wrote:While "Imperial Takeover" is unlikely, there's a realistic possibility of being able to take over ships and planets via espionage. Furthermore, empire A, which has thoroughly infiltrated empire B, is likely to be of great utility to empire C, who is at war with empire B, and who might offer empire A ships, planets or resources in return for its services.
Warning: Antarans in dimensional portal are closer than they appear.