Jump to content
The Dark Mod Forums

Frobbing objects in water


stgatilov

Recommended Posts

I played with a chair in Lady Helena's bath. When a floating object is frobbed it starts doing weird things. Sometimes it dances like mad, jumps out of the bath. That damn piece of wood has even killed me once (Yet Another Stupid Death it is)! And once I managed to grab it and it started rotating with mad velocity. I still wielded it and could move it! I tried quicksaving this game state, but after loading the chair was not moving.

EDIT: caught crazy rotating chair again. This time I tried to manipulate it (rotate it myself) while it was spinning. It works strange: the chair behaves as I manipulate it about half of frames, and the other half consists of random positions. Moreover, after I release manipulate button it continues to rotate with the same crazy speed. Even collisions do not always stop its rotation.

 

 

Has anyone experienced the same?

 

 

 

 

 

Edited by stgatilov
Link to comment
Share on other sites

Yes. Well, not exactly. But objects that bounce around like mad and behave oddly in water. Depends a little on how hard one throws the object into the water. Perhaps, if the physics are dodgy, it is best to just have it sink to the bottom?

Where are the REAL brits?! The one's we have are just brit-ish.

Link to comment
Share on other sites

We have adjusted the masses of objects and the water density, so they "realistically" float (e.g. some sink, some not). However, there are shortcomings in the "physics engine" (if you can call id's "code" that..):

 

* There is only uniform density. So long slender objects with a heavy bottom do not swim upright, instead they swim different. Related, objects composed of two different objects (heavy candle holder with candle attached) do not have the right weight distribution (I think the attached object isn't taken into account at all). Likewise, the mass is taken from the volume of the clipmodel, but that can have a completely different volume than the visible model - mainly because it needs to be very very simple. So a visible model which should sink (small volume, mass of X) swims (clipmodel has bigger volume, but same mass X). Unfortunately, we can't just adjust the mass (as this is needed f.i for throwing things) and so far we have not yet implemented a "use this density mabyeonly use it when in water" because if you adjust the density, the mass will be calculated from the volume. Basically,the engine makes a lot of simply but wrong assumptions about mass, density, volume and their relationships.

 

* The water phyiscs (taken from the water mod IIRC) is wonky. It just reduces the mass so things float (IIRC) but this means things can achvie lower orbit if you grab them or hit them. Esp because our grabber does nothing special for things floating in water (it probably should limit forces in this case).

 

So yeah, we know about it, and would love to fix physics. But it might be easier to completely switch to a new physics engine than fix all the problems in the current one.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

If I increased the mass of an individual chair as a test would it then float more correctly? Or would the physics calculate that now it can't float at all?

 

If it still floats, I think it would be "more correct" but still very wrong (grabbing makes it fly), if you increase the mass far enough, it will sink, but then it might be too heavy for the player to pick it up.

 

Essentially this a code fix, objects in or partially in water need different code - mucking with the mass will only cause more problems elsewhere.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

wasn't there a warning somewhere on the wiki stating that having objects with physics in water at the start of a map causes them to fly around, but place them over the water so they fall in when the map starts in doom.

 

How far above? Because wherever I place an object that should float it rests at the bottom until I try to pick it up (then it jitters until it it dropped and rockets to the surface), or I hit it.

 

Maybe there's a way to simulate a "pick up" before the game starts?

Edited by ocn

Where are the REAL brits?! The one's we have are just brit-ish.

Link to comment
Share on other sites

I give up- I can't get things to start off floating no matter what I do.:wacko:

 

Do the things float when you put them in water via the grabber (e.g. at map start, they stay on land, then the player walks over and puts them in)? If not, it is too heavy to float.

 

Otherwise, there is the small problem of "activating" things at maps start, Try this:

 

* select any worldspawn brush

* select your moveable, too

* press CTRL-K to link them. The worldspawn will then trigger it at map start, this seems to be nec. to activate the physics.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Otherwise, there is the small problem of "activating" things at maps start, Try this:

 

* select any worldspawn brush

* select your moveable, too

* press CTRL-K to link them. The worldspawn will then trigger it at map start, this seems to be nec. to activate the physics.

 

Nope. It doesen't work. The object, a standard wooden chair, floats when I pick it up or bump into it. But rests eerily like a ghost at bottom until I do.

Where are the REAL brits?! The one's we have are just brit-ish.

Link to comment
Share on other sites

The boat in the trainer was a special func; it wasn't using the water physics.

 

 

It can be done with a script but hopefully there is a better way:

 

Create a small brush just above the water big enough to stand the chair on

Texture it common > nodrawsolid

Make it a func_static

Name it say, TempPlatform

Stand the moveable chair or whatever just above with a small gap like you normally would

 

Create a plain text file to go in the same folder as your map.

Name it the same as your map but suffix .script eg, mymap.script

Paste the following in and modify it for the name of your floating object.

 

void main()
	{
		sys.wait(0.5);
		$TempPlatform.remove();
		$TestChair.activate($player1);
	}

 

The 'wait' is 0.5 seconds. This is to allow the chair to settle at the start. Increase that a little to 1 or 2 seconds if it doesn't work in say a big map with lots of moveables that might take several seconds.

 

The line '$TestChair.activate($player1); is for a chair named TestChair so obviously change it to the name of your floating object. You can copy that line below it and add another name and so on to have multiple floaters.

 

PS. Possibly this might work if they start below water. I'll check.

 

[EDIT] Confirmed. You can start the platform and chair underwater and at map start the chair springs up to the surface.

Link to comment
Share on other sites

Thanks, Fidcal. That certainly helps. But I remember a mention in the wiki about floating debris on a river, with a teleport system at each end reusing the individual entities. How's that achieved if things won't initially float? Also, apologies to stgatilov for unintentionally hijacking the thread, but it is a related issue.

Where are the REAL brits?! The one's we have are just brit-ish.

Link to comment
Share on other sites

At one time it was possible to get items to float just by activating them from a script without the platform but that doesn't seem to work anymore. The code has been developed over the years. Possibly someone will think of a better way to get entities to float at the start. It's not been a priority and nobody has developed a map that critically required it so other things have taken priority. I suspect that in the original Doom 3 that Tels method worked to just target them from worldspawn.

 

Anyway, my system is not too difficult and will enable the recycling debris idea to work if that is what you want.

Link to comment
Share on other sites

It can be done with a script but hopefully there is a better way:

 

Yes there is :) You don't need a script for this, just use this script object:

 

http://wiki.thedarkmod.com/index.php?title=Script_objects#tdm_suicide

 

Give the two spawnargs to the platform, and it will remove itself after the set time.

 

The real bug (things don't float in water when they start above it at map start) should be tracked and fixed, too, tho.

 

Edit: Just a note, the script object assumes that the time is in seconds, and if less than one seconds, waits 360 seconds. That's not a good idea, it will catch mappers off guard. I am gonna change it, if the time is < 0,then it fallsback to 360 seconds, and also document this on the wiki. But with v1.03, you still can only use times >= 1 second.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OK. In this case probably 1 second will do. It just depends if it happens right in front of the player.But removing the platform is not enough; the floater still needs activating. That can be done without a script probably using a timer trigger or something although it starts to get more complicated than doing my script! Maybe we need an additional script object for floaters - self-activate or something.

Link to comment
Share on other sites

When's this engine going open source again? Wouldn't changing the code break the missions that are already released? Oh, you probably have a plan you cunning taffers you.:D

Where are the REAL brits?! The one's we have are just brit-ish.

Link to comment
Share on other sites

OK. In this case probably 1 second will do. It just depends if it happens right in front of the player.But removing the platform is not enough; the floater still needs activating. That can be done without a script probably using a timer trigger or something although it starts to get more complicated than doing my script! Maybe we need an additional script object for floaters - self-activate or something.

 

Ah, ok, missed that. But it would be easy to link the platform to the chair, and then in the tdm_suicide script add "activateTargets()" just before the remove call. That would automatically activate all targets.

 

If you don't want this, then you just don't link (target) anything from the platform, and it still works.

 

Should I do this? It's easy enough.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Yes, that sounds a very good solution. I wonder also maybe we should have a custom entity, effectively a func_static with that script_object on it. This same platform can be used for other things. For instance, most of my FMs have started with the player on such a temporary platform because the drop is over before rendering makes anything visible.

 

Actually thinking further, if this triggers its targets it could be a general start trigger entity. So suppose it is called tdm_start_trigger or similar and it triggers then self-destructs after a selected time from game start. Might be useful for different things and applied to a brush it forms a platform for floaters or for the player or anything you want to drop at game start but timed. For instance, say an object or a dead body drops in front of the player view at game start. There might not be ceiling room to place a ragdoll or moveable that wouldn't be settled on the floor before rendering becomes visible. With this platform it could be delayed.

Link to comment
Share on other sites

Yes, that sounds a very good solution. I wonder also maybe we should have a custom entity, effectively a func_static with that script_object on it. This same platform can be used for other things. For instance, most of my FMs have started with the player on such a temporary platform because the drop is over before rendering makes anything visible.

 

Actually thinking further, if this triggers its targets it could be a general start trigger entity. So suppose it is called tdm_start_trigger or similar and it triggers then self-destructs after a selected time from game start. Might be useful for different things and applied to a brush it forms a platform for floaters or for the player or anything you want to drop at game start but timed. For instance, say an object or a dead body drops in front of the player view at game start. There might not be ceiling room to place a ragdoll or moveable that wouldn't be settled on the floor before rendering becomes visible. With this platform it could be delayed.

 

It is done now. Added activateTargets() to the script object, and added "atdm:vanishing_platform" as entity def, you find it under "Func" in DR. How to use it:

 

* create a brush, texture it any way you like it

* select the brush,

* right click on orthoview, choose "Create entity"

* link any potential targets from this entity (select new platform, select target, press CTRL-K)

* Profit!

 

I added a test to the test/light_delay.map - 30 seconds after the map start the invisible platform is destroyed and also extinguishes the linked light near the ceiling. Works like a charm :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OK, thanks. I prefer atdm:vanishing_platform_trigger under triggers though. :)

 

It's not really a trigger, tho. Plus, I also though to rename it to "atdm:vanishing", because it is not nec. a platform, anyway.

 

Any other opinions?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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.
      · 5 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...