Jump to content
The Dark Mod Forums

A question and an idea about plants for the DM.


Maximius

Recommended Posts

Im playing FarCry Moto 4 Mod right now as a lark before school hits. Its fun, the gun battles are pretty cool, and none of those dumass mutant monkeys either. If you play it on realistic, be sure to learn how to save, cause the save points won't help you. There are a lot of good times and I may try moto 3 at some point at the first break. But there are flaws and some of them gave me some questions about the Dark Mods and how it will do things.

 

For one thing, when the character Jack is hiding in the tall grass and bushes that are everywhere he is not hidden by those plants. You have to get ground or a tree between you and the AIs or they spot you. Its a little stupid in the game because there is all this great cover that just doesn't work.

 

So it got me wondering, will the grass and bushes etc. be able to hide the Thief in the game, will they provide shadow. I understand they often get shadow casting turned off to save on processor power but I have an idea that may be able to do the job.

 

First the idea depends upon whether or not a zone could be constructed around a patch of high grass or bushes. These can be alpha map plants, because they are not going to actually cast shadow. So imagine a patch of high grass and around it is an invisible box, that is roughly the same height, width, and depth of the plants, and that when the Thief is inside that box his light gem darkens. This is to mimic the shadows and cover that hiding in tall plants would provide. Is this a possibility? It doesn't seem out of the blue.

 

One problem I could see is that the Thief would be able to stand in tall grass and still receive a shadow bonus, even if his head and shoulders are clearly in sight of the AI. I don't know if this could be compensated for somehow, if the game could somehow distinguish between when the Thief is standing or lying prone in a faux shadow casting zone.

 

Ok, so assuming all that is possible, here is the second piece. I think there is a way, I will have to search the Internet for this again, but there is a way to mimic movement with alpha maps, I remember reading about it months ago. I cannot remember it all but it went something like this:

 

In addition to the alpha map of the foliage, another map is laid very close to the foliage map but this map is simply a dark black map with the outline of the foliage map. Somehow, I don't remember how at all, the two maps are joined so that when the Thief would brush into them, they would move apart slightly, again I don't know the details of how. Essentially, the darker maps gives the appearance of being a shadow behind the foliage and jumps around behind the real image just a tiny bit as the Thief moves through. No shadow actually hits the ground but according to the site I read a long time back it looks like fairly convincing to the player that the plant is moving as well as at least some shadow effect.

 

So if all this works I think alpha map bushes and grass could be constructed that appeared at least to move a bit when they are disturbed, some good sound would help too of course, and then actually provide some cover to the Thief. Perhaps to it would be possible for mappers to darken the ground underneath the area covered by heavy plants to mimic ground shadow. Although this does add some pixels to the processors workload it doesn't add polygons which is good. Im going to look for that website. If anyone can add some insight I would be really appreciative.

Edited by Maximius
Link to comment
Share on other sites

One problem I could see is that the Thief would be able to stand in tall grass and still receive a shadow bonus, even if his head and shoulders are clearly in sight of the AI. I don't know if this could be compensated for somehow, if the game could somehow distinguish between when the Thief is standing or lying prone in a faux shadow casting zone.

 

I think such a system could work within our current lightgem bonus system by having the volume around the grass only give you the bonus if your crouching.

Link to comment
Share on other sites

I think such a system could work within our current lightgem bonus system by having the volume around the grass only give you the bonus if your crouching.

We don't currently have the capability for such a volume, though, do we? (Which is not to say it can't be added, because it's definitely within the realm of the feasible.)

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Would it not be similar to a volume of water, at least in that its a zone where certain rules apply that are not applied everywhere on the map? In a way it could be like an invisible box of water without the water effects, only shadow effects. I don't really understand these things of course.

Link to comment
Share on other sites

Found the website:

 

http://www.animationartist.com/2000/Tutori...es/lwtrees.html

 

and here is the relevant text:

 

"You can also simulate a breeze rustling the leaves by moving a fractal bump map through them. This will create moving shadows that make the leaves appear to move. A fractal displacement also can be used to move the leaves as well. Use a Texture Size of 0.1 meters and a Texture Velocity of 0.01 meters for a nice gentle breeze effect.

 

By saving this as a scene, you can easily use the Load From Scene button to bring this tree into any other scene and keep all the clipping and displacement information intact. This will make it easy to quickly landscape that park. At least until the client considers a nice big Douglas fir."

 

Unless I'm mistaken this is looking pretty possible. Im going to start making plant textures in GIMP.

Edited by Maximius
Link to comment
Share on other sites

Well, we can add shadow meshes to plants. Most of the plants do have alpha maps. This cuts down drastically on polys which is good for plants, there will typically be alot of them scattered about.

 

But adding shadows does increase computation, and to get shgadows that look like the plants will require quite a few polys to be added to the models.

 

A very basic 'blob' shadow mesh can be added but won't ever look like grass, it will just help darken things and hide player.

 

I wonder if shadow2 can be used on a patch? I don't see why not. That could help authors just make a general area shadow where lots of plants are. Probably better than every plant obj having it's own shadow mesh.

 

Plants that brush aside would probably need either an AF file (meaning animations, md5 files, ect... major pain, little benfit. most fm's will most likely be more city than vegetation jungle type maps) or maybe a script to make the plants move when touched, probably thru source/receptron.

That would be a major lag on the system.

------------

I think it's one of those things that would be REALLY cool to see in game, but the computation is above the engine/modern computers.

Also, alot of our plants (trees/bushes/grass) will probably be particles. They look alot better than old style models, but try and make particles behave that way. Don't think that's very likely, they like to face the player, that's about it.

 

--------

Edit--

Just saw your new post and link...

The problem I see with that is that it is for a 3d program. There are things a 3d program can do a game engine can't.

one was the leaves, they are using clusters to make the leaves appear in certain areas. D3's particles aren't that good.

Also, that program is not keeping track of all the game related stuff, only the trees.

 

Don't know if you've seen our particle trees yet, they look pretty good. As good as Oblivion IMO. I think it would take alot of work to do it better, and that's as good of a tree as I've seen in any game to date.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Would it not be similar to a volume of water, at least in that its a zone where certain rules apply that are not applied everywhere on the map?

More or less, yeah. Like I said, it's definitely feasible. I'm just querying the implication that we already have that capability.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

We had actually discussed this issue early in the mod and had plans to do something about it. The problem isn't really shadows, it's that the object (bush, grass, etc) *itself* should hide the player--you should be able to crouch behind a bush or in long grass and be relatively hidden regardless of how much light is around.

 

The problem is that objects in D3 are either fully opaque or fully transparent. To be honest, I can't remember which category textures with alpha channels fall into. We had originally planned on creating some kind of "occlusion quality" spawnarg that could be applied to entities that were semi-transparent. If a guard's visual trace hit an object with an occlusion quality value, it would affect their ability to detect the player. In other words, hiding behind a thin bush might help hide you a little, but not absolutely.

 

I have my doubts that any system like that will make it into the first release, however.

Link to comment
Share on other sites

The problem is that objects in D3 are either fully opaque or fully transparent. To be honest, I can't remember which category textures with alpha channels fall into.

Opaque, probably. So bushes should give you a fair amount of cover (actually too much, but oh well - you're a master thief, a single grass stem is plenty of cover ;) ).

 

We had originally planned on creating some kind of "occlusion quality" spawnarg that could be applied to entities that were semi-transparent. If a guard's visual trace hit an object with an occlusion quality value, it would affect their ability to detect the player. In other words, hiding behind a thin bush might help hide you a little, but not absolutely.

 

I have my doubts that any system like that will make it into the first release, however.

As do I.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

We had originally planned on creating some kind of "occlusion quality" spawnarg that could be applied to entities that were semi-transparent. If a guard's visual trace hit an object with an occlusion quality value, it would affect their ability to detect the player. In other words, hiding behind a thin bush might help hide you a little, but not absolutely.

 

I have my doubts that any system like that will make it into the first release, however.

As do I.

I have doubts that it can even reasonably be done (i.e., without rewriting the entire trace algorithm from scratch), without D3 being first GPL'd. I seem to recall that the trace is performed in the precompiled, unreachable part of the SDK. (Somebody, please correct me if I'm wrong.)

Link to comment
Share on other sites

The trace algorithm is indeed inaccessible. However, that doesn't prevent what Springheel describes; we could probably still do it, we'd just have to use multiple traces. (Trace from the AI's eyes to the player, until you hit something opaque. If it's a "semi-opaque" object, multiply the visibility value by its semi-opaque-ness factor, then do another trace from the collision point (possibly offset slightly to avoid hitting the same object again) to the player. Repeat until you find a completely opaque object (result: AI can't see player) or the player (result: player is in line of sight, with the visibility modifier we calculated previously).

 

What we can't do is cause the trace to "pass through" the transparency parts of an alpha-mapped texture while being blocked by the opaque parts. That doesn't matter so much since such a trace would be pretty expensive and probably not worth it anyway.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Opaque, probably. So bushes should give you a fair amount of cover (actually too much, but oh well - you're a master thief, a single grass stem is plenty of cover

 

It's going to be a bit much when you can hide behind a few wisps of cobweb though. :unsure:

 

AI can see through transparent glass and water, can't they?

Link to comment
Share on other sites

Yes, but simply because they are being entirely ignored by a trace.

 

The trace algorithm is indeed inaccessible. However, that doesn't prevent what Springheel describes; we could probably still do it, we'd just have to use multiple traces. (Trace from the AI's eyes to the player, until you hit something opaque. If it's a "semi-opaque" object, multiply the visibility value by its semi-opaque-ness factor, then do another trace from the collision point (possibly offset slightly to avoid hitting the same object again) to the player. Repeat until you find a completely opaque object (result: AI can't see player) or the player (result: player is in line of sight, with the visibility modifier we calculated previously).

I remember this being suggested before, but I seem to recall that it was stated that it would adversely affect performance, particularly if there are many collisions (think hiding in a tree). Perhaps even then it is not significant enough to warrant such a concern? How much of a performance impact is stopping and restarting the trace?

Link to comment
Share on other sites

Traces seem to be fairly expensive. We're probably doing too many as it is, and unless we're sparing with the semi-opaque objects this could easily multiply the number of traces by 3 or 4. So yeah, it's potentially a significant performance impact, and that's another reason why we haven't done it.

 

I'd be surprised if it wasn't possible to mark cobwebs as being transparent to traces, but I don't know how that's done.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

I'd be surprised if it wasn't possible to mark cobwebs as being transparent to traces, but I don't know how that's done.

 

You're right, come to think of it. There must be some kind of shader keyword for that.

Link to comment
Share on other sites

  • 3 months later...

You could just go along with that shadow-box idea, but instead calculate how far the "view" of an AI goes through the shadow-box until it hits something. This way you could avoid multiple traces and such things, I think, as long as you take one shadow-box for a whole partly-transparant obstacle.

If my English is bad I am very sorry. It's not my mother tongue.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...