Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

https://wiki.thedarkmod.com/index.php?title=Cutscene_video_with_FFmpeg

Haven't tested it yet, but instead of bothering with new GUI, couldn't you just teleport a camera to a dark room, as Dragofer suggested, where it points to a surface with with videoMap material applied?

Edited by peter_spy

Share this post


Link to post
Share on other sites

I have some buggy doors which have a pretty big drop in sound volume across them even though they're open, and they don't respond to loss_closed and loss_open spawnargs.

For example if I'm in a deckhouse and open the left door, the wind becomes louder as expected, but if I open the right door the wind is still muffled by what must be 10dBs. Only when I walk through the doorway does the wind become louder.

The wind speaker has a very large maxradius that's more than twice the distance to those doors, and there are no visportals on the way.

Has anyone else run into this/solved it?

Share this post


Link to post
Share on other sites

I assume the door doesn't have a loss_open value (or whatever the spawnarg is that allows open doors to occlude sound)?

Share this post


Link to post
Share on other sites

Thanks, Dragofer & peter_spy, don't know how I overlooked that wiki page about video. Complicated as expected. One thing I didn't see in a quick scan of the article was how to actually start the playback (of a non-briefing vid), from either a script, trigger/target, or STIM/Response.

Share this post


Link to post
Share on other sites

Probably teleporting into a dark room with a video-wall is not the best way to go for a true cutscene. You'd need to center the player's view on the wall and lock him there, i.e., disable keyboard and mouse controls. Plus you'd be scaling each vid pixel twice (once onto the videowall, then onto the physical screen) with attenuation of quality.

Looking instead for a variation of the TDM "briefing video" method, but that can be invoked anywhere throughout the story, perhaps more than once with different content. May need to add a visual hint about it being a cutscene. I've seen letterbox top & bottom black bars used for that in other games. Probably that FX could be done in a video editor or FX package, rather than TDM.

All still theoretical so far. I have no video capture software or video editor on my dev box yet.

Share this post


Link to post
Share on other sites

Oh, I guess what I thought was a "video briefing" mode was (after consulting the "Advanced" section of the "Briefing" wiki info) just programmatic timed slide manipulation like zoom & rotation. Hmmm, perhaps the video-wall method is all we got at the moment. Any known way to instantly freeze then later unfreeze the player controls?

Share this post


Link to post
Share on other sites

You can trigger a func_camera to freeze controls and again to unfreeze. It's good practice to put those triggers into a script together with a sys.wait command so that the player is able to press escape to skip the cutscene.

Share this post


Link to post
Share on other sites

Ah, I see this from stumpy in the distant past:

Quote

the player gets frozen during cinematics, but only cause the player's view gets moved to a func_camera.

So it's the func_camera that would be locked onto the video wall image in the darkened room. (Not clear to me why the player would have to be teleported to the room... couldn't one be anywhere when the cinematics is invoked? Is that needed to solve potential audio conflicts, because, say, func_camera doesn't have microphone capabilities? Or just to get the player isolated from any potential AI attack?)

Share this post


Link to post
Share on other sites

It's because the player will still hear his former surroundings if you don't teleport him, the func_camera only changes what he sees. Safety from AI is another benefit of course.

IIRC grayman did work with changing the position of the player's 'ear', so it may be possible to get a kind of microphone functionality. This is pretty vague coming from me though.

 

Share this post


Link to post
Share on other sites

IIRC You don't have to freeze anything during the camera cutscene because it's alreafy frozen (unless you have noclip turned on, then you can turn your head around.

You need to teleport the player to where your camera is mostly to control where he is. If you e.g. move your camera along a spline, the player will move in relation to his last position where he triggered the cutscene, so he can end up in the void.

Share this post


Link to post
Share on other sites
3 hours ago, peter_spy said:

You need to teleport the player to where your camera is mostly to control where he is. If you e.g. move your camera along a spline, the player will move in relation to his last position where he triggered the cutscene, so he can end up in the void.

Is there evidence of this behavior?

Share this post


Link to post
Share on other sites

Here you go: https://we.tl/t-b49jMFNaFP

Place these maps in any of your project folders, I deleted all the custom stuff and changed materials to stock TDM assets. First, launch ctscn_t01.map. When the cutscene ends, you should be right where the camera was during the last frame. Now launch ctscn_t02.map. Player ends in the void after the cutscene finishes. Open maps in DR. The only difference is that in the second map I deleted the player teleport that was linked to the trigger volume, which placed the player exactly where the starting point of the moving camera is. The cutscene is a bit long-ish, you can press Esc to get there faster it you want to.

@grayman

Edited by peter_spy

Share this post


Link to post
Share on other sites

The fault is in the "2" map, and is not a general "the player will move...".

What happens in the "1" map:

1. The player falls into the trigger, and gets teleported to a spot just below mover1.

2. The player falling into the trigger also calls the script routine "cs_cam1".

3. This routine runs AFTER the player has been teleported.

4. The player is bound to the mover, and stays with the mover until it's finished its movement.

5. When the player's view is restored, he's at the end of the mover's path, so when he's unbound from the mover, he drops down to the floor in the 'end' area.

 

What happens in the "2" map:

1. The player falls into the trigger, and DOES NOT teleport, because the teleport entity doesn't exist.

2. The player falling into the trigger also calls the script routine "cs_cam1".

3. The player is bound to the mover, and stays with the mover until it's finished its movement. Since the player never teleported, he ends up a large offset from the mover, at (4623.88 2948.38 204.64), which is in the void.

5. When the player's view is restored, he's unbound from the mover, and since he's in the void, he begins to fall forever.

 

Share this post


Link to post
Share on other sites

Map 1 is a workaround for a problem with map 2, which was technically  the first one. I wasn't able to trigger the camera the simple way, where view would just return to player's last position, as it would be in other engines. In map 2 player moves with the camera, just with the starting position offset to player coordinates.

Edited by peter_spy

Share this post


Link to post
Share on other sites

Sounds like a way "to trigger the camera the simple way, where view would just return to player's last position, as it would be in other engines" is needed.

I think, returning to my desire for pre-recorded video cutscenes, I understand the basic playback approach of dark room+videowall+func_camera+teleport, and will explore it. I still view this as a messy workaround, inferior to direct video+audio playback. I gather the engine already has the ability for direct playback of sample videos (but only invoked by the command line, and displayed in a small test rectangle). So a new-feature request to the engine devs, to extend this to full-screen and script-invocable, is warranted, even if it should come too late to help me.

Share this post


Link to post
Share on other sites

Well, I believe you can:

1) Create a material def with "videomap" pointing to a pre-recorded cut-scene in mpeg, roq, etc format.

2) Create a movable entity with a simple patch that has this material applied to it

3) Use a script event to immobilize the player and attach the entity to the player's head

I believe that the "overlay" system is better suited to this idea but I don't think it can be controlled via script?

(Though it may be a good idea to add that...)

 


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...)

Share this post


Link to post
Share on other sites

Alright, two questions:

First, I have a sign that I made frobable because I want a message to show up on screen when it is frobbed. It uses a sign_shield_keg skin, but every time the hovers over it, this happens: https://imgur.com/9PqB0r0  

Anyone know why this happens? 

Second question: The player_tools spyglass and player_tools compass that I place in my map always disappear in game. I have the blackjack, sword, and other equipment that show up just fine, but no compass or spyglass. Any reason why these disappear in game?

Share this post


Link to post
Share on other sites

@Amadeus #1 looks like it's because the material used by that skin is mixing several different textures together.

For #2 if this happens even though your compass has inv_map_start and no diff_x_nospawn spwnargs I'd replace them with the ones you get when importing the prefabs from the mapper_tools folder. Remember to adjust their diff_no_spawn spawnargs after you imported them.

Share this post


Link to post
Share on other sites

Thanks! Will do. As for question 1, is there anything I can do to fix that?

Share this post


Link to post
Share on other sites

You could override that particular material by copy pasting it into your own .mtr file (renamed from .txt), fix the inconsistency in it and provide it with your mission.

As for fixing it, I'd look first to see if at one place it points to diffusemap x and another to diffusemap y. Can't look at this myself atm as I'm not near a PC.

  • Thanks 1

Share this post


Link to post
Share on other sites
16 hours ago, Geep said:

Sounds like a way "to trigger the camera the simple way, where view would just return to player's last position, as it would be in other engines" is needed.

I think, returning to my desire for pre-recorded video cutscenes, I understand the basic playback approach of dark room+videowall+func_camera+teleport, and will explore it. I still view this as a messy workaround, inferior to direct video+audio playback. I gather the engine already has the ability for direct playback of sample videos (but only invoked by the command line, and displayed in a small test rectangle). So a new-feature request to the engine devs, to extend this to full-screen and script-invocable, is warranted, even if it should come too late to help me.

Would it be possible to create a custom GUI that covers the whole screen and only consists of one material that shows the video playing? In that case, you could pause the game via script (at least I found the script event void pauseGame() ), call the GUI and unpause afterwards. I have no experience with GUIs, so it may be that this is simply not possible to create, but it is an idea that sounds easier than the whole teleporting stuff.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

nbohr1more and Dragofer - these are 2 interesting ideas. I wonder if anyone has ever tried either with video before? I was hoping not to be the pioneer on this one.

Share this post


Link to post
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.


×
×
  • Create New...