Introduction
This is a simple walk through of a demo project included in Project Anarchy setup which we can use and modify to our liking.Project Anarchy is a game engine which is free for Android game Development(also available for Tizen).Modify,implement get your own game logic going with Havok Physics engine.
Background
Project Anarchy is a game engine meant for mobile development integrated within is Havok's heart (the main tools),its very easy to create AAA animated game and this game engine is from Intel.
Modifying the Game Demo
Project Anarchy comprises of
i)Havok Vision Engine
ii)Havok Physics
iii)Havok Animation Studio
Programming skill-set required for developing games with Project Anarchy
i)LUA:- Most importantly you need knowledge of LUA Scripting because character logics action moves etc everything is done using LUA Scripting
ii)C++ :-The compilation part to form the final APK plus some debugging is done using C++ so knowledge of C++ is required
A look at the executables you get after downloading
Prerequisites for Installation of Project Anarchy
Android ADT bundle needs to be there (32bit) with package to be installed is 2.3.3 that is the requirement for Project Anarchy
Android NDK r9(32bit) needs to be installed on your computer.
Download VC++ 2010 express edition
Download Direct X 2010 SDK
You may find some issues while installing probably s1023 error so in command prompt with administrative privileges you need to put this command
MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
After that you will be good to go
Download and install JDK 7(x86)
Step by step instruction can be found here
https://www.projectanarchy.com/setting-your-computer-android-development
Let's start by recognizing your Android phone
My phone :Lenovo K900
I went to command prompt mode and getting into the android ADT installed link I typed in this command to check if the device was available or not
It was not showing anything and then I installed Lenovo K900 drivers and then checked again and so it was there.
Started installing the phone drivers(its important to do it otherwise your device will not get recognized)
Another screenshot showing the installation of drivers
It was not showing anything and then I installed Lenovo K900 drivers and then checked again and so it was there
It's time to experiment
I will be targeting the RPG Demo its available as a free version and the demo has got some cool GUI and great 3D graphics.
VForge :-
VForge is the place in Project Anarchy where everything is setup for development. It is the interface where you start from Scratch or modify a project. Lot of toolsets are available for developing the games
I start by getting into the RPG project and start making changes to the project.
The Scene is located at this location
C:\Havok\AnarchySDK\Data\Vision\Samples\Engine\RPG
open the Project in VForge prior to this lets do some modifications to the main player LUA file lets increase the health of the player
-- Script for the player character
function GetEntityClassType(self)<br />
return "RPG_PlayerCharacter";<br />
end
function OnInitProperties(self) <br />
-- Entity Properties<br />
self:SetProperty("m_collisionRadius", 40);<br />
self:SetProperty("m_collisionHeight", 160);<br />
self:SetProperty("m_sensorSize", 256);<br />
self:SetProperty("m_desiredSpeed", 350);
self:SetProperty("m_equipmentAttachmentBoneNames[ES_Weapon]", "right_attachment_jnt");<br />
self:SetProperty("m_equipmentAttachmentBoneNames[ES_Shoulder]", "left_shouderPad_jnt");<br />
<br />
self:SetProperty("m_defaultEquipmentScripts[ES_Weapon]", "Scripts/Pickups/RPG_Barbarian_Axe.lua");<br />
--self:SetProperty("m_defaultEquipmentScripts[ES_Shoulder]", "Scripts/Pickups/RPG_Barbarian_Shoulder.lua");
self:SetProperty("m_actionData.m_spawnAnimationDelay", 1.4);
-- base character stats<br />
self:SetProperty("m_stats.m_strength", 16);<br />
self:SetProperty("m_stats.m_dexterity", 12);<br />
self:SetProperty("m_stats.m_spirit", 10);<br />
self:SetProperty("m_stats.m_vitality", 12);
-- health<br />
self:SetProperty("m_stats.m_baseHealth", 200);<br />
self:SetProperty("m_stats.m_healthRegenerationEnabled", true);<br />
self:SetProperty("m_stats.m_healthRegenerationRate", 0.8);<br />
self:SetProperty("m_stats.m_unlimitedHealth", false);<br />
self:SetProperty("m_displayHealth", true);
-- mana<br />
self:SetProperty("m_stats.m_baseMana", 30);<br />
self:SetProperty("m_stats.m_manaRegenerationEnabled", true);<br />
self:SetProperty("m_stats.m_manaRegenerationRate", 0.8);
-- attacks<br />
self:SetProperty("m_stats.m_baseDamage", 60);
self:SetProperty("m_actionData.m_aoeAttackDamageMultiplier", 3);<br />
self:SetProperty("m_actionData.m_aoeAttackRange", 250);<br />
self:SetProperty("m_actionData.m_aoeAttackManaCost", 14);<br />
<br />
self:SetProperty("m_actionData.m_powerAttackDamageMultiplier", 2);<br />
self:SetProperty("m_actionData.m_powerAttackRange", 750);<br />
self:SetProperty("m_actionData.m_powerAttackAngle", 10);<br />
self:SetProperty("m_actionData.m_powerAttackManaCost", 8);<br />
<br />
self:SetProperty("m_actionData.m_rangedAttackImpactSpeedMultiplier", 1);<br />
self:SetProperty("m_actionData.m_aoeAttackImpactSpeedMultiplier", 1.5);<br />
self:SetProperty("m_actionData.m_powerAttackImpactSpeedMultiplier", 2);<br />
self:SetProperty("m_actionData.m_meleeAttackImpactSpeedMultiplier", 1);
-- debugging<br />
self:SetProperty("m_debugDisplayStats", false);<br />
self:SetProperty("m_debugDisplayMovementInfo", false);<br />
self:SetProperty("m_debugDisplayInventory", false);<br />
self:SetProperty("m_debugDisplayBehaviorEvents", false);<br />
self:SetProperty("m_debugDisplayNavmeshStatus", false);<br />
self:SetProperty("m_debugDisplayEffectInformation", false);
end
Its base Health is 200 lets increase the Health of the player so that it dies less often
-- health<br />
self:SetProperty("m_stats.m_baseHealth", 1200);
Lets Scale the Characters
There are lot of options in the VForge menu to work upon like you can drag and drop a character scale it rotate it
and there on
First of lets drag the RPG_Garden_Caster to the scene and scale it
We drag and scale other enemies
rotate and scale again
Checking the Scene after modification and running it
Saving the Scene so that we can compile it for the final package
It will export the scene as you compile it in Vforge
Open the Android build for the project in VC++
The path where it is there
C:\Havok\AnarchySDK\Workspace\Android_x86_VS2010_anarchy__C++
The place where you add or modify the scene
#define LOGOHAVOK_FILENAME "GUI/Textures/Logo_Havok_128x64.tga"<br />
#define LOGOWMD_FILENAME "GUI/Textures/Logo_WMD_128x256.tga"<br />
#define INTROSCREEN_FILENAME "GUI/Textures/Anarchy_Intro_512x512.tga"<br />
#define GAMEOVERSCREEN_FILENAME "GUI/Textures/Anarchy_GameOver_512x512.tga"<br />
#define LOADINGSCREEN_FILENAME "GUI/Textures/Anarchy_Splash_512x512.tga"<br />
#define SCENE_FILENAME "Scenes/Arena/Arena1.vscene"
You need to modify the SCENE_FILENAME options to the scene you created and then set RPG as the Startup project
Lets start compiling the project I selected the Release build
The Important files getting compiled in the build process
1>------ Build started: Project: VisionEnginePlugin, Configuration: Release hkAndroid ------<br />
2>------ Build started: Project: HavokPhysicsEnginePlugin, Configuration: Release hkAndroid ------<br />
3>------ Build started: Project: HavokBehaviorEnginePlugin, Configuration: Release hkAndroid ------<br />
4>------ Build started: Project: FmodEnginePlugin, Configuration: Release hkAndroid ------<br />
1>C:\Havok\AnarchySDK\Build\MSBuild\Platforms\hkAndroid\Microsoft.Cpp.hkAndroid.Targets(328,5): warning : The x86 toolchain doesn't seem to play nice with the STL, or C++ features. Use at your own risk.<br />
2>C:\Havok\AnarchySDK\Build\MSBuild\Platforms\hkAndroid\Microsoft.Cpp.hkAndroid.Targets(328,5): warning : The x86 toolchain doesn't seem to play nice with the STL, or C++ features. Use at your own risk.<br />
4>C:\Havok\AnarchySDK\Build\MSBuild\Platforms\hkAndroid\Microsoft.Cpp.hkAndroid.Targets(328,5): warning : The x86 toolchain doesn't seem to play nice with the STL, or C++ features. Use at your own risk.<br />
3>C:\Havok\AnarchySDK\Build\MSBuild\Platforms\hkAndroid\Microsoft.Cpp.hkAndroid.Targets(328,5): warning : The x86 toolchain doesn't seem to play nice with the STL, or C++ features. Use at your own risk.<br />
4> Performing Custom Build Tools<br />
1> Performing Custom Build Tools<br />
2> Performing Custom Build Tools<br />
3> Performing Custom Build Tools<br />
3> Language subdirectory: lua<br />
3> Search paths:<br />
3> .\<br />
3> ..\..\..\..\..\<br />
4> Language subdirectory: lua<br />
4> Search paths:<br />
4> .\<br />
4> ..\..\..\..\..\<br />
4> .\swig_lib\lua\<br />
4> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\lua\<br />
4> \lua\<br />
4> .\swig_lib\<br />
4> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\<br />
4> \<br />
4> Preprocessing...<br />
4> Starting language-specific parse...<br />
3> .\swig_lib\lua\<br />
3> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\lua\<br />
3> \lua\<br />
3> .\swig_lib\<br />
3> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\<br />
3> \<br />
3> Preprocessing...<br />
3> Starting language-specific parse...<br />
2> Language subdirectory: lua<br />
2> Search paths:<br />
2> .\<br />
2> ..\..\..\..\..\<br />
2> .\swig_lib\lua\<br />
2> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\lua\<br />
2> \lua\<br />
2> .\swig_lib\<br />
2> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\<br />
2> \<br />
2> Preprocessing...<br />
2> Starting language-specific parse...<br />
4> Processing types...<br />
4> C++ analysis...<br />
4> Generating wrappers...<br />
2> Processing types...<br />
2> C++ analysis...<br />
2> Generating wrappers...<br />
3> Processing types...<br />
3> C++ analysis...<br />
3> Generating wrappers...<br />
1> Language subdirectory: lua<br />
1> Search paths:<br />
1> .\<br />
1> ..\..\..\..\<br />
1> .\swig_lib\lua\<br />
1> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\lua\<br />
1> \lua\<br />
1> .\swig_lib\<br />
1> C:\Havok\AnarchySDK\ThirdParty\redistsdks\swig\2.0.3\Lib\<br />
1> \<br />
1> Preprocessing...<br />
1> Starting language-specific parse...<br />
1> Processing types...<br />
1> C++ analysis...<br />
1> Generating wrappers...<br />
4> Section 1: OK<br />
4> Parsing finished.<br />
4> Rewriting cpp...<br />
4> Writing Lua/FmodLuaModule_wrapper.cpp<br />
2> Section 1: OK<br />
4> Success<br />
2> Parsing finished.<br />
2> Rewriting cpp...<br />
2> Writing Lua/PhysicsLuaModule_wrapper.cpp<br />
2> Success<br />
3> Section 1: OK<br />
3> Parsing finished.<br />
3> Rewriting cpp...<br />
3> Writing Lua/BehaviorLuaModule_wrapper.cpp<br />
3> Success<br />
4> VFmodEvent.cpp<br />
2> vHavokBallAndSocketConstraintChain.cpp<br />
3> vHavokBehaviorResource.cpp<br />
1> Section 1: OK<br />
1> Section 2: OK<br />
1> Section 6: OK<br />
1> Section 8: OK<br />
1> Section 9: OK<br />
1> Parsing finished.<br />
1> Input file is valid, rewriting cpp and generating hpp...<br />
1> No need to update Scripting/Lua\VisionLuaModule_wrapper.hpp<br />
1> Writing Scripting/Lua/VisionLuaModule_wrapper.cpp<br />
1> Success<br />
1> VisionEnginePluginPCH.h<br />
1> SkyLayer.cpp<br />
1> DecorationDensityChannel.cpp<br />
4> VFmodReverb.cpp<br />
1> Projector.cpp<br />
4> FmodLuaModule_wrapper.cpp<br />
1> VTransitionStateMachine.cpp<br />
1> VFollowPathComponent.cpp<br />
1> IVMenuSystemResource.cpp<br />
1> VisionEnginePlugin.cpp<br />
1> SimpleCopyPostprocess.cpp<br />
4> VFmodEventGroup.cpp<br />
1> VLensFlareManager.cpp<br />
1> PathCameraEntity.cpp<br />
1> VisionEnginePluginPCH.cpp<br />
1> VCoronaManager.cpp<br />
1> ParticleGroupBase.cpp<br />
3> vHavokBehaviorModule.cpp<br />
2> vHavokConstraintChain.cpp<br />
4> VFmodAnimationEventSoundTrigger.cpp<br />
1> VMapLookupControl.cpp<br />
4> VFmodCollisionMeshInstance.cpp<br />
1> VisionLuaModule_wrapper.cpp<br />
4> FmodEnginePlugin.cpp<br />
4> VFmodSoundObject.cpp<br />
2> vHavokConversionUtils.cpp<br />
4> VFmodSoundResource.cpp<br />
3> HavokBehaviorEnginePlugin.cpp<br />
4> VFmodManager.cpp<br />
2> vHavokRagdollConstraint.cpp<br />
3> vHavokBehaviorComponent.cpp<br />
4> FmodEnginePlugin_android_x86_vs2010_anarchy.vcxproj -> C:\Havok\AnarchySDK\Source\Vision\Runtime\EnginePlugins\ThirdParty\FmodEnginePlugin\..\..\..\..\..\..\Lib\android_x86_vs2010_anarchy\release\libvFmodEnginePlugin.a<br />
2> vHavokConstraintChainRenderingData.cpp<br />
5>------ Build started: Project: VisionApp, Configuration: Release hkAndroid ------<br />
5>C:\Havok\AnarchySDK\Build\MSBuild\Platforms\hkAndroid\Microsoft.Cpp.hkAndroid.Targets(328,5): warning : The x86 toolchain doesn't seem to play nice with the STL, or C++ features. Use at your own risk.<br />
5> VAppBase.cpp<br />
3> HavokBehaviorPlugin.cpp<br />
2> vHavokShapeFactory.cpp<br />
5> VAppImpl.cpp<br />
5> VCameraHandling.cpp<br />
3> vHavokBehaviorResourceManager.cpp<br />
2> vHavokStaticMesh.cpp<br />
5> VAppAndroid.cpp<br />
5> VHelp.cpp<br />
3> BehaviorLuaModule_wrapper.cpp<br />
5> VAppHelper.cpp<br />
2> vHavokCableConstraintChainRenderer.cpp<br />
5> VDefaultMenu.cpp<br />
2> vHavokRagdoll.cpp<br />
5> VLogoOverlay.cpp<br />
5> VDebugProfiling.cpp<br />
5> VScreenShotHelper.cpp<br />
2> vCharacterStateClimbing.cpp<br />
5> VRestoreScreen.cpp<br />
3> HavokBehaviorEnginePlugin_android_x86_vs2010_anarchy.vcxproj -> C:\Havok\AnarchySDK\Source\Vision\Runtime\EnginePlugins\Havok\HavokBehaviorEnginePlugin\..\..\..\..\..\..\Lib\android_x86_vs2010_anarchy\release\libvHavokBehavior.a<br />
5> VAppModule.cpp<br />
2> vHavokVisionShapes.cpp<br />
5> VCheckOutputFolder.cpp<br />
5> VDebugOptions.cpp<br />
2> vHavokPhysicsModule.cpp<br />
5> VLoadingScreen.cpp<br />
5> VExitHandler.cpp<br />
5> VAppMobile.cpp<br />
5> VDebugShadingModes.cpp<br />
2> vHavokPrismaticConstraint.cpp<br />
5> VDataDirectoryHelper.cpp<br />
5> VisionApp_android_x86_vs2010_anarchy.vcxproj -> C:\Havok\AnarchySDK\Source\Vision\Runtime\Framework\VisionApp\..\..\..\..\..\Lib\android_x86_vs2010_anarchy\release\libVisionApp.a<br />
2> vHavokVisualDebugger.cpp<br />
2> vHavokGenericConstraint.cpp<br />
1> VCoronaComponent.cpp<br />
1> VCablePathRenderer.cpp<br />
1> VFreeCamera.cpp<br />
2> vHavokPointToPlaneConstraint.cpp<br />
1> VCursor.cpp<br />
1> _AnimEntity.cpp<br />
1> VLuaHelpers.cpp<br />
2> vHavokDebugConstraintChainRenderer.cpp<br />
1> CommonTerrainFilters.cpp<br />
1> IVShadowMapComponent.cpp<br />
1> VPostProcessScreenMasks.cpp<br />
1> VPathRendererBase.cpp<br />
2> vHavokStiffSpringConstraint.cpp<br />
1> VGraphObject.cpp<br />
1> CameraPositionEntity.cpp<br />
1> VDebugPathRenderer.cpp<br />
1> VMobileForwardRenderLoop.cpp<br />
1> VSimpleShaderProvider.cpp<br />
2> vHavokConstraintChainRenderer.cpp<br />
1> StochasticalParam.cpp<br />
1> TimeOfDay.cpp<br />
1> VPathRenderingData.cpp<br />
2> vHavokPointToPathConstraint.cpp<br />
1> VCustomVolumeManager.cpp<br />
1> VMobileForwardRenderer.cpp<br />
1> BillboardGroup.cpp<br />
1> Sky.cpp<br />
2> VThrowItemComponent.cpp<br />
1> ParticleGroupManager.cpp<br />
1> VRendererNodeCommon.cpp<br />
1> VArchive_wrapper.cpp<br />
2> vHavokFileStreamAccess.cpp<br />
1> VDialogFrame.cpp<br />
1> VTooltip.cpp<br />
1> IVRenderableItem.cpp<br />
2> vHavokCharacterController.cpp<br />
1> VTransitionBase.cpp<br />
1> VScriptComponent.cpp<br />
1> VSkeletalBoneProxy.cpp<br />
1> VItemContainer.cpp<br />
1> VShadowMapGenSpotDir.cpp<br />
2> vHavokHingeConstraint.cpp<br />
1> CubeMapHandle.cpp<br />
1> VSceneLoader.cpp<br />
1> VShadowMapGenerator.cpp<br />
2> vCharacterStateFlying.cpp<br />
1> Mirror.cpp<br />
2> vHavokDisplayHandler.cpp<br />
1> RenderingOptimizationHelpers.cpp<br />
1> ParticleDescriptor.cpp<br />
1> VDialog.cpp<br />
2> vHavokChainConstraintChainRenderer.cpp<br />
1> SectorVisibilityZone.cpp<br />
1> VRSDLuaImplementation.cpp<br />
1> VTextControl.cpp<br />
2> vHavokSerialize.cpp<br />
1> VRSDClient.cpp<br />
1> VWallmarkManager.cpp<br />
2> vHavokPulleyConstraint.cpp<br />
1> VModelPreviewControl.cpp<br />
1> VLensFlareComponent.cpp<br />
1> VEntityLODComponent.cpp<br />
2> vCharacterStateInAir.cpp<br />
1> VTimeOfDayComponent.cpp<br />
1> VOrbitCamera.cpp<br />
1> VLightClippingVolumeComponent.cpp<br />
2> vHavokConstraintListener.cpp<br />
1> TriggerDoorEntity.cpp<br />
1> _DanglingEntity.cpp<br />
1> _ClothEntity.cpp<br />
1> ClothMesh.cpp<br />
1> VDialogResource.cpp<br />
2> vHavokSync.cpp<br />
1> IVTransitionEventTrigger.cpp<br />
1> VFakeSpecularGenerator.cpp<br />
1> VPlayableCharacterComponent.cpp<br />
1> VPrefab.cpp<br />
1> VScriptInstance.cpp<br />
2> vCharacterStateJumping.cpp<br />
1> VResourcePreview.cpp<br />
2> vHavokContactListener.cpp<br />
1> VPostProcessTranslucencies.cpp<br />
1> ScratchTexturePool.cpp<br />
1> VZoomDetector.cpp<br />
1> VGUICommandBuffer.cpp<br />
1> VListControls.cpp<br />
1> Glow.cpp<br />
2> VLineFollowerComponent.cpp<br />
1> VStringInputMap.cpp<br />
1> VTimedValueComponent.cpp<br />
1> VVirtualThumbStick.cpp<br />
2> vHavokCpuJobThreadPool.cpp<br />
1> VGUIContext.cpp<br />
1> BlobShadowManager.cpp<br />
1> MirrorRenderLoop.cpp<br />
1> Curve.cpp<br />
2> vHavokBallAndSocketConstraint.cpp<br />
1> ToneMapping.cpp<br />
1> ParticleConstraint.cpp<br />
2> HavokPhysicsEnginePluginTrackerClasses.cpp<br />
1> ClothDeformer.cpp<br />
1> VTransitionManager.cpp<br />
1> IVPathRenderingData.cpp<br />
1> VScriptManager.cpp<br />
2> vHavokBlockerVolumeComponent.cpp
It will take time to build the Project and will show that build is successfull
Lets deploy the Project to Android Phone
You need to copy the APK to the phone.My Build was available at
C:\Havok\AnarchySDK\Bin\android_x86_vs2010_anarchy\Release
So first of all I connected my K900 phone to PC
You need to turn on USB data storage
copy the APK file into the phone and disconnect it from PC
Browse the file in the phone
Start installing it
The game app will get installed
Lets run the Project in phone
After all your efforts you were able to modify the demo of the Game and adjust accordingly.You were able to create a AAA game with good graphics.What can you do more?Tweak around the demo and you will learn lot of things
Resources
https://software.intel.com/en-us/tags/42357
http://www.projectanarchy.com/about
http://forum.projectanarchy.com/forum.php?langid=1
Points of Interest
This has been a good Learning experience as I had to dig in little into Project Anarchy and one good thing about Project Anarchy is that you can import your designs,Characters from 3D MAX,Maya so you can get cool AAA animation for Android.The game engine is free and it is from Intel.
History
1st update