About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
Realtime world editing
Author Message
kulesz Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
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
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #3
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():
Code:
myWorld.draw();

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
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #4
RE: Realtime world editing
Still can't make it to work :-/
06-10-2011 07:13 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
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
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #6
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Realtime world editing
Use 129 Hm res
And heightmap() is null?
06-17-2011 11:48 AM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #8
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
Find all posts by this user Quote this message in a reply
Post Reply