arundelJoin Date: 2008-04-21 Post Count: 5762 |
Don't know if it exists yet, and I have no idea why I'm doing this, but here it is: mesh collision detection. All types of special meshes which are in the site's database can be made walkable with no lag at all. You have to play around with the variables in the script if you want succesfull walkable collision. Right now it only works for your character. If you insert the script, enable it and you're ready to walk the example mesh.
You've got to watch out when opening the script: lot's of vertex coordinates may freeze your pc if you do. (roblox's new update where you have wordwrap causes the problem)
The script takes the mesh's vertices and converts them into a voxel grid. Where-ever you walk, your torso's position is rounded to the nearest table of the diameter or "gap" between each voxel and the surrounding voxels. That way whenever you get close to a polygon, a brick is put into the place of the voxel and acts as a walkable object.
Tell me what you think.
http://www.roblox.com/Mesh-Collision-Detection-item?id=112574385
- Arundel. |
|
SharksieJoin Date: 2009-10-10 Post Count: 30576 |
10/10 would use this on every mesh and crash my game |
|
|
Why do you create the walkable part at runtime instead of instancing all the vertex points at once and let the roblox engine handle? It sounds like that would force a lot of Lua-sided math which is probably slower then roblox's C sided maths. |
|
arundelJoin Date: 2008-04-21 Post Count: 5762 |
@RenderSettings, the walkable parts are created once and stored. All vertices are put into a voxel grid once, in the beginning. There's not much math involved with instancing a few parts and position them accordingly to a pre-made grid.. The grid only takes up a tiny bit of memory, and the few parts take up a tiny bit of the fps. How would you possibly want to do this on the c-side? |
|
|
I meant, instead of instancing/parenting parts when you get close just parent them all at once and let roblox's physics do the collision calculations. |
|
arundelJoin Date: 2008-04-21 Post Count: 5762 |
@Rendersettings, the parts are pre-made and stored in limited amounts. Let's say I have 64 parts (4*4*4 rows), then 64 is the maximum amount needed for collision detection, no matter the mesh size. If I were to parent all parts of the mesh, we could be talking about a few hundred thousands, so no, it's not a good idea to parent all of those. I don't know why you'd want that. Roblox is already doing the physics calculations on those 64 parts. This grid and nearest table rounded method is highly efficient, unless there's a memory leakage.. |
|
|
This script is so useful! You know, if I knew how to get the vertices of other meshes...
Oh, and, reported for spam. |
|
arundelJoin Date: 2008-04-21 Post Count: 5762 |
@Kirky: get the mesh ID of a mesh and paste it in a script's linkedsource. Now open the script. :) |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
O.o
Ik opеndе dе Script еn m'n ogеn puildе al uit van diе langе tafеl ._.
еn ik hеb gееn idее wat еr allеmaal gеbеurt xD
Ik dеnk dat hеt voor mij bruikbaardеr zou zijn als ik zou wеtеn wat еr allеmaal gеbеurt xD!
Ach ja, misschiеn ooit. Lеuk jе wееr tе ziеn, trouwеns - ееn van dе wеinigеn mеt hеrsеns hiеr.
Hoе lang duurdе jе hеt еigеnlijk dit allеs tе schrijvеn? |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
Bah sommige zinnen formuleerde ik echt raar... |
|
lombardo2Join Date: 2008-11-30 Post Count: 1603 |
Not again myrco... |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
Mhm? |
|
|
Why is it that when I change the scale of the mesh, the collisions quit working?
Oh, and, reported for spam. |
|
arundelJoin Date: 2008-04-21 Post Count: 5762 |
Oh I forgot to tell, I think that the scales can be almost any number, but it should be in the table of "diameter". If diameter=5 then scale 30 is ok cuz it's in the table of 5. That goes for all variables in the script I think.
I tried scale {400,400,200} (takes a while to load!) but it works.
@Myrco, heeyz. dankje. het koste een paar avonden om het script te maken. ja ik zie niet veel relevante discussies in deze forum. ;p
waar denk jij dat mesh collision detection handig voor kan zijn? |
|
lah30303Join Date: 2008-02-15 Post Count: 10027 |
Quick, someone upload an entire map as a single mesh :D
So many vertices... |
|
|
@lah
There is an official roblox mesh that is the entire quake 3 map "the longest yard" |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
@aru: Ik weet niet waar 'ie handig voor zou zijn aangezien ik het amper begrijp =/
|
|
|
|
Halo, leer mij nederlandse alsjeblieft!
"No, you were not downloaded. You were born!" |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
@candy: Stop maar meteen.
@Arundel: Maar je moet wel weten dat ik het script niet echt heb doorgenomen. mhm hoe oud ben je nu eigenlijk? Ik schat je 16/17. :O |
|
|
Why? I genuinely want to lol.
"No, you were not downloaded. You were born!" |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
I meant that google. Seriously, nederlandse (which should be Nederlandse btw) is Dutch as an adjective. |
|
arundelJoin Date: 2008-04-21 Post Count: 5762 |
Umg I tried it with the quake map: http://www.roblox.com/asset?id=77173224
And it works great, set scale to {1,1,1}, map_width/height to 5000, and then wait for like 10 minutes for it to load. Coolz, a totally walkable quake map. :D (warning, your virtual memory will take up like 800 mb.) |
|
|
How am I supposed to copy the vertice data from a script with a linkedsource if roblox cant open the script without crashing.
I mean, it can open it without crashing after a while, but you cannot scroll down and it only counts lines 1-3 |
|
TheMyrcoJoin Date: 2011-08-13 Post Count: 15105 |
Er die link werkt niet.
Maar vertel eens, hoe werkt dit? Ik heb nog steeds geen tijd om het Script door te lezen q_q |
|