kulesz
Member
|
Realtime world editing
Hi,
Can I somehow:
1. Make an empty World in the application code
2. Add new areas to this world (based on some previously generated heightmaps)
3. Brush grass, trees etc. on this new area
4. Save the world afterwards
|
|
06-10-2011 12:17 PM |
|
Esenthel
Administrator
|
RE: Realtime world editing
1. Game::WorldManager::Create
2. WORLD_MANUAL -> area load -> edit heightmap (yes)
3. no
4. game::area::data::wantsToBeSaved -> true
|
|
06-10-2011 02:01 PM |
|
kulesz
Member
|
RE: Realtime world editing
Thanks for fast response. I did:
In Init():
Code:
EE::Game::WorldSettings worldSettings;
worldSettings.area_size=128;
worldSettings.hm_res=128;
myWorld.Create("world/my.world", worldSettings);
myWorld.init();
myWorld.New("world/my.world");
In Update():
Code:
myWorld.update(Cam.at);
In Render():
However I have some more questions:
Regarding 2 - I didn't find any Area Load (or similar) members in the myWorld object. I don't know, how to add those areas.
Regarding 3 - But I still can manually place single objects (inc. grass), one by one?
Generally what I'm trying to do - I've got a bunch of 128x128 heightmaps, from which I'd like to make areas and then add them to current (newly made) world. All must be made in the code, because heightmaps are generated randomly at each start.
|
|
06-10-2011 04:02 PM |
|
kulesz
Member
|
RE: Realtime world editing
Still can't make it to work :-/
|
|
06-10-2011 07:13 PM |
|
Esenthel
Administrator
|
RE: Realtime world editing
Use 129 as hm res
2. I think it's areasetstate
3. You can only create dynamic objects using these method. Game.world.objcreate. No embed, const, grass
|
|
06-11-2011 10:57 AM |
|
kulesz
Member
|
RE: Realtime world editing
Hmm, now it crashes, when I'm trying to do:
Code:
m1.load("mtrl/ground/0.mtrl");
EE::Game::WorldSettings worldSettings;
worldSettings.area_size=128;
worldSettings.hm_res=128;
Game::World.Create("world/empty.world",worldSettings);
Game::World.init();
Game::World.New ("world/empty.world");
Game::World.setObjType(Items ,OBJ_ITEM ) ;
Game::World.update(Cam.at);
Edit::Area ar(VecI2(1,1));
ar.heightmap()->create(128,&m1,false,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
|
06-16-2011 11:31 AM |
|
Esenthel
Administrator
|
RE: Realtime world editing
Use 129 Hm res
And heightmap() is null?
|
|
06-17-2011 11:48 AM |
|
kulesz
Member
|
RE: Realtime world editing
After:
Code:
Edit::Area ar(VecI2(1,1));
ar.heightmap()->create(129,&m1,false,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
int res=ar.heightmap()->resolution();
The value of res is 4 :-/
(This post was last modified: 06-20-2011 10:34 AM by kulesz.)
|
|
06-20-2011 10:34 AM |
|