NullBot goes through big refactoring
Re: NullBot goes through big refactoring
Wow, how do they do that? Is that all hand-crafted or is there some tool for doing that? Looks awesome! Do you have infos on how they did it?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: NullBot goes through big refactoring
Looks like it: doccoaubergine wrote:Wow, how do they do that? Is that all hand-crafted or is there some tool for doing that? Looks awesome! Do you have infos on how they did it?
http://jashkenas.github.com/docco/
upd:
python version (pycco) works in that way
http://addons.wz2100.net/ developer
Re: NullBot goes through big refactoring
I'll allow myself to write a little essay on adaptation. Well, i'm writing this mostly for myself, cause i need some clarity in my head before proceeding.
Currently the NullBot3's adaptation mechanisms allow gathering information on usefulness rating of certain components in current game situation.
Based on this data, NullBot3 needs to make an adaptive decision formulated as a single game object template: a tank design, a cyborg template, a vtol design, or a defensive structure, or a research item, to produce or build right now at that particular moment.
You may say it's easy: just pick the best propulsion, the best body, and the best weapon. But in fact we can't choose those independently, for there are many restrictions imposed:
My current idea is as follows. First of all, we throw all absolutely unbreakable restrictions into a single checker function: isValidOption(option). Then, we start with an option of all components being independently best in their category. Then we start a breadth first search on an oriented option graph (the Hasse diagram of the partially ordered set of all options, with "better than" as its order) where options are vertices, and arcs are coming from independently-better options to options that are one level worse in one component: for instance, from the (twin AG, panther, tracks) option there will be arcs to (AG, panther, tracks), (twin AG, leopard, tracks) and (twin AG, panther, halftracks). We only proceed our search until all options in our BFS queue are valid; if a certain option we have just pulled out of the queue is already valid, then we don't proceed with searching through it (for it will only lead to worse options), but store it in a separate "result array", which will ultimately contain all maximal valid options. Once the search is completed, we choose the best of the valid options presented by the search (taken from the "result array") via a certain rating procedure (most likely, options that are farther from the search origin will be valued less).
Currently the NullBot3's adaptation mechanisms allow gathering information on usefulness rating of certain components in current game situation.
- propulsions, classified by movement scopes (ground, hover, air).
- propulsions, classified by weakness to certain weapons (tanks, cyborgs, defenses, vtols)
- bodies, classified by dominating armor class (kinetic, thermal)
- weapons, classified by roles (anti-tank, anti-personnel, anti-structure, anti-air).
- weapons, classified by damage class (kinetic, thermal)
Based on this data, NullBot3 needs to make an adaptive decision formulated as a single game object template: a tank design, a cyborg template, a vtol design, or a defensive structure, or a research item, to produce or build right now at that particular moment.
You may say it's easy: just pick the best propulsion, the best body, and the best weapon. But in fact we can't choose those independently, for there are many restrictions imposed:
- Sometimes the desired weapon class, body class or propulsion class is unavailable. For instance, weapons of anti-tank role (rockets, or maybe cannons) are unavailable for quite some time in early game. Or you may have not yet researched hover propulsion. In this case it is unobvious whether you can proceed by making the second best decision (eg. using machinegun as an anti-tank weapon until rockets are available, or prefer to keep upgrading machineguns instead of researching flamers from scratch simply because your enemy switched his tanks from new paradigm bodies to collective bodies) or you need to stop and reconsider the very choice of producing a unit (eg. on a hover-only map you'd prefer to wait for hovers rather than fill your base with wheeled or tracked tanks).
- Sometimes components just won't match. For instance, you may believe that leopard body is better than scorpion body for your VTOLs (since it provides faster reload due to decreased weight, and also has the same armor and only slightly less hp), but you can't put heavy bombs on it, because they will fly too slowly. Sometimes some sorts of weapons are unavailable in form of cyborgs or VTOLs (for instance, a pure rocket player will never had anti-personnel VTOLs or cyborgs), but available as tanks and defenses.
My current idea is as follows. First of all, we throw all absolutely unbreakable restrictions into a single checker function: isValidOption(option). Then, we start with an option of all components being independently best in their category. Then we start a breadth first search on an oriented option graph (the Hasse diagram of the partially ordered set of all options, with "better than" as its order) where options are vertices, and arcs are coming from independently-better options to options that are one level worse in one component: for instance, from the (twin AG, panther, tracks) option there will be arcs to (AG, panther, tracks), (twin AG, leopard, tracks) and (twin AG, panther, halftracks). We only proceed our search until all options in our BFS queue are valid; if a certain option we have just pulled out of the queue is already valid, then we don't proceed with searching through it (for it will only lead to worse options), but store it in a separate "result array", which will ultimately contain all maximal valid options. Once the search is completed, we choose the best of the valid options presented by the search (taken from the "result array") via a certain rating procedure (most likely, options that are farther from the search origin will be valued less).
Last edited by NoQ on 23 Jan 2013, 12:57, edited 1 time in total.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: NullBot goes through big refactoring
You probably also need some sort of temporal latching in there as well. Otherwise you'll end up with a complete mixed bag of units, defences and research.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: NullBot goes through big refactoring
I'm not yet sure whether to consider tanks, buildings, structures, and researches separately or simultaneously ...
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: NullBot goes through big refactoring
Few thoughts aloud...
First, I'm assuming this is a complete rewrite of NB post-3.1 master?
Also:
Just an idea, not a suggestion:
Also in previous nb personalities you have research paths and play style dependent on each other. Have you considered defining a play style (e.g. tank rush, truck rush, mixed, turtle) and then defining research paths/the rest of the personality as a subset of that play style?
You could use the same subsets of paths for the different play styles, paths could change but usually play styles dont change in mid game (because if they do, its usually already too late.)
First, I'm assuming this is a complete rewrite of NB post-3.1 master?
Also:
If I'm following correctly, wouldn't simultaneously be the hardest to code but most realistic option? For instance, if the AI finds that a player is going wheeled, manta bodies wouldn't it make sense to build both flamer tanks and flamer bunkers around his base? I might be following wrong...NoQ wrote:I'm not yet sure whether to consider tanks, buildings, structures, and researches separately or simultaneously ...
Just an idea, not a suggestion:
Also in previous nb personalities you have research paths and play style dependent on each other. Have you considered defining a play style (e.g. tank rush, truck rush, mixed, turtle) and then defining research paths/the rest of the personality as a subset of that play style?
You could use the same subsets of paths for the different play styles, paths could change but usually play styles dont change in mid game (because if they do, its usually already too late.)
Re: NullBot goes through big refactoring
The decision of eg. tanks vs. research will have to be made anyway, it's just on what level it is to be made that i'm not sure of. Either first decide that we want tanks and then run the fancy maximal element search, or run the fancy maximal element search in a bigger scope that will include both tanks and research items.wouldn't simultaneously be the hardest to code but most realistic option?
I think it's just the opposite. If your rush fails, you can transition to a regular game, while still enjoying some economical advantage until your rush force is completely eliminated. But it clearly makes no sense to switch to cannons when you researched rockets with a few upgrades already.paths could change but usually play styles dont change in mid game (because if they do, its usually already too late.)
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: NullBot goes through big refactoring
You also need to take account of the human player issuing !nb chat commands
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO