• What Are You Working On? Mesh Edition - August 2012
    650 replies, posted
[QUOTE=MDave;37479275]When I tried the Entity:PhysicsFromMesh, gmod13 actually crashed, and before completely stopping, it tried to connect en external IP adress. :tinfoil:[/QUOTE] It was probably submitting a crash minidump.
PhysicsFromMesh takes a table of vertices and a vertice looks like this {pos=Vector(whatevs)} each 3 vertices form a triangle in the mesh.
I actually asked people to document stuff more, but apparently the more the people know about the API, the less they feel motivated to document them.
I have no idea how to modify the wiki:tinfoil:
I finally got it working with PhysicsFromMesh. For whatever reason, disabling collisions helped. PhysicsInitConvex( {v, v, v, ... } ), and PhysicsInitMultiConvex( {v, v, v, ... }, {v, v, v, ... }, ... ) seems to do nothing for me. The strange thing is now, that traces dont hit the mesh, also it acts like a bounce pad for players, I can walk into it, and then it throws me out of it. Works perfectly for physics props tough. I read that the mesh should be applied in a shared way, so I followed that. Is there a vertex hardlimit for a physics mesh? It seems to crash over certain vertex count.
Call :EnableCustomCollisions(true) server-side.
Hm, that worked, for about 0.001 seconds. When I spawn the entity, it starts flying in random directions, and spazzing. After a time it stops it and lands. I am unable to grab it, or interact with it while it does that, after that if I grab it with the physgun, gmod crashes. ( This mesh stuff is really strange.. ) [editline]31st August 2012[/editline] I think I will move my questions to the "What Do You Need Help With" topic, since this is not what I am working on.
[img]http://puu.sh/10DTU[/img] Horizontal flow. This is getting way too complicated. Anyone up to code this with me? I'm running out of duct tape to keep my hands attached to my torso. [editline]asds[/editline] [img]http://puu.sh/10E4b[/img] Centering. Next: Docking and stretching. [editline]...[/editline] I can't wait to get to text wrapping.
[QUOTE=vercas;37479898][img]http://puu.sh/10DTU[/img] Horizontal flow. This is getting way too complicated. Anyone up to code this with me? I'm running out of duct tape to keep my hands attached to my torso. [editline]asds[/editline] [img]http://puu.sh/10E4b[/img] Centering. Next: Docking and stretching. [editline]...[/editline] I can't wait to get to text wrapping.[/QUOTE] Win with the descriptions.
[QUOTE=vercas;37479898][IMG]http://puu.sh/10E4b[/IMG][/QUOTE] I dont know how you do the inner lines of the description, but it looks cool! Also, progress on my maze generator, got physics working! Finally! [IMG]https://dl.dropbox.com/u/7659139/Facepunch/gm_maze_wip3_physics.png[/IMG] I dont know what you guys meant by defining the mesh shared, so it could get predicted properly. Could anyone explain it please? I noticed some bugs too: The IMesh sometimes messes up the material it is being rendered with, like this: [IMG]https://dl.dropbox.com/u/7659139/Facepunch/material_wtf.png[/IMG] Also, it seems that if the physics object generated from the mesh exceeds a certain velocity, gmod hangs up. Maybe I should make a bugreport out of this? ( I made this in GM13 )
They mean you should create the mesh both serverside and clientside, and initialize its physics both serverside and clientside.
I tried, but strange visual bugs appeared, and I have no idea what is causing that: [IMG]https://dl.dropbox.com/u/7659139/Facepunch/weird.png[/IMG] The balloons are attached to the mesh, but after moving it, the ropes stay here, so does the physgun beam,
Haven't felt like doing much lately, but carving seemed easy to implement, so yeah: [media]http://www.youtube.com/watch?v=eWsT4psQAyM[/media] Ignore the messed up textures.
[img]http://puu.sh/10Fe2[/img] Horizontal splitter. (I forgot the height calculation; will be done) [img]http://www.facepunch.com/fp/ratings/tick.png[/img] Should I publish this templating system one day? [img]http://www.facepunch.com/fp/ratings/funny2.png[/img] Or should I keep it to myself? [editline]lol[/editline] 11 to 0 as of now. Here's the height fixed: [img]http://puu.sh/10IGt[/img] I messed something up badly. But I fixed it eventually. Dynamic typing is a son of a bitch. [editline]eh[/editline] Just for the record, that partially cut W in the description is not my fault. It's DLabel's fault, I assume.
[QUOTE=MDave;37480512]I tried, but strange visual bugs appeared, and I have no idea what is causing that: [IMG]https://dl.dropbox.com/u/7659139/Facepunch/weird.png[/IMG] The balloons are attached to the mesh, but after moving it, the ropes stay here, so does the physgun beam,[/QUOTE] If you Init physics clientside there are clientside physics after that which don't follow the serverside physics. What this allows to do (and what I learned from ralle) is make clientside objects collide with your prop. What you have to do is set the physics pos clientside to where it's serverside. Hopefully there's a better solution though. Your maze is probably static positioned so you won't have that problem when you make it non-movable.
Has anyone had an issue where net.WriteVector did not write (or read correctly on the other end), and had to write 3 floats instead?
[QUOTE=COBRAa;37481226]Has anyone had an issue where net.WriteVector did not write (or read correctly on the other end), and had to write 3 floats instead?[/QUOTE] didn't garry remove WriteVector/Angle to add more floats?
[QUOTE=Chewgum`;37481246]didn't garry remove WriteVector/Angle to add more floats?[/QUOTE] That was DTVars afaik.
So I wrote some SWEP thing to test my bullets It ended up having a certain feel in it, its hard to project with a video but still, its also awful to fire with the lag gm_video causes [vid]https://dl.dropbox.com/u/4838268/gm_construct%202012-8-31%2017-54-50.webm[/vid]
Rolling around a randomly generated maze. Finally everything works. ( Ignore the mat_fullbright, I am a terrible mapper... ) [video=youtube;IVdHan1_PPE]http://www.youtube.com/watch?v=IVdHan1_PPE[/video] Now I need create a nice map for it, set up some player classes, add some generated obstacles, and maybe one way only doors. The goal is to remake a CSS minigame, where red balls are supposed to crush players to death before the time runs out :v: Any ideas / suggestions?
[QUOTE=MDave;37482694]Rolling around a randomly generated maze. Finally everything works. ( Ignore the mat_fullbright, I am a terrible mapper... ) [vid]https://dl.dropbox.com/u/7659139/Facepunch/gm_maze_wip0_ruuun.webm[/vid] Now I need create a nice map for it, set up some player classes, add some generated obstacles, and maybe one way only doors. The goal is to remake a CSS minigame, where red balls are supposed to crush players to death before the time runs out :v: Any ideas / suggestions?[/QUOTE] do not use mat_fullbright? [editline] [/editline] Sigh sarcasm people do not get.
[vid]https://dl.dropbox.com/u/4838268/gm_construct%202012-8-31%2020-28-55.webm[/vid] I'm terrible at effects but that turned out decently EDIT: fixed the video, I uploaded the wrong one
I'm kindly asking everyone who shoots WEBM videos to upload them to YouTube and add the YouTube video here. Embedded WEBM videos are retardedly bugged no matter what browser I'm using, and I am sure I'm not the only one. Facepunch makes them even more retard because they autoplay, scaring the carbon out of me when scrolling through posts. [editline]meh[/editline] I am asking this because I really want to see what are you working on. :/
Certainly. I was afraid of my dropbox getting locked, I saw it happened to some people. [editline]31st August 2012[/editline] Not because the huge bandwitch, and the crowds who want to see my video tough... :v: [editline]31st August 2012[/editline] OFF: Took a forever to hide my name and personal infermation on youtube, what is wrong with you Google?
It happened to me once when I posted a pagefull of videos on the vphysics thread :v: If it wasent for the embedding I wouldent use gm_video, its laggy as fuck and the compression is terrible, if I'm uploading to youtube I use fraps
After shitloads of thinking and help from WDYNHW, I managed getting this intro (Also showing scoreboard) into my gamemode: [img]http://puu.sh/10L2x[/img]
Drawing players' view frustrums: [img_thumb]http://i.imm.io/CK9B.png[/img_thumb] Determining who can see you based on the view frustrum: [img_thumb]http://i.imm.io/CKq7.png[/img_thumb] This is quite accurate. As soon as you step out of their FOV, the script will know they don't see you anymore. And it only starts messing with traces AFTER the view frustrum check. The view frustrum check is a bunch of vector maths, which should be loads faster than a trace. :D [b]Why I made this[/b] Obviously you can't prop surf when the admin is looking. The solution is simple: if there's a red name in the top left of the screen, don't prop surf. If there isn't, [u]do[/u] prop surf.
[QUOTE=FPtje;37485905]Drawing players' view frustrums: [img_thumb]http://i.imm.io/CK9B.png[/img_thumb] Determining who can see you based on the view frustrum: [img_thumb]http://i.imm.io/CKq7.png[/img_thumb] This is quite accurate. As soon as you step out of their FOV, the script will know they don't see you anymore. And it only starts messing with traces AFTER the view frustrum check. The view frustrum check is a bunch of vector maths, which should be loads faster than a trace. :D [B]Why I made this[/B] Obviously you can't prop surf when the admin is looking. The solution is simple: if there's a red name in the top left of the screen, don't prop surf. If there isn't, [U]do[/U] prop surf.[/QUOTE] How are you checking you are in their fov? I made something similar to this, and used dot products for optimal results.
[QUOTE=JustSoFaded;37486095]How are you checking you are in their fov? I made something similar to this, and used dot products for optimal results.[/QUOTE] Dot products aren't accurate enough. As you can see I have the coordinates of the FOV. I must admit I got the angles for the FOV by trial and error (90 for horizontal FOV was too much, even though it was set to 90). I construct implicit equations for the near plane and all the side planes of the view frustum. I don't bother with the far plane. I get the normals of those planes with cross products. I then Dot the LocalPlayer's shoot position with the normals of those planes. Per plane: If the dot is positive then I'm on the wrong side of that plane (not in his view) If the dot is negative, then I'm on the right side of that plane (I am in his view) If the dots for all planes are negative, and a trace from his position to my position hits nothing, THEN he can see me. For the FOV I assume the maximum (90) If you just use dot products with the aim vector, you can't take the aspect ration in account. With dot products you create a cone of view instead of a frustum.
[QUOTE=FPtje;37486381]Dot products aren't accurate enough. As you can see I have the coordinates of the FOV. I must admit I got the angles for the FOV by trial and error (90 for horizontal FOV was too much, even though it was set to 90). I construct implicit equations for the near plane and all the side planes of the view frustum. I don't bother with the far plane. I get the normals of those planes with cross products. I then Dot the LocalPlayer's shoot position with the normals of those planes. Per plane: If the dot is positive then I'm on the wrong side of that plane (not in his view) If the dot is negative, then I'm on the right side of that plane (I am in his view) If the dots for all planes are negative, and a trace from his position to my position hits nothing, THEN he can see me. For the FOV I assume the maximum (90) If you just use dot products with the aim vector, you can't take the aspect ration in account. With dot products you create a cone of view instead of a frustum.[/QUOTE] Ah, that makes sense. Although, in my personal scripts I just dot product with the aim vector. I can't imagine them being so inaccurate to the point where it's noticeable on such a small scale.
Sorry, you need to Log In to post a reply to this thread.