Jump to content
jen

Support for 8129x8129 Terrain Size?

Recommended Posts

8192* :P

What are you trying to achieve? Maybe we can give you an idea to work around it meanwhile.

Share this post


Link to post

You could always just scale the terrain to get that size:

local world=World:GetCurrent()

for i=0,world:CountEntities()-1 do

if world:GetEntity(i):GetClass()==Object.TerrainClass then

terrain=world:GetEntity(i)

tolua.cast(terrain,"Terrain")

terrain:SetScale(2,1,2) --scales a 4096x4096 terrain to 8192x8192 terrain

break

end

end

 

or you could just create the terrain via code at that size:

terrain = Terrain:Create(8192,true)

terrain:SetLayerTexture(0, Texture:Load("Materials/Nature/terrain_savannah_dirt.tex"), 0)

terrain:SetLayerTexture(0, Texture:Load("Materials/Nature/terrain_savannah_dirtdot3.tex"), 1)

...

...

Share this post


Link to post

Hi Macklebee, thanks!

 

I didn't think it was possible to interact with the terrain. I couldn't find a reference in the API Reference page. I'm using C++ API.

 

Can we edit the terrain in real time by the way?

 

Thanks alot.

Share this post


Link to post

It's not official but they are available. Yes, its possible to edit the terrain in real time as others have done it in the past but I suspect once the terrain is that large it will be slow to perform 'terrain:UpdateNormals()'.

Share this post


Link to post

You could always just scale the terrain to get that size:

local world=World:GetCurrent()

for i=0,world:CountEntities()-1 do

if world:GetEntity(i):GetClass()==Object.TerrainClass then

terrain=world:GetEntity(i)

tolua.cast(terrain,"Terrain")

terrain:SetScale(2,1,2) --scales a 4096x4096 terrain to 8192x8192 terrain

break

end

end

Well, alright, but then you want to open the map in the editor and "populate" the new terrain with objects. How do you save the map from c++ / lua ?

Share this post


Link to post

I understand, but the result does not help since what you get is a big, empty, flat terrain without texture (which has to be modified and populated using the IDE) ...

Share this post


Link to post

Well you can set vegetation layers via code and place objects as well but yes it will not be easy to get very detailed. Mostly depends on what you are trying to accomplish. The best way to create the terrain would probably be to load a heightmap to get what you want.

Share this post


Link to post

4096 is really really large. From an editor point of view it is really difficult to work on.

 

I think from a design point of view, it's better to use smaller terrain. Less assets loading = Faster loading time. Quicker movement of the camera in the editor = Faster building.

 

I originally designed my game around 4096, but decided 2048 would be better overall

Share this post


Link to post

I use even smaller terrain as 1024 or even 512 depending on the scenery. I have divided my game into a number of scenes, each with its own terrain., But that will only work in level based games of course

Share this post


Link to post

I also want to point out that 4096 terrains are very unstable. At least five of my recently saved maps (4096 large) have become corrupted, even after saving - I would close the window, and load the window again then I find the map changed - paint layers gone, sculpting changed, sometimes sculpting become flat entirely.

 

It's frustrating. Even my backups got corrupted which suggest that it's the save algorithm that isn't working properly for larger maps. In 2 separate incidents I saved 2 copies of the same map, 1 for production and 1 for backup and both got corrupted.

Share this post


Link to post

If it's not there already, I strongly suggest posting this in the bugs forum with an example map or two, so Josh can investigate. Curious: have you worked with other terrain sizes to the same extent and have you encountered issues with those at all? In other words, do you know if this only happens on 4096 terrains for you?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...