Terrain Squaresize Question
by Patrick Glaspey · in Torque Game Engine · 02/26/2003 (1:49 am) · 19 replies
Hi,
From what I can piece together after searching all the Terrain posts and all the tutorials I could find (desmond fletchers had the most information), I still have some questions about the squaresize and position fields when creating a new terrain in the mission file.
From Desmond Fletchers tutorial I see that if you change the square size from the default 8 to 4 or 2 you do the following.
Reduce the mesh size inworld which accomplishes a few things. Reduces the size of the map - Rough numbers here 8 = 1 mile, 4 = 1/2 mile and 2 = 1/4 mile. This also reduces stretching of the terrain textures.
I have done this successfully with 4 but when I go down to squaresize 2 my player keeps falling through the terrain a ways. Seems to think the ground is at a different point. From Desmonds tutorial I changed the position as recommended
position settings based on square size
8 = -1024 -1024 0
4 = -512 -512 0
2 = -256 -256 0
Has anyone gotten the squaresize 2 setting to work?
Thanks.
From what I can piece together after searching all the Terrain posts and all the tutorials I could find (desmond fletchers had the most information), I still have some questions about the squaresize and position fields when creating a new terrain in the mission file.
From Desmond Fletchers tutorial I see that if you change the square size from the default 8 to 4 or 2 you do the following.
Reduce the mesh size inworld which accomplishes a few things. Reduces the size of the map - Rough numbers here 8 = 1 mile, 4 = 1/2 mile and 2 = 1/4 mile. This also reduces stretching of the terrain textures.
I have done this successfully with 4 but when I go down to squaresize 2 my player keeps falling through the terrain a ways. Seems to think the ground is at a different point. From Desmonds tutorial I changed the position as recommended
position settings based on square size
8 = -1024 -1024 0
4 = -512 -512 0
2 = -256 -256 0
Has anyone gotten the squaresize 2 setting to work?
Thanks.
#2
Did you have problems falling through the terrain at squaresize 2?
Is there something else I need to do to avoid that?
02/26/2003 (11:19 am)
Desmond,Did you have problems falling through the terrain at squaresize 2?
Is there something else I need to do to avoid that?
#3
Right now though I'm happily at a terrain squaresize of 1 and offset of -128 -128 0. I hope it continues to work!
02/26/2003 (2:18 pm)
I was messing with squaresize the past couple of days. I actually ran into an instance where I was always falling through the terrain, even when I set everything back to defaults - can't explain it, the mission file looked okay, so I can only assume the terrain file was the problem.Right now though I'm happily at a terrain squaresize of 1 and offset of -128 -128 0. I hope it continues to work!
#4
02/26/2003 (2:47 pm)
hmmm, not sure what's happening to your terain--I don't fall thru at squareSize 2
#5
So I am assuming that I read your tutorial correct and I am making the correct changes when changes the squaresize
Thanks.
02/26/2003 (11:20 pm)
ok I will do more testing.So I am assuming that I read your tutorial correct and I am making the correct changes when changes the squaresize
Thanks.
#6
If I change a mission by hand and then load it the client locks while loading the mission.
Is there any other datablocks which would need tweaking that could be causing this?
any ideas?
02/26/2003 (11:32 pm)
ok so more testing. Anything below 4 not only do I fall through terrain if I come out of editor after making the change.If I change a mission by hand and then load it the client locks while loading the mission.
Is there any other datablocks which would need tweaking that could be causing this?
any ideas?
#7
02/27/2003 (12:46 am)
is there a easy way to just increase the number of squares? so you have the same size terran but the number of squares increases?
#8
02/27/2003 (3:05 am)
if you want to make the terrain size larger. For example if you go to squaresize 16 you will change the map to 2 miles (rough) from 1. You will also increase the texture stretching. I have not tried but my guess is it will not look very good.
#9
02/27/2003 (5:13 am)
If the mission area is larger then the terrain I get a crash during loading. That might be worth checking.
#10
I am very interested in seeing a mission file from someone who has gotten these sizes to work.
I am hoping that I have another simobject that is going out of bounds with the new sizes but I have not been able to track it down yet.
Anyone have any ideas?
thanks.
02/28/2003 (4:18 pm)
I have continued to test the different squaresize and position settings and still if I try 2 or 1 squaresize my avatar falls through terrain.I am very interested in seeing a mission file from someone who has gotten these sizes to work.
I am hoping that I have another simobject that is going out of bounds with the new sizes but I have not been able to track it down yet.
Anyone have any ideas?
thanks.
#11
02/28/2003 (4:37 pm)
Check terrData.h for getHeight ... It uses BlockShift, which is a constant defined as 8. This should, I think, be rewritten to look at the actual block size. But perhaps for speed reasons it'd be better to replace BlockShift with the terrain size you're using.
#12
02/28/2003 (6:52 pm)
Is there a write up of the terrain rendering engine anywhere?
#13
On an already made level, I've tryed 2 = -256 -256 0. The effect wasn't showing up, so I closed the app, then restarted. On entering the level, my car was "jammed" in the terrain but I was seeing my level like it was before. I've hited F8 to see where I was then it shows me that the terrain was changed and my spwnsphere was into the terrain. I hited F7 and tryed to see if there was problems with the new terrain and all was ok. Maybe your spawnsphere is now on a newly created mountain ?
I tryed at 1 = -128 -128 0 and the engine crash. But my textures are all 256, so this is probably the problem. Didn't test to reduce it to 128, but I guess this could be the solution.
Gilles Jr Lafrance
Lafbros
02/28/2003 (8:08 pm)
I was curious about this, so I did some testing.On an already made level, I've tryed 2 = -256 -256 0. The effect wasn't showing up, so I closed the app, then restarted. On entering the level, my car was "jammed" in the terrain but I was seeing my level like it was before. I've hited F8 to see where I was then it shows me that the terrain was changed and my spwnsphere was into the terrain. I hited F7 and tryed to see if there was problems with the new terrain and all was ok. Maybe your spawnsphere is now on a newly created mountain ?
I tryed at 1 = -128 -128 0 and the engine crash. But my textures are all 256, so this is probably the problem. Didn't test to reduce it to 128, but I guess this could be the solution.
Gilles Jr Lafrance
Lafbros
#14
Is this a limitation of the editor?
Sean
01/03/2006 (12:42 pm)
I am getting it to work at squaresize=1, but I can no longer use the terrain editor, i.e. it will not select the terrain squares to modify the height. Is this a limitation of the editor?
Sean
#15
01/08/2006 (1:30 am)
Lots of little places in Torque assume a squareSize of 8. The editor may be one of those.
#16
Also, I've been playing with using two terrains to have a low square size (high resolution) terrain where the player plays in (say a small town) and a larger square size surrounding (for a countryside surrounding the town). This gives the ability to create highly detailed terrains in some areas, and not in others. The trick is to create two terrains, say one with squaresize = 2, and the other with squaresize=8 and then removed the squares from the larger terrain where the two overlaps, so they do not render over each other. Somewhat cumbersome, but it works.
You can only seem to edit one terrain at a time, so you might need to toggle them on and off to edit them.
01/08/2006 (8:53 am)
I've figured out that the editor will work only on terrains where squaresize <> 8 as long as the terrain is tiled. Therefore, if I want to edit the terrain, I need to turn tiling on, edit what I need to, then turn tiling off again. Also, I've been playing with using two terrains to have a low square size (high resolution) terrain where the player plays in (say a small town) and a larger square size surrounding (for a countryside surrounding the town). This gives the ability to create highly detailed terrains in some areas, and not in others. The trick is to create two terrains, say one with squaresize = 2, and the other with squaresize=8 and then removed the squares from the larger terrain where the two overlaps, so they do not render over each other. Somewhat cumbersome, but it works.
You can only seem to edit one terrain at a time, so you might need to toggle them on and off to edit them.
#17
If lots of little places in Torque assume 8, why are other sizes available? Or is there a way to search for and fix those places? I'm very interested in using square size of 2 or 4 for my whole current project, but if that's gonna prove maddening in the end, I'd rather know now. Thanks ;)
01/08/2006 (12:51 pm)
@BenIf lots of little places in Torque assume 8, why are other sizes available? Or is there a way to search for and fix those places? I'm very interested in using square size of 2 or 4 for my whole current project, but if that's gonna prove maddening in the end, I'd rather know now. Thanks ;)
#18
I've been using a squaresize of 2 without any problem. Just need to turn tiling on to edit the terrain, then turn it off after.
Sean
01/08/2006 (12:57 pm)
I'd be curious also to know why the editor assumes 8. I havn't looked at the editor's code too much, but I would assume its possible (if not easy) to change it so that it adapts to the squaresize defined by the terrain. I've been using a squaresize of 2 without any problem. Just need to turn tiling on to edit the terrain, then turn it off after.
Sean
#19
Atlas, of course, has no squaresize limitations.
01/08/2006 (4:46 pm)
Because when the editor was written, everyone only needed 8. Now people are looking for more flexible solutions. Tweaking everything to be friendly with variable sizes is only a few days work, to a few weeks, depending on the programmer's skill level.Atlas, of course, has no squaresize limitations.
Torque Owner Desmond Fletcher
fletcher