s25client icon indicating copy to clipboard operation
s25client copied to clipboard

Project editing... AI behavior... colors... game acceleration

Open ultimate-underground opened this issue 4 months ago • 11 comments

Hej

Can someone tell me in which file in the project can I modify the behavior of the AI ​​bot? I want to change the current behavior such as demolishing military buildings in the interior and disconnecting roads from these buildings... I also want to somehow solve the stupid AI reforestation in existing forests where the AI ​​player then gets stuck and is unable to continue expanding his territory...

I would also welcome information about where in the project I can change-tune the colors of the players in the game and in the lobby sample next to the nationality... I don't want to solve the minimap but only the gamelobby sample and then the color in the game... so the color of the characters... soldiers... flags... signs on buildings etc.

Also where should I focus in the project if I want to expand the existing game acceleration... currently the limit is I think 4x game acceleration and I should increase it even more... so that I don't have to play some maps for dozens of hours

ultimate-underground avatar Oct 14 '25 15:10 ultimate-underground

The AI stuff is in the libs\s25main\ai\aijh subfolder. In the AIPlayerJH.cpp in the function AIPlayerJH::MilUpgradeOptim is the code for disconnection of the military buildings. Demolishing military buildings is in the function void AIPlayerJH::PlanNewBuildings(const unsigned gf) at the end of the function. The forester stuff should also be somewhere in this file or in the buildingplanner.cpp.

ottml avatar Oct 14 '25 17:10 ottml

The colors are defined in external\libutil\libs\common\include\s25util\colors.h

ottml avatar Oct 14 '25 17:10 ottml

Ok thanx

ultimate-underground avatar Oct 14 '25 17:10 ultimate-underground

In libs\s25main\gameData\GameConsts.h you can find the values for the speed of the game. If you search for SPEED_GF_LENGTHS in the code base you should find the places.

ottml avatar Oct 14 '25 17:10 ottml

I see you have an overview =D Could you please tell me where I need to intervene if I want to increase the maximum number of players in the game? The standard is now 8... I would welcome 10

ultimate-underground avatar Oct 14 '25 17:10 ultimate-underground

I see you have an overview =D Could you please tell me where I need to intervene if I want to increase the maximum number of players in the game? The standard is now 8... I would welcome 10

libs\s25main\gameData\MaxPlayers.h

ottml avatar Oct 14 '25 21:10 ottml

Yes, I found it... but this probably won't be enough, right? Are there any other dependencies in other cpp... gamelobby... gameclient etc?? Or can this one line really automatically apply it to all other dependencies?

ultimate-underground avatar Oct 14 '25 22:10 ultimate-underground

There can be additional places which may not respect the MaxPlayers constant though (UI, ...) thats something you need to check and find out

Flow86 avatar Oct 15 '25 05:10 Flow86

Ok Thanx

ultimate-underground avatar Oct 15 '25 11:10 ultimate-underground

There can be additional places which may not respect the MaxPlayers constant though (UI, ...) thats something you need to check and find out

It's strange, but it was really enough to rewrite MaxPlayers.h from eight to ten players and it works in the game... at least in single player.

ultimate-underground avatar Oct 17 '25 17:10 ultimate-underground

Solved...

ultimate-underground avatar Dec 02 '25 21:12 ultimate-underground