Few theorethical questions about voxels

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Post
Posts: 54
Joined: Mon Jul 11, 2005 12:48 pm

Few theorethical questions about voxels

Post 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!
Last edited by Post on Thu Jan 16, 2014 1:04 am, edited 1 time in total.
User avatar
edward850
Posts: 5904
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Few theorethical questions about voxels

Post 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
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Few theorethical questions about voxels

Post 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"?)
User avatar
edward850
Posts: 5904
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Few theorethical questions about voxels

Post by edward850 »

Also nope. It's always been square based + height.
User avatar
Post
Posts: 54
Joined: Mon Jul 11, 2005 12:48 pm

Re: Few theorethical questions about voxels

Post 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?
User avatar
edward850
Posts: 5904
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Few theorethical questions about voxels

Post 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.
User avatar
Post
Posts: 54
Joined: Mon Jul 11, 2005 12:48 pm

Re: Few theorethical questions about voxels

Post 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!
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Few theorethical questions about voxels

Post 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.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Few theorethical questions about voxels

Post 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?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Few theorethical questions about voxels

Post 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.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Few theorethical questions about voxels

Post 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?
User avatar
ibm5155
Posts: 1268
Joined: Wed Jul 20, 2011 4:24 pm
Contact:

Re: Few theorethical questions about voxels

Post 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...
User avatar
Nash
 
 
Posts: 17506
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Few theorethical questions about voxels

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

Return to “Editing (Archive)”