Jump to content
The Dark Mod Forums

func_forcefield + water + movable object = WTF?!


LordSavage

Recommended Posts

I set up a forcefield in a water brush/entity to emulate a river. The uniform vector is 90 0 0 and it works (not too good but ok) for many objects but there are other forcefields in the water with a vector of 180 0 0 (to emulate a faster river under a narrow bridge) and objects in this "fly" away like in an explosion. I read somewhere that this is a somewhat known bug but is there any workaround or fix I can use for my map?

Link to comment
Share on other sites

I can't find a bugtracker entry for this.

 

I looked at the forcefield code and didn't see anything obviously wrong. There is a random amount of torque applied, probably to make the object spin, but this should only apply to angular velocity, not translation velocity.

 

If you could please enter this in bugtracker, possibly with a sample map, that would help get it fixed.

 

In the meantime, if there's a specific moveable that gets dropped into the water, you could lower its mass to see if that helps.

 

Thanks.

Link to comment
Share on other sites

Here is an example map. Look how things speed up in water! And now imagine this in a long river and objects dropped from a few meters above the water.

 

Edit: Can't attach .map files.

 

Here you go:

Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "-169.396 -163.181 149.664"
"editor_drLastCameraAngle" "-46.7999 113.4 0"
// primitive 0
{
brushDef3
{
( 0 0 1 0 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 2 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 1 0 -64 ) ( ( 0.0078125 0 254 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 192 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 -128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 13.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 -64 ) ( ( 0.0078125 0 2 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 -320 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -200 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 1 0 -64 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 -320 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0.0625 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 -288 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0.0625 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 -320 ) ( ( 0.0078125 0 13.75 ) ( 0 0.0078125 0.0625 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 192 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.0078125 0 15.9375 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 1 0 -72 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 -320 ) ( ( 0.0078125 0 15.9375 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 -128 ) ( ( 0.0078125 0 15.9375 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 -320 ) ( ( 0.0078125 0 13.8125 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 64 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 1 0 -64 ) ( ( 0.0078125 0 0.0625 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 -328 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 -128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0.0625 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 -288 ) ( ( 0.0078125 0 15.9375 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 320 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 1 0 -64 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.875 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 -320 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 -136 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 -288 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 -320 ) ( ( 0.0078125 0 13.75 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 1 128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.0078125 0 0.0625 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 -320 ) ( ( 0.0078125 0 0.0625 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 -128 ) ( ( 0.0078125 0 0.0625 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 -296 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 -320 ) ( ( 0.0078125 0 13.6875 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 1 0 288 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
// primitive 6
{
brushDef3
{
( 0 0 1 -192 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 0.0625 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 1 0 -64 ) ( ( 0.0078125 0 15.9375 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 0 -1 -128 ) ( ( 0.0078125 0 0 ) ( 0 0.0078125 15.9375 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 0 -1 0 -288 ) ( ( 0.0078125 0 0.0625 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( -1 0 0 -328 ) ( ( 0.0078125 0 13.75 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
( 1 0 0 320 ) ( ( 0.0078125 0 13.75 ) ( 0 0.0078125 0 ) ) "textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour" 0 0 0
}
}
}
// entity 1
{
"classname" "info_player_start"
"name" "info_player_start_1"
"origin" "-256 0 0"
"angle" "-89.999992370605469"
}
// entity 2
{
"classname" "func_forcefield"
"name" "func_forcefield_1"
"model" "func_forcefield_1"
"origin" "0 -112 -72"
"applyImpulse" "1"
"start_on" "1"
"uniform" "180 0 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -56 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/common/caulk" 0 0 0
( 0 1 0 -176 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/common/caulk" 0 0 0
( 1 0 0 -320 ) ( ( 0.03125 0 0.75 ) ( 0 0.03125 0 ) ) "textures/common/caulk" 0 0 0
( 0 0 -1 -56 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/common/caulk" 0 0 0
( 0 -1 0 -176 ) ( ( 0.03125 0 0 ) ( 0 0.03125 0 ) ) "textures/common/caulk" 0 0 0
( -1 0 0 -320 ) ( ( 0.03125 0 63.75 ) ( 0 0.03125 0 ) ) "textures/common/caulk" 0 0 0
}
}
}
// entity 3
{
"classname" "atdm:liquid_water_murky"
"name" "atdm_liquid_water_murky_1"
"model" "atdm_liquid_water_murky_1"
"origin" "0 -112 -72"
"underwater_gui" "guis\underwater\underwater_green_thinmurk.gui"
// primitive 0
{
brushDef3
{
( 0 0 1 -56 ) ( ( -0.007812499534338713 -6.829903864691289e-10 255.75 ) ( 6.829903864691289e-10 -0.007812499534338713 2.185569414336896e-08 ) ) "textures/water_source/water_stream" 0 0 0
( 0 1 0 -176 ) ( ( 0.0625 0 0 ) ( 0 0.0625 0 ) ) "textures/common/nodraw" 0 0 0
( 1 0 0 -320 ) ( ( 0.0625 0 0 ) ( 0 0.0625 0 ) ) "textures/common/nodraw" 0 0 0
( 0 0 -1 -56 ) ( ( 0.0625 0 0 ) ( 0 0.0625 0 ) ) "textures/common/nodraw" 0 0 0
( 0 -1 0 -176 ) ( ( 0.0625 0 0 ) ( 0 0.0625 0 ) ) "textures/common/nodraw" 0 0 0
( -1 0 0 -320 ) ( ( 0.0625 0 0 ) ( 0 0.0625 0 ) ) "textures/common/nodraw" 0 0 0
}
}
}
// entity 4
{
"classname" "light"
"name" "light_1"
"origin" "0 -112 32"
"light_center" "0 0 0"
"light_radius" "328 184 168"
"texture" "lights/ambientlightnfo"
"_color" "0.20 0.20 0.20"
"nodiffuse" "0"
"noshadows" "0"
"nospecular" "0"
"parallel" "0"
}
// entity 5
{
"classname" "atdm:moveable_bucket_wood"
"name" "atdm_moveable_bucket_wood_1"
"origin" "-216 -32 8"
}
// entity 6
{
"classname" "atdm:moveable_bucket_wood"
"name" "atdm_moveable_bucket_wood_3"
"origin" "-216 -8 8"
}
// entity 7
{
"classname" "atdm:moveable_bucket_wood"
"name" "atdm_moveable_bucket_wood_4"
"origin" "-216 -56 8"
}
// entity 8
{
"classname" "atdm:moveable_bucket_wood"
"name" "atdm_moveable_bucket_wood_5"
"origin" "-240 -56 8"
}
// entity 9
{
"classname" "atdm:moveable_bucket_wood"
"name" "atdm_moveable_bucket_wood_6"
"origin" "-264 -56 8"
}

Link to comment
Share on other sites

If it's a uniform vector forcefield, the magnitude of the force is equal to the length of the vector. In "The Creeps", I set a very short length (0 2 -1) to push some moveables south and slightly up to mimic wind blowing. '90 0 0' and '180 0 0' seem really big for what you're doing. Divide that by ten, start with '9 0 0' and '18 0 0'.

 

Other than that, it looks set up correctly. I hope this isn't a side-effect of water physics. Sometimes, impulses had gone all wonky in water, but I thought Ishtvan and I fixed that a while ago.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Found a spawnarg in the code: "playerOnly" "0/1". Something worth your experimenting with?

 

I'm still a bit baffled in the handling of the player in a forcefield. It pushes the player with the same magnitude impulse whether in water or falling down in the air (not standing on ground).

 

 

Edit: Oh, I think I see what's happening. Because moveables get a mass multiplier in water (to make them bouyant), that may be why the forcefield impulse is so violent only on the buckets.

Edit2: Oh wait, no. Because the buckets still get kicked around violently by the forcefield even without the water. This may be a bug with the handling of the player, not moveables.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Now that the Source code is out, anything can be fixed (presuming "the staff" have the needed skillset). That said, physics code is pretty difficult...

AFAIK, Grayman, Ishtvan, Greebo and Angua have all fixed physics issues via SDK so now with the full sources they should have more resources to fix stuff?

 

I would make a test map and open a Bug tracker ticket and see what happens ;)

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

The forcefield applies the same force to any object.

 

The mass of the object factors into how that force translates into velocity.

 

Heavier objects receive less velocity than lighter objects.

 

So the player floats nicely along while the buckets fly.

 

Since a forcefield has been used in at least 5 FMs to date, I don't want to change the physics of it.

 

So here's a workaround:

 

Set up two forcefields, same size, same origin.

 

Give one these spawnargs:

 

"uniform" "171 0 0"

"playerOnly" "1"

 

Give the other this spawnarg:

 

"uniform" "9 0 0"

 

The two forces will be additive on the player, giving you the equivalent of "180 0 0".

 

The bucket is only affected by the "9 0 0" force, which makes it float along nicely. If it's still going too fast for you, then adjust "9 0 0" downward and compensate in the other forcefield by adjusting "171 0 0" upward.

Link to comment
Share on other sites

The forcefield applies the same force to any object.

 

The mass of the object factors into how that force translates into velocity.

 

Heavier objects receive less velocity than lighter objects.

 

So the player floats nicely along while the buckets fly.

 

Since a forcefield has been used in at least 5 FMs to date, I don't want to change the physics of it.

 

So here's a workaround:

 

Set up two forcefields, same size, same origin.

 

Give one these spawnargs:

 

"uniform" "171 0 0"

"playerOnly" "1"

 

Give the other this spawnarg:

 

"uniform" "9 0 0"

 

The two forces will be additive on the player, giving you the equivalent of "180 0 0".

 

The bucket is only affected by the "9 0 0" force, which makes it float along nicely. If it's still going too fast for you, then adjust "9 0 0" downward and compensate in the other forcefield by adjusting "171 0 0" upward.

 

That did it for the buckets but the barrel (atdm:moveable_barrell_med) is super slow now. Much too slow to be realistic. :/

Link to comment
Share on other sites

That did it for the buckets but the barrel (atdm:moveable_barrell_med) is super slow now. Much too slow to be realistic. :/

 

Sounds like we need a sliding fudge factor applied to things in a forcefield. (A force of 180 is good for a mass of 70 (player), a force of 9 is good for a mass of 4.75 (bucket), and a force of N is good for a mass of 45 (med barrel). )

 

Could you adjust the force and tell me what N is for a med barrel? I'm guessing it's around 90.

Link to comment
Share on other sites

90 is exactly what I used for the river where the barrel is in my map :D.

 

For better understanding:

forcefield.jpg

 

What happens if an object is touching multiple of these areas at the same time, for example a "180 0 0" and a "90 0 0" volume - does that get handled properly or does it add all the forces together flat ?

Link to comment
Share on other sites

What happens if an object is touching multiple of these areas at the same time, for example a "180 0 0" and a "90 0 0" volume - does that get handled properly or does it add all the forces together flat ?

 

Each field acts independently on the object, so the results are additive. In your example, the effect of the two fields would be the same as a single field with a push of "270 0 0".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...