mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 22:59:12 +00:00
Annotated todos in /src/ai, per IRC discussion with alink
This commit is contained in:
parent
621a172807
commit
dae5fa7d29
@ -902,7 +902,7 @@ void ai::play_turn()
|
||||
{
|
||||
// Protect against a memory over commitment:
|
||||
/**
|
||||
* @todo Not in the mood to figure out the exact cause:
|
||||
* @todo 2.0 Not in the mood to figure out the exact cause:
|
||||
* For some reason -1 hitpoints cause a segmentation fault.
|
||||
* If -1 hitpoints are sent, we crash :/
|
||||
*/
|
||||
|
@ -407,7 +407,7 @@ void ai::attack_analysis::analyze(const gamemap& map, unit_map& units,
|
||||
// Note we didn't fight at all if defender is already dead.
|
||||
double prob_fought = (1.0 - prob_dead_already);
|
||||
|
||||
/** @todo FIXME: add combatant.prob_killed */
|
||||
/** @todo 1.8 add combatant.prob_killed */
|
||||
double prob_killed = def.hp_dist[0] - prob_dead_already;
|
||||
prob_dead_already = def.hp_dist[0];
|
||||
|
||||
@ -478,7 +478,7 @@ void ai::attack_analysis::analyze(const gamemap& map, unit_map& units,
|
||||
avg_damage_taken += (up->second.hitpoints() - att.average_hp()) * (1.0 - advance_prob);
|
||||
|
||||
/**
|
||||
* @todo FIXME: attack_prediction.cpp should understand advancement
|
||||
* @todo 1.8: attack_prediction.cpp should understand advancement
|
||||
* directly. For each level of attacker def gets 1 xp or
|
||||
* kill_experience.
|
||||
*/
|
||||
|
@ -83,8 +83,8 @@ bool ai_configuration::parse_side_config(const config& cfg,
|
||||
}
|
||||
|
||||
//set some default config values.
|
||||
//@todo: later, the entire 'ai parameter/ai memory/ai effective parameter' system should be refactored.
|
||||
//@todo: the following can also be rewritten to use a loop and a better version of bind_config_parameter [for each in default parameters T do bind_config_parameter(T,cfg,global_ai_params,defaults) ]
|
||||
//@todo 1.7 later, the entire 'ai parameter/ai memory/ai effective parameter' system should be refactored.
|
||||
//@todo 1.7 the following can also be rewritten to use a loop and a better version of bind_config_parameter [for each in default parameters T do bind_config_parameter(T,cfg,global_ai_params,defaults) ]
|
||||
ai_algorithm_type = bind_config_parameter(
|
||||
cfg["ai_algorithm"],
|
||||
global_ai_parameters["ai_algorithm"],
|
||||
@ -125,7 +125,7 @@ bool ai_configuration::parse_side_config(const config& cfg,
|
||||
|
||||
//some default values for the AI parameters following the default values listed
|
||||
//in the wiki at http://www.wesnoth.org/wiki/AiWML
|
||||
//@todo: think about reading this from config
|
||||
//@todo 1.7 think about reading this from config
|
||||
const config& ai_configuration::get_default_ai_parameters(){
|
||||
static config default_cfg;
|
||||
if (!default_cfg["init"].empty()) {
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
/**
|
||||
* AI parameters. class to deal with AI parameters. It is an implementation detail.
|
||||
* @todo: AI parameter/AI memory/AI effective parameter system must be reworked
|
||||
* @todo 1.7 AI parameter/AI memory/AI effective parameter system must be reworked
|
||||
* We need implementation which will allow easy access to all the parameters
|
||||
* which match any of the pre-defined set of filters
|
||||
* such as 'select from ai_parameters where time_of_day=first watch'
|
||||
|
@ -95,7 +95,7 @@ namespace dfool {
|
||||
// LOG_STREAM(info, ai)<<"dfool filter:"<<std::endl;
|
||||
unit_list filtered_units=filter_units(ff,my_units,get_info().units);
|
||||
|
||||
/** @todo FIXME: add sorting */
|
||||
/** @todo 2.0: add sorting */
|
||||
|
||||
for(unit_list::iterator i = filtered_units.begin(); i != filtered_units.end() && (num > order_units.size()); ++i) {
|
||||
unit_map::iterator ui=unit(*i,get_info().units);
|
||||
@ -255,7 +255,7 @@ bool dfool_ai::moveto(const config &o, unit_map::const_iterator m)
|
||||
int closest_distance = -1;
|
||||
std::pair<location,location> closest_move;
|
||||
|
||||
/** @todo This undoubtedly could be done more cleanly */
|
||||
/** @todo 2.0 This undoubtedly could be done more cleanly */
|
||||
for(move_map::const_iterator i = dstsrc.begin(); i != dstsrc.end(); ++i) {
|
||||
// Must restrict move_map to only unit that is moving.
|
||||
if(i->second==m->first){
|
||||
|
@ -157,7 +157,7 @@ void ai_holder::set_ai_algorithm_type( const std::string& ai_algorithm_type ){
|
||||
const std::string ai_holder::describe_ai()
|
||||
{
|
||||
std::string sidestr;
|
||||
//@todo: extract side naming to separate static function
|
||||
//@todo 1.7 extract side naming to separate static function
|
||||
if (this->side_ == ai_manager::AI_TEAM_FALLBACK_AI){
|
||||
sidestr = "'fallback_side'";
|
||||
} else if (this->side_ == ai_manager::AI_TEAM_COMMAND_AI){
|
||||
@ -359,7 +359,7 @@ long ai_manager::history_item_counter_ = 1;
|
||||
//this is stub code to allow testing of basic 'history', 'repeat-last-command', 'add/remove/replace ai' capabilities.
|
||||
//yes, it doesn't look nice. but it is usable.
|
||||
//to be refactored at earliest opportunity
|
||||
//@todo: extract to separate class which will use fai or lua parser
|
||||
//@todo 1.7 extract to separate class which will use fai or lua parser
|
||||
const std::string ai_manager::internal_evaluate_command( int side, const std::string& str ){
|
||||
const int MAX_HISTORY_VISIBLE = 30;
|
||||
|
||||
@ -473,7 +473,7 @@ const std::string ai_manager::internal_evaluate_command( int side, const std::st
|
||||
// ADD, CREATE AIs, OR LIST AI TYPES
|
||||
// =======================================================================
|
||||
|
||||
//@todo: add error reporting
|
||||
//@todo 1.7 add error reporting
|
||||
bool ai_manager::add_ai_for_side_from_file( int side, const std::string& file, bool replace )
|
||||
{
|
||||
config cfg;
|
||||
@ -508,7 +508,7 @@ bool ai_manager::add_ai_for_side_from_config( int side, const config& cfg, bool
|
||||
}
|
||||
|
||||
|
||||
//@todo: add error reporting
|
||||
//@todo 1.7 add error reporting
|
||||
bool ai_manager::add_ai_for_side( int side, const std::string& ai_algorithm_type, bool replace )
|
||||
{
|
||||
if (replace) {
|
||||
@ -523,7 +523,7 @@ bool ai_manager::add_ai_for_side( int side, const std::string& ai_algorithm_type
|
||||
|
||||
ai_interface* ai_manager::create_transient_ai( const std::string& ai_algorithm_type, int side, bool master )
|
||||
{
|
||||
//@todo: modify this code to use a 'factory lookup' pattern -
|
||||
//@todo 1.7 modify this code to use a 'factory lookup' pattern -
|
||||
//a singleton which holds a map<string,ai_factory> of all functors which can create AIs.
|
||||
//this will allow individual AI implementations to 'register' themselves.
|
||||
|
||||
|
@ -272,7 +272,7 @@ public:
|
||||
/**
|
||||
* Return a list of available AIs
|
||||
* @return the list of available AIs
|
||||
* @todo get this list from a list of files in specified directory
|
||||
* @todo 1.7 get this list from a list of files in specified directory
|
||||
*/
|
||||
static std::vector<std::string> get_available_ais();
|
||||
|
||||
@ -458,7 +458,7 @@ private:
|
||||
* @param i game information for the AI
|
||||
* @param side side number (1-based)
|
||||
* @param str string to evaluate
|
||||
* @todo: rewrite this function to use a fai or lua parser
|
||||
* @todo 1.7 rewrite this function to use a fai or lua parser
|
||||
*/
|
||||
static const std::string internal_evaluate_command( int side, const std::string& str );
|
||||
|
||||
@ -540,8 +540,8 @@ private:
|
||||
|
||||
};
|
||||
|
||||
//@todo: Refactor history handling and internal commands
|
||||
//@todo: Refactor all the mess with those AI parameters
|
||||
//@todo: AI Interface command to clear the history
|
||||
//@todo 1.7 Refactor history handling and internal commands
|
||||
//@todo 1.7 Refactor all the mess with those AI parameters
|
||||
//@todo 1.7 AI Interface command to clear the history
|
||||
|
||||
#endif
|
||||
|
@ -529,7 +529,6 @@ std::pair<map_location,map_location> ai::choose_move(std::vector<target>& target
|
||||
if(tg->type == target::VILLAGE) {
|
||||
if(current_team().ai_parameters().has_attribute("scout_village_targetting")) {
|
||||
rating *= lexical_cast_default<int>(current_team().ai_parameters()["scout_village_targetting"],3);
|
||||
// TODO: re-enable next line after forking 1.6
|
||||
//lg::wml_error << "[ai] the 'scout_village_targetting' attribute is deprecated, support will be removed in version 1.7.0; use 'scout_village_targeting' instead\n";
|
||||
}
|
||||
else {
|
||||
@ -565,7 +564,6 @@ std::pair<map_location,map_location> ai::choose_move(std::vector<target>& target
|
||||
bool simple_targeting = false;
|
||||
if(current_team().ai_parameters().has_attribute("simple_targetting")) {
|
||||
simple_targeting = utils::string_bool(current_team().ai_parameters()["simple_targetting"]);
|
||||
// TODO: re-enable next line after forking 1.6
|
||||
//lg::wml_error << "[ai] the 'simple_targetting' attribute is deprecated, support will be removed in version 1.7.0; use 'simple_targeting' instead\n";
|
||||
}
|
||||
else {
|
||||
@ -880,7 +878,7 @@ const map_location& ai::suitable_keep(const map_location& leader_location, const
|
||||
for(std::map<location,paths::route>::const_iterator rt = leader_paths.routes.begin(); rt != leader_paths.routes.end(); ++rt) {
|
||||
const map_location& loc = rt->first;
|
||||
if (keeps().find(loc)!=keeps().end()){
|
||||
//@todo: .move_left for 1-turn-moves is really "cost_to_get_there", it is just not renamed there yet. see r34430 for more detais.
|
||||
//@todo 1.7 move_left for 1-turn-moves is really "cost_to_get_there", it is just not renamed there yet. see r34430 for more detais.
|
||||
const int cost_to_loc = rt->second.move_left;
|
||||
if (units_.count(loc) == 0) {
|
||||
if ((*best_free_keep==map_location::null_location)||(cost_to_loc<cost_to_best_free_keep)){
|
||||
|
Loading…
x
Reference in New Issue
Block a user