What is TexAI? How do I play with it?
-
Sanguivorant
- Posts: 31
- Joined: Mon Apr 25, 2022 12:54 am
What is TexAI? How do I play with it?
I have been reading the AI documentation and I'm wondering if this is a separate AI that you can play with versus "classic" AI. If so, how can I play against it? I have tried to use the command /create "AI" "tex", but it tells me that there is no AI type of that name.
There is also a section in the documentation that says that the game supports "AI Modules", in the sense that you can create your own AI script and somehow load it into the game for testing. Is freeciv normally installed with dynamic modules support enabled?
There is also a section in the documentation that says that the game supports "AI Modules", in the sense that you can create your own AI script and somehow load it into the game for testing. Is freeciv normally installed with dynamic modules support enabled?
Re: What is TexAI? How do I play with it?
Sounds like your freeciv has not been built with tex enabled. It should be enabled by default, though. At least in recent freeciv versions. What is your freeciv version?Sanguivorant wrote: ↑Sun Dec 28, 2025 4:23 pm I have tried to use the command /create "AI" "tex", but it tells me that there is no AI type of that name.
It's not a "script" support, but a dynamic module (quite similar to a shared/dynamic library) which you would typically implement in C. Implementing your own AI module would be a major undertaking.Sanguivorant wrote: ↑Sun Dec 28, 2025 4:23 pmThere is also a section in the documentation that says that the game supports "AI Modules", in the sense that you can create your own AI script and somehow load it into the game for testing. Is freeciv normally installed with dynamic modules support enabled?
Meson based build system does not yet support building dynamic modules support at all. In autotools based build system it's not enabled by default (in the ~15 years that we've had this dynamic modules support, nobody has shown interest in creating a single module)
-
Sanguivorant
- Posts: 31
- Joined: Mon Apr 25, 2022 12:54 am
Re: What is TexAI? How do I play with it?
I built it from source, however, it is not Freeciv, but freeciv21, a different launcher So maybe in the configuration I forgot to support it. I will building it from source on the latest version and see if I can play with Tex.cazfi wrote: ↑Sun Dec 28, 2025 6:34 pmSounds like your freeciv has not been built with tex enabled. It should be enabled by default, though. At least in recent freeciv versions. What is your freeciv version?Sanguivorant wrote: ↑Sun Dec 28, 2025 4:23 pm I have tried to use the command /create "AI" "tex", but it tells me that there is no AI type of that name.It's not a "script" support, but a dynamic module (quite similar to a shared/dynamic library) which you would typically implement in C. Implementing your own AI module would be a major undertaking.Sanguivorant wrote: ↑Sun Dec 28, 2025 4:23 pmThere is also a section in the documentation that says that the game supports "AI Modules", in the sense that you can create your own AI script and somehow load it into the game for testing. Is freeciv normally installed with dynamic modules support enabled?
Meson based build system does not yet support building dynamic modules support at all. In autotools based build system it's not enabled by default (in the ~15 years that we've had this dynamic modules support, nobody has shown interest in creating a single module)
When you say dynamic module, does this mean that I would have to rebuild my game to get these AI scripts to show if I were to make one?
Edit: So I built from source the latest version and tex does work. What makes it different exactly? Does it do air combat?
Re: What is TexAI? How do I play with it?
It's dynamic in the sense that it's not statically compiled in to freeciv, but freeciv is able to dynamically load it. So, using a dynamic module does not require rebuilding freeciv as long as it has originally been built with dynamic modules support.Sanguivorant wrote: ↑Sun Dec 28, 2025 7:47 pmWhen you say dynamic module, does this mean that I would have to rebuild my game to get these AI scripts to show if I were to make one?cazfi wrote: ↑Sun Dec 28, 2025 6:34 pmIt's not a "script" support, but a dynamic module (quite similar to a shared/dynamic library) which you would typically implement in C. Implementing your own AI module would be a major undertaking.Sanguivorant wrote: ↑Sun Dec 28, 2025 4:23 pmThere is also a section in the documentation that says that the game supports "AI Modules", in the sense that you can create your own AI script and somehow load it into the game for testing. Is freeciv normally installed with dynamic modules support enabled?
Meson based build system does not yet support building dynamic modules support at all. In autotools based build system it's not enabled by default (in the ~15 years that we've had this dynamic modules support, nobody has shown interest in creating a single module)
-
Dino the Dinosore
- Hardened
- Posts: 215
- Joined: Sun Dec 31, 2017 3:41 am
Re: What is TexAI? How do I play with it?
Is it possible to set some players to one aitype and others to a different one? This script of server commands seems to do that -
The "set aitype tex" seems to reset the difficulty level back to the default "easy".hard
set aifill 5
set aitype tex
hard
set aifill 9
Re: What is TexAI? How do I play with it?
Yes. The typical case is that wanted number of tex players is created with the "/create <name> tex" -commands, and rest up to "aifill" players get the default AI type (classic).Dino the Dinosore wrote: ↑Mon Dec 29, 2025 1:21 amIs it possible to set some players to one aitype and others to a different one?
-
Dino the Dinosore
- Hardened
- Posts: 215
- Joined: Sun Dec 31, 2017 3:41 am
Re: What is TexAI? How do I play with it?
Now I'd like to see 2 aitypes compete to see which is better. Is it possible to set up a game similar to my example server script, with no human player and run it and see the end game screen?
Re: What is TexAI? How do I play with it?
Since the point of tex (originally "t)hreaded ex)perimental") is that it tries to reduce turn-change time by doing some calculations during the turn, be sure not to use timeout of -1 like in traditional autogames. Instead set it to a couple of seconds. Otherwise tex won't have opportunity to do its calculations.Dino the Dinosore wrote: ↑Wed Dec 31, 2025 4:11 am Now I'd like to see 2 aitypes compete to see which is better. Is it possible to set up a game similar to my example server script, with no human player and run it and see the end game screen?
Otherwise classic and tex are almost identical. They both use "default AI" code.
-
Sanguivorant
- Posts: 31
- Joined: Mon Apr 25, 2022 12:54 am
Re: What is TexAI? How do I play with it?
If you look at the code itself, texAI pretty much uses classicAI scripts for deciding what to build, how to move, what to research, how to fight, etc.Dino the Dinosore wrote: ↑Wed Dec 31, 2025 4:11 am Now I'd like to see 2 aitypes compete to see which is better. Is it possible to set up a game similar to my example server script, with no human player and run it and see the end game screen?
Only way to change behaviour is to change the code, or at least how wants are calculated.
-
Dino the Dinosore
- Hardened
- Posts: 215
- Joined: Sun Dec 31, 2017 3:41 am
Re: What is TexAI? How do I play with it?
I've never run an autogame - how do you do that? Or is there anything on the wiki that explains it?
This functionality would be quite useful if I ever get up the nerve to try and improve the ai code.
This functionality would be quite useful if I ever get up the nerve to try and improve the ai code.