Jump to content
The Dark Mod Forums

Transparent AI


Destined

Recommended Posts

Hm, the custom .cm-file seems not to be applicable on AIs (on exporting, you have to choose a model to apply it to; this does not cover AIs). So I am bascally back at the start. The "maxs" and "mins" seems to be most promising, but I cannot find it in the regular def-files of any models. Will try varying that next...

Link to comment
Share on other sites

Finally did it: I can finally pass through the AI :smile: "mins" and "maxs" did the trick. The AI has now a collsision model that is 0.005 cubic units big, so the player can walk through it. It still evades the player, when standing in its way, but this is probably as good as it gets, without turning the collision completely off... With this I also had the idea, that you could make it pass through walls by leaving a tiny little gap between wall and floor. This would not be noticeable by the player, but the AI should fit beneath it. But when I tested it, the AI simply walked to the first waypoint and then stood still. What am I missing? I don't really know, how the AAS works, so maybe someone can help me out here?

Link to comment
Share on other sites

Yes, you could fake it by making the walls nonsolid and putting playerclip there.

Link to comment
Share on other sites

Yeah, I already read these workarounds. I had hoped, to get it to work, even when there are other AI around. On the other hand, if the ghost actually thinks it is alive, it would most likely not move through a wall. Maybe I will experiment with that later. For now I am satisfied with the current version.

But I will have to tweak the properties a bit. The AI is blind and the hearing border is 1000, but they still react to the fire arrow. I want them to be completely deaf and still able to see other ghosts, to get a better feeling of "all the ghosts think they are still alive and react to each other". So this is the next step on my to-do-list. And getting rid of the shadow. I will have to check all the def, skin, and model files again, I fear. Maybe I will just create new files for the spirits. Right now I have added them to the ai_undead files, where possible. If I can give them their own model-files, I might actually find the missing "noshadow" or so I hope.

Link to comment
Share on other sites

I think the STIM_VISUAL/STIM_COMMUNICATION/AIUse stuff is handled in SDK code, but to get ghosts to react to each other you could possibly give them a custom STIM_GHOST and response scripts for the same stim. (See http://bugs.thedarkmod.com/view.php?id=4209for response effects that can target the stimming entity.) Though without additional scripting they'd 'see' each other through the backs of their heads.

 

Edit: is it the fire arrow in flight they react to, or the explosion, or both? (And do they take splash damage from the explosion?)

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I think, for now, I will leave the "react to one another part". So they are each caught in their own afterlife. They are only for show anyway. At least for now...

 

The arrow in flight passes through the ghost. On impact with a nearby wall or floor, the AI says "An intruder" or "Help!" but no animation regarding being hit is played, so I assume, that the AI gets no splash damage, but somehow hears the explosion. I have no idea, how loud the explosion is set. The border for hearing is at 1000, but maybe I can turn off the hearing capabilities all together.

Edited by Destined
Link to comment
Share on other sites

You can set the audio and visual acuity on each AI, though I can't recall the spawnarg.

Link to comment
Share on other sites

  • 4 weeks later...

Inspired by the Halloween Contest, I decided to work on my spirit AIs again. I have created skins for the commoner AI, but have encountered a problem: The skin "well_dressed_reddish" uses the model "tdm_ai_townsfolk_commoner", but has an additional red cloak. I could not find, where in the skin file this red cloak is defined. Springheel, could you help me out here? You have written these skin files, if I have seen correctly...

Link to comment
Share on other sites

So, I wanted to be ready with the townsfolk on Halloween, but did not get as much done, as I wanted to...

 

But I am still at it and currently working on heads. But I have one problem: I cannot find the file "tdm_inquisitor_head.md5mesh", that is needed for Head02. Can anyone tell me, where I can find it?

 

Also I cannot find the material definition "models/md5/chars/inventors/engineer2/engineer_main". I would have supposed that it would be somewhere in the material files of engineer or inventor. Also looked in the others I have extracte, but did not find it...

Edited by Destined
Link to comment
Share on other sites

And another question regarding vocal sets: If in the vocal set one entry is defined without a number, does it choose a random one from the numbered ones? Example: In the vocal_set.def the entry is "snd_greeting_civilian_to_civilian" "tdm_ai_jack_greet_beggar_to_guard". Does that choose a random one from tdm_ai_jack_greet_civilian_to_guard01.ogg, tdm_ai_jack_greet_civilian_to_guard02.ogg, and tdm_ai_jack_greet_civilian_to_guard03.ogg?

 

I plan to take the existing sound files and give them some "ghost effect" (I have Audacity, just have to find out, which effects I should use, that it sounds right, but that shouldn't be too hard...), but will have to set up the new vocal sets. Hence the question.

Link to comment
Share on other sites

I just nnoticed a mistake in the regular "skin" file of the heads. I am not sure, if it really matters, but for the skin "head08_plaincap" the used model is "head08_base.md5mesh". This should be "head08_hat.md5mesh". I have to leave right now, so I don't have time to check, if it really matters. Will do that this evening...

Link to comment
Share on other sites

So, I am almost done with the new skins :) I have only encountered one last problem: When the material file contains something like this:

{blend diffusemap
map models/md5/chars/long_hair1
red .4
blue .4
green .4
}
the material does not appear translucent anymore. Can someone help with that? It is strange, because the same function is used for the "ghostly" glow and there it works...

i.e.

{blend diffusemap
map models/md5/chars/heads/average_jack_head_local
rgb .5
}

Link to comment
Share on other sites

The colour values don't affect transparency; they just make the image colours darker. If you want transparency, you have to change the blend state to "blend filer" or "blend add" depending on whether you want the ghost to be dark or light.

Link to comment
Share on other sites

The colour values don't affect transparency; they just make the image colours darker. If you want transparency, you have to change the blend state to "blend filer" or "blend add" depending on whether you want the ghost to be dark or light.

 

I don't really understand that, but I will try around a bit wit what you wrote... I just copy and pasted the second "blend diffusemap" stated above along with "noshadows" "translucent" and "nonsolid" to the materials, where I wanted a ghostly glow (i.e. the face and hands) and changed the path of the diffusemap to the name of the bumpmap (since I saw, that it was done like that by Bikerdude for the revenant). For materials I wanted to be translucent, but otherwise unchanged, I only added the "noshadows" "translucent" and "nonsolid" to the material file. I admit, I did not really know, what I was doing, but it worked most of the time. I just noticed, that the "translucent" spawnarg had no effect on materials, that had the "blend diffusemap" I wrote first. This was the case for some hair and the tunic used in the beggar skin.

 

Does the new texture have an alpha channel?

 

As I said: I really have no idea, what I actually did... So I assume the new texture only has an alpha channel, if it had one in the first place. At least I didn't add any.

Link to comment
Share on other sites

I'll check when I get home but I suspect someone removed the alpha channel to conserve space and improve compression.

You can check yourself by opening the file in GIMP or Photoshop and looking at the Channels dialog.

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

I could not find the hair model files right now, but for the commoner_tunic_ragged_local (which, if I remember correctly, also did not work) it is not possible to delete the alpha channel, which I assume is, because it was already removed. But if this is actually the case: what do I need to do to get it back?

 

Ok, I found a tutorial to add an alpha channel to a tga-file. I will test, if it works, when I get home (which will be quite late today). When it works for the tunic, I will look for the hair files and repeat. After that, I might be able to post a screenshot of the whole set of commoners spirits with various heads :)

Edited by Destined
Link to comment
Share on other sites

Hold on...how was the alpha channel removed in the first place? If there were no alpha channel in the texture file, I would think we would have noticed some issues with AI by now.

Link to comment
Share on other sites

No idea, I opened the file "commoner_tunic_ragged_local.tga" with Paint Shop Pro X2 and looked through the flags. On "picture" I noticed that the option "delete Alpha-channel" option was greyed out. Maybe it isn't even the file I actually needed or it might even be a file that does not need an Alpha channel. As I said, I will check the files I need, as soon as I get home.

Edited by Destined
Link to comment
Share on other sites

Normalmaps don't always have an alpha channel. If the diffuse and specularmaps have one, then the normalmap works without one.

Link to comment
Share on other sites

Ok, I just noticed, that the "*_local.tga" don't have an alpha channel, the regular tga files have one. But this seems to be the case in general... I just noticed another thing, that is present in the material files, that do not get transparent: They all have a "alphatest .5/.9" somewhere. Can I just remove that? If this sets the transparency to .5, it would make sense that it appears not translucent.

Edited by Destined
Link to comment
Share on other sites

The alphatest line is needed if you want the alpha channel to be transparent. I don't know how it interacts with the translucent stage.

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • 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
×
×
  • Create New...