About Store Forum Documentation Contact



Post Reply 
Objects disappear
Author Message
Ogniok Offline
Member

Post: #1
Objects disappear
Hi!

I have a problem with my game. I've made simple world in World Editor. I build it and play it in World Editor, and everything was fine. But, when I've loaded the world into my game i have a problem. When the world appear on my screen everything is fine.

[Image: uu0e6kf.jpg]

When I move my mouse into left, the objects disappear. But shadows are fine.

[Image: ob1tgcj.jpg]

I'm moving my mouse more into left again and the shadows disappear:

[Image: 3sw21n7.jpg]

But collisions works fine. So, what's the problem? What I'm doing wrong?
03-14-2010 08:09 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Objects disappear
maybe you've missed the latest version history note:
Quote:-IMPORTANT: worlds need to be re-builded
just select Menu\Build\clean all and build all
let me know if that won't help
03-14-2010 08:14 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #3
RE: Objects disappear
It doesn't work. It works good only in World Editor.
03-14-2010 08:19 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Objects disappear
what codes are you using?
03-14-2010 08:21 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #5
RE: Objects disappear
Code:
/******************************************************************************/
#include "stdafx.h"
#include "Main.h"
/******************************************************************************/
LUA luaTest;
/******************************************************************************/
bool gamePause;
/******************************************************************************/
void Render();
/******************************************************************************/
UInt View; // current VIEW_MODE
/******************************************************************************/
Game::ObjMemx<Game::Static> Statics; //Container for static objects
Game::ObjMemx<Game::Item>   Items;   //Container for item objects
Game::ObjMemx<Game::Chr>    Chrs;    //Container for character objects
Game::ObjMemx<Player>       Players; //Container for player objects
/******************************************************************************/
Bool InitGame()
{
   luaTest.init();
   luaTest.run("AI/test.lua");

   //Cam.setSpherical(Vec(16, 0, 16), -PI_4, -0.5, 0, 10).set(); // set initial camera
   //Cam.dist = 50;

   Game::World.init();

   Game::World.setObjType(Statics, OBJ_STATIC);
   Game::World.setObjItem(Items  , OBJ_ITEM  );
   Game::World.setObjType(Chrs   , OBJ_CHR   );
   Game::World.setObjType(Players, OBJ_PLAYER); // please note that here we'll use 'Players' memory container for 'OBJ_PLAYER' objects

   Game::World.New("world/main.world");

   Game::World.update(Cam.at);

   return true;
}
void ShutGame()
{
    luaTest.del();
}
/******************************************************************************/
void UpdateCamera()
{
   // set next camera mode when Tab pressed
   if(Kb.bp(KB_TAB))
   {
      View = (View + 1) % VIEW_NUM;
   }

   // setup the camera
   if(Players.elms()) // if we have at least one player
   {
      // set camera depending on current view mode
      switch(View)
      {
         case VIEW_FPP:
         {
            OrientP &head=Players[0].cskel.getPoint("head"); // obtain player "head" skeleton point (this was created in Mesh Editor)
            Cam.setPosDir(head.pos,head.dir,head.perp); // set camera from 'head' position, direction and perpendicular to direction
         }break;

         case VIEW_TPP:
         {
            Cam.dist=Max(1.0f,Cam.dist*ScaleFactor(Ms.wheel()*-0.1)); // update camera distance according to mouse wheel
            Cam.setSpherical(Players[0].ctrl_pos+Vec(0,0.5,0), Players[0].angle.x, Players[0].angle.y, 0, Cam.dist); // set spherical camera looking at player position with given player angles
         }break;
      }

      Cam.updateVelocities().set();
   }
   else
   {
      CamHandle(0.1, 100, CAMH_ZOOM |(Ms.b(1) ? CAMH_MOVE:CAMH_ROT));
   }
}
Bool UpdateGame()
{
   if(Kb.bp(KB_P))
   {
       if(gamePause == true)
       {
           gamePause = false;
       }
       else if(gamePause == false)
       {
           gamePause = true;
       }
   }
   if(gamePause == true) return true;

   if(Kb.bp(KB_ESC)) StateMenu.set(1.0);
   if(Kb.bp(KB_F10)) Renderer.screenShots("Screenshot/","jpg");
   //CamHandle(0.1, 100, CAMH_ZOOM | (Ms.b(1) ? CAMH_MOVE:CAMH_ROT));

   Physics.startSimulation().stopSimulation();

   Game::World.update(Cam.at);
   UpdateCamera();

   return true;
}
void DrawGame()
{
   //Setting default parameters for all frames
   Renderer.wire = false;

   D.clear(TURQ);
  
   if(gamePause == true)
   {
       D.text(0, 0, "Pauza");
       return;
   }

   /* RENDERING PARAMETERS FOR PROGRAMMER */
   /* REMEBER TO REMOVE IT IN THE FINAL VERSION */
   Renderer.wire = Kb.b(KB_BSLASH);
   if(Kb.b(KB_BACK)) Physics.draw();
   /*n END OF RENDERING PARAMETERS */

   Renderer(Render);

   //luaTest.onDraw();

   //D.text(0, 0.9, S + "FPS: " + Time.fps());
   //D.text(0, 0, S + Game::World.activeRange());
}
void Render()
{
   Game::World.draw();
}
/******************************************************************************/
State StateGame(UpdateGame, DrawGame, InitGame, ShutGame);
/******************************************************************************/

Game.cpp file. All code.
(This post was last modified: 03-14-2010 08:28 PM by Ogniok.)
03-14-2010 08:27 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Objects disappear
the codes look ok,
the problem looks like the not re-builded world,
are you sure that you rebuilded the correct world? and you're not using a copy of the world stored somewhere else.

I've checked ERPG2, Bloody Massacre, and some tutorials compiled with latest SDK (worlds rebuilded) and everything works ok.
03-14-2010 08:51 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #7
RE: Objects disappear
I use the correct world. I've add this objects after the engine update, so the world is rebuild.
03-14-2010 08:55 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Objects disappear
ok, did you use the latest World Editor during world building? from the latest SDK?
03-14-2010 09:00 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #9
RE: Objects disappear
No. I've forgot about this. Thank you very much! It works fine now!
03-14-2010 09:04 PM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #10
RE: Objects disappear
In autoupdate is path to SDK, Visual Studio and Data folder in game project for copy engine.pak. I think about adding path to game tools folder for automatically update world editor.
03-14-2010 09:09 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #11
RE: Objects disappear
It's a good idea.
03-14-2010 09:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
RE: Objects disappear
I suggest using tools from the SDK folder path (not copying them to game folder)
03-14-2010 09:12 PM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #13
RE: Objects disappear
I always use WE from game folder, not from SDK but I can start using WE from SDK, it's not wrong smile
03-14-2010 09:18 PM
Find all posts by this user Quote this message in a reply
Post Reply