agentx Posted August 29, 2014 Report Share Posted August 29, 2014 (edited) Using this:./pyrogenesis -quickstart -autostart="scenarios/Arcadia 02" -autostart-ai=1:hannibal -autostart-ai=2:petraI 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 000However, 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 August 29, 2014 by agentx Quote Link to comment Share on other sites More sharing options...
auron2401 Posted August 29, 2014 Report Share Posted August 29, 2014 (edited) 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 August 29, 2014 by auron2401 Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted August 29, 2014 Report Share Posted August 29, 2014 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. Quote Link to comment Share on other sites More sharing options...
agentx Posted August 29, 2014 Author Report Share Posted August 29, 2014 > 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}_wonderI'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. 1 Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted August 29, 2014 Report Share Posted August 29, 2014 Have you tried without autostart, going through normal game setup? Autostart init is weird, buggy and full of hacks, it wouldn't surprise me if it had some issues like this. That said, this should be fixed, the AIs definitely need accurate players data. 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted August 30, 2014 Report Share Posted August 30, 2014 (edited) Is this because you are testing a scenario expecting to be able to change the civs when a scenario by definition has pre-chosen civs? Edited August 30, 2014 by wowgetoffyourcellphone 1 Quote Link to comment Share on other sites More sharing options...
FeXoR Posted August 30, 2014 Report Share Posted August 30, 2014 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? Quote Link to comment Share on other sites More sharing options...
agentx Posted August 30, 2014 Author Report Share Posted August 30, 2014 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\\ 3 Quote Link to comment Share on other sites More sharing options...
niektb Posted August 30, 2014 Report Share Posted August 30, 2014 I'm willing to test! It would be good (and cool!) to have some kind of AI that analyses capabilities and drawbacks from a civ on the fly (100% compatible with every mod and civ so to say) Quote Link to comment Share on other sites More sharing options...
Radagast. Posted August 31, 2014 Report Share Posted August 31, 2014 (edited) 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 evolutionPlease 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 August 31, 2014 by Radagast. Quote Link to comment Share on other sites More sharing options...
agentx Posted August 31, 2014 Author Report Share Posted August 31, 2014 > 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. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted August 31, 2014 Report Share Posted August 31, 2014 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. Quote Link to comment Share on other sites More sharing options...
agentx Posted August 31, 2014 Author Report Share Posted August 31, 2014 > with a proper bug report instead of a rambling forum postSorry, 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. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted August 31, 2014 Report Share Posted August 31, 2014 All I want to know is whether the command line interface is fix-worthy and if yes will it happen before release of A17?It's not the highest priority bug for A17 at this point (compared to serious crashes). I'm familiar with the autostart code and have some ideas of what might have broken, so I will take a look at it. 1 Quote Link to comment Share on other sites More sharing options...
Radagast. Posted August 31, 2014 Report Share Posted August 31, 2014 > 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). Quote Link to comment Share on other sites More sharing options...
agentx Posted August 31, 2014 Author Report Share Posted August 31, 2014 > so I will take a look at it.Thanks, that's great news! Quote Link to comment Share on other sites More sharing options...
agentx Posted August 31, 2014 Author Report Share Posted August 31, 2014 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. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted September 17, 2014 Report Share Posted September 17, 2014 Should be fixed in r15761 thanks to a patch by mimo. If you find other problems, please create new tickets for them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.