AI interface cleaning

AI interface cleaning

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

AI interface cleaning

Post by lamer »

This is a TD list/note (mostly for myself) of partial AI interface cleaning/refactoring.
  • [-?] int SkirmishAII::GetTeamId()

    [-] int Game::GetMyTeam()
    [+] Team* Game::GetMyTeam()

    [-] Teams* Game::GetTeams() //returns Teams object with only 1 method GetSize()
    [+] std::vector<Team*> Game::GetTeams()

    [-] std::vector<Team*> OOAICallback::GetAllyTeams()
    [-] std::vector<Team*> OOAICallback::GetEnemyTeams() //returns everything that is not ally (enemy, neutral, gaia)
    [+] bool Team::IsAllied(Team*)

    [-] bool Team::HasAIController() //it is only here for awk-script to generate proper constructor, useless imho

    [-] int SkirmishAIs::GetMax()
    [+] int OOAICallback::GetMaxSkirmishAIs()

    [-] SkirmishAIs* OOAICallback::GetSkirmishAIs()
    [+] std::vector<SkirmishAI*> OOAICallback::GetSkirmishAIs()

    [-] float Game::GetTeamResourceCurrent(int otherTeamId, int resourceId)
    [-] float Game::GetTeamResourceIncome(int otherTeamId, int resourceId)
    [-] float Game::GetTeamResourceUsage(int otherTeamId, int resourceId)
    [+] float Game::GetTeamResourceCurrent(Team* otherTeam, Resource* resource)
    [+] float Game::GetTeamResourceIncome(Team* otherTeam, Resource* resource)
    [+] float Game::GetTeamResourceUsage(Team* otherTeam, Resource* resource)
    i.e. replace as much ids with objects as possible.
  • Delete classes
    Teams, SkirmishAIs, <Other>s
  • Delete deprecated methods
  • OOAICallback::GetDebug() is not as full as in Legacy (missing overlay texture operations)
  • OOAICallback::GetEngine() doesn't provide any info (not sure if necessary)
Last edited by lamer on 20 Aug 2015, 18:03, edited 4 times in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI interface cleaning

Post by AF »

Which interface are you speaking of? The engine side? The C API? The C++ legacy API? The newer C++ API?
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: AI interface cleaning

Post by lamer »

The engine side. The C API. The newer C++/Java API (as being only an automagically generated wrapper around C API).
Legacy is legacy, won't touch it. Also there is no named functions in legacy interface.
Planning to make those changes after .99 release.

EDIT: Probably legacy will get in the way. I forgot that there is no new interface but only new C++/Java wrappers based on same C API.
Post Reply

Return to “AI”