Jump to content
SlipperyBrick

Leadwerks Units

Recommended Posts

Just a suggestion that isn't really that important but it would really help in regards to modelling. Can the units in Leadwerks be changed to something more real world?

 

1 game unit = 1cm.

 

This would make it so easy to model or even use CSG to make game levels. Even adding the ability to change Leadwerks units would be awesome.

Share this post


Link to post

I wish leadwerks units between the editor and the programming were the same. A position of (-300, -200, 100) in the editor is far different than in C++.

 

I think at least though, 1 unit in the editor is 1 meter.

Share this post


Link to post

How are centimaters more "real" than meters? And why would meters, the scientific base measure of units, not be the logical default?

Share this post


Link to post

Textures often contain details that should be lined up with actual geometry like windows, doors, etc. Textures are always power-of-two sized. Thus, the grid uses major lines every 8th line and doubles/halves in size every time you hit the [ ] keys/

 

By default, a 1024x1024 texture should fill up a wall. A wall, in broad terms, is roughly 2.5 meters tall. If I used a meter grid and a texture mapping scale that mapped 1024 texels / 2.5 meters there would be two issues:

  • You would have to know to create your walls at one of the minor grid lines (0.5 meters), which is unintuitive.
  • It would be impossible to line up features in the texture with real world geometry. The grid lines would fall at measurements like 0.25, 0.5, 0.75, 1.0, 1.25, and since the mapping scale is 1024 texels per 2.5 units, you would not be able to line things up. For example, let's say there is a texel at position 128 on the texture. This is 1/8 the width. 1/8 * 2.5 = 0.3125. This does not correspond at all to the measurements the grid falls on, so it is impossible to line up.

 

On the other hand, if we simply display a centimeters grid without changing any actual sizes, things work out really nicely. 256 centimeters is a power-of-two number that is roughly the height of a wall, so our texture mapping scale can be 1024 texels per 256 cm. Now it is easy to line details in the texture up with geometry, because the grid falls along measurements like 8,16,32,64,96,128 etc. Without this it would be impossible to create details like this:

 

post-1-0-90782600-1474550616.jpg

 

When you can just sketch out your map geometry like that and have things magically line up, it makes mapping fun. This is what the template textures are provided for.

Share this post


Link to post

I do remember you saying this a while back when introducing the mapping standards post.

 

This is awesome for CSG and clearly works really well when mapping with CSG, thats where Leadwerks really shines is it's mapping tools. The speed and ease of use you have with Leadwerks when making a map I've not seen it anywhere in any other engine.

 

If you are modelling things though the measurements just seem a little strange. It would be easier to have a setup like 1 unit = 1cm but now knowing the reason behind the current measurements I think the original suggestion is redundant haha.

 

The only reason I brought it up was because I seemed to struggle to get a good set of measurements for my level a couple of days ago. I just couldn't get my map to look right from the players perspective, either thing's felt/looked to small or they seemed to big.

 

I've not really added other elements to my level, this was really just a simple map that had walls and a floor and ceiling so it was a bit to early to judge that kind of thing anyway.

 

Thanks for the info Josh. It all makes perfect sense now :D

Share this post


Link to post
The only reason I brought it up was because I seemed to struggle to get a good set of measurements for my level a couple of days ago. I just couldn't get my map to look right from the players perspective, either thing's felt/looked to small or they seemed to big.
Suggest playing around with the camera's FOV. The default is 90 degrees. It's 70 degrees if using fpsplayer script which sometimes seems restrictive in some scenes depending on your screen's aspect ratio or your window's resolution.

Share this post


Link to post

I mostly refer as scale based on a character size. Since you can export a brush from the editor. Create a brush to cover a single character, and export that brush.

 

I use that box as a reference in your modeling application. Most of the time the character size I assume is 6 feet. This always worked great when I was making models for a game.

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...