jncraton / BWMetaAI

A StarCraft Brood War AI designed to follow the modern 1v1 metagame
Other
100 stars 12 forks source link

Ability to select a bo instead of randomly pick one #57

Open Death-cord opened 5 days ago

Death-cord commented 5 days ago

Can the built-in AI be flexible like in BWAPI Revamed in a way that allows you to choose a specific AI or a specific bo of the AI.

I like the idea of a general-purpose built-in AI that is smarter/interesting than the default one while still not limited to a custom map/campaign/mod. I wonder if we can have different copies of patch_rt.mpq that are named based on a specific bo the built-in AI will do, not to wait for it to pick a random one.

For example, can we've a separate patch_rt.mpq that'll only go BBS in Terran vs Terran, or in Terran vs Random ?

jncraton commented 5 days ago

I'm not opposed to this in principle. It would require modifying the build process to create build-specific artifacts in addition to the primary artifacts as you suggested.

For what it's worth, you can already do this if you build locally by deleting the builds from the builds directory that you do not want to play against.

Death-cord commented 5 days ago

There is nothing in the build folder (and no folder named builds) and I can't find rebuild instructions for the project, I'd love if you do it yourself, I know some Python but I'm not familiar with the build process here.

Also, I think this suggested feature is very important, because in the past I tried BWMetaAI, but the thing that prevented me from using it more, is just that I didn't get the bo I wanted to practice against, since it's picked randomly !

I know it's better than the default built-in AI, but giving more control to the end user, I think it'll attract more people to play with it, have more fun, and construct a clear/definite picture of what we can do with the project, instead of a random one.

jncraton commented 5 days ago

There are brief instructions to build from source in CONTRIBUTING.md. The builds to remove would live in the race-specific build order directories (e.g. src/terran).

Death-cord commented 5 days ago

I'm not sure if GNU Make works for Windows, if so then how to use it ? (I don't use Linux)

Death-cord commented 4 days ago

And what about the maps there like: https://github.com/jncraton/BWMetaAI/releases/download/v2.5/1.Destination.BWMetaAI.P.scx

Do they work on their own with the modified AI inside them ? I don't understand also what the complex triggers for Player1 in those maps do.

jncraton commented 4 days ago

Custom maps weren't designed to include custom AI scripts, so we exploit a buffer overflow in order to overwrite the built-in scripts. The triggers to accomplish this along with some light documentation are in the docs directory.

The build system creates a new set of triggers and injects them into the race-specific maps automatically, so you wouldn't need to deeply understand that part of the system unless you want to add more maps.

Death-cord commented 2 days ago

Can I somehow specify the default bo for each race, in case I want 2 built-in AI to play PvT or any game scenario that contains 2 or more built-in AI ?

jncraton commented 2 days ago

This should be possible. You can leave three builds in each builds directory, where each will be selected for use in only one match-up. This is accomplished by starting each build with a use_build_vs statement. There's an example in the Fantasy build.

Death-cord commented 2 days ago

Sorry if I wasn't clear in my previous question, I've no problem in leaving only one bo in each race folder and rebuild, but I wanted to do it without manually specifying what 1bo to stay there (bc I might change my opinion later, and I won't have access to Linux all the time, so I think the rebuild process won't help here).

I guess getting all the bos then maybe changing the weight (I guess the weight means the probability of a bo to be picked, I just notices the term there and find it familiar with BWAPI AI way of choosing a bo)

So maybe I need to use PyAI.pyw and feed it a modified combined.pyai (I guess this is the decompiled form of aiscript.bin ?), after changing the weight of 3 bos there to have the value '1' instead of a percent/fraction, then compile it and add it to the .mpq.

Sorry if I'm throwing ideas in the air, I'm just new to all this, I hope you understand me.

jncraton commented 2 days ago

If you want to be able select a particular build order without re-running the build, the best approach is probably to store the generated patch_rt.mpq file or aiscript.bin file for each build that you'd like to be able to play against. You can then swap out these files as needed when you launch the game to play against different build orders.

Death-cord commented 2 days ago

Yes I can make a different 35 aiscript.bin based on all the bos combinations in BWMetaAI (13P + 13T + 9Z), but this only allows me to force bo-pick to one race at a time, I think I'll have to make 1521 aiscript.bin if I want all the combinations (in case of PvPTZ human vs 3 built-in AIs), which is very cumbersome/complex to do and maintain.

Hopefully forcing a bo can be easy in the future for all the 3 races (not just 1 race at a time), thanks for your help.

jncraton commented 2 days ago

I misunderstood initially, but now I see what you mean. 1521 combinations is certainly unwieldy.

I'm not sure if this would be helpful in your case or not, but I have considered creating aggressive, standard, and greedy versions of the agents. I wasn't envisioning picking individual builds, but instead providing the ability to select the timings of initial attacks.

Death-cord commented 2 days ago

Yeah I'm sure there is more complex work internally that you need to tweak 1st, but I just remembered an old launcher called BWAI launcher that allows you to easily specify a default bo for each race, I thought it would be awesome if BWMetaAI has a launcher like that. https://www.starcraftai.com/wiki/BWAI_Launcher