Garry has implemented the long desired ShouldCollide hook. This is what I've been dreaming about for years now. Its lack of existence has caused us much pain with adding No-Collides to our contraptions.
I have created an addon which will automatically hijack all weld constraints. In doing so, it creates groups of welded entities, or "weld groups". Entities in the same weld group do not collide with eachother. If you build a complex contraption and weld everything once to a single prop, NOTHING on that contraption will collide with itself! No extra work needed!
Typically, you'd have used my No Collide - Multi/Smart tools to prevent this. But in creating a NoCollide constraint actually creates another game entity which has to travel with your contraption. This lags the server. A simple 16 prop contraption can have up to 120 NoCollide constraints!
Anyway, if you want this on your server, just install this addon:
[url]http://svn.sgc-clan.com/repos/weld_groups/trunk[/url]
Username: anonsvn
Password: anonsvn
[b]Revision 5 on 2009-11-11[/b]
It is still in beta and there are likely bugs still. If you have any issues, please post them here or send an email to my name at sgc-clan.com. Please don't post on garrysmod.org as the svn may be occasionally updated. This may not function properly with client-side physics objects or shadows. Official post can be found [url=http://www.sgc-clan.com/forum/general-development-discussion/3526-weld-groups-addon-new.html]here[/url].
Works good only thing I see not working is duplication. Now I'll have a extra 2000 constraints (=
Ha, interesting. Thanks, I'll look into that.
If you need help with duplication I can help with that. I think this is a really awsome idea.
It doesn't work for me. I installed it and it doesn't come up in tools and I don't get any errors.
ZIP PL0X
Its an autorun... it's always working.
I think it may have to do with my NoCollide hack, since it determines if it is creating a nocollide between two entities in the same weld group, it returns NULL. Maybe returning NULL is confusing the duper?
Would you care to do a test for me? Try disabling the "NewCreateNoCollide" code and try pasting.
[QUOTE=Teh_Medic;18103331]It doesn't work for me. I installed it and it doesn't come up in tools and I don't get any errors.
ZIP PL0X[/QUOTE]
There is no tool. It's something that's done automatically when you weld objects together.
Alright Ill try it, but im pretty sure your going to have to register the nocollide groups in the duplicator which isn't to hard.
edit* yeah didn't work.
Sounds awesome, I've been looking for something like this. I'll put it on my server as soon as duplicator support is added. Great work! :D
Fixed. I've committed revision 3 which is duplicator friendly and fully tested.
Okay so basically, this makes it so anything that is welded together does not collide with anything that is a part of that contraption, and by doing so decreases lag as it doesn't spam entities? If that's the just of it then this is something that EVERY server needs. Granted they allow building.
Precisely. It negates the need for no-collide at virtually no cost. That and it makes building a lot easier without having to figure out what will collide with what.
[QUOTE=Narkaleptic;18232942]Precisely. It negates the need for no-collide at virtually no cost. That and it makes building a lot easier without having to figure out what will collide with what.[/QUOTE]
Word of warning: Either the ShouldCollide hook or game.CleanUpMap() (not sure which, could be a combination... I haven't used them exclusively) break the physics system after awhile (in most cases after around 200 minutes of use). And by "break" I mean players falling into the ground, props bouncing around with bbox physics and a total lack of dampening "break".
What if you NEED welded things to collide?
[QUOTE=CptFuzzies;18234020]What if you NEED welded things to collide?[/QUOTE]
He could probably just make an "Allow Collisions" tool. Given the way the hook works it couldn't be too hard.
That's just absurd. Let's bypass a feature, then bring it back in? This addon needs to be seriously rethought. It's a brilliant concept, but the application to it isn't practical.
Firstly, SGC's [url=steam://connect/69.162.65.18:27015]Naval Play server[/url] runs for days on end without issues. That must be a sign of poor implementation on the part of others. If we see any issues, I'll announce it and reevaluate.
Secondly, when would you [b]ever[/b] want welded entities to collide with each other? Think about this. If you have 20 props welded together, when would you want one of those 20 props to collide? If they are attached by any other means (rope, axis, ballsocket, etc) they will still collide. The idea of welding is that they become one, regardless of what is welded to what other props, as long as they are all attached by welds. Complex collisions (IE: constrained props against constrained props) are incredibly taxing on the physics system.
Lastly, there is no harm in trying the addon on your server or locally to evaluate its benefits.
[QUOTE=CptFuzzies;18234626]That's just absurd. Let's bypass a feature, then bring it back in? This addon needs to be seriously rethought. It's a brilliant concept, but the application to it isn't practical.[/QUOTE]
He could just make a stool and what ever you selected would be excluded from the array of things to not collide. It's very practical. If you think it's absurd then you must think being able to undo a nocollide is absurd; it's the same principle.
OK, though I'm still not convinced that there is a time when this is necessary, I've created a tool to disable it on a per-entity basis. It has duplicator support.
Yeah I don't really see the need for it, but I was just explaining that it's possible.
Awesome, more work to do something a checkbox takes care of.
[QUOTE=CptFuzzies;18265717]Awesome, more work to do something a checkbox takes care of.[/QUOTE]
Troller, your negative comments arn't welcome. This is how weld should have been made in the first place. nocollide constraints cause lag, take time to place on all your props, and consume the amount of constraint welds you can place. Plus you would have to go around no colliding all the props that you didn't weld taking lots of time. Your the one with who asked what if we want things to collide, which isn't very needed, and he made it. The addons here, it works, it's very usefull, and you should realize it.
[QUOTE=CptFuzzies;18265717]Awesome, more work to do something a checkbox takes care of.[/QUOTE]
Do you really understand what it does or are you just posting to show stupidity?
This has been tested on a few servers and has improved performance in heavy physics environments. So if you want to say 'oh well I can just do same thing by clicking this here checkbox' then lets see that checkbox also enable the server to not incur so much physics processing time too.
Is anyone else loving the end of "contraption spazzing" as much as I am? Excluding our troll, does anyone have any issues or suggestions so far?
I'm not sure if it needs to be added but I noticed that it didn't work with things other than weld like axis.
Edit* I guess it might need to be added since you did make a stool that will allow collision if they do want their axis and other constraints to collide.
Constraints other than weld are kinda sketchy. It is common that people want axis and ball joints to collide. It would be complicated to determine when other constraints should be included in the weld groups. There seems to be no "constraint modifiers" for the duplicator so I can't have it save.
I'll keep my mind open for a solution.
autorun/weldgroups.lua:64: bad argument #1 to 'insert' (table expected, got nil)
happened when I welded 2 pieces of wood together and one broke and I tried to weld another piece of wood to it.
I've been trying to duplicate that error for over an hour and to no avail. I've put some padding in the code to prevent it from happening again but I'm not sure what could have caused it. That whole piece is pretty elegantly balanced.
Additionally, I've updated my email address to one that I actually read and made the variable names slightly more meaningful. Not a necessary update if your copy works.
What about a tool that adds a prop to the other prop's weld group?
Sorry, you need to Log In to post a reply to this thread.