Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[TUTORIAL] Apex Destruction (client+server)

Joined
Jun 30, 2013
Messages
421
Reaction score
157
Hello everyone, long thought, and decided to share with the community is not a big useless function, it is called "Apex Destruction"
Attention! Server version is not complete, there are drawbacks, and various bugs that other people do not see how you destroy objects!
For a start no need for download Apex and PhysX:


(extract and replaced - WarZ\bin)
Put the contents of archives on the way: WarZ\src\External (It is desirable to first remove the old).
Added to the client side:
Open your WarZ.sln
Search this
#define APEX_ENABLED 0
Replace this:
#define APEX_ENABLED 1

Search this
close->setSkipOcclusionCheck(true);
Replace this:
clone->setSkipOcclusionCheck(true);
Compile.....


If neither of which I have not forgotten that on the client side are done, you can go to the studio, load the map and add objects to the destruction of.
Attention! Apex uses to destroy their own objects!
object_name.apb
They are on the way: ObjectDepot\ApexObjects

Now, on to add to the server side.
Open your Warz_Server.slh
Search this
#if APEX_ENABLED
g_pApexWorld->Simulate(substepSize, true);
g_pApexWorld->FetchResults(true);
#else
PhysXScene->simulate(substepSize);
m_needFetchResults = true;
#endif

Replace this:
#ifndef WO_SERVER
#if APEX_ENABLED
g_pApexWorld->Simulate(substepSize, true);
g_pApexWorld->FetchResults(true);
#else
PhysXScene->simulate(substepSize);
m_needFetchResults = true;
#endif
#endif

Search this
#if APEX_ENABLED
g_pApexWorld->Simulate(substepSize, i == numStepsReq - 2);
g_pApexWorld->FetchResults(true);
#else
PhysXScene->simulate(substepSize);
PhysXScene->fetchResults(true);
#endif

Replace this:
#ifndef WO_SERVER
#if APEX_ENABLED
g_pApexWorld->Simulate(substepSize, i == numStepsReq - 2);
g_pApexWorld->FetchResults(true);
#else
PhysXScene->simulate(substepSize);
PhysXScene->fetchResults(true);
#endif
#endif

Create obj_ApexDestructible.cpp
#include "r3dPCH.h"#include "r3d.h"


#include "GameCommon.h"


#include "multiplayer/P2PMessages.h"
#include "ServerGameLogic.h"


#include "obj_ApexDestructible.h"


IMPLEMENT_CLASS(obj_ApexDestructible, "obj_ApexDestructible", "Object");
AUTOREGISTER_CLASS(obj_ApexDestructible);


obj_ApexDestructible::eek:bj_ApexDestructible()
{
#if APEX_ENABLED
ObjTypeFlags |= OBJTYPE_ApexDestructible;
#endif
}


obj_ApexDestructible::~obj_ApexDestructible()
{
#if APEX_ENABLED
ObjTypeFlags |= OBJTYPE_ApexDestructible;
#endif
}


BOOL obj_ApexDestructible::Load()
{
return FALSE;
}


BOOL obj_ApexDestructible::OnDestroy()
{
r3dOutToLog("obj_ApexDestructible %p destroyed\n", this);
return parent::OnDestroy();
}


BOOL obj_ApexDestructible::Update()
{
return parent::Update();

}


Create obj_ApexDestructible.h
#pragma once

#include "GameCommon.h"
#include "NetworkHelper.h"


class obj_ApexDestructible: public GameObject
{
DECLARE_CLASS(obj_ApexDestructible, GameObject)


public:
obj_ApexDestructible();
~obj_ApexDestructible();

virtual BOOL Load();
virtual BOOL OnDestroy();
virtual BOOL Update();

};

Compile server.......
Like everything, oh destroying work only at high graphics settings!
Sorry for my English, so I wrote this tutorial on memory, I hope not forgotten anything xDDD
I said earlier, this feature is useless, given below my craft unique objects, and a video demonstration:
[video=youtube;fF7xkWgZSn0]https://www.youtube.com/watch?feature=player_detailpage&v=fF7xkWgZSn0[/video]

stlmnt_wall_section_01_str_3x.apb
barrier_sandbag_01_03x02_01.apb
stlmnt_bld_cln_genstore_01.apb

Good luck.........
 
Last edited:
Master Summoner
Joined
May 8, 2013
Messages
574
Reaction score
571
Code:
BOOL obj_ApexDestructible::Load()
{
  return FALSE;
  return TRUE;
}

Two returns?
 
Harro
Joined
Mar 29, 2013
Messages
754
Reaction score
284
Nice tutorial also for anyone getting errors its probably cause of the new file you created

#include "r3dPCH.h"#include "r3d.h"

Change that to

#include "r3dPCH.h"
#include "r3d.h"
 
Custom Title Activated
Loyal Member
Joined
May 18, 2006
Messages
1,425
Reaction score
119
Poster13, do u have new update ?
 
Newbie Spellweaver
Joined
Apr 19, 2008
Messages
23
Reaction score
5
That is good job!
SERVER:
ObjectRegistration.h

#if APEX_ENABLED
#include "obj_Apex.hpp"
IMPLEMENT_CLASS(obj_ApexDestructible, "obj_ApexDestructible", "Object");
AUTOREGISTER_CLASS(obj_ApexDestructible);
#endif //APEX_ENABLED

and include Engine GameObjects APEXXXX.H and .cpp
so needn't obj_ApexDestructible.cpp and .h file
 
Last edited:
I can do it!, i guess...
Joined
May 14, 2014
Messages
758
Reaction score
770
And still havent seen an infestation with this implemented :D
Cuz eclipse is not a engine for that XD? i saw similiar thing made by GigaToni and it was pointless.

yes,so old old poste,but scene destruction system is so cool!:w00t:

Yea it is soo cool you still would just copy-n-paste that and later cry for help! XOX LOLOLOLOLOLOLOLOLOL
 
Back
Top