Game option to add collision for stuff like pillows?

Everything about development and the OpenMW source code.
User avatar
Thunderforge
Posts: 503
Joined: 06 Jun 2017, 05:57

Game option to add collision for stuff like pillows?

Post by Thunderforge »

One of the planned features for TES3MP is an option to allow collision for objects that normally don't have it, like pillows. Apparently building pillow forts has been a popular thing to do in multiplayer so far. Since that's not a strictly multiplayer feature, I asked one of the developers if he would be willing to merge that code back into OpenMW as an option just like distant terrain, and he responded that he wasn't sure how the OpenMW developers would feel about doing that.

So how do we feel about it? Would we be interested in adding it as a configurable option?>
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Game option to add collision for stuff like pillows?

Post by Chris »

Collisions are defined by the models. The engine determines if an object can be collided with or not by the existence of specific nodes in the object's associated .nif model, so making pillows with collision would be handled by a mod that replaced the pillow's .nif model with one that defines a collision shape.
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: Game option to add collision for stuff like pillows?

Post by DestinedToDie »

But aren't all collisions in .nif files ignored if pillow is a lootable item? Last I asked modders it was impossible to have lootable items with collision at current state of affairs.
User avatar
Thunderforge
Posts: 503
Joined: 06 Jun 2017, 05:57

Re: Game option to add collision for stuff like pillows?

Post by Thunderforge »

I'm pretty sure that he was talking about changing the source code configured by a server option, rather than making this a mod. David talks about it at 2:00:35 in this video. He also talks about adding the option to make it so that if you drop, say, three of an item, it appears as three things stacked instead of one item that represents three, and making it a configurable option. I think he also mentioned adding an option to turn on gravity for items so you can't have floating stuff. None of that is possible with mods right now.
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: Game option to add collision for stuff like pillows?

Post by DestinedToDie »

We just need to hijack him away from the multiplayer stuff and have him work on these things on main branch. :D
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Game option to add collision for stuff like pillows?

Post by Chris »

Thunderforge wrote: 29 Jul 2017, 02:33 I'm pretty sure that he was talking about changing the source code configured by a server option, rather than making this a mod.
The general idea is that if something can be done as a mod, it should be. The engine doesn't (shouldn't) second-guess what the game data says to do.

What DestinedToDie says about lootable items not having collision regardless does throw a kink into that plan, though. I imagine it was done that way because it could be easily abused and/or you could accidentally get yourself stuck if you could move items and subsequently stand on them. But still, even that sounds like something that should be a flag in the object definition (could even by tied to whether gravity is applied), rather than an engine option.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Game option to add collision for stuff like pillows?

Post by scrawl »

I could think of many ways to abuse that - lock an NPC in place, levitate, etc. I think it's better to wait with that option until we have actual object physics.

Also, our settings file is mostly limited to things that won't change the gameplay. Maybe we should have a separate 'engine' settings file for engine behavior?

Anyway if you want to add it in your fork, it's easy, here:

https://github.com/OpenMW/openmw/blob/m ... ok.cpp#L36

How would you deal with different clients having different values for the setting, though? Characters would then glitch about all over the place, right?
User avatar
Thunderforge
Posts: 503
Joined: 06 Jun 2017, 05:57

Re: Game option to add collision for stuff like pillows?

Post by Thunderforge »

A separate engine settings file makes sense. This would also have the advantage of allowing TES3MP to make sure players all have the same one by running a checksum file on it, assuming they want to go that route.
davidcernat
Posts: 256
Joined: 19 Jul 2016, 01:02

Re: Game option to add collision for stuff like pillows?

Post by davidcernat »

The way I see it, instead of having some sweeping setting that makes all objects of a certain type have collision or gravity, the server could just send an ObjectCollision packet turning collision on or off for a single specific object or group of objects.

So, for instance, pillows placed by players could have collision enabled for them at the server's behest, while pillows that regularly exist in the world would not need to have it, and this could all be solved by having a check for a new hasCollision boolean for each object.

I haven't really looked into the potential node issues that Chris has mentioned, but even if there are problems with .nif models, specific collision boxes could be set for each object or object type through a packet.
Post Reply