Jump to content

Search the Community

Showing results for tags 'develop ai'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome
    • Announcements / News
    • Introductions & Off-Topic Discussion
    • Help & Feedback
  • 0 A.D.
    • General Discussion
    • Gameplay Discussion
    • Game Development & Technical Discussion
    • Art Development
    • Game Modification
    • Project Governance
    • Testing

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Lobby Name


Location


Interests


First Name


Last Name


Skype ID

Found 3 results

  1. Hi everyone, I’d like to share a small tool I made for anyone who wants to build their own AI for 0 A.D. GitHub: https://github.com/lilypoppybooks/PetraBot_Template The problem Starting a new bot from Petra usually begins with a tedious step: copy Petra, then rename it everywhere. Since R28 introduced JavaScript modules, you also have to fix about a hundred import paths. Miss a single one and your bot silently loads the original Petra code, or two derived bots overwrite each other in the game’s file system. The solution PetraBot_Template is an exact copy of Petra from Release 28, isolated in its own namespace, with no change in behavior. It comes with a small Python script that clones it under a new name: python3 clone_bot.py Alpha # creates PetraBot_Alpha.zip The script renames everything (mod, AI folder, imports) and keeps the license and credits intact. You get an independent, working bot ready to install, and several clones can play against each other in the same game. I've tested it over roughly 10 hours of games: I tested both land and naval maps across different game settings, repeatedly comparing the Petra bot, the PetraBot_Template, and the derived Petra. The result is that PetraBot_Template works and behaves exactly like Petra. Why? To make developing Petra-based bots easier. Instead of spending time on renaming, developers can focus on what matters: new ideas and new strategies. And since every bot starts from the same reliable base, it becomes simple to compare them fairly and to share results. Three gaps I see in Petra Petra is stable, but in my opinion three areas leave room for improvement: Naval strategy. Petra’s naval manager mostly handles trade, fishing, coastal defense and transport. The comment at the top of navalManager.js even lists sea scouting as an “ultimately” goal. On island maps, war fleets that take the initiative, sea control and coordinated landings would make a big difference. Politics, dialogue and intimidation. Petra already handles tributes and alliance requests, but its diplomacy is reactive and its messages don’t form a real dialogue. Imagine a bot with a diplomatic personality, one that can intimidate (demand a tribute and actually attack if refused), remember betrayals, or make calculated alliances. Exploration and strategy. Petra mostly picks its strategy from its own situation and reacts more than it anticipates. Early scouting, adapting to what was seen, choosing targets from gathered information and switching plans mid-game are all open fields. Each of these could be a project on its own, and the template makes it easy to start one. Links GitHub: https://github.com/lilypoppybooks/PetraBot_Template License: GPL-2.0-or-later, same as Petra. All credit for Petra goes to Wildfire Games and the Petra contributors. This project is not an official Wildfire Games project. If you build a bot from it, please share it here! I’d love to see clones play against each other and compare approaches. Feedback and suggestions are very welcome. petrabot_cycle.svg
  2. Because the documentation of the AIs are not so much, i want to create a litte tutorial with the first steps to develop a new AI while i develop my own AI. Execuse me for my english, I am from Germany and my english is not the best. At first you must create the following directory structur in the directory <Install Path>/binaries/data/mods, if it does not exists. <Module Name> simulation ai <Your AI Name> In this directory you add a new file data.json with the following text: { "name": "<AI Name>", "description": "<AI Description>", "moduleName" : "<Module Name>", "constructor": "<The Constructor Method>", "useShared": true } My data.json hast the following content: { "name": "NewAI", "description": "newAI", "moduleName" : "NEWAI", "constructor": "NewAIConstruct", "useShared": true } After this we create a new javascript file _init.js, if you want to use the common-api module (optional), with this module you dont have to develop the AI from low-level. AegisBot use this common-api too. Engine.IncludeModule("common-api"); This line loads the common-api module, which can be founded in the mods/public/public.zip/simulation/ai/common-api, but you dont have to copy this module, the game find this module in the public.zip, which is in this directory by default. After this we create a new javascript file, called as your modulename, e.q. "newAI.js" and must contains the constructor method in an anonymous function, saved in a var. var NEWAI = (function() { var m = {};//an empty object //your code must be placed here //return the module object return m; }()); This constructor method must return the module AI object! ---------------------------------------------------------------- This tutorial hasnt finished yet! I want to edit this post to append new steps.
  3. If i want to develop an new AI, how must i do this? I have seen your little documentation at http://trac.wildfiregames.com, but how can i add the AI to the game? I added an directory simulation/ai/myAI in the directory mods and added a data.json, but why does the game not load the AI, if i want to create a new game? EDIT: It works!
×
×
  • Create New...