About Store Forum Documentation Contact



Post Reply 
World editor problems
Author Message
Tottel Offline
Member

Post: #1
World editor problems
Some questions regarding the world editor.

1. I can't make the map any bigger than this. It's got a white border around it, preventing me from inserting more terrain parts..
EDIT: I just noticed you can drag the terrain outside of the box to create new parts.. any simpler way of doing this?

2. When I build my terrain and load it in-game with the proper code, I just get an empty screen. All I see is my sun and clouds, that's it.
As a test, I used the tutorial file: world with character, and all I did was replace the sample.world with my world, and it didn't work..

NEW 3. (check picture) For some reason, my terrain resolution is pretty low. As you can see when looking at the riverbed, it's clearly triangulated. It's pretty hard to get a flat river like this. Can I increase the poly count on the terrain?


Attached File(s) Image(s)
       
(This post was last modified: 02-16-2010 10:37 PM by Tottel.)
02-15-2010 03:02 PM
Find all posts by this user Quote this message in a reply
Chris Offline
Member

Post: #2
RE: World editor problems
1. Hold space and move the mouse - you'll get to place more world; you're bound by the viewing radius (View > Area Radius)

2. Have you got a Player object in the world?
02-15-2010 03:08 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #3
RE: World editor problems
Thanks Chris,

Yes, I do have a player object in the world.
02-15-2010 03:28 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: World editor problems
2. did you build the world? menu\main\build
02-15-2010 03:30 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #5
RE: World editor problems
I did
02-15-2010 04:02 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: World editor problems
you have entered incorrect path in Game::World.New... ?
02-15-2010 04:45 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #7
RE: World editor problems
No, it's all correct.. I just changed the name of the World in "03 - World with Character.cpp", and it didn't work.
02-15-2010 05:05 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: World editor problems
what's your code?
02-15-2010 05:08 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #9
RE: World editor problems
This is basically "world with char.cpp", all that is changed is the enums header location, and the name of the world I'm loading.

Code:
/******************************************************************************/
#include "stdafx.h"
#include "../data/enum/_enums.h"
/******************************************************************************

   In this tutorial is presented how to combine extending base classes with World Manager usage

/******************************************************************************/
struct Player : Game::Chr // extend character structure by defining a player class based on the character
{
   Memx<Game::Item> item;                          // here is the characters inventory, a container of items
   virtual _Memx*   itemContainer(){return &item;} // override default method of character, to return proper item container

           void updateItems(); // update items actions
   virtual Bool update     (); // here we'll update the player
};
/******************************************************************************/
Game::ObjMemx<Game::Static> Statics; // container for static objects
Game::ObjMemx<Game::Item  > Items  ; // container for item   objects
Game::ObjMemx<      Player> Players; // container for player objects
/******************************************************************************/
void Player::updateItems()
{
   if(Kb.bp(KB_1)) // try to pickup an item
      if(Items.elms()) // if world items container has some elements
         itemPickUp(Items[0]); // pick up the first valid item

   if(Kb.bp(KB_2)) // try to drop down an item
      if(item.elms()) // if inventory has some items
         itemDropDown(item[0]); // drop down the first item

   if(!Kb.alt())grabStop();else // if don't want to grab
   {
      if(grab.is()) // if already grabbing
      {
         Vec pos;
         SinCos(pos.z,pos.x,angle.x+PI_2); // set direction according to player angle
         pos *=ctrl.radius()+0.5;          // set radius    according to player controller radius
         pos.y=ctrl.height()*0.4;          // set vertical  position
         pos +=T.pos();
         grab.pos(pos);                    // set desired grab position
      }else
      if(Items.elms()) // if isn't grabbing anything check for presence of world items
      {
         grabStart(Items[0]); // grab first present
      }
   }
}
/******************************************************************************/
Bool Player::update()
{
   if(action)
   {
      if(Kb.b(KB_W) || Kb.b(KB_S) || Kb.b(KB_A) || Kb.b(KB_D) || Kb.b(KB_Q) || Kb.b(KB_E))actionBreak();
   }

   if(!action)
   {
      // turn & move
      input.anglei.x=Kb.b(KB_Q)-Kb.b(KB_E);
      input.anglei.y=Kb.b(KB_T)-Kb.b(KB_G);
      input.diri  .x=Kb.b(KB_D)-Kb.b(KB_A);
      input.diri  .z=Kb.b(KB_W)-Kb.b(KB_S);
      input.diri  .y=Kb.b(KB_SPACE)-Kb.b(KB_LSHIFT);

      // dodge, crouch, walk, jump
      input.dodge = Kb.bd(KB_D)-Kb.bd(KB_A);
      input.crouch= Kb.b (KB_LSHIFT);
      input.walk  = Kb.b (KB_LCTRL );
      input.jump  =(Kb.bp(KB_SPACE ) ? 3.5 : 0);

      // mouse turn
      Flt max=DegToRad(900)*Tm.d(),
          dx =Ms.dir_ds.x*1.7,
          dy =Ms.dir_ds.y*1.7*Ms.inv();
      angle.x-=Mid(dx,-max,max);
      angle.y+=Mid(dy,-max,max);

      // ready stance change
      ready^=Kb.bp(KB_R);
   }

   updateItems();
   return __super::update();
}
/******************************************************************************/
void InitPre()
{
   App.name("World with Character");
   App.flag=APP_MS_EXCLUSIVE|APP_FULL_TOGGLE;
   IOPath("../data");
   Paks.add("engine.pak");

   D.full(true).sync(true).hpRt(true).hdr(true);
}
/******************************************************************************/
Bool Init()
{
   Text_ds.scale*=0.8;

   Physics.create();

   Sun.image=Images("gfx/sky/sun.gfx");
   Sky.atmospheric();

   // create the world
   Game::World.init()
              .setObjType(Statics,OBJ_STATIC)
              .setObjType(Players,OBJ_PLAYER) // please note that here we'll use 'Players' memory container for 'OBJ_PLAYER' objects
              .setObjItem(Items  ,OBJ_ITEM  ) // please note that here is called 'setObjItem' instead of 'setObjType', this is used for enabling built-in character<->item relations such as picking up and dropping items
              .New("world/WaterWorld.world"  );

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

   return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
   if(Kb.bp(KB_ESC))return false;

   Game::World.update(Cam.at); // update world to given position

   return true;
}
/******************************************************************************/
void Render()
{
   Game::World.draw();
}
void Draw()
{
   Renderer(Render);
                     D.text(0,0.9,"Press WSAD keys to move, 1/2 to pick up/drop item, Alt to grab");
   if(Players.elms())D.text(0,0.8,S+"Items in inventory : "+Players[0].item.elms());
}
/******************************************************************************/
02-15-2010 05:15 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: World editor problems
does the world display properly when you "play" it inside WE?
do you have the world folder located relative to your project where you compile the .exe "../data/world/waterworld.world" ?

maybe just your game camera is located below the terrain?
02-15-2010 05:21 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #11
RE: World editor problems
It works perfectly now.. the camera was indeed way off. grin

Thank you!
02-15-2010 05:52 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #12
RE: World editor problems
First post updated with new question.

EDIT: Meh, solved.. Mesh quality was set on 'half'..
(This post was last modified: 02-16-2010 10:45 PM by Tottel.)
02-16-2010 10:41 PM
Find all posts by this user Quote this message in a reply
Post Reply