View Issue Details

IDProjectCategoryView StatusLast Update
0004615The Dark ModSaving/Loadingpublic21.04.2019 16:42
Reporterduzenko Assigned Toduzenko  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0004615: Remote camera lost when saving\loading
DescriptionThe engine supports a so called "remote camera subview" and even though it has not been used for a while Neons has expressed interest in using it in one of his maps.
The first problem that I see with it is that it does not sustain the quick/load test.

Steps To Reproduce1. Start the attached map
2. See the remote camera 'kinda' working
3. Quick save
4. Load quick save
5. Camera is dead.
TagsNo tags attached.

Relationships

related to 0004296 new Glitch with remote render 
related to 0004632 closedduzenko Mirror is black: no reflection (Inn Business) 
related to 0004667 resolved Mirrors are too bright 
related to 0005028 assignedgrayman Crash on loading game in March of Rahena (EV_UpdateCameraTarget) 

Activities

duzenko

duzenko

08.09.2017 18:21

developer   ~0009183

I was able to go as far as idEntity::Event_UpdateCameraTarget

It seems to be called from the script subsystem (?) which I have no knowledge about.
duzenko

duzenko

08.09.2017 18:27

developer   ~0009184

Last edited: 08.09.2017 18:27

View 2 revisions

When loading the quick save idSecurityCamera::Restore is called, but idSecurityCamera::Spawn is not.
Further debugging is blocked by missing stacktrace.

grayman

grayman

17.09.2017 15:33

administrator   ~0009270

Where's the attached map?
duzenko

duzenko

17.09.2017 18:23

developer   ~0009273

https://drive.google.com/file/d/0B-fuuLxkbWRZSnEwVmpfa0hjams/view?usp=sharing
grayman

grayman

17.09.2017 20:25

administrator   ~0009276

Last edited: 17.09.2017 20:25

View 2 revisions

The cameras are working after the loadgame. I can tell because they emit a beep every now and then (missing sound).

The problem looks like it's in the func_static displaying the view. It needs to be kick-started.

grayman

grayman

17.09.2017 21:35

administrator   ~0009280

Camera view from the func_static is now kick-started after reloading.

Working on the 4 missing camera sounds.

Also, the camera doesn't stop moving when it spots the player. (I don't think it's spotting me and I have to walk through it. Once it spots me, the rest of what it's supposed to do looks okay.)
grayman

grayman

18.09.2017 02:02

administrator   ~0009285

Grabbed D3 security camera sounds to make sure the sound code worked. It does. Need to replace the sounds.

Fixed a math statement that was bass-ackwards.

Turned spotlight on and it doesn't look right. Need to find out what it's _supposed_ to look like.
duzenko

duzenko

18.09.2017 09:22

developer   ~0009286

Last edited: 18.09.2017 09:24

View 2 revisions

Not in svn yet?
The way Neon wants it to work is static immovable camera, no need to react on anything.

grayman

grayman

18.09.2017 12:45

administrator   ~0009287

Not done yet.

I'll look at the spawnargs to see if setting them a certain way gives Neon what he wants. If not, I'll add a spawnarg that tells the camera to not move and to not react to the player. Since the sounds are related to moving and reacting, the camera would emit no sounds, either.
grayman

grayman

19.09.2017 14:09

administrator   ~0009298

Last edited: 19.09.2017 14:13

View 2 revisions

Needed to kickstart the remote camera after loading a savegame.

Other changes:
- Added “seePlayer” spawnarg, which can be turned off so the camera doesn’t care about seeing the player
- Camera wasn't seeing the player when it should.
- Added “rotate” spawnarg, which can be turned off for a stationary camera
- Fixed a line of timing code having to do with the sweep time
- Added the “camera gui” texture from Obs’ test pk4
- Added the 4 camera sounds. Used placeholder Doom3 sounds, and will replace them ASAP.
- Kill spotlight when the camera is destroyed.
TODO:
- When the camera is killed, it screws up the display on the screen.The screen should just go black.
- Replace Doom3 sounds.
- Figure out why the display screen is flipped horizontally, and correct that.
- When there are multiple cameras and screens, moving away from one screen can cause that screen to start displaying an image from a different, closer, camera.
- Not sure I like the spotlight attached to the camera when it's in use.

Rev. 7154:

Entity.cpp
SecurityCamera.cpp
SecurityCamera.h

Rev. 14933:

func.def
tdm_security_camera.mtr
tdm_sfx_machinery.sndshd
security_camera_activate.ogg
security_camera_end.ogg
security_camera_sight.ogg
security_camera_moving.ogg

grayman

grayman

19.09.2017 14:14

administrator   ~0009299

Attached camera.map, which tests the camera changes.
grayman

grayman

19.09.2017 20:58

administrator  

camera.map (48,770 bytes)
grayman

grayman

19.09.2017 21:00

administrator   ~0009306

Last edited: 19.09.2017 21:01

View 3 revisions

Updated camera.map to include a block of text, to help with the horizontal flip problem.

If you look at the two screens on the column to the player's right, both show the text flipped horizontally. It's easier to see the flip there than it is on the screen on the column straight ahead near the two scanning cameras.

duzenko

duzenko

20.09.2017 12:15

developer   ~0009311

Copy of the framebuffer in the _scratch image is not flipped.
If put this line in glprogs\oldStage.fs
    gl_FragColor.x = gl_TexCoord[0].x;
Then red fills the remote camera from left to right instead of right to left as supposed to.
How can we check the texture coordinates for this surface in the .map file?
duzenko

duzenko

20.09.2017 12:17

developer   ~0009312

Multiple cameras in single frame.
Try this modifier in the texture stage params:
map cameraX
where X is a unique number
grayman

grayman

20.09.2017 12:25

administrator   ~0009313

- checking texture coordinates: the display screens are set so that the texture fills the screen. Does that help?

- I don't understand the "map cameraX" line. The texture is to be used on all screens, with whatever cameraTarget the patch it's used on is set to.
VanishedOne

VanishedOne

20.09.2017 14:59

developer   ~0009314

'The way Neon wants it to work is static immovable camera, no need to react on anything.' -- In that case, I think a func_cameraview/idCameraView (if necessary with a func_static model) can do that. (There's also a func_camera_anim/idCameraAnim.)

However, I for one am happy to see func_securitycamera being worked on. If the aim is to get a fully usable security camera then http://forums.thedarkmod.com/topic/14394-apples-and-peaches-obsttortes-mapping-and-scripting-thread/page-12#entry352597 has a note on bugs that may be useful.
grayman

grayman

20.09.2017 15:24

administrator  

cameramodel.pk4 (94,634 bytes)
grayman

grayman

20.09.2017 15:26

administrator   ~0009315

I attached dragofer's test map with his camera model. He made this 3 years ago.

Note, again, that the display screen is flipped horizontally. The gui material he's using on the screen is identical to the one I committed to SVN.
duzenko

duzenko

23.09.2017 11:56

developer   ~0009328

Got it working in svn commit 7165. Needs a separate (unique) map (texture) for each mirror and camera like this

textures/darkmod/camera2
{
...
    {
...
        map "table"
    }
}
duzenko

duzenko

23.09.2017 11:58

developer   ~0009329

Please note that the following modifier has no effect now
 mirrorRenderMap 512 256
The mirror texture is resized automatically to fit the rect it takes on the screen.
grayman

grayman

23.09.2017 12:14

administrator   ~0009330

What does

map "table"

do?

Is it named that because it's pointing at a table?
duzenko

duzenko

23.09.2017 13:47

developer   ~0009333

No that's just a unique name so that rendered images from different views don't conflict.
It can be any name, I used "table" to link it to the camera looking at the table.
VanishedOne

VanishedOne

23.09.2017 15:11

developer   ~0009334

Are there any possible performance implications from the mirrorRenderMap auto-resize? I'm thinking of Arcturus's grass test map, where there's a big lake that blends in a fairly low-res reflective surface (mirrorRenderMap 128 128) and relies on distortion, etc. to keep it looking good.

Does the auto-resize also apply to remoteRenderMap?
duzenko

duzenko

23.09.2017 17:37

developer   ~0009335

remoteRenderMap is fixed size, assumed to be the camera "display resolution".
mirrorRenderMap performance needs independent testing. It could theoretically be a problem if texture is resized every frame.
nbohr1more

nbohr1more

24.09.2017 00:30

developer   ~0009336

Mirrors in "Caduceus of St Alban's" are all black in the latest SVN...
grayman

grayman

24.09.2017 02:54

administrator   ~0009337

The one mirror I found in a bathroom uses this material:

textures/washroom/mirror
{
    discrete
    //translucent
    //twosided
    noshadows
    qer_editorimage textures/glass/mirror
    {
        blend gl_dst_color,gl_zero
        map textures/glass/mirror
    }
    solid
    mirror
}
duzenko

duzenko

24.09.2017 11:20

developer   ~0009338

Where is bathroom in "Caduceus of St Alban's"?
The only kind of bathroom that I see in on the ground floor.
http://i.piccy.info/i9/eb06d4332f08243eabde10dd2f7f930d/1506252007/670635/1182320/Bezymiannyi.jpg
nbohr1more

nbohr1more

24.09.2017 14:08

developer   ~0009339

Strangely, I couldn't find any online images of them but I know there are at least two mirrors in rooms on this floor of the building:

http://www.moddb.com/mods/the-dark-mod/images/the-caduceus-of-saint-alban2
grayman

grayman

24.09.2017 15:03

administrator  

mirrors.zip (2,444,176 bytes)
grayman

grayman

24.09.2017 15:05

administrator   ~0009343

I attached two savegames from the rooms where the mirrors are located.

Saved with the latest SVN build.

Extract into the fms/caduceus folder.
duzenko

duzenko

24.09.2017 15:20

developer   ~0009344

textures/washroom/mirror fixed on the material level
grayman

grayman

24.09.2017 15:25

administrator   ~0009345

Both mirrors still black.
duzenko

duzenko

24.09.2017 18:23

developer   ~0009347

Sorry. Try now (src svn)
grayman

grayman

24.09.2017 18:32

administrator   ~0009348

Yay! Brilliant! Working again!
nbohr1more

nbohr1more

27.09.2017 01:48

developer   ~0009351

Skybox is broken in Caduceus with the latest revision 7174
duzenko

duzenko

27.09.2017 08:11

developer   ~0009352

Last edited: 27.09.2017 08:11

View 2 revisions

Fixed in assets svn 14964

duzenko

duzenko

27.09.2017 11:13

developer   ~0009353

Fixed skybox in water reflection
nbohr1more

nbohr1more

28.09.2017 00:40

developer   ~0009355

The Grass Demo map crashes on the latest build.

Trying to get physics bounds for audio.
nbohr1more

nbohr1more

28.09.2017 11:39

developer   ~0009361

Still crashing on the latest revision
grayman

grayman

04.11.2017 13:40

administrator   ~0009542

Transferring to duzenko, since we're now out of the realm of the remote camera.

Issue History

Date Modified Username Field Change
08.09.2017 18:21 duzenko New Issue
08.09.2017 18:21 duzenko Note Added: 0009183
08.09.2017 18:27 duzenko Note Added: 0009184
08.09.2017 18:27 duzenko Note Edited: 0009184 View Revisions
17.09.2017 15:33 grayman Note Added: 0009270
17.09.2017 18:23 duzenko Note Added: 0009273
17.09.2017 20:25 grayman Note Added: 0009276
17.09.2017 20:25 grayman Assigned To => grayman
17.09.2017 20:25 grayman Status new => assigned
17.09.2017 20:25 grayman Note Edited: 0009276 View Revisions
17.09.2017 21:35 grayman Note Added: 0009280
18.09.2017 02:02 grayman Note Added: 0009285
18.09.2017 09:22 duzenko Note Added: 0009286
18.09.2017 09:24 duzenko Note Edited: 0009286 View Revisions
18.09.2017 12:45 grayman Note Added: 0009287
19.09.2017 14:09 grayman Note Added: 0009298
19.09.2017 14:12 grayman File Added: camera.map
19.09.2017 14:13 grayman Note Edited: 0009298 View Revisions
19.09.2017 14:14 grayman Note Added: 0009299
19.09.2017 20:58 grayman File Deleted: camera.map
19.09.2017 20:58 grayman File Added: camera.map
19.09.2017 21:00 grayman Note Added: 0009306
19.09.2017 21:01 grayman Note Edited: 0009306 View Revisions
19.09.2017 21:01 grayman Note Edited: 0009306 View Revisions
20.09.2017 12:15 duzenko Note Added: 0009311
20.09.2017 12:17 duzenko Note Added: 0009312
20.09.2017 12:25 grayman Note Added: 0009313
20.09.2017 14:59 VanishedOne Note Added: 0009314
20.09.2017 15:24 grayman File Added: cameramodel.pk4
20.09.2017 15:26 grayman Note Added: 0009315
23.09.2017 11:56 duzenko Note Added: 0009328
23.09.2017 11:58 duzenko Note Added: 0009329
23.09.2017 12:14 grayman Note Added: 0009330
23.09.2017 13:47 duzenko Note Added: 0009333
23.09.2017 15:11 VanishedOne Note Added: 0009334
23.09.2017 17:37 duzenko Note Added: 0009335
24.09.2017 00:30 nbohr1more Note Added: 0009336
24.09.2017 02:54 grayman Note Added: 0009337
24.09.2017 11:20 duzenko Note Added: 0009338
24.09.2017 14:08 nbohr1more Note Added: 0009339
24.09.2017 15:03 grayman File Added: mirrors.zip
24.09.2017 15:05 grayman Note Added: 0009343
24.09.2017 15:20 duzenko Note Added: 0009344
24.09.2017 15:25 grayman Note Added: 0009345
24.09.2017 18:23 duzenko Note Added: 0009347
24.09.2017 18:32 grayman Note Added: 0009348
27.09.2017 01:48 nbohr1more Note Added: 0009351
27.09.2017 08:11 duzenko Note Added: 0009352
27.09.2017 08:11 duzenko Note Edited: 0009352 View Revisions
27.09.2017 11:13 duzenko Note Added: 0009353
28.09.2017 00:40 nbohr1more Note Added: 0009355
28.09.2017 11:39 nbohr1more Note Added: 0009361
09.10.2017 21:42 nbohr1more Relationship added related to 0004296
13.10.2017 23:56 nbohr1more Relationship added related to 0004632
04.11.2017 13:40 grayman Note Added: 0009542
04.11.2017 13:41 grayman Assigned To grayman => duzenko
14.11.2017 19:40 VanishedOne Relationship added related to 0004667
02.12.2017 12:43 duzenko Status assigned => resolved
02.12.2017 12:43 duzenko Fixed in Version => TDM 2.06
02.12.2017 12:43 duzenko Resolution open => fixed
21.04.2019 16:42 stgatilov Relationship added related to 0005028