Jump to content

agentx

Community Members
  • Posts

    276
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by agentx

  1. I'm all for same information for humans and bots in the game, that's why I coded scouts to explore the map, to find treasure and to detect resources instead of just reading resource or passability maps. I published a video in a another thread showing them in action. But that's not the point here, instead it seems the commandline interface broke since A16 and automated testing is no longer an option. Apparently bot developers are now expected to clickfest their way through the GUI to test specific maps and civs.

    So, any AI which depends on heuristics, genetic algorithms, neuronal networks or machine learning are now impossible. At least for developers who don't have the resources to pay a huge team of testers and equip them with machines.

    Hannibal consists now of +20,000 lines of code including a triple store, a query language, a HTN planner, a path finder and other modules. All loops are hand optimized and run fast in native code. It launches autonomous groups to build a village, scout the area or gather resources. Units know when to hide in buildings or to counter attack based on their health status and their tasks. They rebuild the fields and buildings if destroyed they are responsible for. It explores the technology tree of its civilization to research only the technologies advantageous for the map to play and the enemies to fight.

    The project is at 80%, missing now is combat action on land and water, which needs the most testing. The units will detect weak points of the opponents based on a potential field explored by scouts to no start suicide missions.

    I don't want to give up now, not at this stage and not with all the features implemented and goals accomplished so far. I'm quite sure Hannibal will be a resourceful enemy in single and multiplayer games, challenging you to constantly come up with new strategies and tactics.

    If anybody reading this is willing to help out with testing, please let me know.

    //agentx.cgn[]gmail.com\\

    • Like 3
  2. > But all by all, you shouldn't rely a lot on the civ you get, you should rely on the CC you start with to see what you can produce. Remember that mods can add civs you've never heard of before.

    Sure, my fault. However, I can't produce enemies at the CC. How do I get their civ?

    And have a look at gamestate.js, looks like that whole thing is no longer reliable, too.

    m.GameState.prototype.applyCiv = function(str) {    return str.replace(/\{civ\}/g, this.playerData.civ);};m.GameState.prototype.civ = function() {    return this.playerData.civ;};m.GameState.prototype.currentPhase = function(){    if (this.isResearched("phase_city"))        return 3;    if (this.isResearched("phase_town"))        return 2;    if (this.isResearched("phase_village"))        return 1;    return 0;};m.GameState.prototype.townPhase = function(){    if (this.playerData.civ == "athen")        return "phase_town_athen";    return "phase_town_generic";};m.GameState.prototype.cityPhase = function(){    if (this.playerData.civ == "athen")        return "phase_city_athen";    else if (this.playerData.civ == "celt")        return "phase_city_gauls";    return "phase_city_generic";};

    And when comes to buildings, the units I've started with can build these things below, but the engine doesn't accept them, probably also unreliable now:

    structures/{civ}_housestructures/{civ}_storehousestructures/{civ}_farmsteadstructures/{civ}_fieldstructures/{civ}_corralstructures/{civ}_outpoststructures/{civ}_dockstructures/{civ}_barracksstructures/{civ}_blacksmithstructures/{civ}_templestructures/{civ}_marketstructures/{civ}_defense_towerstructures/{civ}_wallset_stonestructures/{civ}_civil_centrestructures/{civ}_fortressstructures/{civ}_wonder

    I'm tempted to ask what else is now considered unreliable, but I'm not sure whether the list of reliable things is shorter. Anyway, I'm happy I didn't delete A16, which was also faster.

    Mimo, if you read this, search Petra for 'applyCiv'.

    Hopefully nobody expects bots to build structures or research technology or even survive beyond phase village.

    • Like 1
  3. Using this:

    ./pyrogenesis -quickstart -autostart="scenarios/Arcadia 02" -autostart-ai=1:hannibal -autostart-ai=2:petra

    I get this from sharedScript.playersData:

    PLAYER:       name  team     civ     phase  pop  ally  enmy  neut     0:       Gaia    -1    gaia   village    0   100   011   000     1:   Player 1    -1   athen   village    7   010   101   000     2:   Player 2    -1    cart   village    7   001   110   000

    However, the map is defined like this:

      "PlayerData": [    {      "Civ": "spart",      "Name": "Player 1",      "Team": -1    },    {      "Civ": "gaul",      "Name": "Player 2",      "Team": -1    }  ],

    Which is what the game actually plays.

    Is there a new way for bots to determine own and opponents civ?

  4. > Maybe defining trees as a group for pathfinder would be better ?

    It would, but the amount of freedom for map maker in 0AD should remain, imho. I'd prefer the editor indicates problematic regions, in red, like the other helpful obstructions/passability overlays. So map makers can choose to design for efficient multiplayer maps or visual pleasing single player maps and players do not wonder why the 12,000 trees giant map isn't suitable for an 8 player combat with a Pentium class machine.

  5. I think trees are a special case of obstruction. They are smaller than a tile and probably only an issue if they come as a forest. And then it depends on their distance/density. Effectively they can turn a map into a complex labyrinth breaking any pathfinder. Some maps have thousands of trees and since pathfinder have to look at both sides of any obstruction this leads to a combinatorial explosion very quickly. Probably there should be tool and/or best practice guide for map maker. It is easy to create maps which are a challenge to any pathfinder. In that way the map is slow and not the pathfinder.

  6. > the slope map is [X-1]*[X-1] in size because you need 2*2 heights to get a plane witch than has a slope.

    Yes, that's documented for *.pmp and leads to a very tiny offset in NE direction, barely a pixel.

    > Afaik there is a tool that let´s you set passability. Maybe you need some tweaking ?

    Sorry, should have mentioned the passability info is needed to steer a bot's units around. No chance to edit maps while playing.

  7. I've been looking for opposite pairs possibly describing a bot personality like:

    • Fortification - Spreading/Claiming
    • Defensive - Attacking
    • Exploitation - Barter

    Which gives a nice 3D space a bot can choose of. However the pairs are not exclusive, e,g, exploitation includes claiming. Also it depends on the map, which brings me to cheating: Humans memorize maps. LOS is most interesting on the first play, from there it is getting more and more relative. After the fifth replay you know form where the attacks are coming and build towers likewise.

    Currently bots can't remember maps. They could however include pre-compiled information about maps/scenarios. If any of the devs might fancy an "online brain" for bots I'm all ears, all needed is a kinda XMLHttpRequest object supporting GET/POST/HEAD. Maps is only one thing, even more interesting is a database of players and their strategies. Who wants to play the same game twice?

  8. I've found a way to render internal maps on a HTML canvas providing some visual confirmation. Only the passabiltiy map gives some headache. pathfinder.xml defines these PassabilityClasses:

    unrestricteddefault  <MaxWaterDepth>2  <MaxTerrainSlope>1.0ship  <MinWaterDepth>1building-land  <MaxWaterDepth>0  <MinShoreDistance>1.0  <MaxTerrainSlope>1.0building-shore  <MaxShoreDistance>2.0  <MaxTerrainSlope>1.25

    The API knows these classes + values:

    //uneval(sharedScript.passabilityClasses);pathfinderObstruction:1, foundationObstruction:2, building-land:4, building-shore:8, default:16, ship:32, unrestricted:64  

    Here are the classes rendered using the Arcadia 02 map:

    post-16051-0-93335300-1405700631_thumb.ppost-16051-0-36026900-1405700634_thumb.ppost-16051-0-66990400-1405700636_thumb.ppost-16051-0-99178600-1405700637_thumb.ppost-16051-0-04963900-1405700639_thumb.ppost-16051-0-63938300-1405700640_thumb.ppost-16051-0-61151100-1405700641_thumb.p

    (the mouseover title shows the mask value)

    pathfinderObstruction is surely no-go area for everything. What I want is where land/water units can go, so default looks good for land, however slope is not indicated in the map and ship also has area on land indicated. I know I can bitmask what I need, but somehow API and pathfinder.xml do different things. Which one is reliable?

    • Like 1
  9. I would say medium, hard, and very hard should use all features (barter, heroes, etc). It would be dull to have to up the difficulty just to see enemy traders or heroes. I wouldn't want the core experience to change as the difficulty rises. I would prefer the AI to expand territory faster, gather resources quicker, and use much more advanced battle tactics and strategy as the difficulty goes from medium to very hard.

    It depends on the user model. I assumed users advance by adding features to their repertoire, you seem to assume users start with the full set of features and advance by improving. The reality is probably in between and different for each user. But I think it is easier to reason about difficulties if basically it is about switching features on/off and not moving along a scale.

  10. I'm also trying to make this ladder useful to beginner. I like no attacks for sandbox and very hard as unleash everything. May I suggest no technology for easy? So:

     - sandbox:   no attacks, no tech - easy:      no tech, simple economy, no rush - medium:    advanced economy (, no barter?) - hard:      advanced combat (, no heros?) - very hard: no limit

    Still lacking a useful criteria for hard...

    Btw, am I right the AI settings dialog could be a mod and the selected settings just go straight into bot constructor? Spending extra options for AIs without compilation?

  11. Just came across this article of a guy doing pathfinding with WebGL, which is slow because getting the texture back is only supported pixel by pixel. However, his Game of Live using same architecture is freaking fast, so OpenGL might support a faster way. If I understand it correctly the algorithm resolves multiple paths requests per call and time only depends on size of map.

    Probably the expertise of writing a shader to do pathfinding is quite rare within single mind, but 0AD has shown quite some prolific synergy effects, so I wanted to check if this solution rattles some nerves.

    • Like 1
×
×
  • Create New...