Jump to content

Build 28/08 Civs mixed up


Recommended Posts

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?

Edited by agentx
Link to comment
Share on other sites

Diplomacy menu.

Little signet ring next to trade menu and menu menu! Top right!

Oh bots, nvm. I'm Drunk, sore, sobering up! shaddap!

Edit: I'm pretty certain there’s' no logic to civs for bots. Only "i can train @#$%, i can gather @#$%, i can move @#$%".

Edit 5: I can train stuff - i can gather stuff - i can move stuff.

Sorry, just got home from awesome gig and i had some coffee so i COULD get home. I'll be here for a few hours, so excuse my proffanities. :)

Edited by auron2401
Link to comment
Share on other sites

What you're getting are the default choices for unselected things (looping alphabetical through all civs). While in reality, it's set to the choices given in the scenario file.

There should probably be another setting for scenario files. Or maybe, you're just getting the info too early, before it's being set.

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.

Link to comment
Share on other sites

> 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
Link to comment
Share on other sites

If the opponent chooses random and the AIs units can't see the enemies CC I'd consider getting the enemies CC and with it (in most cases) it's civ cheating (not very bad but still).

IMO the AI should try to make the best of what he has, not specifically focus on enemies weaknesses (especially if, if it was a non-AI player, it wouldn't have the informations for that in the first place).

If an AI notices (like a non-AI player also would e.g. by scouting) that an opponent masses a specific type of unit it for sure should adept to that.

Is any AI development going on that would work for totally different civs (unknown to the AI scripter at the time of implementation) like needed for civ changing mods?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Agent, please don't give up! Hannibal is amazing! And I hope you and mimo can merge his naval break throughs.

I also experienced weirdness using autostart, and I'm glad to see historic back.

Civ meta data knowledge vs. knowledge of the state of the technological evolution

Please allow me one question:

Does Hannibal really need to know about the Civilization? In my opinion it has to know the tech tree, and that is the current state of the research of the tech tree!

Reason is the tech tree defines which structures you can build, which units you can train, which gather rates you have, ... and your state of technologies researched allows you to also construct buildings of other civs.

Thus the civ is just a meta information and not required. What we need to scout is the tech tree / state of the art of the technological evolution of the opponent, and that may be possible by scouting the territory and analyzing the template of each entity you encounter, properly storing it for each opponent you know of (i.e. the bot already encountered a entity or other sign of).

Edited by Radagast.
Link to comment
Share on other sites

> Does Hannibal really need to know about the Civilization?

In principle no. In practice yes.

The engine expects an exact template name to build/train/research things, example "structures/athen_house".

The API delivers template names with wildcards: "structures/{civ}_house"

So a bot has to string replace the wildcard with its own civ. That's the purpose of applyCiv() pasted above.

Without knowing its own civ a bot is stuck to whatever entities the designer has put on the map.

Link to comment
Share on other sites

Apparently bot developers are now expected to clickfest their way through the GUI to test specific maps and civs.

No, that was a suggested workaround and a way to test if the problem was autostart-specific. If you confirm it is indeed autostart (like, with a proper bug report instead of a rambling forum post), then we know where to look to fix it. Personally, I don't have time to setup tests for this and without narrowing it down further, no time to debug it.

Link to comment
Share on other sites

> with a proper bug report instead of a rambling forum post

Sorry, the first post is as exact as I can describe it. And experience tells me trac entries are postponed without any comment so I figure forum posts are more effective. Looking at trac right now i see the issue has already been reported yesterday. It is very probably an autostart issue, otherwise I would expect more feedback.

All I want to know is whether the command line interface is fix-worthy and if yes will it happen before release of A17?

If I can provide a test case for autostart to make it never break again, I'd be happy to work on that.

Link to comment
Share on other sites

> Does Hannibal really need to know about the Civilization?

In principle no. In practice yes.

The engine expects an exact template name to build/train/research things, example "structures/athen_house".

The API delivers template names with wildcards: "structures/{civ}_house"

So a bot has to string replace the wildcard with its own civ. That's the purpose of applyCiv() pasted above.

Without knowing its own civ a bot is stuck to whatever entities the designer has put on the map.

Thanks for pointing out. I forgot about that. I even wanted to add the same functionality for Actors but failed miserably, thx to leper for pointing out, that the entity Identity is a scripting-side component only and thus the C++ side can't apply the {Civ} to actor files.

Nevertheless there's a solution for that:

- Resolve researched tech tree (a bot should have access to its own technologies, doesn't it?).

- Resolve which buildings/units the techs unlock,

- Use those unlocked entities to create your plans.

If a new tech is researched, then adapt your plans. (OnTechResearched event, at least exists for triggers, so there should be a way to provide the same for the AI).

Link to comment
Share on other sites

Nevertheless there's a solution for that:

- Resolve researched tech tree (a bot should have access to its own technologies, doesn't it?).

- Resolve which buildings/units the techs unlock,

- Use those unlocked entities to create your plans.

If you have working code, post a link.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...