Page 1 of 1

Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 12:12 am
by Post
Hi there, mates, it's been quite a while since i've been here last time. Let's get to the topic. First - what is the actual size of a voxel placed on map? It's fixed or scalable? Second - is there any collision detection with voxels? Thall be kinda fun to make an arch and put in the doorway. Or create a bunch of nice-looking crates to jump on.

edit: first question is off, i've foubd the answer in the manuals. Yay!

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 12:58 am
by edward850
Post wrote:Second - is there any collision detection with voxels? Thall be kinda fun to make an arch and put in the doorway. Or create a bunch of nice-looking crates to jump on.
Nope. Idtech1 is still Idtech1. :P

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 1:03 am
by The Zombie Killer
Personally I'd like the option to use cube-based collision rather than sphere-based. (it is sphere based, isn't it? Hence "radius"?)

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 1:04 am
by edward850
Also nope. It's always been square based + height.

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 1:05 am
by Post
edward850 wrote:Also nope. It's always been square based + height.
Did i understand you correctly, there is a collision for voxel models and it's square + height?

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 1:11 am
by edward850
Nope the Third. As I stated before, Doom's physics haven't changed at all, and collisions are still actor based. Voxels are purely a visual effect replacement for sprites.

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 1:24 am
by Post
edward850 wrote:Nope the Third. As I stated before, Doom's physics haven't changed at all, and collisions are still actor based. Voxels are purely a visual effect replacement for sprites.
Oh, yeah, i get it. Thanks a lot good sir!

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 3:56 am
by Gez
The term "radius" is improper since Doom uses Lazy Geometry. Lazy Geometry is geometry where trigonometry doesn't exist.

For example, the distance between points A and points B are the same, according to Doom, in both these cases:

Code: Select all

A     B

________

A

      B
It compares X-axis distances and Y-axis distances separately, and go with the greater of the two; instead of combining them together. (Also, it generally completely ignores the existence of Z-axis distance, though ZDoom changed that in many cases.)

So a mobj's radius is really just half the size of the side of its square collision box. But laziness goes beyond making circles into squares:

Here are a few mobjs rotated with different angles:

Code: Select all

  0° 10° 20° 30° 40° 50° 60° 70° 80° 90°
 ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ 
 └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ 
As you can see, the mobj's angle has absolutely no effect on its collision box. If you create a voxel crate, you can have its physical shape match its collision box perfectly... But only as long as it is angled along the grid. If you rotate it 45°or any other value that isn't a multiple of 90°, then the collision box will no longer fit the apparent volume.

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 4:43 am
by The Zombie Killer
Interesting read. You should make a page/thread with all of your miscellaneous ZDoom info :p
How easy would correcting Doom's use of lazy geometry be? Would it work by changing the calculations in the source so that they use trigonometry?

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 4:46 am
by Gez
Problem is that it would risk breaking things. Doom has a twenty-year history of people making maps that work according to how it works. Changing something as fundamental as collision detection and distance checks is going to break countless maps.

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 4:52 am
by The Zombie Killer
Makes sense. I am planning to have a custom version of GZDoom for a personal project so it shouldn't cause any issues for me.

Are there any serious problems that can only be fixed by editing the source that lazy geometry causes?

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 4:45 pm
by ibm5155
Nah it's just limited by the age that it was made, there was some cool updates that came by the time, like before you couldn't jump over a monster/object xD

hmm you could make a fake geometry putting some bridges on it and the voxel with no heigh...

Re: Few theorethical questions about voxels

Posted: Thu Jan 16, 2014 10:50 pm
by Nash
A voxel's maximum size is 256 x 256 x 256 so that's basically the largest object you can make. To make small voxel objects have a higher resolution, you can create large voxels and scale them down. Be careful about this however, if you're going to create high res voxels that will end up being spawned a lot in the same screen, you might experience slow downs.