Index: src/ai/configuration.cpp
===================================================================
--- src/ai/configuration.cpp	(revision 42728)
+++ src/ai/configuration.cpp	(working copy)
@@ -107,6 +107,7 @@
 
 		description desc;
 		desc.id=id;
+		desc.sort_order = lexical_cast_default<int>(ai_configuration["sort_order"],0);
 		desc.text=ai_configuration["description"];
 		desc.cfg=ai_configuration;
 
@@ -132,6 +133,7 @@
 
 		description desc;
 		desc.id=id;
+		desc.sort_order = lexical_cast_default<int>(ai_configuration["sort_order"],0);
 		desc.text=ai_configuration["description"];
 		desc.cfg=ai_configuration;
 
@@ -150,6 +152,7 @@
 		ais_list.push_back(&desc->second);
 		DBG_AI_CONFIGURATION << "has ai with config: "<< std::endl << desc->second.cfg<< std::endl;
 	}
+	std::stable_sort(ais_list.begin(), ais_list.end(), description_sorter);
 	return ais_list;
 }
 
@@ -185,6 +188,26 @@
 	return cfg;//in boolean context
 }
 
+const std::string configuration::get_default_ai_algorithm()
+{
+	std::string ai_default_algorithm = "default";
+	int ai_max_order = 0;
+
+	for(description_map::iterator desc = ai_configurations_.begin(); desc!=ai_configurations_.end(); ++desc) {
+		if (desc->second.sort_order > ai_max_order) {
+			ai_max_order = desc->second.sort_order;
+			ai_default_algorithm = desc->first;
+		}
+	}
+	for(description_map::iterator desc = era_ai_configurations_.begin(); desc!=era_ai_configurations_.end(); ++desc) {
+		if (desc->second.sort_order > ai_max_order) {
+			ai_max_order = desc->second.sort_order;
+			ai_default_algorithm = desc->first;
+		}
+	}
+	return ai_default_algorithm;
+}
+
 const config& configuration::get_default_ai_parameters()
 {
 	return default_config_;
Index: src/ai/configuration.hpp
===================================================================
--- src/ai/configuration.hpp	(revision 42728)
+++ src/ai/configuration.hpp	(working copy)
@@ -58,9 +58,18 @@
 
 	std::string text;
 	std::string id;
+	int sort_order;
 	config cfg;
 };
 
+/**
+ * Sort AI descriptions based on their sort_order
+ */
+inline bool description_sorter(const description *desc1, const description *desc2)
+{
+	return (desc1->sort_order > desc2->sort_order);
+};
+
 class configuration {
 public:
 
@@ -78,6 +87,10 @@
 	 */
 	static const config& get_default_ai_parameters();
 
+	/**
+	 * Return the name of the default algorithm
+	 */
+	static const std::string get_default_ai_algorithm();
 
 	/**
 	 * Return the config for a specified ai
Index: src/multiplayer_connect.cpp
===================================================================
--- src/multiplayer_connect.cpp	(revision 42728)
+++ src/multiplayer_connect.cpp	(working copy)
@@ -168,10 +168,12 @@
 
 	update_faction_combo();
 
-	if (const config &ai = cfg_.child("ai"))
-		ai_algorithm_ = lexical_cast_default<std::string>(ai["ai_algorithm"], "default");
-	else
-		ai_algorithm_ = "default";
+	const std::string default_ai = ai::configuration::get_default_ai_algorithm();
+ 	if (const config &ai = cfg_.child("ai"))
+		ai_algorithm_ = lexical_cast_default<std::string>(ai["ai_algorithm"], default_ai);
+ 	else
+		ai_algorithm_ = default_ai;
+
 	init_ai_algorithm_combo();
 
 	// "Faction name" hack
Index: changelog
===================================================================
--- changelog	(revision 42728)
+++ changelog	(working copy)
@@ -57,6 +57,7 @@
    * added "leaf litter" terrain
    * added new "mine rail tracks" terrain
  * User interface:
+   * Added sort on the available AI based on the setting for sort_order
    * Added the era AI in the list of AI shown when opening a game
    * Added dialog for installation of add-on dependencies
    * Removed the unused gui2 menu bar
@@ -94,6 +95,7 @@
    * Tooltips of ellipsed text are grouped in the last visible item's tooltip
    * Increase a little tooltip's opacity
  * WML Engine:
+   * Add a sort_order property to the [ai] key when used inside [era]
    * Deprecated [set_variable]'s random key, use rand instead
    * Renamed [unit][status] healable to unhealable so it can default to 'no'
    * Added 'side X turn refresh' and 'side X turn Y refresh' events
