Skip to content

Commit

Permalink
Move AI navigation to xrAICore.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Dec 9, 2015
1 parent d0b5e12 commit e1fa93f
Show file tree
Hide file tree
Showing 373 changed files with 2,888 additions and 3,701 deletions.
24 changes: 13 additions & 11 deletions src/xrServerEntities/LevelGameDef.h → src/Common/LevelGameDef.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//---------------------------------------------------------------------------
#ifndef LevelGameDefH
#define LevelGameDefH
#pragma once

#define RPOINT_CHOOSE_NAME "$rpoint"
#define ENVMOD_CHOOSE_NAME "$env_mod"
Expand All @@ -20,9 +18,10 @@ enum EWayType{
};

enum ERPpointType{ // [0..255]
rptActorSpawn = 0,
rptArtefactSpawn ,
rptItemSpawn ,
rptActorSpawn = 0,
rptArtefactSpawn,
rptItemSpawn,
rptLast = 0xff
};

enum EEnvModUsedParams{ eViewDist =(1<<0),
Expand All @@ -33,8 +32,14 @@ enum EEnvModUsedParams{ eViewDist =(1<<0),
eHemiColor =(1<<5)
};

extern ECORE_API xr_token rpoint_type[];
extern ECORE_API xr_token rpoint_game_type[];
/* // XXX: find better place for this (need cpp)
xr_token rpoint_type[] = {
{"Actor Spawn", rptActorSpawn},
{"Artefact Spawn", rptArtefactSpawn},
{"Item Spawn", rptItemSpawn},
{nullptr, rptLast}
};
*/

// BASE offset
#define WAY_BASE 0x1000
Expand Down Expand Up @@ -98,6 +103,3 @@ extern ECORE_API xr_token rpoint_game_type[];
-//-
*/
//---------------------------------------------------------------------------
#endif //LevelGameDefH

2 changes: 2 additions & 0 deletions src/Common/LevelStructure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ struct SNodePositionOld
typedef SNodePositionOld NodePosition;
#endif

const char LEVEL_GRAPH_NAME[] = "level.ai";

const u32 XRCL_CURRENT_VERSION = 18; // input
const u32 XRCL_PRODUCTION_VERSION = 14; // output
const u32 CFORM_CURRENT_VERSION = 4;
Expand Down
5 changes: 4 additions & 1 deletion src/Include/xrAPI/xrAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class IUIRender;
class CGameMtlLibrary;
class CRender;
class CScriptEngine;
class AISpaceBase;

class XRAPI_API EngineGlobalEnvironment
{
Expand All @@ -33,6 +34,8 @@ class XRAPI_API EngineGlobalEnvironment
#endif
IRenderFactory* RenderFactory;
CScriptEngine* ScriptEngine;
AISpaceBase *AISpace;
};

extern XRAPI_API EngineGlobalEnvironment GlobalEnv;
extern XRAPI_API EngineGlobalEnvironment GlobalEnv; // XXX: rename to GEnv
extern XRAPI_API bool g_dedicated_server; // XXX: move to EngineGlobalEnvironment
1 change: 1 addition & 0 deletions src/Layers/xrAPI/xrAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#include "Include/xrAPI/xrAPI.h"

EngineGlobalEnvironment GlobalEnv = {};
bool g_dedicated_server = false;
2 changes: 1 addition & 1 deletion src/utils/xrAI/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct vertex // definition of "patch" or "node"

DEF_VECTOR(DWORDs,u32);

#include "xrGame/level_graph.h"
#include "xrAICore/Navigation/level_graph.h"

void Compress (CLevelGraph::CVertex& Dest, vertex& Src);

Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrAI/compiler_load.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "compiler.h"
#include "levelgamedef.h"
#include "xrGame/level_graph.h"
#include "Common/LevelGameDef.h"
#include "xrAICore/Navigation/level_graph.h"
#include "AIMapExport.h"

IC const Fvector vertex_position(const CLevelGraph::CPosition &Psrc, const Fbox &bb, const SAIParams &params)
Expand Down
8 changes: 4 additions & 4 deletions src/utils/xrAI/game_graph_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

#include "stdafx.h"
#include "game_graph_builder.h"
#include "xrGame/level_graph.h"
#include "xrGame/graph_abstract.h"
#include "xrAICore/Navigation/level_graph.h"
#include "xrAICore/Navigation/graph_abstract.h"
#include "xrMessages.h"
#include "xrServer_Objects_ALife.h"
#include "factory_api.h"
#include "xrGame/game_level_cross_table.h"
#include "xrAICore/Navigation/game_level_cross_table.h"
#include "xrCrossTable.h"
#include "guid_generator.h"
#include "xrGame/graph_engine.h"
#include "xrAICore/Navigation/graph_engine.h"

CGameGraphBuilder::CGameGraphBuilder ()
{
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrAI/game_spawn_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "xrServer_Objects_ALife_All.h"
#include "xrai.h"
#include "server_entity_wrapper.h"
#include "xrGame/graph_engine.h"
#include "xrGame/patrol_path_storage.h"
#include "xrAICore/Navigation/graph_engine.h"
#include "xrAICore/Navigation/PatrolPath/patrol_path_storage.h"

extern LPCSTR GAME_CONFIG;
extern LPCSTR generate_temp_file_name (LPCSTR header0, LPCSTR header1, string_path& buffer);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrAI/game_spawn_constructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "alife_space.h"
#include "xr_graph_merge.h"
#include "utils/xrLCUtil/xrThread.hpp"
#include "xrGame/graph_abstract.h"
#include "xrAICore/Navigation/graph_abstract.h"
#include "xrServer_Object_Base.h"
#include "spawn_constructor_space.h"
#include "server_entity_wrapper.h"
Expand Down
8 changes: 4 additions & 4 deletions src/utils/xrAI/level_spawn_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

#include "stdafx.h"
#include "level_spawn_constructor.h"
#include "xrGame/game_level_cross_table.h"
#include "xrGame/level_graph.h"
#include "xrGame/graph_engine.h"
#include "xrAICore/Navigation/game_level_cross_table.h"
#include "xrAICore/Navigation/level_graph.h"
#include "xrAICore/Navigation/graph_engine.h"
#include "xrmessages.h"
#include "xrServer_Objects_ALife_All.h"
#include "factory_api.h"
#include "clsid_game.h"
#include "game_base_space.h"
#include "game_spawn_constructor.h"
#include "xrGame/patrol_path_storage.h"
#include "xrAICore/Navigation/PatrolPath/patrol_path_storage.h"
#include "space_restrictor_wrapper.h"
#include "Common/object_broker.h"
#include "restriction_space.h"
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrAI/space_restrictor_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "stdafx.h"
#include "space_restrictor_wrapper.h"
#include "xrServer_Objects_ALife.h"
#include "xrGame/level_graph.h"
#include "xrGame/graph_engine.h"
#include "xrAICore/Navigation/level_graph.h"
#include "xrAICore/Navigation/graph_engine.h"

IC Fvector construct_position (CLevelGraph &level_graph,u32 level_vertex_id, float x, float z)
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrAI/spawn_constructor_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#include "xrGame/game_graph.h"
#include "xrAICore/Navigation/game_graph.h"

class CSE_ALifeLevelChanger;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrAI/verify_level_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "xrGame/level_graph.h"
#include "xrAICore/Navigation/level_graph.h"

CLevelGraph::CVertex **stack_storage;

Expand Down
3 changes: 1 addition & 2 deletions src/utils/xrAI/xrAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#pragma comment(lib,"MagicFM.LIB")
#pragma comment(lib,"xrCore.LIB")
#pragma comment(lib, "xrLCUtil.lib")
#pragma comment(lib, "xrAICore.lib")

#include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp"
#include "xrCore/cdecl_cast.hpp"
Expand Down Expand Up @@ -55,8 +56,6 @@ CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast(
{ Logger.Progress(progress); }
);

extern LPCSTR LEVEL_GRAPH_NAME;

extern void xrCompiler (LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name);
extern void test_smooth_path (LPCSTR name);
extern void test_hierarchy (LPCSTR name);
Expand Down
89 changes: 8 additions & 81 deletions src/utils/xrAI/xrAI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\xrEngine\xrLoadSurface.cpp" />
<ClCompile Include="..\..\xrGame\random32.cpp" />
<ClCompile Include="..\..\xrServerEntities\alife_human_brain.cpp" />
<ClCompile Include="..\..\xrServerEntities\alife_monster_brain.cpp" />
<ClCompile Include="..\..\xrServerEntities\alife_space.cpp" />
Expand Down Expand Up @@ -246,12 +245,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\xrGame\level_graph.cpp" />
<ClCompile Include="..\..\xrGame\level_graph_vertex.cpp" />
<ClCompile Include="level_spawn_constructor.cpp" />
<ClCompile Include="..\..\xrGame\patrol_path.cpp" />
<ClCompile Include="..\..\xrGame\patrol_path_storage.cpp" />
<ClCompile Include="..\..\xrGame\patrol_point.cpp" />
<ClCompile Include="server_entity_wrapper.cpp" />
<ClCompile Include="space_restrictor_wrapper.cpp" />
<ClCompile Include="spawn_patcher.cpp" />
Expand All @@ -266,7 +260,6 @@
<ClCompile Include="xr_graph_merge.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\xrGame\random32.h" />
<ClInclude Include="..\..\xrServerEntities\alife_human_brain.h" />
<ClInclude Include="..\..\xrServerEntities\alife_human_brain_inline.h" />
<ClInclude Include="..\..\xrServerEntities\alife_monster_brain.h" />
Expand All @@ -275,7 +268,6 @@
<ClInclude Include="..\..\xrServerEntities\character_info_defs.h" />
<ClInclude Include="..\..\xrServerEntities\clsid_game.h" />
<ClInclude Include="..\..\xrServerEntities\game_base_space.h" />
<ClInclude Include="..\..\xrGame\game_graph_space.h" />
<ClInclude Include="..\..\xrServerEntities\InfoPortionDefs.h" />
<ClInclude Include="..\..\xrServerEntities\inventory_space.h" />
<ClInclude Include="..\..\xrServerEntities\ItemListTypes.h" />
Expand All @@ -302,83 +294,18 @@
<ClInclude Include="..\..\xrServerEntities\xrServer_Object_Base.h" />
<ClInclude Include="..\..\xrServerEntities\xrServer_Space.h" />
<ClInclude Include="AIMapExport.h" />
<ClInclude Include="..\..\xrGame\a_star.h" />
<ClInclude Include="..\..\xrGame\a_star_inline.h" />
<ClInclude Include="..\..\xrGame\builder_allocator_constructor.h" />
<ClInclude Include="..\..\xrGame\builder_allocator_constructor_inline.h" />
<ClInclude Include="compiler.h" />
<ClInclude Include="cover_point.h" />
<ClInclude Include="cover_point_inline.h" />
<ClInclude Include="..\..\xrGame\data_storage_binary_heap.h" />
<ClInclude Include="..\..\xrGame\data_storage_binary_heap_inline.h" />
<ClInclude Include="..\..\xrGame\data_storage_bucket_list.h" />
<ClInclude Include="..\..\xrGame\data_storage_bucket_list_inline.h" />
<ClInclude Include="..\..\xrGame\data_storage_constructor.h" />
<ClInclude Include="..\..\xrGame\data_storage_double_linked_list.h" />
<ClInclude Include="..\..\xrGame\data_storage_double_linked_list_inline.h" />
<ClInclude Include="..\..\xrGame\data_storage_single_linked_list.h" />
<ClInclude Include="..\..\xrGame\data_storage_single_linked_list_inline.h" />
<ClInclude Include="..\..\xrGame\dijkstra.h" />
<ClInclude Include="..\..\xrGame\dijkstra_inline.h" />
<ClInclude Include="..\..\xrGame\edge_path.h" />
<ClInclude Include="..\..\xrGame\edge_path_inline.h" />
<ClInclude Include="ETextureParams.h" />
<ClInclude Include="factory_api.h" />
<ClInclude Include="..\..\xrGame\game_graph.h" />
<ClInclude Include="game_graph_builder.h" />
<ClInclude Include="game_graph_builder_inline.h" />
<ClInclude Include="..\..\xrGame\game_graph_inline.h" />
<ClInclude Include="..\..\xrGame\game_level_cross_table.h" />
<ClInclude Include="..\..\xrGame\game_level_cross_table_inline.h" />
<ClInclude Include="game_spawn_constructor.h" />
<ClInclude Include="game_spawn_constructor_inline.h" />
<ClInclude Include="..\..\xrGame\graph_abstract.h" />
<ClInclude Include="..\..\xrGame\graph_abstract_inline.h" />
<ClInclude Include="..\..\xrGame\graph_edge.h" />
<ClInclude Include="..\..\xrGame\graph_edge_inline.h" />
<ClInclude Include="..\..\xrGame\graph_engine.h" />
<ClInclude Include="..\..\xrGame\graph_engine_inline.h" />
<ClInclude Include="..\..\xrGame\graph_engine_space.h" />
<ClInclude Include="..\..\xrGame\graph_vertex.h" />
<ClInclude Include="..\..\xrGame\graph_vertex_inline.h" />
<ClInclude Include="guid_generator.h" />
<ClInclude Include="LevelGameDef.h" />
<ClInclude Include="..\..\xrGame\level_graph.h" />
<ClInclude Include="..\..\xrGame\level_graph_inline.h" />
<ClInclude Include="..\..\xrGame\level_graph_space.h" />
<ClInclude Include="..\..\xrGame\level_graph_vertex_inline.h" />
<ClInclude Include="level_spawn_constructor.h" />
<ClInclude Include="level_spawn_constructor_inline.h" />
<ClInclude Include="..\..\xrGame\manager_builder_allocator_constructor.h" />
<ClInclude Include="..\..\xrGame\manager_builder_allocator_constructor_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager.h" />
<ClInclude Include="..\..\xrGame\path_manager_game.h" />
<ClInclude Include="..\..\xrGame\path_manager_game_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_game_level.h" />
<ClInclude Include="..\..\xrGame\path_manager_game_level_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_game_vertex_type.h" />
<ClInclude Include="..\..\xrGame\path_manager_game_vertex_type_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_generic.h" />
<ClInclude Include="..\..\xrGame\path_manager_generic_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_level.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_evaluator.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_evaluator_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_flooder.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_flooder_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_straight_line.h" />
<ClInclude Include="..\..\xrGame\path_manager_level_straight_line_inline.h" />
<ClInclude Include="..\..\xrGame\path_manager_params.h" />
<ClInclude Include="..\..\xrGame\path_manager_params_flooder.h" />
<ClInclude Include="..\..\xrGame\path_manager_params_game_level.h" />
<ClInclude Include="..\..\xrGame\path_manager_params_straight_line.h" />
<ClInclude Include="..\..\xrGame\patrol_path.h" />
<ClInclude Include="..\..\xrGame\patrol_path_inline.h" />
<ClInclude Include="..\..\xrGame\patrol_path_storage.h" />
<ClInclude Include="..\..\xrGame\patrol_path_storage_inline.h" />
<ClInclude Include="..\..\xrGame\patrol_point.h" />
<ClInclude Include="..\..\xrGame\patrol_point_inline.h" />
<ClInclude Include="profiler.h" />
<ClInclude Include="PropertiesListHelper.h" />
<ClInclude Include="quadtree.h" />
<ClInclude Include="quadtree_inline.h" />
Expand All @@ -391,14 +318,6 @@
<ClInclude Include="spawn_constructor_space.h" />
<ClInclude Include="spawn_patcher.h" />
<ClInclude Include="StdAfx.h" />
<ClInclude Include="..\..\xrGame\vertex_allocator_fixed.h" />
<ClInclude Include="..\..\xrGame\vertex_allocator_fixed_inline.h" />
<ClInclude Include="..\..\xrGame\vertex_manager_fixed.h" />
<ClInclude Include="..\..\xrGame\vertex_manager_fixed_inline.h" />
<ClInclude Include="..\..\xrGame\vertex_manager_hash_fixed.h" />
<ClInclude Include="..\..\xrGame\vertex_manager_hash_fixed_inline.h" />
<ClInclude Include="..\..\xrGame\vertex_path.h" />
<ClInclude Include="..\..\xrGame\vertex_path_inline.h" />
<ClInclude Include="xrAI.h" />
<ClInclude Include="xrCrossTable.h" />
<ClInclude Include="xrShaderTypes.h" />
Expand All @@ -407,6 +326,14 @@
<ItemGroup>
<ResourceCompile Include="resource.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\xrAICore\xrAICore.vcxproj">
<Project>{5cb057d8-4464-40a6-af10-c26b826d1d90}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
Loading

0 comments on commit e1fa93f

Please sign in to comment.