(<< home) Dev log for "Le Cauchemar", a freeware game by Phil Palmer                            
       
  Download / game info    
  Mailing list / contact    
       
Total hours: 2350.0388                    
                     
Date Entry Hours                  
23-Apr-2008   2    
  Asked Web Mania if they support ASP.NET (C:\correspondence\WebMania)      
 
My test ASP.NET website, so I don't lose it:
C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\WebSite1\WebSite1.sln
     
  Blogger: 1024MB of storage available
My current website\final\devlog folder is 16MB
     
  Gave blogger (blogspot.com) a fair bit of testing, as a possible replacement for Excel for the devlog.
Decided I didn't quite like it enough.  IT'S TOO NARROW!  It makes me claustrophobic.
I do like the way it links from small preview versions of the images to the full-size images; that's handy.
     
  (below) I never knew you could put flowcharts into Excel html pages, nice. Switching off 'autolayout' allows the nodes to be positioned freely.  Might have been useful for planning the menus.
Although, the font size keeps resetting and I can't seem to enlarge the canvas.  Also, the bubbles can become too small for the text when I open the file in Internet Explorer.
     
 
C:\Program Files\Le Cauchemar\
Profiles\
Default.txt
The game's default settings
test
test
Custom.txt
Player's custom settings
 
     
  Excel: pictures, flowchart nodes etc can be made into links - handy!      
  Web Mania's support service was super quick, but the bad news is:
"As we have only Linux servers, hence you cannot run the  ASP.NET application on our server."
BOOOO!
     
  123-Reg don't support ASP.NET either:
"At present no shared 123-REG hosting packages support asp or asp.net"
BOOOO!
     
  Web Mania:
The most data I've ever transferred in a month is (June 2007) 1254.73 MB
Hosting is about £30/month inc vat
     
  Bought 1 year of ASP.NET-compatible hosting from Catalyst2.
Had a quick look at their control panel app, very nice.
     
22-Apr-2008   3.75    
  After putting the slave into sleep mode while the game was running full-screen (master build) then bringing it out of sleep mode:
hr failed, DXUT.cpp line 3484.
Tried getting at it with the debugger, but couldn't reach that line.
Tested MS Flight Sim demo; it handles this situation fine.
     
  Added all the missing French menu text.      
  Fixed various problems that could arise from changing certain options using the menus.      
  (below) Replaced the various anaglyph example profiles with a single one that should give the best impression (minimal convergence, low saturation)
Example_TypicalAnaglyphGlasses.txt
     
 
 
     
#version 15.1 Released version 15.1
Just a couple of minor fixes and improved menu text, nothing exciting.
     
21-Apr-2008   2.5    
  Asked the iZ3D people nicely if they'd let me know how to support their displays. (C:\correspondence\iZ3D)      
#revision 1088 ModeEnvironment.cpp: Fixed crashes that would occur when starting the game with mist or falling rain disabled (previously these class instances were only getting created if their effect was enabled, and would therefore crash on CreateDeviceObjects).      
#revision 1090 Fixed a bug with falling rain: it had been using the wind's speed to control the elongation of the streaks.  So starting the game with wind disabled caused almost-invisible streaks.
Also speeded up the rain falling speed a bit.  Was previously looking a bit like neige fondue.
     
  I'm finding that granddictionnaire.com is really helpful for translating these menus - it contains a lot of very technical terminology (not surprising since it's produced by the Office québecois de la langue française - those guys ROCK!).
v15.1 will have improved French menu text.
     
  TODO: fix ground glitch seen when the game is started with rain impacts disabled      
  Still haven't been able to reproduce (in debug) the original startup crash I was looking for (related to failing assert in CModeStack::InsertAbove)
TODO: FIX THIS!
     
20-Apr-2008      
  Had a few people testing the game today as a result of this flattering link (thanks crim!) :      
  http://www.mtbs3d.com/phpBB/viewtopic.php?t=1323      
  To clarify, the game does not have native support for iZ3D yet (I hadn't heard of iZ3D till today).
It does have native support for:
- Philips WOWvx 3D displays - http://WOWvx.com
- eMagin Z800 3DVisor (stereoscopy and 3DOF headtracking) -
http://3DVisor.com
- NaturalPoint TrackIR with TrackClip PRO (6DOF) -
http://www.naturalpoint.com/trackir/
- Anaglyph stereoscopy
More details in the release log:
http://programmerart.org/releaselog
and the FAQ:
http://programmerart.org/faq
     
  I gather iZ3D takes in dual monitor inputs (hurrah!), so that's the stereo mode I'll need to implement in order to support these screens (which I definitely want to do, they sound great).
So, sorry for any disappointment today, but do watch this space :)
     
  Useful feedback from today's testing:
- There's an intermittent startup crash on v15.0 - this is top priority.  Probably an uninitialised variable, because it's never happened in debug.  v15.1 will fix this crash.  Test turning rain off, setting various reses, etc.
- I should add a dual monitor stereo mode as quickly as possible.  These screens could become
very popular.
- The game is apparently compatible with iZ3D stereo drivers (so, presumably with stereo drivers in general).
- It'd be worth me doing an optimisation pass on the pixel shaders about now (framerate is unhealthy in full screen; in anaglyph mode it's terrible).
- Options that require a restart need to make that fact clear (even if it's just a bit of debug text in the corner of the screen).  Eventually, none of the options will require a restart, but till then it's important not confuse/annoy the player.
- Screen res option needs to list just the enumerated available resolutions; don't allow funny reses to be chosen, because people don't expect them and don't want them.
...
     
  ...
- Some players didn't manage to find the text options profiles when they looked for them (but ideally they should never have to).  Maybe they were searching for *.ini ?
- Example anaglyph profile has way too much ghosting.  Should definitely change this to very low convergence and low saturation.  Maybe resurrect the anaglyph deghosting (would be a shame to waste that whole weekend's work).
- Players seem to be impressed with the realism of the graphics (?!)
- It really is about time I added some weapon effects.  This is more high-priority than the enemies; people don't seem to mind the placeholder enemies too much.  I don't think they're especially bothered about sound either (although that will add tons to the experience).
- The videos on YouTube are useful.  Need to add new ones; will probably do this once there's a weapon effect to play with.
- People are actually playing the game!  Aaaargh!!! Run away!
     
  iZ3D: Ah, it's not as simple as I thought:      
  http://www.mtbs3d.com/phpbb/viewtopic.php?t=1295      
  TODO: try asking them nicely if they'll explain how it works.<-DONE      
19-Apr-2008   0    
  Tried using Visual Studio 2005's "Personal Web Site Starter Kit"
Managed to set up a holy grail of a website on a local server (brilliant gallery and much more), but how do I then get that to run on my hosting servers?
I don't see any mention of ASP.NET applications on the Web-Mania site.  Am I just being thick, or do I need to switch to one of the hosting companies that appear when I google for ("ASP.NET" hosting) ?

Had to re-install Microsoft SQL Server 2005 to get this stuff working locally.
     
  That's all I've managed to do today.  Spent about 4.5 hours on this, which I've not logged because it hasn't produced anything usable yet.      
  I'm not going to persevere with the new site or gallery until I've asked some people about ASP.NET.      
  Auditioned a few placeholder music tracks.  Zombie Overlords is still probably my favourite.  Tried playing the game with that track combined with weather sounds - works well and adds a lot.
TODO: placeholder music & weather loops, soon please!
     
  Ooh, this track's nice, especially the intro.  I could really use an intro like that.  It's by Cinematic Orchestra apparently:
http://fr.youtube.com/watch?v=7b8SAyRjid0
     
18-Apr-2008   0    
  Decided it was time I set up some kind of screenshot gallery on the site.
Taking screenshots of ongoing work (and letting people see those screenshots) is a really good thing to do.  It lets you get a feel for what's working visually and forces you to fix any eyesores that are getting in the way.
     
  Downloaded & installed PHP 5.2.5 (C:\installs\PHP).  I don't know or care what it is, but Gallery needs it.      
  Downloaded & installed netpbm 10.27 (C:\installs\netpbm).  Again, not the faintest idea what this is but Gallery needs it for thumbnails to work.      
  Downloaded & installed Gallery (C:\installs\Gallery)      
  ...er, no wait, I don't want to use Gallery because it requires me to set up my own server.      
  Downloaded and installed 'Web Gallery Builder' (trial version), but it produces crumby unusable results.      
  I'm going to knock-up my own gallery.  Maybe Photoshop actions will help for making the thumbnails?      
16-Apr-2008   4.8    
  Added all the French text for la foire aux questions.  Took ages, but not as long as it would have done in the past; I'm definitely speeding up.
It's probably all wrong mind - please feel free to correct my French!
     
  Words that DON'T have cedillas! :
- raccourci
- ici
- cela
- facile
- recevoir
     
  Words that DO have cedillas! :
- ça
- façon
- français
     
  Took some screenshots from v15.0      
  (below) random v15.0 screenshot.  Colour grading defaults OFF in v15.0.  Not because it's broken, just because it's a counter-productive thing to have enabled until after I've got the textures, lights and effects looking the way I want them.
Is there ever a good time to turn colour grading on?  Maybe at the very end, by which point you don't need it any more because you've improved the textures and lighting underneath.  It's not something the game should rely on in order to look good.
     
 
       
15-Apr-2008   4    
  FAQ = foire aux questions (nf)    
  website: added une foire aux questions (programmerart.org/faq), because I'm gradually starting to need one (which is good).
TODO: French text; the lack of this gives a really bad impression at the moment :/
TODO: talk about anaglyph deghosting.
   
  Spooky - I typed "devlog" (pages francophones) into google.fr, jumped arbitrarily to page 10, and my devlog was right there!    
  HTML: "align" and "valign" can't be assigned values inside a style string.  Took me a while to work that out.    
  Found that the eMagin SDK is now a freely-available download :)  You used to have to do a little dance to get hold of it.
Wait...that must mean none of that stuff is confidential any more (?)  That would make it easier for me to share my code.
   
14-Apr-2008   4    
  TODO?: for sharp [parts of] shadows, threshold the soft shadow image instead of using the aliased raw shadow image?
This would allow for a continuous change of softness along a length range of the shadow (instead of the current cross-fade from sharp to soft).
     
  Virtual-window headtracking now only affects FOV if the 'auto-FOV' option is true.      
  TODO?: to reduce the extent to which colour grading exaggerates banding, do the grading inside HDRLighting.fx (tone-map the floating-point lit scene image, run it through the ramp, then output it to fixed-point final render target.
The current banding is appearing because the lit scene image is quantized to 8 bits per channel before going through the ramp.
     
  Found that the HDR\finalMultiplier option would cause the rain and the edge blur to appear too dark if it was increased, or too light if it was decreased (ie. those post-HDR effects don't take finalMultiplier into account).

For v15.0, I've just disabled finalMultiplier and toneMap ("adaptive luminance").  It would be a shame to throw these options out; instead what I'll probably do is change finalMultiplier (todo: rename) to be applied at the same point where the tone-mapping is/would be done.  In that way the post-HDR effects (and there will be more of them) won't have to worry about it.  Maybe the multiplier should only take effect when tone mapping is switched off, or maybe I'll be able to get rid of it completely.

TODO?: set finalMultiplier to 1 and tweak the post-HDR effects and the middle-grey accordingly?
     
  TODO: fix whatever that failing post-build command is in Master config.      
  Made the Master config remote-launchable.
Cleared-out some unused configs.
     
  TOFIX: alt-tabbing away from the game in fullscreen mode doesn't put it into pause mode when it should.      
  TOFIX: the south wall of Regent St. disappears on v15.0.  Looks like a CullPlane problem, but what has changed?
Check the obvious first: check that the plane hasn't got shifted/rotated (almost seems to be flipped).
Bit annoying, that, but I'm not going to let it hold up the build.
     
  MAX: Added a hidden 'NaughtyStep' layer, and put one of the John St. road patches in there because its normals were all wrong.  TODO: investigate.  Couldn't see anything wrong with the decal's orientation.      
  MAX: For some reason every time I tried to hide the NaughtyStep layer, the game failed the "is the ground there" collision assert (?)
TODO: investigate!
For now, I've just shoved that one decal to the bottom of the stack so it can't be seen.
     
  Last-minute crash on the slave, trying to open controls config.  For v15.0, I've therefore had to disable the controls config option :(
Tested it on the master and it worked fine.
For both cases, the Noctambule folder was renamed beforehand.
     
#version 15.0 Released version 15.0      
  TOFIX: frame-sequential eye-swapping button (RMB) doesn't do anything in pause mode.      
13-Apr-2008   9.5    
  TODO: for v15:
- fix processMenus option (currently causes crash if true)<-BODGED(option is disabled for v15.0)
- fix headtracking calibration mode<-FIXED
- fingers crossed that the OptiTrack stuff can be made to work on Vista...<-FIXED(just needed to install the OptiTrack SDK on the slave)
- slight specular / POM / mipping discrepancy (see screenshot mentioned below)<-FIXED(was screen-res filtering in DeferredLightingApply.fx)
- missing patchwork decals on slave<-FIXED(was uninitialised decal vert RGBA getting through to Patchwork.fx)
- been getting a problem where the app sometimes loses all its keyboard input after losing and regaining focus (does this only happen in pause mode?)
- Deal with crash trying to open controls config in full-screen.<-BODGED(fixed the disabling of the config menu item in fullscreen).
- Alt-enter, etc<-FIXED,PARTLY(I've enabled it again but the menus read alt-enter as enter to toggle options etc, TOFIX).
     
  Website: Added a YouTube video bar; improved front-page formatting etc.      
  BUG: switching motion blur off changes the filtering on the ground (dimples?).      
#revision 1073 Menu system now ensures that a disabled menu item is not selected.      
  TODO: Cars should explode when you shoot near their petrol tanks.  That will be a game in itself; can also be used as a way of taking-out multiple enemies at once (the old 'exploding barrels' trick).
A really impressive explosion effect would be time well spent, absolutely.  By changing the parameters (size, colour, etc) it should give a lot of mileage.
     
  TOFIX: alt-enter, in pause mode, is received as menu input (enter).
Same goes for alt-tab but that's only a minor glitch.
     
#revision 1075 Fixed a bug where you couldn't quit the game if OptiTrack was being used.  The quit message was somehow getting swallowed-up by the OptiTrack message loop (in COptiTrack::Update).  I expect my fix isn't ideal (re-posting a WM_QUIT if one was found in the message loop) but it does work.  The other messages (eg. I checked WM_KILLFOCUS) seem to be getting picked-up just fine, so I don't know why QUIT is any different (?).  TODO: Investigate?      
#revision 1076 Renamed CNoctambuleApp::Quit -> RequestQuit.  The name was misleading because it just posts a quit message rather than shutting-down the app there & then.      
  Re-arranged EHeadTrackingHardwareHint so that it matches the string order shown in the combo.      
  Remember: when adding new input semantics, need to update the string table!  (EINPUTSEMANTIC_)      
  Had a problem where the mouse cursor would appear in headtrack calibration mode (allowing the window to be manipulated.
A bit of fiddling later, got the same problem when entering pause mode and couldn't control the menus either.
Just had to delete C:\Program Files\Common Files\DirectX\DirectInput\User Maps\*.ini as mentioned in the comments in InputManager.cpp.
     
  Found a couple of problems with falling rain in WOWvx mode:
1. background mapping / positioning is wrong
2. it's using the Z buffer for the ordinary screen size instead of the left half of the screen (can see Z buffer 'ghosts' etc).

To avoid these problems I've temporarily disabled falling rain in WOWvx mode for v15.
     
#revision 1078 Head-tracking calibration mode is currently only available when using OptiTrack.  TODO: enable it for 3DVisor too.      
  Failed to get v15 out.
Getting a crash on the slave when entering pause mode.<-FIXED(I'd forgotten to add Menu.fxo to the installer)
Also not convinced the rain is right....
Will definitely release v15 tomorrow night.
<-FIXED, DONE
     
12-Apr-2008   8.91667    
  missing decal problem:
- not a sorting bug.  Removing the base decal doesn't reveal them.
- not a visibility testing bug.  Forcing visibility test to always pass doesn't reveal them.
- missing: doubleYellowJohnEastNorth

- IT'S UNINITIALISED VERTEX RGBA ON THE DECALS
     
  MAX: X EXPORTER: brackets in object names get turned into underscores in the X file    
  MAX: Adding a VertexPaint modifier onto an object prompts the object into including a "MeshVertexColors" block in the X file, defining vertex RGBA (floats).
Removing the VertexPaint then removes the "MeshVertexColors" block.
     
#revision 1062 FIXED: The fix I've now made for the missing decal problem is to remove vertex RGBA influence from Patchwork.fx.
When I want to use vertex RGBA for some decals later on (it will be useful), I'll just make a variation of Patchwork.fx called maybe PatchworkVertexRGBA.fx (see define VERTEX_RGBA in Patchwork.fx).

I might well make this same fix for the building materials (eg. Parallax.fx).  The current placeholder buildings have already been manually fixed by setting vertex colours or applying VertexPaint modifiers.
     
#revision 1063 Changed DeferredLightingApply.fx to use point sampling for the screen-res images (sceneDiffuse, diffuseLighting, specularLighting).  This prevents smudginess on 8800 which can filter floating-point textures.      
#revision 1064 DeferredLighting.fx: reduced the diffuse angular falloff range a bit - doing that makes it nice & contrasty, wetter and rougher, less 'default'.    
#revision 1065 Found and fixed a platform difference with the ground reflections.  In ground.fx, the reflection sampler had been set to use BORDER addressing.  The x1900 doesn't seem to support this (?), so it was using clamp instead (which works well for the reflections).  The 8800 supports BORDER, so in places where the reflection is bent by the likes of a curved road surface, black gaps were appearing in the reflection at the edges of the screen.
Now changed the sampler to use CLAMP.
Only found one other use of BORDER in Shaders.sln: RainSplash.fx.  Now changed that to CLAMP as well.
   
  MAX: REMEMBER: After editing lines, don't leave them in sub-object (eg. vertex) editing mode!
This was twisting some of my road paint.
   
  Made some quick road paint improvements in Max.    
  TODO: "Debug image" option (enumeration).  eg. setting this to "rain occlusion" would show the just the alpha channel of ERENDERTARGET_RAINOCCLUSION (which is also _FALLBACKSHADOWREFLECTIONPOSITION).
Maybe for the position 'images', I'd show the values divided by 1500 or something, so you can really see what's going on.  For the HDR luminance images, I'd show the 'exp' of the values.
   
  TODO: "Debug image mode" option (enumeration) :
- scaled PIP
- partial PIP (same scale as screen image but only visible in the PIP area)
- full screen
- half of screen?  diagonal split?
   
#revision 1067 Fixed some flickering seen in the rain occlusion.  This was simple Z fighting.
I'm now using a minimal depth bias in RainOcclusion.fx to fix this (DEPTH_BIAS_TO_PREVENT_Z_FIGHTING).
     
  OptiTrack on slave:
In COptiTrack::Init,
CoCreateInstance(__uuidof(NPCameraCollection)...
is failing with
hr = Class not registered

"CLASSNOTREG indicates that the thing you are trying to create isn't listed in the registry" (in the CLSID folder)
     
  FIXED: OptiTrack mode is now working on the slave (Vista 32).  All I had to do was install the OptiTrack SDK on the slave.  It's a free SDK that anyone can download:
http://www.naturalpoint.com/optitrack/support/downloads.html
("OptiTrack SDK for V100, C120, FLEX:3 Cameras")
     
  Installing the OptiTrack SDK (1.1.031) on the slave, got harmless messages saying that the following files may have been left over by a previous installation (although there have been no previous installations) :
C:\Windows\inf\
oem4.inf
oem5.inf
oem9.inf
     
  "IDirect3DDevice8::CreateImageSurface was renamed CreateOffscreenPlainSurface"      
  IDirect3DDevice9::UpdateSurface:
"This method is similar to CopyRects in DirectX 8."
     
  Un-commented-out the code for fullscreen controls config, and fixed compile errors (it hasn't been compiled since I moved to DX9!)      
  Trying to open controls config in fullscreen mode:
in CInputDeviceManager::ConfigureDevices:
IDirectInput8::ConfigureDevices fails (and doesn't call my callback).  Returns this error code:

DIERR_NOINTERFACE
The specified interface is not supported by the object

E_NOINTERFACE
No such interface supported
     
11-Apr-2008   2.95    
  HDR: since g_apTexToneMap[0] matches between the machines, technique "SampleAvgLum" (PS SampleLumInitial) is off the hook?

So is it technique "ResampleAvgLum" that's going wrong?  <-YES
   
  I think I can see the root of the problem now, and it's on the master side (X1900XTX, XP)
Every second texel of every second row of the g_apTexToneMap textures is very low (but not black).  Now I just need to work out why.
   
  FIXED!
I've fixed the HDR brightness discrepancy.  It was the DITHERING renderstate affecting the HDR luminance surfaces on the master but not on the slave (why the difference though?).  It was getting initialised TRUE in CNoctambuleApp::VirtualRestoreDeviceObjects.
It's now initialised FALSE in that function, with a "can't touch this" comment.  Dithering is nothing but trouble - I've seen this kind of problem with render target effects a bunch of times in the past.

Screenshot showing the damage being done:
C:\noctambule\debug\11_4_8_HDR_masterPC_dither_vs_nodither.psd

Screenshot showing master & slave now matching (g_apTexToneMap[3]) :
C:\noctambule\debug\11_4_8_HDR_masterWorking_vs_blasterWorking.psd
NOTE: TOFIX: SLIGHT SPECULAR / POM / MIPPING DISCREPANCY
   
10-Apr-2008   2    
  Focus-reloads (eg. FX files) work fine when remote debugging.      
  HDR brightness discrepancy:
On the slave:
- g_pTexAdaptedLuminanceCur is too dark, maybe something like 1/50 what it should be.  Same for g_apTexToneMap[0]
- HDR_OnCreateDevice fails to create that texture as R32F; uses R16F
- g_bSupportsD16 = true
- g_bSupportsD32 = false
- g_bSupportsD24X8 = true
-
g_pTexScene seems to match the master
-
g_pTexSceneScaled seems to match the master
-
g_apTexBloom[0] seems to match the master
On the master:
- the same path through HDR_OnCreateDevice and C_HDR::RestoreDeviceObjects
     
  TODO: lights should all have a slight fluctuation to them.  No reason for it, would just look nice.  Almost get this from the mist already.      
  TODO: continue tracking-down the brightness discrepancy, starting from g_apTexToneMap[0]      
9-Apr-2008   2.58333    
  TOFIX: (LOW priority) Monitor-dragging while in pause mode causes a couple of minor menu glitches (circuitry disappears and text is the wrong colour till selected)      
  Now starting on compatibility debugging.      
  Tried using Pix for Windows.
It doesn't seem to be able to give me a GPU timeline like the Xenon one, that's annoying.
It does show me textures and surfaces.
It doesn't seem to let me analyse a remote PC.

- leamrotatedsharp.png (aerial guide photo), in non-shipped builds, is loaded as a 22MB texture with 11 mips...and a corresponding 17MB surface [and one for each mip?]  Should probably stop that happening ;)
- 1K TGAs (with mip chain) take up 5,592,404 bytes each.  Same for 1K PNGs.
- 1K G16R16F = 4,194,304 bytes each.  NB each RT has a texture and a surface, each the same size.
- 512 = 1,398,100 bytes per texture and per surface
- largest vertex buffers are 1,200,960 bytes
     
  Made a Debug folder (C:\noctambule\debug) which will contain debugging grabs.

HDR surfaces:
C:\Noctambule\Debug\9_4_8_masterPC_HDRSurfaces.psd


Speckly junk in the alpha channel of the HDR backbuffer?:
C:\Noctambule\Debug\9_4_8_alphaJunkFromPIX.psd
     
  TODO: need an FX file for the texture displayed by CModeDebug.  This will allow the HDR surfaces to be displayed at a sensible brightness so I can hopefully find the source of the brightness discrepancy between the two machines.  WIll also allow individual channels to be displayed, inverted, whatever.<-DONE(10th, DebugShowTexture.fx)      
8-Apr-2008   2.75    
  Too-many-text-prims problem:
- there seem to be 6 prims too many being drawn for each menu.  Test: when I draw 7 less prims, half of the final character is chopped off of either the English or French (whichever's the longest) version of any menu if the final menu item is fixed-length.
<-NOW UN-DONE THIS CHANGE; SEE COMMENTS IN CMenu::CreateItemGeometry
     
  HA! At the end of CMenu::DeleteDeviceObjects, it was recursing through all the child menus, calling...wait for it...

RenderItems!

Handy!  Good old cut'n'paste.  Debug DX managed to catch the invalid drawprim that uncovered this problem.
     
  Without entering pause mode:

Debug DX:153 references on closing.  This becomes 150 after one or more monitor drags.  Alt-tabbing doesn't affect it (reloadOnWindowFocus is currently false).
"
D3DX: MEMORY LEAKS DETECTED: 1516 allocations unfreed (1543638 bytes)
D3DX: Set HKLM\Software\Microsoft\Direct3D\D3DXBreakOnAllocId=0x373 to debug"
I can't get BreakOnAllocId (from DX settings) to work.

Retail DX: 633 references on closing, 1516 allocations
     
  Can't get into the 3DVisor forums:
"The website declined to show this webpage
Most likely causes:
This website requires you to log in."

(below) Trying to follow a link to an old thread:
"Unable to open <URL>.  The Internet site reports that the item you requested could not be found. (HTTP/1.0 404)"

The paranoiac in me immediately assumes I've been banned for some reason :/

All I said was "this headset's good enough for Jehovah"!
     
  http://3dvisor.com/forum/viewtopic.php?t=979      
  When dragging between monitors, there are currently no unreleased device objects (only when closing).      
  CNoctambuleApp::VirtualInvalidateDeviceObjects:
When exiting, all effect pointers are NULL.  Normal?  NO <-FINE, already released

CRenderTarget::InvalidateDeviceObjects:
When exiting, CRenderTarget::s_pListHead is NULL.  Normal?  NO
<-FINE, already released
     
  That's interesting:
If I remove the CGameMode:: AllInvalidateDeviceObjects and AllDeleteDeviceObjects from CNoctambuleApp::FinalCleanup, I get the same number of unreleased device objects when quitting.
     
  Moved deletion of g_game.pRenderTargets from CModeEnvironment::OnRemovedFromStack to CNoctambuleApp::FinalCleanup.
I thought this would fix some unreleased device objects, but it didn't.
     
#revision 1057 FIXED.  Can now exit cleanly again, and drag between monitors cleanly.  PHEW!!!
I don't fully understand the fix - just tried it on a hunch and it worked.  It's just a matter of ordering anyway - all the right code has been in there for ages.
It was the addition of DXUTCleanup3DEnvironment at the top of CNoctambuleApp::FinalCleanup.  This also required the removal of AllInvalidateDeviceObjects and AllDeleteDeviceObjects from FinalCleanup.

This finally clears an annoying blockage for v15.  Will start compatibility debugging for v15 in the next couple of days.
     
7-Apr-2008   1.7    
  FX: The following causes D3DERR_UNSUPPORTEDTEXTUREFILTER:
"MINFILTER = NONE"
or
"MAGFILTER = NONE".

NONE is only valid for MIPFILTER.
Now fixed in RainOcclusion.fx and RainFalling.fx
     
  CMenu::RenderItems: trying to work out why the wrong number of prims is apparently being drawn (caused error in Debug DX because too many text prims were being drawn, for the number of verts)      
  TOFIX: since moving some menu init to CreateDeviceObjects, the processMenus option makes the menus crash when opening.      
27-Mar-2008   1.16667    
  TODO: when debugging the glitches in v15, try running the game using debug DX and 'break on D3D error' ticked.      
  Patchwork.fx, Parallax.fx: Now fixed:
MIPFILTER = ANISOTROPIC;
produced an error message in debug D3D:
D3D9 Helper: IDirect3DDevice9::SetSamplerState failed: D3DERR_UNSUPPORTEDTEXTUREFILTER
EEK NOW I'M CONFUSED, even the minfilter is complaining when set to anisotropic.  What's going on?
     
26-Mar-2008   2.16667    
  Grr, can't can't call virtual function overrides from within a base class destructor (because the subclass part is already destroyed) - I'd forgotton about that.
Instead, in the CGameMode destructor I'm now asserting that the device objects have been invalidated and deleted (indicated by the mode flags).  Added CGameMode::PrepareToDelete which must therefore be called before deleting a mode.  Overloading the delete operator did cross my mind... *shudder*
     
25-Mar-2008   2.16667    
  ...nearly there; just got some memory/resource leaks now.  I can't see any mis-placed calls to CreateDeviceObjects or RestoreDeviceObjects.      
23-Mar-2008   3.3    
  CGameMode now inherits from CListItem.
Added static CGameMode methods <Create,Invalidate,Restore,Delete>DeviceObjects
Removed the CModeStack equivalents, because these methods need to be called on all the game modes whether they're on the stack or not.
     
  Made some good progress with the device-changing stuff (eg. for dragging the game between monitors).
The game does actually survive this now; just need to fix up the menus and that should be it all working.  Presumably the remaining unreleased objects were to do with menus?
     
21-Mar-2008   7.9    
  Added 'to-fix' notes at the top of options.cpp
TOFIX: OptiTrack\cameraMountedOnMonitor: when true, this causes a camera/projection crash on startup<-FIXED(just had to put a check around the OptiTrack virtual-window headtracking update in ViewInfo.cpp)
     
  In a master build, alt-entering now edits the value of the 'display\fullscreen' option.
In this way, the game remembers the state that the player left the game in and starts in this mode when the game is next run.  This also keeps the 'full screen' checkbox in sync with the current state. (CNoctambuleApp::OnToggleFullScreen)
     
  Menu.fx no longer writes to the Z buffer.  Previously, the menus had been wiping away the falling rain if the pause background was frozen.      
  On the first frame, FTIME is about 22.  That must've been the loading time.<-I've now added a temporary bodge so that FTIME returns 1/60 until the environment has done its first update.  I'll be overhauling the time system real soon to allow for replays, etc.      
#revision 1041 Spent quite a long time fixing the annoying first-frame bugs that could be seen if the game lost focus before it finished loading.
Most importantly, got rid of the crash.  Also tidied it right up so that you can switch away while it's loading, come back to it after it's finished loading, and it'll be sitting in pause mode with a correctly-rendered first-frame environment behind the menu.

Ideally I think I need a 'Start game' option at the top of the Pause menu, that turns into 'Resume game' when you re-enter pause mode.
     
  Started trying to fix the crash when dragging the game window from one monitor to the other.  I think I know what's going on.
When toggling fullscreen, the D3D device is lost and then restored.  Nowadays the game handles this correctly.
But when dragging between monitors, the D3D device is
destroyed and a new one is created.
The problem is that various parts of my game code assume that the device won't be destroyed until the game is shut down.  So they're creating device objects in their constructors and releasing them in their destructors.  That creation and release needs to be separated out now into CreateDeviceObjects and DeleteDeviceObjects functions.
     
  Added CModeStack::CreateDeviceObjects.  DeleteDeviceObjects is already there and in use.      
  Renamed all InitDeviceObjects functions CreateDeviceObjects      
  g_game.OneTimeSceneInit creates the mode stack.      
  TODO: continue fixing the monitor-dragging stuff (add a CreateDeviceObjects for landscape, patchwork, etc....).  Looks like it should be straightforward.      
17-Mar-2008   3.08333    
  The following debug options now work:
processFonts
processMenus
reloadOnWindowFocus
pauseModeOnWindowFocus
allowFrozenPauseBackground
     
  CMIRenderTarget now displays render target dimensions.
Added CRenderTargetOptions::WriteToMenuString for this
     
  TOFIX: Why is custom.txt not working (loading) ?<- it was being overridden by phil.txt      
16-Mar-2008   5    
  French-English dictionary: http://www.granddictionnaire.com      
  Managed to get all 22 menus in and working and not tangled-up with each other (well just about; 'HDR' and 'motion blur' are still overlapping).
To fix the tangle I had to split up the 'interfaces' menu by adding 'input' and 'output' sub-menus.  I was reluctant about this, but I couldn't see another way, and works out more future-proof anyway.
If the menus were to reshape/resize based on contents, and this affected tree structure, it would be precarious (adding new items would change the tree structure).
     
  So tired and lethargic today; haven't got much done.  It's because I was out drinking Red Bull last night.  What do they put in that stuff?      
  YouTubed a little video of some rain (nothing new) :
http://www.youtube.com/watch?v=1c3x__pKUFg
higher-quality version:
http://lecauchemar.com/videos/rain.wmv
I might record a longer, better version of this idea later on
     
  Joined the forums at WordReference.com.  User name: z6po      
  YouTubed a video of the menus:
http://www.youtube.com/watch?v=EjvyaLIOzBE
     
15-Mar-2008   8.666    
  Option: replaced HDR\curve with screenEffects\colourGrading which is a clearer name      
  String table now contains the full set of configurable options.
Also did a lot of translation
     
  The chap I contacted on ICQ about the mythical WINx3D SDK never replied.  So I've now uninstalled ICQ (it's evil and I only installed it so I could contact him).
If anyone reading this manages to find the WINx3D SDK, please PLEASE let me know!
     
  Maths: added function WrapInt, and WrapIntExclusive which has non-inclusive limits      
  MICombo value selection is now cyclical/looping      
  Got nearly all the menus in.      
14-Mar-2008   2.5    
  Been reorganising the menus, re-grouping the options in the string table, mostly to avoid the enormous-graphics-menu problem that I had.
Also translating.
     
13-Mar-2008   2.25    
  Lost some time due to a silly 'scratchpad'-contention bug.
To prevent this happening again I've made g_game.generalTemporaryBuffer private and added methods LockGeneralTemporaryBuffer and UnlockGeneralTemporaryBuffer (which just use asserts to check that everything's ok).
     
  MICombo now takes into account all its possible variable text when calculating bounds.
Added CMenuItem::UpdateBoundsForVariableVerts for this.
TODO: same for the other item types (for spinners, check the space required for the min and max values).
TODO: limit the left position for menu contents; scale the contents to fit the remaining space where necessary?
   
12-Mar-2008   3.78333    
  Menus now draw correctly in WOWvx mode.      
  Fixed bugs with CMICombo variable text.    
  CMICombo is now functional.      
  Stereoscopy modes are now listed in order of how difficult they make it to read the menu ;)      
  TODO: for spinners (and sliders?), definitely need to be able to type the numbers in :/
This creates a bit of work for me.
Might well leave this till after v15.
     
  Added function COptions::ApplyStereoscopy      
  Found that zero-convergence anaglyph (or practically zero) is super-clean.  Obviously it minaturises the scene and only allows objects to come out from the screen rather than having depth into the screen.  But I like it - it's much more usable and impressive than the accurate version (which is ruined by ghosting).

TODO: use settings something like this in the anaglyph example profile(s):
convergence: 0.1
saturation: 0.6 odd
viewing distance: 28 odd
     
  About half of the current menu items are functional now.  You can change settings and see the difference they make to the game.      
  Found that upping (say, doubling) the rain impact density really makes the rain look more dramatic.  And it ties-in better with the amount of falling rain.
TODO: increase the default,<-done, (256 -> 512)
check the speed hit.
     
  TODO: I'm at the point where I could reeely do with some timers, now that I can adjust the graphics settings easily.
But that's another post-v15 thing.
     
  Menu items now take a real brute-force approach to applying their option changes.  They call COptions::ApplyAll, then they force a refresh of the environment image.
I was finding that the 'apply' work required after making any given change could be difficult to gather-together.  For example, after changing stereoscopy settings, CEnvironment::ApplyOptions needs to be called.
The brute-force method removes all the uncertainty.
My worry with it was that it could easily cause a dropped frame that would swap the eyes in 3DVisor mode.  TODO: test this on the new PC.
...And then there's the business of changing render target options, errgh!....
I really wish they'd designed the 3DVisor with two monitor inputs (I did see a mod for this, but you had to remove the headtracker).
     
11-Mar-2008   4.41667    
  sprintf: to left-align an integer, and set its minimum number of characters, and prefix it with a space if it's signed & positive:
"%_-6d" where the underscore is a space
There doesn't seem to be a way of specifying the maximum number of characters
     
  Replaced CStringTable::StringLength with CStringTable::MaxStringLength which takes into account all languages.
This is because I'm going to allow the language to be changed from the menu (since I've got a nice multilingual stringtable system, I think it's worth the effort to show it off).
   
  Did some translation, for some of the menu options added so far.  It's probably all wrong.  I'm currently calling anaglyph deghosting "défantomisation" (citation: http://abtutor.free.fr/ColorGhosts/index.html)    
  To add to font map:
ç (shouldn't need uppercase)
(
)
?
<-Done
   
  Font: Made the changes above; also shifted the most common 'variable' characters to the start (numbers, etc).
Found that lens blur is much more tame than Gaussian blur (ie. it doesn't spread out as much).  I think I prefer the nice soft look of Gaussian though.  Current blur settings: Graphics\Menu\blurSettings.png
     
  CMICombo now displays its variable text correctly      
  CMISpinner and CMISlider are now usable :)      
  below: used the menu to adjust realWorld \ viewingDistance as a test; this gives a glimpse of what the menu tree actually looks like.  As you can see, I'm not finished translating yet ;)
Can't wait to see it with proper reflections on it, assuming that whole thing works....
     
 
 
     
  TODO: localise decimal points into virgules.  I'm assuming sprintf won't do this automatically on a French-language system (??)  Good thing I've taken the precaution of getting a French-language system so I can test this kind of thing :D      
10-Mar-2008   2.5    
#revision 1025 Got CMICheck updating its text the way it should, phew.
I was just being thick and forgetting to transform the text verts from menu space to tree space.
     
  TOFIX: rain impact effect toggling (with alt-entering)    
  Centralised the MenuItem 'variable text' code.    
#revision 1027 CMISpinner is now displaying its variable values correctly.    
9-Mar-2008   2.31667    
  CMICheck is now closer to updating its text the way it should.  Not quite got it yet.      
8-Mar-2008   3.3    
  Added function CStringTable::StringLength      
  Added function CMenuItem::PlotText      
  CMICheck now responds to input, to toggle its bool value.      
  Full screen' menu option now works.      
  CMICheck is now just-about updating its text the way it should.      
7-Mar-2008   1.43333    
  Late start again.      
#revision 1021 TEMP: The 'controls' menu item now disables in fullscreen mode to prevent the current crash.
TODO: fix properly after v15.

Added CNoctambuleApp::OnToggleFullScreen for this.
DXUT.cpp is including global.h & main.h for this - TEMP?
     
  Started making CMICheck (the yes/no menu item) functional      
6-Mar-2008   1.38333    
  Was working late, hence the late start.      
  Got the auto menu positioning fixed, properly this time - it's all making perfect sense now and the tree is forming just the way it should.
Embarrassingly, it was the very simplest final step of the thing that I was doing wrong - distributing each menu's angle range amongst the child menus.  All the more complicated stuff was working fine (as of last night).
     
#backup Backed-up the project.      
5-Mar-2008   4.666    
  Added quaternion normalisation into MatrixLerp33 after finding some cases where the menu movements went crazy without it.      
  Found that dragging the game window fully onto the second monitor causes an error (unreleased device objects).  TODO: fix.  The DX sample apps handle it correctly.      
  Fixed the problems I was having with the auto menu positioning, but ran into yet another one.  Had a look at it using the 3DVisor in case this made the problem clearer, but couldn't see anything obvious.  Currently the stereoscopy menu thinks it has hardly any space around it for its child menus.  I haven't been able to work out why yet, but I expect it could be something to do with it being at the top 'pole' of the tree.  TODO: FIX!<-FIXED(6th)      
  3DVisor: On the old PC, the headtracker was working fine in the bottom two USBs, but for the top two I had to install its drivers.  Working fine now though.      
  3DVisor: Got a 'lost connection' error one time just after entering pause mode.  Don't know why it happened (loose USB cable?) but it was all handled gracefully.  The game switched from full-screen back to Windows to show the message, in the right language; the retry option succeeded; the game reappeared full-screen and continued with headtracking.
This was using the 3DVisor in the second monitor port (along with a second monitor).
     
  Added the 'anaglyph' menu      
4-Mar-2008   0    
  Works night out.      
3-Mar-2008   2.75    
  Added the 'stereoscopy', 'real world', 'display' and 'weather' menus.      
  CMISlider now inherits from CMISpinner.  I might rename these classes later to make the relationship more obvious.      
  Option display\headMounted is now realWorld\headMountedDisplay
The 'display' menu is more for the properties of the video output; the 'real world' menu contains all the real-world info.
     
  Made some fixes & added some tests to the automatic menu positioning.  Ended up running into another bug after adding more menus.  TODO: FIX<-done(5th)      
2-Mar-2008   8.55    
#revision 1014 Menu highlight effect has changed in design slightly.  Was originally a solid-edged bar with alpha-blended red fluid going through it (see mockup 17th feb), representing the blood of the menu.  The functional aim was to thicken/darken the background for the text.
Now it's a subtle additive red smoke, with no solid edges, drifting from the letters as if they're subliming.  Can be a wee bit hard to read the text when a light is behind this additive smoke plus the text glow, but for the purposes my demo, prettiness wins over practicality.   And it does look very pretty now.
     
  Added method CMenuItem::Enable.  Menu items can now be disabled, which makes them un-selectable, removes their text glow and turns the text to roughly the same weak colour as the menu titles.
As I add new items to the menus I'll disable any that aren't hooked-up/supported yet.
     
  F1 is now another pause key.      
  Decided that I don't want to support direct-from-game access into the DX controls config.  Partly because the time doesn't freeze properly at the moment when doing this.
I'm keeping the 'CONTROLS' input semantic because some controllers actually have a 'controls' button.  For my game, this will open up the Controls menu (my one).
     
  Temp: 'Controls' link now simply opens the DX controls config.      
  The menu tree now automatically generates the positions of all the menus.  Currently still a bit wonky; todo: fix.<-sorted(5th)      
1-Mar-2008   10.6667    
  Added method g_game.Quit to exit the app.  Made sure this doesn't bypass any DXUT error checking (message boxes about unreleased resources, etc).      
  Added option debug\reloadOnWindowFocus (reload shaders etc when the window regains focus.  In Master this behaviour is always false).
Added option debug\pauseModeOnWindowFocus (enter pause mode when the window loses focus.  In Master this behaviour is always true).
     
  CModeStack::Remove no longer asserts that the mode is currently on the stack; bails out instead (see comments).      
  Realised that I needed to let DXUT handle at least some hotkeys (eg. alt-enter); changed it back accordingly.
Also realised that DISCL_EXCLUSIVE wasn't what I wanted because it blocks the above and blocks the printscreen key.  Now using DISCL_NOWINKEY instead to disable the Windows key.
     
#revision 1006 DXUT.cpp: disabled DXUT handling of hotkeys:
VK_F3 (toggle reference device; currently I don't support this, so it crashes)
VK_F8 (wireframe; I don't support this, so it's glitchy.  Can be handy now & again but I'll re-enable it manually when I want it)  TODO?: A well-implemented wireframe option on the debug menu would be very handy for showing-off culling, patchworks, effect geometry, etc.  Would be handy for debugging too.  A good thing to add, really.
VK_ESCAPE (exit app; this key now enters & exits pause mode instead)
     
  Added option debug\allowFrozenPauseBackground (allow g_game.flags.freezeBackgroundWhenPaused to be set true where appropriate).  In Master this behaviour is always true      
#revision 1007 Fixed the rain-splash glitch seen when alt-entering while paused.
Added flag g_game.flags.refreshEnvironmentImages which allows the 'frozen' paused environment to re-render for a single frame after alt-entering.
Related to this, HDR no longer pauses when the game is paused.  It causes less problems this way (eg. alt-enter), and also it would make no sense for it to be paused when headtracking's enabled because you can then still look around in pause mode.
     
  Crosshair no longer appears in pause mode.      
  Menu tree now aligns with the current camera (so the menus appear in the right place).      
#revision 1008 Selected menu items now glow white (see CMenu::UpdateMenuItemVerts).  The glow fades out in sync with the circuit line.      
  Photoshop: found that tiling marble textures are the easiest thing in the world to make:
- difference clouds, times lots, 15 say
- curves
- done!
     
  FX: Crazy: In menuCircuit.fx (and presumably any other effect file) I have to set ZENABLE = TRUE in order for the thing to *write* to the Z buffer - despite the fact that there's a separate ZWRITEENABLE which I also have to set TRUE in order for the thing to write to the Z buffer!      
  Got a blue-screen crash while in Dev Studio doing nothing in particular.      
  Got the menu selection 'highlights' working nicely.  Took a bit of experimentation to get them playing well aesthetically with the other menu elements (especially the circuit lines).      
29-Feb-2008   2.71667    
  Menu.fx: Added a quick & dirty refraction effect, and improved the placeholder reflections to take into account the tree orientation.      
  TODO: get the default hotkeys available again in debug builds;
clean-up the game exit (from pause mode).  Is there a DXUT exit function??<-done (see 1st Mar)
     
28-Feb-2008   2.83333    
#revision 1002 Got a rare crash when drawing lighting on the first frame, while the game window was in the background (I was doing a little E&C build at the time, hmm).  Crashed because g_game.pCurrentCamera was NULL.
Had a look and saw that the pointer wouldn't be set until after the lighting would draw (???)
Now fixed.
     
  Menu transitions no longer give any movement glitches with a low framerate.
I've also smoothed-over a movement glitch that could be seen when a new transition to a third menu was started before a transition between two others had finished: the homer-interpolated transition matrix is now used as a lerp target for the final tree matrix used for drawing.
     
  Added function MatrixEqualApprox33 - this is used to detect the menu being at rest at the end of a transition.      
  Added flag g_game.flags.freezeBackgroundWhenPaused.  When the game is using no headtracking and no stereoscopy, this flag is set true so that in pause mode, the last rendered scene image is used instead of re-rendering the same scene each frame (note: the rain is still rendered each frame because it's done post-HDR).
The result of this is that no matter what framerate the player is getting for the game, the menus should always run in a frame if stereo & headtracking are inactive.  In such a case, it makes up nicely for the lack of motion blur on the menus.
     
  Seeing the menus moving against their background makes it clear that they need some refraction to stop them looking paper-thin (or hollow like balloons).  The refraction has to correctly follow the branches too, otherwise the illusion is broken, so I'll need to use the per-pixel normals.<-DONE(29th)
TODO: add refraction.<-DONE(29th)
Also improve placeholder reflection to take into account tree orientation<-DONE(29th)
     
  TODO: on entering pause mode, the tree needs to orient itself so the root menu is on the line of sight (not including the head-tracking offset).<-DONE(1st mar)      
27-Feb-2008   4.5    
  Got the menu transitions working nicely.
Added CHomer (Homer.cpp/h) which automates smooth movements between two float values.  It even lets you change direction smoothly half-way through a transition between menus.
It's surprising how getting little things like the menu movements just right creates an impression of quality.  The menus of a game are kinda like the interior of a car in that way.  If you want the player to feel like they're driving a Jaguar, you shouldn't use the menus from a Škoda Favorit.
     
26-Feb-2008   1    
  DIUtil.cpp: Now setting cooperative level to DISCL_EXCLUSIVE.  This disables the Windows key.<-(see 1st Mar)      
  Windows key can't be blocked during control config.  The player can't map it to to an action either.
DX docs:
"Even if the cooperative level for the application is disabling the Windows logo key passively through an exclusive cooperative level or actively through use of the DISCL_NOWINKEY flag, that key will be active while the default action mapping UI is displayed."
     
  Input: Couldn't see a way to prevent the likes of DIKEYBOARD_WEBSEARCH doing its default thing (although detecting the button is no problem).
I can't block it in LowLevelKeyboardProc (dxut.cpp) unless I know its VK_ code, and I can't see one that corresponds.
     
  Input: DIKEYBOARD_RMENU is 'Alt Gr'
DIKEYBOARD_APPS ("Application" in the controls config) is the 'menu' key (normally for right-click menus)
     
25-Feb-2008   1    
  I've set DXUT to no longer handle default hotkeys (esc, pause, wireframe, ref device).<-(see 1st Mar)
I've also set it not to parse the command line (just to be safe, until such time as I actually want it to).
     
  Did a few input/menu odds & ends.  CMILink now changes the current menu.      
  Revived my old MySpace page (which was still being linked to from the band page) to point people to my site.  Hopefully it won't use up loads of my time like it did before.  I'm currently keeping it very minimalist.      
24-Feb-2008   12.25    
  Had a look at the LocalDeformablePRT DX sample:
C:\Documents and Settings\user\My Documents\Visual Studio Projects\LocalDeformablePRT
Had to increase the shader model numbers in CDXUTDirectionWidget::StaticOnCreateDevice to get it to run, because 1_1 is no longer supported.
Also had a look at the PRT demo.
Didn't see anything very useful-looking for this project, but it was interesting as reference...
     
  Input: A DIACTION array, for a DIACTIONFORMAT struct, for IDirectInputDevice8::SetActionMap, is not allowed to contain two mappings of the same input (dwSemantic member).
Nor is it allowed to contain out-of-genre inputs (eg. DIBUTTON_BROWSER_PREVIOUS can only be used if the genre of the DIACTIONFORMAT is DIVIRTUAL_BROWSER_CONTROL).  For this reason I allow DIBUTTON_FPS_PAUSE to enter pause mode and DIBUTTON_BROWSER_PAUSE to exit pause mode.  In practice though, I can't test either of these 'virtual inputs' so there's also a non-virtual input to do the same thing (defaulting to P).
     
  Finally worked out how to get the menu input channels working.  I just have to call CInputDeviceManager::SetActionFormat to switch between reading game actions (ie. during play) and reading menu actions (ie. when paused).  I'll probably also use this mechanism for fly-cam, headtrack calibration, replay mode, etc.      
#revision 992 Input 'action' descriptions (seen when configuring/viewing controls) are now localised through the string table.
See EINPUTSEMANTIC_... strings.
Added OnChangeOfLanguage methods to a couple of classes.
     
  Input: semantics mapped to DIAXIS_FPS_MOVE don't appear in the config interface, and aren't active, when using a keyboard & mouse.  I'm guessing it would show up if I used an analogue joystick/gamepad.      
  Managed to get controls configurable [again?].  Just had to supply a name string for CInputDeviceManager::Create.
Control files in C:\Program Files\Common Files\DirectX\DirectInput\User Maps now get named accordingly (upper-cased).
     
  Spent most of the day giving CInputManager a thorough overhaul.  It had been based on the input code from an old DX aerial FPS sample (no longer in the SDK).  There was a lot of lazy duplicated code there so it was bulky and hard to maintain.
Now it's tons better, nice and tidy and makes perfect sense.  Added CAxisInput, and CButtonInput (which takes care of debouncing).
     
  Aarrgh!  Just noticed that CInputManager was written four years ago !  Que cela me serve de leçon.      
  F1 in fullscreen: assertion failure at C:\noctambule\source\common\diutil.cpp(344): hr hr=E_INVALIDARG (0x80070057)      
  I've only just discovered fr.wiktionary.org - it's ace!      
  TODO: need an analogue joystick/gamepad thing to test some of these control axes.      
  According to Wikipedia, an "invert mouse" option means flight-sim mouse, and apparently Quake set that standard.  I was never sure which way round it was but I'll go with that.
Added option controls\invertMouse (defaults false)
NOTE: this option isn't limited to mouse input; it inverts the final accumulated pitch value (from all devices) used for looking up & down during play (but doesn't affect head-tracking).  Does this inside the input manager.
     
23-Feb-2008   2.75    
  Faffing with the input code.  I've mostly made sense of it now.      
21-Feb-2008   5    
  FX: I can't get the BLENDOP state to do anything!  It's always just adding!  (???)      
  (below) Got the circuit lines finished.  They were sodding fiddly!  I didn't make it any easier for myself by insisting that they have perfectly rounded corners (which are too small to even notice anyway).  Ah well, it's all experience.
You can cycle through the menu items of the active menu now.  The lines fade out pleasingly when they disappear.
TODO: get those menu input channels working.
     
 
 
     
20-Feb-2008   2.38333    
  Menus: Made more progress with the circuit lines and general functionality.      
19-Feb-2008   2.18333    
  Menus: Made good progress with the circuit lines and general functionality.      
  Enemies: Sketched an almost-upright scorpion beetle guy with head-pincers, various legs (longer at the front, for uprightness) and lobstery head-fangles/feelers.  The body is fat enough that he'd be a satisfying target that could explode when hit.  The scoprion tail emits a snappy lighting attack.
(I'm not including an image here because it's not a great drawing [good by my standards though!] and don't have a scanner anyway.)

I'll try sketching a few different designs in the near future and then decide which one I like best.

Would be nice if the enemies had sort-of searchlights on/in their head, like miners' lamps, maybe glowworm-coloured to contrast with electric-blue attacks (an idea which I'm keen on).  If they have fangles & feelers, they would cast groovy shadows and could demonstrate backlighting/scattering.  Fangles would very likely be code-drawn, and code-animated to provide nice secondary motion.
     
18-Feb-2008   3.16667    
  Enemies: Spent about an hour collecting images of lobsters, toads, scorpions, spiders and other ugly animals & insects.
The toads have good faces and skin but they all look like they could be reasoned with.  Maybe they'd be more intimidating if they were snarly (like angry monkeys - sharp teeth) instead of looking bored all the time.
The scorpions look the most intimidating.
     
  Made some progress with the circuit lines for the menu selection effect.      
17-Feb-2008   8.16667    
#revision 977 (below) got the menu normals about as good as they need to be.  I'll save any further improvements till after the reflections have been added.      
 
 
     
  Made a placeholder sphere map by chopping-up some old location photography : ETEXTURE_SPHEREMAP
This'll do for the menus until the proper reflection effect is written (see 7th Feb).
     
 
 
     
#revision 979 (above) Menus now look like this.
The smudgy effect at the edges of the screen (screenEffects\edgeBlur) is a new addition in v15.  I like it because it's dreamy; it also kinda suggests water in the eyes, which is good.
If I wanted a stronger impression of water in the eyes, I could make the blur thicker at the top of the screen.  I might consider that later.  In 3DVisor mode, the effect is disabled by default.
     
 
       
  (above) Mockups for the selection effect (mockups\menus\selection_PCB.psd)

- The text lights up white

- A PCB-diagram-style line connects from the empty space on the left to underline the text (maybe the whole line, maybe just the label).  Blend mode: soft light.

- A background box with faded left & right sides contains clouds of colour scrolling from left to right.  I've previewed the movement in Photoshop - looks great, very organic.  In red especially, it's as if it's the blood of the menu.  Blend mode: normal.
     
  TODO: should the 'Link' menu items also have PCB lines to their target menus?  That might be nice; do a mockup.      
  Added the WOWvx menu.      
16-Feb-2008   0    
  Band practice      
15-Feb-2008   3.58333    
  (below) menu normals are close to being what they should be.  The texture is still rough though :      
 
 
     
14-Feb-2008   4.11667    
  menus: Had to make fixes to the branch positioning, because I had got it slightly wrong.  The branches are now drawing nicely.
TODO: for the joins to work properly, need to take into account the length of the branch (map the branch V at constant world-space density)<-FIXED(15th); did it in a different way
     
  Had a look at the menus in VR mode - they're good :)
This was also the first time I've seen the falling rain, paused, in VR mode.  It's quite spooky.  I'm definitely glad I took such a stereo-friendly approach to the the rain.
     
13-Feb-2008   3.33333    
  Did a bit of experimentation with detail mapping for Parallax.fx.  Didn't get anything worth bothering with.
See define DETAIL_MAPPING_TEST.
     
  TOFIX: option 'general\autoFOV' seems to have no effect<-WORKS FINE NOW(21.3.8)      
  Got the menu branch join points located properly; last night's stuff worked well and only needed a few little fixes.      
12-Feb-2008   4    
  Mapped the texture onto the menu ellipses, and improved the texture so that the branches will adjoin neatly.      
  D3DXCreateTextureFromFileEx, in CTexture::Create, seems to be forcing square/POW2 textures, despite the D3DX_DEFAULT_NONPOW2 flag (?)
This was causing a problem for the menu texture, but I've now made it POW2 dimensions (as it should have been, of course).
     
  Drafted the code that locates the join points for connecting the branches onto the menu ellipses.
This code also calculates how far to sink the branch into the ellipse so that the texture will join up seamlessly.
The whole of tomorrow night will be spent getting this working properly.
     
11-Feb-2008   3.16667    
  Got the menu transformation matrices working properly.      
  Added function Vec3RotateX      
  Planned the menu branches - they should join on quite easily.
Made a normal map for the menus (menuNormals.tga / ETEXTURE_MENUNORMALS).  From menu.psd
     
  Added the Graphics and Debug menus.      
10-Feb-2008   11.0833    
  Added a 'Remote Debug' build config.<-removed, no longer needed (just using Debug and switching the debugger type)      
  Finally managed to find the USB driver (or driver installer) for my modem:
C:\Installs\BT Broadband\Util\BT220V.exe
Both the PCs are now talking to each other and to that t'Internet.
This puts me at the point I should have been at four days and 55 pounds ago (the router I bought, which I couldn't get to work properly, is completely redundant now).
     
  Added a 'Remote Local Debug' build config (debug the remote exe locally)<-removed, no longer needed, now using local exe for remote debugging      
  NOTE: the debug exe, should I ever want to include it in the install, requires d3dx9d_34.dll
These dlls can either go into the system folder (where the installer currently puts them, maybe shouldn't), or just next to the exe.
The debug exe is about 3 megs
     
  Vista: HANDY: Start \ eventvwr.exe \ Journaux Windows
Shows details of recent crashes etc.
     
#revision 953 KER-REMOTE-DEBUG!!!  POW!!  :D
Now, I am the master.  Er, literally, yeah.
     
  And I'm getting D3DX debug output in French, kewl.      
  remote debugging: had to set the 'Remote Command' to be the slave-relative path to the exe ( \\master\c\... ).  (I'd forgotten this stuff because it's been 8 years since I've used remote debugging.)
The game exe and the remote-debug monitor are both kept on the master (keeps things simpler & tidier, and seems to be the approach recommended in the msvsmon docs).  Does mean the game takes
even longer to start up, but that needs fixing anyway.
Had to set the '
Remote Server Name' to be the server name displayed in msvsmon (currently PC-DE-PHIL:4015 ).
Had to set '
Debugger Type' to 'Native Only', and 'Connection' to '...no authentication' because I'm using Home Editions of Windows on both PCs.....  Corresponding settings had be chosen in msvsmon.
     
  Grrr:
"In Visual Studio 2005, edit and continue is not supported when debugging native C++ code remotely"
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101862
It's not supported in Visual Studio 2008 either:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2274488&SiteID=1
     
  Just to see what would happen, I tried enabling authentication for my remote debugging.  Got the message I'd expect:

"Unable to start debugging.
Access is denied. This seems to be because the 'Network access: Sharing and security model for local accounts' security policy does not allow users to authenticate as themselves. Please use the 'Local Security Settings' administration tool on the local computer to configure this option."

The option it's referring to is not configurable on Home Editions of Windows, so there will no remote EnC for me.  It's annoying, but it's no different from using a console devkit, so I should stop whining.  When I want to use EnC, I'll just debug locally.
     
  Installed NVIDIA PerfKit 5.1 on the new PC.
Can't get NVPerfHUD to work though; apparently there isn't an instrumented driver for 8800 yet:
"The NVIDIA Setup program could not locate any drivers that are compatible with your current hardware.  Setup will now exit."
     
  Got the remote debug monitor auto-starting with all the right parameters, so the game can now be launched with remote debugging without me having to do anything.      
  Installed NVIDIA PerfKit 5.1 on the new PC.
Can't get NVPerfHUD to work though; apparently there isn't an instrumented driver for 8800 yet:
"The NVIDIA Setup program could not locate any drivers that are compatible with your current hardware."
     
  I just got confused to hell and back - Visual Studio had set itself to 'show all files' on the solution explorers.  So I was opening the shaders solution and thinking "what is all this weird random old junk?  Where are all my .fx files?"  The thing that made it extra-confusing was that no amount of SVN reversion seemed to change anything.

The problem might have been caused by me typing on the wrong keyboard, which I've been doing all day - although there doesn't seem to be a default shortcut for 'show all files'.
     
#revision 956
#revision 958
Very nearly lost the following files, which weren't in SVN, while heavy-handedly messing about trying to understand the problem described above:
h_Menu.fx
h_MotionBlur.fx
MenuTitle.fx
CullPlaneUser.cpp
Luckily I found them in the recycle bin.  These files are now in SVN.

This is why I back-up my actual project folder, rather than the SVN repository.
Should really back-up both I suppose.  The repository is only 1.5 GB.
     
  Visual Studio: lost my keyboard shortcuts (?)<-FIXED (11th) somehow 'MyMacros.vsmacros' had got unloaded      
9-Feb-2008   2    
  Wasted the whole day trying and failing to set up
- a router
- remote debugging
     
  Project settings: I've set the debugger type to 'native only'.  This is because remote debugging on home editions of Windows only supports native code rather than 'managed' code.  I don't even know what this means, but I wanted to check that the debugger still behaves ok in that mode.  Seems fine so far.      
  Project settings: Resources: I've set 'culture' to French (France) (0x40c).  I don't think this makes any difference to my stuff anyway.      
#revision 951 Deleted the 'media' folder (junk inherited from the HDR sample).      
#revision 952 Deleted the 'UI' folder and removed it from the installer (junk inherited from the HDR sample).      
  Cleared out a load of inherited UI junk from the HDR code, including HDR_InitApp.      
7-Feb-2008   3.66667    
  The need for reflections on the menus led me into thinking about reflections in general.  The most important place I need them is on all the glass (shop fronts, etc), but I also want the cars to be reflective, and plenty of other stuff too.

I've come up with a very devious plan which, at the lowest detail setting, works without redrawing *anything* :
     
  1. Ignore the ground reflections for just now; I'll keep them working the way they are.  At the end, they might well join up with the general reflection system described below; that would be great, but it's not vital.      
  2. There will be a 'number of reflection planes' option, kinda like the numProjectors one for the shadows.  It will be possible to set the number as low as 0.  Each of these reflection planes will do pretty much what the ground reflection is already doing - straightforward planar reflection.  They'll get assigned to the wall planes that need them most at any given time.  I'll be aiming to set the default number of reflection planes to 1 (ground only) or maybe 2 if I'm feeling generous.      
  3. Here's where it starts to get novel.  I will be keeping a very small list of nearby planes (walls and ground) that will be used for simple ray-tracing.  I might well use the CullPlanes for this, since they'll already be positioned to coarsely cover great big swathes of wall, which is ideal.  One of the planes will always be a big section of the ground plane around the viewpoint.      
  4. One offscreen render target will contain a collage of images roughly representing the surfaces of each of the planes.  Those images are created by, each frame or across a span of frames, the appropriate trapezoids being cut out of the previous frame image (possibly also out of the ground reflection image), reshaped and glued onto the ORT.  Obviously only little bits of the collage (the bits that were in the frustum) will thereby get updated on any given frame, but that's fine.
When a new wall plane becomes 'active' as a raytracing plane, if it's not in view I can start it off by slapping a 'generic wall' texture on it or copy from whichever wall plane has been active longest, something like that.
     
  5. The collage from point 4 is used for the reflectors that don't have a reflection plane (so this includes all non-planar reflectors).  The following also applies to those reflectors.
In the reflection receiver material, whether it's on a window, a car or whatever, the vertex shader will trace the reflected view ray to the point where it hits a raytracing plane (if it doesn't hit a raytracing plane, bail out ASAP).
An extension here, to support normal mapping, would be that the vertex shader computes an extra two intersection points - one for the ray reflected by the tangent and one for the ray reflected by the binormal (or by vectors somewhere between those axes and the normal).  The pixel shader would then interpolate between the texture coords calculated in point 7 for each of these intersections.
     
  6. The vertex shader can compare the reflected ray direction against the main view direction, and against the view direction reflected by the ground plane.  From this it can decide whether the previous frame, or the current ground reflection image, would the better image to use for the reflection.      
  7. The intersection point is transformed into the clip space of either the previous frame's view, or of the current ground reflection view - whichever was chosen in point 6.  If the intersection point is found to be inside the frustum of interest, simply sample from the image chosen in point 6, and we're done.
If the intersection point is found to be outside the chosen frustum, sample from the collage instead.  Cross-blend at the transitions between the frustum and the collage if necessary - it won't break the bank.
     
  It's going to be a lot of work, but the result should be really pretty amazing.  Provided it all works, and doesn't look pants, the benefit-to-cost ratio of this effect will be totally off the scale :)      
  Although it's very tempting to dive into the reflection work now, I really need to get v15 out first.  This is because the compatibility bug in v14 (missing ground detail) is annoying, and slightly worrying too.
So the menus in v15 will not have any reflections on them at all,<-added placeholder reflections for now (17th)
but I will hopefully get the menus functional (most of them at least), so that options can be tweaked on the fly, finally - yipee!
     
  TODO: mock-up and implement menuitem selection effect<-done(17th) (mockups\menus\selection_PCB.psd)      
6-Feb-2008   3    
  Got the new PC working nicely.  And - PHEW - the 3DVisor headtracking is working on Vista 32 :)      
  Greatly improved the default settings for 3DVisor stereoscopy.
Remembered that I was clamping stereo convergence (0..1).  It's best to allow this to be set higher than 1, so I've now removed the clamp.  That should let me push the background further into the distance without changing the other settings.
     
  The setting that surprised me the most was interpupillaryDistance.  Once I'd got a decent impression of depth going on and the objects were appearing at the right size, it still felt like they were lacking 'weight' somehow.  Reducing the interpupillary distance from 7 to 5 fixed this really effectively.  Suddenly the cars felt as big as real cars.

These three stereo parameters - field of view, convergence and interpupillary distance - balancing them properly makes all the difference.  It's the difference between "yeah, that's
kinda 3D" (the worst feedback a VR project could ever receive) and "it feels like I'm actually there".
     
  Couldn't manage to network the two PCs using this broadband router.  Neither of them seems to be able to talk to it using USB.
TODO: GET A ROUTER!
     
  I managed to get TrackIR working on the new PC, but for some reason the game isn't finding the camera.  I did remember to copy the 'OptiTrack' folder into the 'NaturalPoint' folder.
Remote debugging might give me more information.  I hope it's fixable and not some kind of limitation with the OptiTrack SDK?
     
  TODO: need to try keeping the two eyes in sync (only updating once per two eyes); they lag apart on v14.  Or have I already changed that now?      
5-Feb-2008   2.41667    
  Hah!  I just got a crash because the 'O' in my character table was actually a zero! D'oh      
  below: got the fish-eye and subtle diffusion working for the titles.  There's a slow, just-noticeable bulging motion of the title text, as if it's breathing.  I'll probably do something similar for the tree itself; it's a good way of making the thing seem 'organic'.      
 
 
     
  The next layer is some glossy reflections, which should make it feel really solid and tie it into the environment.      
  But first I'm going to set up Vista 32 on the new PC...      
4-Feb-2008   4.5    
  Added MenuTitle.fx - Effect for menu title text.  WIll be closely related to MenuItem.fx      
  below: more soft-lighty goodness.  Pretty-much got these menu titles working now; just haven't quite nailed the fish-eye distortion.
Need to fix the glows as well; currently they get a bit chopped at the edges (faint vertical lines in picture below).
     
 
 
     
  Google: I've set France as the 'geographic target' for programmerart.org and lecauchemar.com.  I'll be interested to see if this brings in any more French hits.  The hit rate for the site is rubbish at the moment.  Why is no-one visiting my site?!      
3-Feb-2008   7.5    
  CLockableTexture can now be given a callback and context to be used at the end of OnResetDevice.
CFont instances use this to measure their characters, when option debug\processFonts is true.
     
  Added file FontCharacterData.hpp - contains the array of character data #included into Font.cpp (I'm currently only supporting one font, but that's easy to change later if I need to).
This is auto-generated by CFont::MeasureCharacters when option
debug\processFonts is true.
     
  Font blur: Gaussian, 30 pixels (for 1024 font image) .... I think      
  Photoshop blend mode formulae:
http://www.simpelfilter.de/en/grundlagen/mixmods.html
     
  TODO?: rain bounce mist effect by blending the blurred scene onto all the transitions between top surfaces and farther-away not-top surfaces?      
  below: Got all the font stuff working well.  This is built from the ground up, not using any D3DX stuff.  The blend mode is a cut-price forgery of Photoshop's 'Soft Light' blend, performed by MenuItem.fx's pixel shader.  C'est joli hein?
I'm following the mockup pretty-much to the letter, and it's paying off.
     
 
 
     
  TODO: Menu titles <-done (5th)
and selection effect.
     
2-Feb-2008   9.16667    
  Added an error dialogue to handle unplugging of the 3DVisor while the game is running:
MESSAGE_3DVisorError_removed
TODO: need to zero the headtrack transform if the player chooses to continue without headtracking.
TODO: looks like I need to do some 3DVisor re-initialisation if the player chooses to retry.
     
  Excel: ctrl+` to show all forumulae 'raw' rather than evaluated (discovered this by accident because it's my Visual Studio 'find in files' shortcut)      
  Added functions:
Vec2Zero
Vec2InitMinBound (initialise a minimum-bounds vector to high positive values)
Vec2InitMaxBound (initialise a maximum-bounds vector to low negative values)
     
  Added options:
debug\processFonts - (TODO) measure the characters on the font texture(s) and save out the measurements<-DONE(3rd)
debug\processMeshes - (TODO) optimise all meshes and save out the optimised versions (this will reduce the game's startup time enormously - currently it optimises the meshes each time it starts)
     
  TODO?: D3DXCreateTextureFromResource ??      
#revision 933 Spent a long time extending CLockableTexture so that it can load itself from a texture file (this is so I can lock the font map to measure the characters, when option debug\processFonts is true).
Had a lot of ordering & resource-handling hassles to get my head round, most of which were caused by the complete deletion & reconstruction of the pause menu tree each time the pause mode is entered (intentional, debug only, for ease of testing).
But it's working now, at last :)
     
  TODO: Measure the characters<-DONE(3rd)      
1-Feb-2008      
  below: a petition to free our friend from a horrible situation in Dubai; you might be able to help him by signing it:      
  http://www.petitiononline.com/cle2008/petition.html      
  more info:      
  http://thetruthaboutdubai.com/      
1-Feb-2008   2.83333    
  Made a decent chunk of progress with the font & menu stuff.  I'm on the brink of seeing some letters on the screen now :)
Added MenuItem.fx (effect for CMenuItem text)
     
  Remembered there is no D3DPT_QUADLIST >:(      
30-Jan-2008   3.5    
  Improved the font texture loads.  It's now square as well.  The glow seems to fit ok; will need to wait & see if it's wide enough for what I want (although I'm not likely to want to change the layout now!)      
  Added CFont, which takes care of calculating basic positions and UVs for text verts (CFont::PlotText).
It owns the character table and each CFont instance owns a texture.  In practice there will only ever be one font instance, but I'll write it as if there could be any number of them.
     
  CFont: Decided that I probably don't want to get into the business of automatic line-wrapping, and I shouldn't need to.      
27-Jan-2008   5    
  The online devlog is now the complete devlog from day 1.  This is mostly to try to draw more hits in.
Internet Explorer seems to deal pretty well with huge pages, eg. doesn't try to download pictures until you scroll to them.
     
  Tried using the GDI function 'GetGlyphIndices'.  Supposedly I would just have to include <windows.h>, but this didn't help; the call still didn't compile.  Not sure what I'm doing wrong there.      
  Tried using Photoshop's File\Automate\Web photo gallery option (after running the action called Select Workspace "Web Design")
Output here: C:\Noctambule\Website\gallery
I'll try a different template next time.
     
  Note: ImageReady lets you save out SWF files.  I don't know how to make them animate, link or any of that stuff though.      
  Installer: Discovered the right way to ship fonts for the game: just set the font file's 'register' property to 'vsdrfFont'.
When you install the game, it magically installs the font! :)
And it uninstalls the font when you uninstall the game (but presumably not if it's marked 'permanent').
     
  15*8 = 120      
  8*16=128      
  Diacritiques utilisés en français :
http://fr.wikipedia.org/wiki/Diacritiques_utilis%C3%A9s_en_fran%C3%A7ais
     
  Eventually went off the idea of using D3DX font stuff.  It was *almost* helpful, but not quite.  I got the feeling that it was going to make things more complicated than they needed to be, and less flexible.      
  Built-up the font map PSD (C:\noctambule\Graphics\Fonts\Menu\font.psd).  It took a while but it's looking sturdy now.  I'm leaving plenty of room round the characters so I can have a blurred (glow) version that uses the same coordinates.
See corresponding string array currently at the top of menu.cpp
     
26-Jan-2008   10.25    
  Added file pairs for the menu system (most of them are stubs at the moment) :
PauseMenuTree - subclass of CMenuTree for the pause menu tree
Menu - a menu, a node in a menu tree
MenuItem - base class for all menu item types (below)
MILink - item that navigates to another menu
MIConfirm - eg. for the 'quit' option; pops up a confirmation dialogue.  Might use this for the undo options too.
MICheck - checkbox, for Booleans.  This'll be the most-used menu item type.
MISpinner - for int and float values
MISlider - eg. will be used for 0..1 type values
MIRenderTarget - render target dimensions (and in some cases, format)
MICombo - for enum values.  Slightly slangy use of the Windows term 'combo', since there's no 'edit box' element to it.
     
  Note the absence of a basic 'text box' base class, and of any mention of 'boxes' in the naming.  No boxes here.
All menu item types have a string index property, because they'll all display at least one string.
     
  Added ESTRING_none for uninitialised strings.      
  Strings: started using these naming conventions for menu strings in the string table:
(ESTRING_)menuName_title - the menu title string
(ESTRING_)menuName_optionName - the option's label string
(ESTRING_)menuName_optionName_confirm
- the confirmation message for an MIConfirm item
     
#revision 913 StringTableParser: fixed a parsing bug that was stopping some entries getting written out.      
#revision 914 ...and another one.      
  C++: Weird - it seems that a constructor can't directly call a pure virtual method of its class (doesn't link), but it CAN call such a method via another (non-pure-virtual) method.

eg. CMenuTree::CMenuTree can't call CMenuTree::Populate,
but it can call CMenuTree::Init, which calls CMenuTree::Populate
<-no, that gives a runtime 'pure virtual function call' error.
I'm now calling CMenuTree::Init from CPauseMenuTree constructor instead; this works fine.
     
  Note: CLinkedList is not circular.
Added CLinkedList::DeleteAllElements.
     
#revision 916 Made some fixes to CLinkedList.  Spent a while getting frustrated at some memory trampling problems I was getting with it.  Fixed now.      
#revision 917 I fell-out with CLinkedList/CLinkedListItem and have now deleted them (they still exist in SVN history).

I've replaced them with a slimmer, wiser CListItem base class, which is nice and minimal (ListItem.h)
     
  C++: It's a shame you can't pass parameters to destructors:
error C2524: a destructor must have a 'void' parameter list
     
#revision 919 Another stringtable parsing fix (all the French text was coming out English)      
  Started finding out about D3DX's font stuff.  Looks useful.
'Text3D' sample:
C:\Documents and Settings\user\My Documents\Visual Studio Projects\Text3D
     
  Some info about optimised anaglyphs:
www.3dtv.at/Knowhow/AnaglyphComparison_en.aspx
     
25-Jan-2008   0    
  C's leaving doo (another one off to France!)      
  EB recommended Monpellier again.  I'll very likely visit there this year.      
  NC says the game wasn't running too well on an 8600.      
24-Jan-2008   3.25    
  CModeHeadTrackOffset, when added to the mode stack, now makes the hardware-specific profile 'currently-editing'.  This'll save the player a load of confusion.  Returns to the previous profile when removed from the stack.
This means the player can never graphically edit headOffsetMatrix in the Custom profile (by design).
     
  below: Got an accidental 3rd-person mode, by setting a large head position offset when in 3DVisor mode.  This created a head-tracked pivot cam, which is really quite nice to use!  So I'm tempted to add a mode like this:      
  http://www.youtube.com/profile_video_blog?sid=C4FFF779482D5F6C&id=B109960914F9AABD      
  Same video at full quality (24 MB wmv) :      
  http://lecauchemar.com/videos/thirdperson.wmv      
  Didn't really get any work done this evening.  Preparing and uploading a video takes hours :(  And it leaves me in a distracted mood so I can't get any coding done afterwards.      
  On the up-side, I know how to use Windows Movie Maker now ("ga-ga!"), and I know its output works with YouTube.
I used the Video for local playback (2.1 Mbps) setting.
     
23-Jan-2008   2    
  New PC: Just needed to send some power to the CPU.  Now working fine :)
Just waiting for Vista to arrive now.
     
  Added function CModeStack::InsertAbove      
  CGameMode now inherits from CNameUser      
  CModeStack: fixed the ordering within the various add & remove methods so that the mode is fully added/removed before OnAddedToStack/OnRemovedFromStack is called.  This makes it safe for modes to add/remove child modes when they're added/removed.      
  Added function CNoctambuleApp::SetPauseMode      
22-Jan-2008   0    
  Built the new PC with tons of help from M.  At the end of the night it powered-up but didn't do anything.  I assumed I'd broken the CPU or the motherboard.      
21-Jan-2008   0    
  Started trying to build the new PC.  Used the wrong screws when trying to fit the motherboard (misled by some instructions).
Need pliers to continue.  Can't find pliers.
TODO: find pliers.
     
20-Jan-2008   10.5    
  Increased CNoctambuleApp::s_generalTemporaryBufferSize from 2K to 16K.
CNoctambuleApp::(g_game.)generalTemporaryBuffer is used to buffer the file contents in COptions::Save.
It's also used by CBlockFileParser and CRainFalling.

(These were previously called MAIN_TEMPORARY_BUFFER_BYTES and g_temporaryBuffer)
     
#revision 901 COptions::Save now saves out every option correctly.      
  Moved: COptions::ReadRenderTargetOptions
is now
CRenderTargetOptions::ReadFromFileString
     
  CBlockParser: All the 'Read...' methods are now static.  The likes of CRenderTargetOptions uses these functions; I'm happier to expose them than to force classes to inherit from CBlockParser just to get at them (which could be confusing if their job isn't to parse blocks).
Fittingly, all these methods were already marked as const-this anyway.
     
  CBlockParser::ReadVec3/Vec2/Matrix now take pointers instead of references - more consistent with the rest of the code and therefore less likely to cause mistakes.      
  I reckon this music track would be brilliant for the replay mode:
The suitably-titled "Zombie Overlords" by DeathBoy:
http://deathboy.anti-goth.com/ToRights/zombie%20overlords%20-%20DeathBoy.mp3
It fits well because it's dark, techy, intense, glitchy and ominous-sounding.
TODO: choreograph the camerawork/cuts to tie-in the with whatever track I end up using.
     
  Options: rather than having ok/cancel options, I'll add a button to revert to (re-load) the last saved options.  This'll need to reset the override flags as well.
This option should be called something like "Undo last changes"
Saving will be automatic on exiting the pause mode.

A separate option for "Restore defaults" will be provided (empties the currently-editing profile, clears its override flags, re-loads the profiles).
     
  Undo: If changes have been made in the current pause session, the undo option above needs to change to 'undo current changes' (reload all current files - doesn't require a backup).
After undoing current changes, it should change back to 'undo last changes' (copy from backup instance)
     
  More undo: Each menu needs its own local 'undo' and 'defaults' option as well.      
  For the partial profiles, I'll need to put a choice in the (probably main) menu for whether we're editing the Custom, OptiTrack or 3DVisor options (defaulting to Custom).
In debug builds, maybe include the option to edit the 'Default' profile as well.

This setting will simply control which override flags gets set when editing any options.  It should probably spring back to Custom each time you enter the pause mode, to save confusion.
     
  Partial profiles: need some visual indication of which options are overridden in the current profile, and a way of un-overriding them (right-click?)
The override/unoverride option should toggle the value between its unoverridden* value and its last overridden value (if any) from the current pause session.

*not necessarily
default
     
  Added a Profiles\AutoBackups folder which will allow the 'Undo last changes' option to work (game-generated copies of the previous versions of the custom profiles will be kept here)<-changed the undo system to work without backup files now      
  Installer: Added AutoBackups folder (ships empty)<-removed now; not using files for the undo system.
Renamed 'Optitrack' folder to 'OptiTrack' - shouldn't cause any disruption
     
  I've got a slight mix of enumeration styles in the game.  Nearly all of them are old-style (as specified in my coding conventions doc) :
like "ETHREADPRIORITY_LOWEST"
but three of them are EB-influenced and make use of scope (including one I added just now) :
like "COptions::EEditableProfile::custom"

Either style could technically be used in the options profiles, but for that case I'll definitely stick to the old style for consistency.

For the rest of the code.....well the scoped ones make the other ones look bad.  Scoped ones are better I'd say; non-scoped ones are more popular/common; it's good to show consistency; it can also be good to show flexibility.  There doesn't seem to be an ideal solution without knowing the style preferences of the target audience.
I'll just carry on using a mixture.  However, I won't wrap any enums in their own little struct/class unless I actually have a need to.<-(see below)
Updated the coding conventions doc accordingly.  See also: log entry on 2nd of March 2007.
     
  Hmm, now I see the reason for wrapping those enums in their own little structs - it's because the enumerator doesn't create proper scope for its contents the way a struct does.
ie. Two enums in the same scope can't have the same member names.
     
#revision 906 Cool, the partial profiles loading & saving is now working properly (saving a profile only writes-out the values that the profile overrides).
TODO: stop it writing out empty category blocks<-done
     
  Added functions:
COptions::Load
COptions::FlagOptionOverride
     
#revision 908 CModeHeadTrackOffset (headtrack calibration mode) now detects the player's changes and flags the relevant option as being overridden, causing the new values to write to the currently-editable profile when pause mode is exited :D
Where did I put that biscuit tin?
     
  Well that's actually all the options stuff done for now - a weekend well spent.  This leaves me totally ready to start putting the menu system in place, made all the more satisfying by being able to hook into a *working* options system right from the start :)      
19-Jan-2008   8.75    
  NOTE: strncpy_s appends a null terminator, in addition to copying the requested number of characters.      
#revision 899 I've renamed my #included CPP files to be HPP files instead.  HPP seems to be the most correct extension for the job, according to the description below, and it saves me having to exclude them manually from the build when they're added to the project.
- OptionDescriptions.hpp
- StringsFrançais.hpp
- StringsEnglish.hpp
Updated the tools accordingly
     
  HPP: "Header file that may contain variables, constants, functions, and other code referenced by a C++Builder [etc.] source code file; allows common functions to be referenced by multiple files..."      
  Weird, I was sure there was a 'strcatf' ?      
  NOTE: the option description system doesn't allow for private members in the option category structs.  Not ideal, but I only had one of them anyway.      
#revision 900 Spent today writing the OptionsParser tool, which is working well.  COptions::Save now does just that :)      
  Non-loaded members of option category structs use the NON_LOADED symbol after their type, which is a signal to OptionsParser to skip to the next member.      
18-Jan-2008   2.8    
  PC is scheduled to arrive on Monday.      
  Nailed-down the workings of the "option descriptions" system from last night, using a compiling mockup of the auto-generated code.  This looks like it's going to work well.
NOTE there is still no automation for menu population, association of menu items with options, etc.  I don't want to automate any of that, never did.
     
  I've designed-in some support for editing of partial profiles.  SOptionDescription::flags is used to indicate which profiles override their inherited value for the option (the relevant profiles being Custom, 3DVisor, OptiTrack).      
  Added function COptions::Save, which takes a filename and a filter for the flags described above.      
  Added file OptionDescriptions.cpp which will be auto-generated by the 'OptionsParser' tool.      
  TODO: OptionsParser tool!<-DONE(19th)      
17-Jan-2008   4.25    
#revision 881 Yeah, no point doing anything with OptiTrack at the moment - I'll wait till the new PC's put together, and see how that copes with it.
Till then, since I've made a bit of a mess and broken a couple of things, I'm reverting COptiTrack.cpp&h to revision 876.
     
  Added website\final\code to SVN.      
  OptiTrack: The weird startup lerp was caused by a faulty matrix copy (like *destMat = *srcMat where neither is a pointer, so it was only copying the first float).
That's a relief - I'd imagined it was some kind of sinister, thread-related hoy.
     
  CModeHeadTrackOffset: Made this much more usable by changing the transform control to be in head space rather than TrackClip/headset space.      
  Added functions:
MatrixGetTranslation
MatrixToEuler
     
  Removed options:
headTracking\headOffsetX
headTracking\headOffsetY
headTracking\headOffsetZ
headTracking\headOffsetYawRadians
headTracking\headOffsetPitchRadians
headTracking\headOffsetRollRadians
     
  Added option headTracking\headOffsetMatrix      
  OPTIONS:
I need to do a bit of an overhaul in order to make the options nicely saveable.
I could do this using fancy C++, wrapping each type in a class so I'd have like COptionsFloat with a float() operator and so on.
Instead I'm thinking of writing a little tool that parses Options.h and for each category builds up a CRC-sorted table of names, CRCs, types, (strings&counts) and member pointers.  And the same kind of thing for the categories themselves. 
Something like the following (but obviously made to compile) :

const SOptionCategoryDescription COptions::s_optionCategories[EOPTIONCATEGORY_NUM] = {

{"WOWvx", 0x18322693, 7};// name, crc, numOptions
 
...};

const SOptionDescription COptions::s_optionDescriptions[COptions::s_optionCategories.numOptions] = {

{"nearDist", 0x34782562, EOPTIONTYPE_FLOAT, &g_game::s_staticOptions.WOWvx.nearDist, NULL, 0},

{"contentType", 0x24978523, EOPTIONTYPE_ENUM, &g_game::s_staticOptions.WOWvx.contentType,
COptions::s_WOWvxContentTypeNames, EWOWVXCONTENTTYPE_NUM},

...}

<-done, see OptionDescriptions.cpp
     
16-Jan-2008   4    
  OptiTrack thread:
- had to raise the priority to above-normal to get it to move at all in fullscreen.
- when windowed and paused, it's reasonably smooth.<-when windowed & running and set to THREAD_PRIORITY_TIME_CRITICAL, it's very good
- when
running and/or fullscreen, it's jerky.
     
  Tried running the TrackIR heads in the background while the game was running in a ~1280*1024 window:
- it's jerky just like my in-game tracker thread
- when its priority is set to 'realtime', it copes better and uses as much as 20% CPU
     
  I might leave this stuff till I can test it on the new PC.  I feel like I'm wasting my time at the moment.
I've tried everything I can think of; it's as if there isn't enough CPU speed for the image processing to happen fast enough - which maybe suggests that it's not done in the camera hardware itself like I'd imagined?  Not sure.
     
15-Jan-2008   3.5    
  Added option debug\disableEnemies (replaces a macro called ZOMBIEMANAGER_NOTHENOO ;)
I'm trying to keep all the 'debug' properties named so that their defaults are false (hence 'disableEnemies=false' rather than 'enemies=true')
     
  Remembered that the fallback shadow image is generated on a small ORT, so the zbuffer can't be used when generating it.      
  If I definitely only want fallback shadows on the ground (or shall we say, the 'reflective mesh'....) then FallbackShadowReflectionPosition.fx can be merged into FallbackShadow.fx, and the fallback shadow image can be generated by rendering the reflective receiver mesh with this combined effect.
<-nah, that would mean drawing the receiver mesh for each light.  It's good that currently the receiver only has to be drawn once (RT covering quads from there on) to generate the images for all the lights.
     
  Got the fallback shadows working properly.      
  FallbackShadowReflectionPosition.fx: removed the constant 'cMainViewDir'
The depth occlusion now works by comparing VP-relative squared scene
distance with squared view-space receiver Z position.  (NOTE the slight mismatch; if it causes any visible problem then I'll fix it - so far it looks fine).
     
  FallbackShadowReflectionPosition.fx: removed the constant 'cFallbackShadowsOnGroundOnly' (now always true).
Using fallback shadows on meshes other than the intended receiver produces glitchy, unreliable results (works well in some cases, certainly, but that's not good enough).
     
#revision 875 Removed option shadows\fallbackShadowsOnGroundOnly (now always true)      
  TODO: option for ground (kerbs) to reflect in ground (backface culling should help a lot here)
This will also produce kerb fallback shadows, which will be nice.
     
#revision 876 Realised I could rename StringsFrancais.cpp to StringsFrançais.cpp, and did so (purely to be awkward), using SVN rename.
Updated the StringTableParser tool accordingly.
     
  Threads: found that without the Sleep(0) sub-loop in each of the thread procedure loops, Windows locks up.      
  TODO: finish converting COptiTrack to use a thread to read the camera.      
14-Jan-2008   4    
  Trying to track down this weird reflection / fallback shadow glitch:
- rainOcclusion = false: doesn't change it
- numProjectors = 0: doesn't change it
- remming-out the fallback shadow drawprim doesn't change it
- ERENDERTARGET_FALLBACK_SHADOW looks fine
- ERENDERTARGET_REFLECTEDDEFERREDLIGHTING_DIFFUSE looks fine
- remming-out the CRainImpact drawprim doesn't change it
- writing height=(1 or 0) from parallax.fx doesn't change it
- writing height=(1 or 0) from ground.fx doesn't change it
- writing gloss=(1 or 0) from parallax.fx doesn't change it
     
  ...ERENDERTARGET_REFLECTION_FINAL      
#revision 870 Fixed most of the problem I was seeing (corruption / shadow after-images in the ground reflection image).
DeferredLighting.fx was reading shadow samplers even for the reflected draw (in which case they were just whichever textures were last used on those two stages).
I've now added uniform parameters to toggle shadow work and to toggle the 'diffuse shadow' behaviour (fallback shadows set this false to only shadow specular lighting).
This fix should be a fairly hefty savings too :)
     
  Fallback shadow masking is still misbehaving (and always has been).  That's why specular has been missing on walls etc (showing up only occasionally, with faulty masking corresponding to the ground behind the building).

- FallbackShadow.fx has a bit of code to prevent shadows when the light is behind the viewpoint.  It seemed to be causing far more glitches than it prevented, so for now I've remmed it out. 
TODO: test properly once the other glitches are fixed.
- When the ground mesh is drawn into the fallback shadow 'reflection position' image, the landscape seems to have already been cleared out of the zbuffer.  The landscape absolutely
must be in the zbuffer at that point in order for the masking to work.  TODO: reorder stuff so that this is the case.
- clearing ERENDERTARGET_FALLBACKSHADOWREFLECTIONPOSITION to a specific value and then testing for that value just doesn't seem to work.  There's must be some catch I don't know about, probably specific to floating-point render targets.
     
#revision 871 Right, I've got something partly working now (still got the sorting problems), by using 0.f as the 'no shadow' value (tested-for in FallbackShadow.fx).  TODO: investigate/improve, etc.
See CLandscape::GenerateFallbackShadowReflectionPositionImage.
     
13-Jan-2008   0    
  Spent today catching up with work-work.      
  VirtualDub: a good setting seems to be Indeo 5.10, 50% quality, force keyframe every frame (30fps).
Below: dancing head video with those settings, youtube-ified.  Also synced the music which was 1 beat behind :
     
  http://youtube.com/profile_video_blog?sid=C4FFF779482D5F6C&id=00E8D93EFCDE138E      
12-Jan-2008   13.5    
  The crazy background thing last night was caused by an uninitialised W column in CHeadTracker::vsHeadTransform.      
  Added adaptive smoothing for TrackIR - works a treat; filters off all the jittering.
Removed option headTracking\smoothing
Added option OptiTrack\smoothingRange (the total object pixel distance above which the lerp T is 1)
     
  Added a little unit test for the COptiTrack's vector tracking (generates artificial objects to track) - COptiTrack::SpoofObjects.  I really should have done this to begin with - it took about 10 minutes and it's helping the debugging enormously.
By generating artificial objects, I'm removing the following sources of inaccuracy:
- IR camera FOV measurements
- TrackClip light position measurements
- IR camera resolution
     
  Using the artificial objects, the tracking (especially looking at depth results) is bang-on except when the clip is at certain 'ambiguous' angles, then it shakes briefly same as usual.  This is reassuring - it narrows down [most of] the problem to COptiTrack::InterpretObjects.  In fact, the jitter will almost certainly be coming from the ray-plane intersection in GetDistanceFromRayToRing.  I would love to know how a mathematician would solve all this.....      
  Tried using a different implementation of IntersectRaySphere (from t'Internet again).  Currently sitting alongside it and named 'IntersectRaySphere2'.  Compared the difference in return value (inside COptiTrack::TestZPosition); it never exceeded 0.001f.
Both versions gave the occasional jitter described above.
     
  TrackIR 4 camera res: 355*290
355/290 = 1.2241379310344827586206896551724
     
#revision 869 Wow...just been playing with virtual-window headtracking + full-strength anaglyph + placeholder weather sounds.
It's a spicy combo!
     
  TODO: maybe add an anaglyph-friendly (drier) version of the lighting?  Specular highlights on the ground seem to be the main things making the anaglyph really ugly at the moment.      
  Did another bout of testing & calibration for TrackIR.....
- I'm now using the officially quoted horizontal FOV of 46 degrees, *exactly*.
- The aspect ratio that works in conjunction with that FOV give the correct distances for the clip is exactly 6:5 (1.2:1), so that's what I'm now using.
It's possible that instead, I should be using the aspect ratio of the camera res, adjusting the fov to fit accordingly.  Who knows.  It seems to be working well anyway.
     
  TODO: a fix is needed in the VW headtracking: I'm not convinced the camera correctly moves closer to objects as the head moves forward; investigate!      
  Parallax.fx: made the top sides and undersides of objects automatically wetter      
  TODO: fix whatever that glitchy fallback shadow / reflection thing is!!<-FIXED(14th)      
11-Jan-2008   4.5    
  TODO: really should try a rainbow ramp texture for the volume lighting.      
  Added option OptiTrack\cameraMountedOnMonitor (defaults true)
This indicates that the OptiTrack camera is on the real-world screen plane.
When this is true and a camera is active, realWorld\distanceToScreen is ignored and the head depth percieved by the camera is used instead.
     
  Noticed that alt-entering while paused leaves the rain (and presumably bloom?) over-bright (alt-entering again while not paused fixes it).
Could this be a clue to the over-brightness bug on nVidia cards???
     
  Had another look at the TrackIR control panel app.  Their head-tracking results are extremely solid and precise compared to mine.
One of the reasons why it's so good seems to be the clever smoothing that they're using - the interpolation rate seems to be weighted by the delta between the current and destination transforms/dots.  In this way, pixel-level jittering is completely hidden, while large (genuine, intentional) movements feel perfectly responsive.
     
  Added a disclaimer in the release notes, and in the public headtracking source, saying that my TrackIR support is a bit naff.      
  Added function Vec2Distance      
  Got the virtual-window fov working; currently just sorting out some smoothing stuff.      
#revision 864 Below: an uninitialised matrix or something started causing this crazy random flickering background.  So I made an impromptu music video - enjoy!      
  http://youtube.com/profile_video_blog?sid=C4FFF779482D5F6C&id=00E8D93EFCDE138E      
10-Jan-2008   0    
  Got the phone line fixed.
Been ill the past two days, really weak and tired (and no doubt will be tomorrow as well)
     
  Below: ordered a nice new PC to cheer me up.  ETA: 15th January  ETA for French Vista: 24th-28th January.      
  file://C:\correspondence\newPC      
9-Jan-2008   3    
  Little detour this evening - I'm going to add the 'virtual window' head-tracking mode, having seen a video of it looking very effective using a Wii-mote.
When using OptiTrack, this mode shouldn't suffer so badly from the accuracy problems I'd get normally, because it's only the head's position that we care about, not its orientation.
     
  Removed CCamera::ApplyProjection.  This work is now done in CViewInfo::ApplyCamera.      
  TODO: fix crash;<-working now(11th)
finish virtual-window fov update<-done(11th)
     
8-Jan-2008   4    
  FIXME!!! HDR\finalMultiplier breaks the brightness of the rain and the other effects using the bloom image.      
  Now writing HEIGHTMAP values to position.a (MRT[1].a)      
  DeferredLighting.fx: Added heightmap-based fake self-shadowing for diffuse.  Works lovely.      
#revision 860 DeferredLighting.fx: Tried doing something similar for specular.  Decided it wasn't worth it (it worked, but in practice you hardly get to see it), and it damaged the glinting of the rain impacts too.
DeferredLighting.fx is highly speed-critical.
     
  DeferredLighting.fx: Ambient is now affected by height.  Works lovely.      
  Ground.fx: Reflection strength is now increased at areas where the reflected object is very close to the ground.  This makes ground-to-landscape joins look more natural.      
#revision 861 Very pleased with all the improvements to the lighting model.
The POM is looking mighty chunky now, even on the ground :)
     
7-Jan-2008   3.75    
  Improvements to texture levels (road, kerbstones, brick) and Ground.fx.
Ground.fx now has nice Fresnel-esque stuff
     
  IMPORTANT: Keep colour grading turned OFF while tweaking texture levels!!      
  TODO: finish fixing Ground.fx (see #errors - to do with reflection position)<-FIXED(8th)      
  TODO: really need to streamline the texture tweaking process.  Maybe use that procedural T-pages idea (model them in Max and make the game assemble them) ?      
  TODO: decide what to do about kerb decals (overhang)      
6-Jan-2008   11.3333    
  Colour grading (HDR\curve) is now forced OFF in anaglyph modes.  This is because:
- grading increases contrast; contrast is bad for anaglyph
- grading affects colour balance, which wants to be kept flat for anaglyph
- grading is expensive; anaglyph is expensive enough already
- grading was causing a rain colour mismatch in anaglyph modes
     
  NOTE: bloom source image is too banded to be of much use on its own      
  3DVisor: roll drift seems worse than I remember it, hmm.  I'm not getting any yaw or pitch drift though.
Lack of yaw drift would seem to suggest that the problem isn't magnetic.
     
  Added option motionBlur\secondaryBlur (defaults true / false for 3DVisor).
This blends the scene towards the bloom image according to each pixel's speed (done in HDRLighting.fx).
This hides the gaps in the motion blur that appear when turning sharply.
When using an HMD, the benefit of this option is negligable and it should not be used.
     
  Added option screenEffects\edgeBlur (defaults true / false for 3DVisor).
This blends the scene towards the bloom image at the edges of the screen.
     
#revision 847 Getting an instant-restart crash whenever I try to draw to MRT[3] when drawing the menu.
- tried setting the MRT[3] target on MRT[1]; that works fine
- tried a different target as MRT[3]; still crashes
Moving the menu draw to inside CPatchwork::Render prevented the problem (see revision)
     
  Found that the menus will need to draw after the bloom image is created, otherwise they feed back and become opaque.
Drawing them after the bloom image is created means they can't have any motion blur or deferred lighting.
Motion blur on the menus was really nice while it lasted, but you can't have everything.
     
#revision 851 Started playing about with texture brightness levels, starting with the road surface - which now looks about the way it should (inky black with a just a scattering of grey speckles).
TODO: Ground.fx / DeferredLightingApply.fx: texture colour has to get even darker in the distance (shallower angles) - so that road paint appears to blend in with the tarmac.<-DONE(7th)
     
5-Jan-2008   10.8333    
  RenderSubset: NEW TEST: now only generates rain lighting for the first of the two eyes.<-no dedicated rain lighting image now, see below
TODO: VR mode: need to improve eye swapping method so that the ordering is never wrong (swap using a signal to the headset).
     
  Renamed CMist::Generate -> CMist::Prep because nowadays it doesn't do any rendering, just prep (it's rendered as part of DeferredLightingApply.fx)      
#revision 833 Moved pRainFalling->GenerateLighting to be done straight after CHDR::EndScene (instead of right before the rain render).
The lighting image no longer lags behind by 1 frame when used on the MenuTree.
<-see below
     
  CGameMode::flags is now public      
#revision 835 Made important changes to falling rain:
- Did-away with rain lighting image.  Rain now refracts the HDR bloom image (which I've set-up to be an unbiased blurred version of the scene).
- HDR bloom and glare are now drawn in a separate pass after falling rain has drawn.
- Falling rain now performs its own colour grading to match the scene's colour grading (unfortunately I don't see another way of matching the colours)
     
  The limitation of the above is that the values of BRIGHT_PASS_THRESHOLD and BRIGHT_PASS_OFFSET (HDRLighting.fx) can never change.
The result is a slightly different style of bloom / glare, the kind of soft-focus look that was used in Fable.
Luckily for me, this suits both the misty environment and the dream setting.  The glares are going to be designed properly at a later point....
     
  Added options:
HDR \ bloomStrength
HDR \ glareStrength
     
  A slight problem with the new rain lighting is that it turns black at the very edges of the screen.      
  TOFIX: Noticed that rain moves with the player / viewpoint      
  3DVisor: Tried using the independent left/right RGB gain settings to create a perfectly ghost-free anaglyph mode.  Unfortunately the ranges of these settings don't allow complete filtering of colour channels.  However they should be sufficient to work as ghost reduction for a player wearing anaglyph glasses under the 3DVisor.  I might well give that a try at some point, crazy as it sounds.      
  TODO: get rain working in anaglyph mode<-done(6th)      
  Passed the 2000 hour mark.  I don't know if that's good or bad.      
4-Jan-2008   2.83333    
  Quadro: 14.0 didn't have the missing patchwork decals, and really didn't seem to have the over-keen bright pass either.  Tried fixed & floating-point lighting; both worked perfectly.  Rain seemed to go slightly odd-coloured when I brought the window size up to 800*600.      
  TOFIX?: Are rain impact splashes double-bright on 8800??  Would that make sense, with the brightness bodge?      
  I'm going to ignore the missing patchwork bug till I can get hold of an 8800/Vista to test on.  No idea what's going on there.      
  Control improvements (eg. for VR mode) will be left till version 15 I think.      
  Maintenant : MENUS      
  Mocked-up a more packed menu (weather/rain):      
  file://C:\noctambule\mockups\menus\blueRainRough.psd      
  Had a think about how to construct the menu tree.  Decided to make each blob a triangle fan, so that joining the branches to them will be fairly easy.  The glow/feather round the edges will all be done with textures.  I'll create the impression of 3D shape using normal maps.

I decided I didn't want to go down the route of rendering the tree as an offscreen mask and blurring it to get the feathered edges - too expensive and any lumpiness in the edges due to limited res would ruin it.

Considered building it as a fully-3D model in Max.  I'm fairly sure I'd be able to do this, with a bit of experimentation, but decided not to for a few reasons.  The 3D shape doesn't need to be deadly accurate anyway (as proven by the fact that the mockups looked fairly convincing).
     
  MENUS: tree shape squidging should all be done in the shaders (with the blob verts themselves kept in vertex buffers that change as little as possible).  I suppose it'll need to be in the VS so that branches stay connected.      
  Added MenuTree.cpp & .h containing the menu tree class and (temporarily) the classes for the menus and menu items.      
  I'm using the prefix CMI for menu item classes, eg. CMICheckbox.  I expect I should really be using namespaces or something instead....
Updated the coding conventions doc.
     
  CMIRenderTarget: TODO: (ideas at least)
- works like a spinner but has two drag zones, one for each dimension
- RMB changes the units of the dimension under the cursor (see mockup)
- label flashes / pulses when the control is edited; clicking on the label applies the change and puts the label back to normal.
- maybe menu tree fades out while the values are being edited (to give a clearer view of how things are looking) ?
- for the benefit of total-VR mode, spinners need to be mouse wheel compatible (and there should NEVER be any need to use the keyboard - although the ability to type values in would be a nice bonus if it's easy to do)
     
3-Jan-2008   0    
  Got M's recommendations for a new PC.      
2-Jan-2008   1.75    
  A couple of things I noticed in v14 on 8800 (on Vista) :
1. some ground patchwork decals appear to be sorted wrongly.  (BC car park & pavement, east manhole cover, John St. north yellow lines & kerbstones are all missing)
2. The brightness bodge that I added for nVidia cards works as intended, but the bright pass contains more stuff on 8800 than it does on mine (which makes sense, because the adjustment is in the 'finalMultiplier' which is done after everything else).
     
  The most important thing for me was that v14's VR mode worked fine on Vista, with stereo and headtracking.      
  Tested on a 16:10 monitor (setting aspect ratio in the profiles accordingly), all worked fine.      
  Can't think what the reason would be for problem 1 above.  Tried forcing zwrite & ztest off when drawing all meshes, they still came out fine on mine.  Tried removing the qsorts and they still appeared ok (because there isn't much overlapping yet).
Tried reversing the draw order (first in the draw loop, then in CMeshFrame::QSortCallback_VerticalDepth), to check that this gave the result I expected.
Maybe it's not a problem with the sorting but with the culling.  TODO?: Maybe test a v14 exe with no patchwork culling?
     
  TODO: option to use the current desktop res in fullscreen      
20-Dec-2007   5.66667    
  CBlockParser::ReadEnumeration now correctly ignores trailing whitespace in the property value string.      
  Flickering, glitchy lighting actually looks really cool, especially with the motion blur.
TODO?: Just before the enemies arrive, all the streetlights should go crazy (flickering and even flickering to different colours - like the enemies disrupt the mains somehow.  That way, you can tell when enemies are coming by the lights glitching, giving you an incentive not to shoot them all out.  Nice!  Using the lighting as a gameplay device is definitely a good idea.  Or do something with lightning.  Maybe that's their attack?!)
     
  After a bit of history-hopping, I found the source of the crazy lighting glitch I was getting.  I'd added a comment at the end of the "RTForceFloat: false" line in default.txt, and CBlockParser was ignoring lines with '//' anywhere on the line!      
  CBlockParser::ParseBlock now correctly handles trailing comments.      
#revision 825 Options: Testing render-target property values with whitespace:
"frameRT:   [/1<tab>,<tab>/4]"
"frameRT:   [/1,/4<tab>]"

Assertion failed!
Program: c:\Noctambule\Source\Debug\LeCauchemar_DEBUG.exe
File: c:\noctambule\source\options.cpp
Line: 618
Expression: (*pSrcChar) == ']'
     
  NOTE: HDR_InitApp has got nothing to do with HDR; it's legacy GUI setup from the HDRLighting sample.
TODO: remove it!!!
<-DONE (8th Feb 08)
     
  Oh wow, CNoctambuleApp::RestoreDeviceObjects already calls COptions::ApplyAll.  I'd forgotten about that.
So it is safe.
     
  CHeadTracker::Init now calls COptions::ApplyAll after choosing a headtracker device and loading its sub-profile.
This is much nicer than applying a sub-set of the options.
     
#revision 826 COptions::ApplyBeforeDeviceCreation now updates DXUT according to the options:
calls DXUTStartFullScreen and DXUTSetFullScreenRes.
     
  TEMP: Right mouse button now toggles eyes (even in master) when in frame-sequential stereo mode      
  TOFIX: disabling HDR\curve in Default_HeadTracking_3DVisor.txt went badly wrong....
Checked that it works ok (in 3DVisor mode) when disabled in default.txt
     
#revision 827 Going for version 14.0 ..... (please work!)      
  TODO: use a release EMADevice_DLL.dll !      
  Tweaked colourGradingMap_default.png by blending on 33% of colourGradingMap_3DVisor.png on top.  Haven't tested it yet ;P      
  Disabled HDR\curve in Example_speedyBare.txt      
#version 14.0 Released version 14.0      
19-Dec-2007   3.66667    
  TODO: very low priority, but eventually, I should handle the headset being connected & disconnected during play.      
  3DVisor: I've got 4 USB ports on the back of the PC.  The headset works fine on the bottom two.  On the top two, it gets power (displays work fine), but says "new hardware detected, Z800, blah blah" and fails to connect.  Why is that?
Also, TrackIR does something very similar in the leftmost of the two USB ports on the side of the case.
     
  I think this was happening (genuine 3DVisor headtrack connect error), but it's not happening now...
unconnected
can't connect to headtracker -> CANCEL
can't find headset
plug in
CANCEL
headset found.  try headtracker again?
YES
can't connect to headtracker
retry several times, then cancel.  Game starts with no headtracking.
     
  I'm leaving any polishing of the headtracker connection stuff till after the build.  It's plenty sturdy enough now and I don't have time to get sidetracked.
Actually I'm just going to leave it the way it is.  It's a matter of opinion which way it should work, and the current way avoids unnecessary create-then-delete nonsense.
     
  Kewl, CHeadTracker::Init now has a Thunderdome-style while loop for choosing between headtracker hardware!
// PP(19.12.7): up to two devices enter; up to one device leaves
     
  Testing CHeadTracker::Init with no hardware hint (default)
-
no devices: searched for 3DVisor then searched for TrackIR
-
TrackIR: searched for 3DVisor then found and used TrackIR
-
3DVisor: found and used 3DVisor (didn't search for TrackIR)
-
both: found and used 3DVisor (didn't search for TrackIR)
     
  Testing CHeadTracker::Init with 3DVisor hardware hint
-
no devices: searched for 3DVisor then searched for TrackIR
-
TrackIR: searched for 3DVisor then found and used TrackIR
-
3DVisor: found and used 3DVisor (didn't search for TrackIR)
-
both: found and used 3DVisor (didn't search for TrackIR)
     
  Testing CHeadTracker::Init with OptiTrack hardware hint
-
no devices: searched for TrackIR then searched for 3DVisor
-
TrackIR: found and used TrackIR (didn't search for 3DVisor)
-
3DVisor: searched for TrackIR then found and used 3DVisor
-
both: found and used TrackIR (didn't search for 3DVisor)
     
  (above) Checked that all error messages were present and correct.      
  (below) assertion failure when starting-up in TrackIR mode with the trackclip out of view.  Added a milestone bodge (bailout) and a REMIND message for now.
Now copes fine with the trackclip starting out of view.
     
#revision 821 "Assertion failed!
Program: c:\Noctambule\Source\Debug\LeCauchemar_DEBUG.exe
File: c:\noctambule\source\viewinfo.cpp
Line: 265
Expression: !pCameraIn->objectMatDirty"
   
  When the game selects a headtracking device, it now loads and applies one of two options profiles containing just the default headtracking settings for that device:
Default_HeadTracking_3DVisor.txt
Default_HeadTracking_OptiTrack.txt
These profiles can be edited by the player, but TODO: make them overrideable by custom.txt, otherwise the player could lose the default data.<-FIXED(below)
   
#revision 822 ...It now also loads Custom_HeadTracking_OptiTrack.txt / Custom_HeadTracking_3DVisor.txt straight afterwards, allowing the player to customise without losing any data.
The default profiles are now kept read-only and the custom ones are persistent.
   
  Default_HeadTracking_3DVisor.txt now sets up all the 3DVisor default settings, not just headtracking.
COptions::ApplyBeforeDeviceCreation is now called afterwards (instead of just ApplyHeadTracking).
This is precarious and needs to be improved after v14.
<-FIXED(20th)
TODO: should also rename these profiles to prevent confusion.
   
  Fixed frame-sequential speed-halving (CNoctambuleApp::GetFrameTime. todo: improve?)    
  TODO: Fix current crazy lighting glitch.<-FIXED(20th)    
18-Dec-2007   3.5    
  TODO for v14:
- fix speed-halving in frame-sequential mode<-Fixed(19th: CNoctambuleApp::GetFrameTime. todo: improve?)
- keyboard turn mode, mouse turn option
- mouse-only controls ("total VR" mode)  btw, TotalVR.com is taken
- 3DVisor yaw reset thing<-done
- what's going on with that post-build step in master config?<-TODO: use a release EMADevice_DLL.dll !
     
  Managed to terminate the 3DVisor headtracker thread, but only by calling TerminateThread, which is dangerous and not recommended (I think it's quite safe for my purposes though).
Tried using a volatile 'exit' flag but found that the headtracker thread doesn't get polled during the shutdown stage.  It can be exited smoothly in this way while the game is running, but not while it's shutting down.  Why is that?
     
#revision 819 Headtracker thread exit codes: 2 = in response to the exit flag, 3 = forced by TerminateThread      
  Checked the behaviour of 'assert' in a master build.  It's better than I'd expected, and perfectly safe:
-does work
-does evaluate the expression (eg. function call)
-error box displays source filename, line number and expression
-error box even appears and is functional in full-screen!!
-error box options are
abort (quits smoothly), retry (lets you debug the exe, although I think this option only appears if you have certain stuff installed), ignore (closes the box and carries on).
     
  The V macro, in a master build, evaluates its expression but ignores any failure.      
  TODO: switch to using my own assert macro (give it a unique name, not ASSERT).      
  C3DVisor::InitHeadset now "enables the external monitor".
I'm not yet clear on what the benefit of not "enabling the external monitor" is.  But I don't want my monitor to go dark when I'm using the headset (which is the only effect the option has, as far as I can see).
I've always left the monitor enabled using the utility app, but once or twice I think I've seen it lose/ignore the setting somehow.
     
  3DVisor: unwanted processes are now killed before every connection attempt (see C3DVisor::CreateDevice)      
  3DVisor: Managed to get an infinite loop inside EMA device construction, by disconnecting the USB a second or so after launching the program.
Not much I can do about that, and it's not a worry anyway.
     
#revision 820 3DVisor init is now almost right, but there's a slight loophole.  I'm about to fix this now.<-nah, after the build
(TODO: need to create a device without headtracking first, to establish whether or not the unit is connected....  Messy, but I don't see another way of presenting the right information to the player in the right order.)
<-nah, see 19th
     
17-Dec-2007   3.66667    
  String table: I'm using the term "image" to mean render target in the English strings.      
  Menus: Added tree layout doc:      
  file:\\C:\noctambule\docs\menuMap.txt      
#revision 814 Fixed a stringtable parsing bug.      
  Added loads more menu text to the stringtable.      
#revision 815 Fixed another stringtable parsing bug that caused some strings to go missing.      
  TODO: default profile should set up the headtracking values for Z800, not for OptiTrack ?
Need to decide what the game does about choosing between headtrackers (each with their different default values).<-ALL SORTED(19th)
     
  TODO: OptiTrack headtracking on a separate thread (use headTracking\separateThread).      
  TODO: terminate the headtracking threads properly.<-done(18th), but see note      
  Added some OptiTrack dialogue boxes.      
  3DVisor: If the connection fails, the game now does one automatic silent retry before it starts displaying error messages.      
16-Dec-2007   10.25    
  (below) Spent a couple of hours mocking-up the pause menu in Photoshop.  It was only afterwards that it reminded me of neurons, and of bubbles seen underwater, and of a heart.
Anyway, the menus are going to take the form of these translucent blobs, connected together in a sort of a tree around the player's head.  It's a sort of sci-fi "organic computer display".
- Clicking on a 'link' makes the tree rotate so that the target menu is centred in the field of view.
- Another option, when in VR mode, would be that the tree always stays put and that menus just change colour as they become current (when a 'link' directs to the menu or a control on the menu is used).  You'd be able to see the colour change along the branch from the menu you're currently looking at.
...
     
 
       
  ...
-For mega brownie points, the tree would contain a Navier-Stokes fluid simulation, so coloured dye could run through it.  The dye could be attracted to low pressure in the current menu or something.  The dye could have a different refractive index from the clear fluid.  I'm not likely to do this dye thing though - it'd be tons of work and there's better ways I could be spending my time.
-The tree should write noisy values to the
velocity buffer, to cause slightly jumbled motion blur.  This will add a layer of dreaminess straight away.  See flashback sequences from Underworld.
-The text boxes might also want their own
glitching effect.  This will provide some movement as well as making the text look 'dreamy'.  Letters should sometimes change into different letters of similar width.  Be careful to avoid hackneyed text effects, eg. the skateboard-game jitter (radical!)
-The tree must gently
squidge around / pump or something; must not be frozen.  The current menu could beat like a heart.
-Tree rotation needs to be motion-blurred.
     
  I think I've got enough to be going on with; I'll play the rest by ear.      
" Global.h: Disabled warning 4345:
"behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized"
     
  Added option headTracking \ separateThread
Added option headTracking \ threadPriority (LOWEST / BELOW_NORMAL / NORMAL / ABOVE_NORMAL / HIGHEST)
     
  Putting the 3DVisor headtracking on a separate thread has brought my framerate from around 20 to around 33.
(800*600, debug, default settings).
Based on those numbers, it must take about a 50th of a second to get a reading from the headtracker, regardless of the PC.  I should time this properly, but I've got more interesting things to do.  The important thing is that it's not slowing the game down anymore.
     
  With nearly all the effects stripped out, I'm managing to keep the VR mode above 60 (most of the time) in Master config now, which lets me at least get some idea how the game should feel (and it's ver' nice).  Need to upgrade this PC to get the full experience.      
  Fixed the head-tracked stereo separation for 3DVisor.  It wasn't properly accounting for the display being head-mounted.
TODO: for TrackIR, use the old method (from SVN) and test that it's correct.  Check display\headMounted.
     
15-Dec-2007   10.5    
  Found some occasional flickering artefacts in the floating-point lighting (800*600) :(
Floating-point lighting on this card also removes various filtering (including some full-screen filtering that shouldn't be there; TODO: investigate<-FIXED(12.4.8))
     
  Started setting up the string table functionality.
TODO: For the likes of the credits, the stringtable parser should be able to invent the absent identifiers by appending the UK string (suitably processed) onto the last identifier it found.
eg. "ESTRING_CREDITS_THANKS_CelineAccabat"
<-DONE
     
#revision 806 Set up a Tools\StringTableParser project and added it to SVN      
  SVN: Never source-control .NCB files!      
  Stringtable:
0x0D, 0x0A = end of row
0x0A = newline
0x09 = tab (cell delimiter)
I'm opening stringtable.txt in binary mode because in text mode the 0x0D characters get filtered out
     
#revision 808 String table parser is now working nicely.      
  Added function UtilGetWideString (now used by UtilGetTempWideString).      
  TODO: CStringTable::StringW ?      
  Added function UtilMessageBox (takes in stringtable indices and control flags; returns response code).  Very handy.      
  Teehee!  In the French 3DVisor user guide, someone's accidentally left a little green text box that says "Testmuster" !      
  Set up a nice little network of dialogue boxes to handle any & all problems during initialisation of the 3DVisor.  Spent a wee bit of time translating these into French.      
  3DVisor: current firmware version is 6.3E      
  3DVisor:  The new utility, Lab Tool, seems to lose / give up its own connection when the game starts, rather than preventing the game's connection.  Nevertheless, I've added it (LabTool.exe) to list of processes killed before the headset connection is attempted.      
#revision 810 Pleased with the stringtable system; it's real smooth.  Dialogue boxes appear in the right language as specified by the 'general \ language' option (which defaults to French bien sûr).      
13-Dec-2007   3    
  3DVisor: considered making the game change the headset's timeout values, but decided this is something that the user won't want me to mess with.  So I'll continue using the 'keepalive' signals (these won't slow the game, so they can't interfere with frame sequential stereo).  Even resetting the EEPROM doesn't change the timeout values set by the user.      
  3DVisor: when the you first connect to the headtracker, its current yaw is is set as the zero yaw by the eMagin system.      
  3DVisor: [update: almost] Never fails to connect to headtracker when it's in standby (flashing green) mode when you try to connect.
Wanted to try something that might guarantee a successful headtracker connection:
- connect firstly without headtracking
- call GoSleep
- clean up
- connect again with headtracking.
See SDK source for details of why this isn't possible :(
     
  I'm a bit paranoid about mentioning any eMagin SDK stuff in this log; the SDK is all marked confidential, and I only managed to get hold of it after I'd contacted eMagin from my work email account.      
  Y'know, the headtracker connection used to work every time anyway.  Is it only since installing Lab Tool that it's started failing?  I have a feeling that did install a new drivery type thing.
Another change in behaviour (I think) is that after an unsuccessful connection, simply putting the headset into standby makes it work next time ([update: nearly] always works).  Used to have to disconnect the USB lead & re-connect it (unless I just forgot to try the standby button before ?).
     
  3DVisor yaw now resets when exiting pause mode.  TODO: neaten this (should orient the player to the current virtual head yaw; currently snaps the virtual head yaw to the current player orientation).
See CHeadTracker::ResetTransform
     
  Added option headTracking\hardwareHint (NONE / FORCE_NONE / OPTITRACK / 3DVISOR)      
  TODO?: Might sound silly, but I'm quite tempted to design a jetpack into the game, and maybe flying enemies.  Flying around even with the flycam, in VR mode, is amazing.  It's partly because the headtracking gives you a real sense of height when you look down (and I'm not even in stereo mode yet).
Headtracking is great.  It connects another one of your senses into the game: the sense of balance / direction!  And the more senses you connect to the game, the more it feels real and engages your instincts.
Complications with a jetpack would be:
- requires more advanced building collision (probably need this for weapons anyway?)
- occlusion culling gets more complicated (and doesn't help much once you're above rooftop level).
     
12-Dec-2007   3.7    
  Fixed the stuttery headtracking.  I'd left an "if( (g_game.frameNumber&4)==0 )" in the headtracker update, duh!
That's a relief.
     
  (below) Made a new & improved grading map for 3DVisor mode.  Although obviously it's not clear from a screenshot, this comes out nice & vivid while preventing the over-contrast that these little displays would give if using the default grading.
(left to right: no grading, grading for 3DVisor, grading for CRT)  The CRT one is a bit harsh at the moment - you lose too much of that subtle mist.  I'll bring it back a bit.
     
 
       
  I'm fed up with the bug where everything's double-bright on nVidia cards; it gives a bad first impression.  I'm guessing it simply happens when using float RTs for the lighting.<-no, see below.
TODO: test floating-point vs. forced fixed-point on an nVidia card.
TODO: bodge: halve the HDR\finalMultiplier on all nVidia cards<-DONE(13th, in COptions::ApplyAfterDeviceCreation)
     
  CBlockParser::ReadBool now accepts '1' as true.      
  WEIRD: I tried setting lighting\RTForceFloat to true on my x1900, which I was pretty sure couldn't blend to floating-point RTs.  Erm, but it seems to be working perfectly.  And it's definitely using floats; the banding is practically invisible, same as on 8800.
Maybe when I tested this last time, I was trying to blend to D3DFMT_A32B32G32R32F (which comes out black).  With D3DFMT_A16B16G16R16F, it seems 100% fine.
Maybe I tested ALPHA blending last time, rather than additive?  (the lighting uses additive blending to build-up its offscreen images).
Here's what I'll do:
     
  lighting\RTForceFloat now defaults true.      
  TODO: test 3DVisor head-tracking on a separate thread
TODO: need an eye-swap calibration mode for 3DVisor (display 'left' & 'right' over the relevant eye)
     
11-Dec-2007   2.66667    
  "VxDs are not usable in Windows NT or its descendants. Starting with Windows 2000, these operating systems use the Windows Driver Model (WDM)..."      
  Summarised my quest for framerate-independent stereo, on the eMagin forums:
http://www.3dvisor.com/forum/viewtopic.php?t=1036&start=0&postdays=0&postorder=asc&highlight=sync
If only I could find that WINx3D SDK !!!
     
  Right then, this time I'm really giving up with it, until such a time as fresh information comes in through the forum.
Now turning my attention to V
ersion 14: Xmas Edition™ instead!
     
#revision 801 SVN: Finally managed to untangle SVN and add the driver projects for safekeeping.      
  Z800: Hmm, head-tracking's gone stuttery.  Why's that then?
TODO: FIX THIS!!!!!!!!<-FIXED, phew. 
     
10-Dec-2007   5.5    
  Noticed that 3DVisor.exe, even just sitting in the system tray, is continually spitting-out a debug line such as:
[4076] VendorID: 9ac8, ProductID: 6b
I wonder what it means.
     
  (searched wdk help for wdm.h)
ms-help://MS.WDK.v10.6000/Kernel_d/hh/Kernel_d/WDMIntro_d5b4fea2-e96b-4880-b610-92e6d96f32be.xml.htm

"Kernel-mode drivers that follow WDM rules are called WDM drivers. All WDM drivers must:
Include wdm.h, not ntddk.h. (Note that wdm.h is a subset of ntddk.h.) ..."
     
  I need to include wdm.h in order for video.h to compile.
The
avssamp sample driver is WDM one, and I can build it, but when I try to load it using InstallDriver.exe it fails with ERROR_SERVICE_DISABLED.
If I do manage to convert DemoDriver to WDM, will I get the same load error??<-No, converted it now and it still loads
     
  "The I2C bus has only two wires: the serial clock line and the serial data line.
Reading and writing data bits to the I2C lines on the display adapter is hardware dependent, so the vendor-supplied video miniport driver must provide the functions that instruct the display adapter to read and write the individual bits."
     
  Hmm yeah, I've been a bit thick.  WriteDataLine etc aren't functions I can call, they're functions I can implement.
If I'd paid closer attention to the docs, I would have seen that they're callbacks provided by the driver (that's me).
     
  "VideoPortDDCMonitorHelper implements the details of reading the EDID structure according to the I2C specificaiton, but must call back into the video miniport driver to read and write individual data bits to the I2C serial clock and data lines.
The four functions,
implemented by the video miniport driver, that read and write individual bits to the I2C clock and data lines are ReadClockLine, ReadDataLine, WriteClockLine, and WriteDataLine. When the video miniport driver calls VideoPortDDCMonitorHelper, it supplies pointers to those four functions in DDCControl->I2CCallbacks."
     
  Went back and had a look at DrYak's info about syncing the stereo:
http://www.3dvisor.com/forum/viewtopic.php?t=1036&start=0&postdays=0&postorder=asc&highlight=sync
     
  Downloaded eMagin's Lab Tool thing.  Yak's idea about using different sync values between the two eyes sounds very interesting...<-it isn't possible to use offsets that big      
  Allowed the Lab Tool to remove 3DVisor Software Utility, as it seemed to want to do.<-re-installed it      
  Lab Tool reports that my headset has the "3D Commands" capability.  Not sure what it means by that, probably just means the enable/disable 3D mode command.      
  3DVisor: phase at around 18 seems to work well for the stripes calibration test.      
  clock=2047/4095 = show left side of screen      
  Tried fiddling with phase, clock and position settings, but they don't allow a big enough offset to do a split-screen-style stereo mode.      
  TODO: find out about SciTech GLDirect.  Is it a forerunner to Snap?      
  TODO: maybe get hold of that sync-doubler VGA pass-through thing that comes with those LCD shutter glasses at work.  I think that will actually alternate the Z800 (refreshing at 120Hz).  But I don't think it helps me in trying to send my own image pair.  Would be an interesting experiment anyway (in fact, wouldn't this make every game work with the Z800?)      
9-Dec-2007   10    
  Hmm, I lost rather a lot of time to those two gigs (plus hectic work stuff).
Need to keep an eye on how much time gets lost practising next year.  It might become necessary to pull-out of band activities 'early'.
     
  I'm probably going to give up trying to do the framerate-independent frame-sequential stereoscopy thing; it would be really nice but there's more important things to take care of, and time is getting short.
So if you have a frame-sequential headset, and you want to run the game stereoscopically, you'll just have to make sure your PC can keep the game above 60fps.
<-currently trying to get it working using the WDK
The annoying thing is that mine can't :(
I should look into upgrading....
     
  Of course, it would be a very fair criticism to say that the game simply runs too slow - that's the truth of it.
But, although it sounds flippant, my time is far better spent making the game look pretty than making it fast, because the PC/GPU setups people use to play the latest games are fairly monstrous anyway and they can handle it.  No point spending a load of time optimising when the target audience was already able to run it at 60 (which they are) - it's invisible work.
     
  below: here's the VBE doc for the I²C functions that should let me control the DDC pin:<-can't generate interrupts from Win32, see below      
  file://C:\Noctambule\Articles\VBE_I2C.pdf      
  http://www.vesa.org/Public/VBE/vbesci10-2w.pdf      
  Function 15h, Sub-function 11h - Begin SCL/SDA control
Function 15h, Sub-function 10h - Report VBE/SCI Capabilities
Function 15h, Sub-function 14h - Write SDA data line
[Function 15h, Sub-function 13h - Write SCL clock line]
Function 15h, Sub-function 12h - End SCL/SDA control
     
  Example French function descriptions:
"lit les données EDID du moniteur principal"
"ouvre le fichier DUMP"
"écrit le buffer des données EDID dans le fichier DUMP"
TODO: have a dig around on some French coding sites, get more of a feel for commenting & naming
     
  "Generating interrupts only works when running a 16 bit program... Generating an interrupt from a Win32 program
will cause an access violation."

"You cant make BIOS calls in windows from a user mode app...
You can use a published API.......lookup DeviceIoControl on MSDN...."

"at http://www.geocities.com/SiliconValley/Haven/4824/vxdprg.html Bill Alexander has free source code for a VxD to do BIOS calls. Looks like I'll have to recompile it with the Windows 95 DDK though (it's Windows 98)."

"Win32-based applications cannot use MS-DOS and BIOS interrupts"
     
  ...So it's not possible for me to call BIOS functions directly (which would make things very, very easy)
Using 'INT' causes an exception like it says.
     
  The only route left to try now seems to be the I²C functions in the WDK.  Can't remember how far I got with them before...
"WriteDataLine sets the I2C serial data line to high or low."

(see 28th Oct 07)
Needs to be a separate driver I think
     
  Writing a device driver for Windows :
http://www.adp-gmbh.ch/win/misc/writing_devicedriver.html
     
  Essentials Of Building Windows Drivers :
http://www.wd-3.com/archive/WinBuild.htm
     
  I've now managed to get the example driver DemoDriver (from the Essentials article above) to build, and load, and be successfully called from the game.  Had to update it here & there because it was written for the 95/98 DDK.
I just haven't found a good way of debugging the driver code yet.<-Now using DebugView, see below.
It's definitely running the driver code, because if I add an ASSERT, in 'checked' configuration, it causes my PC to instantly restart.
     
  Installed a thing called DebugView (http://www.microsoft.com/technet/sysinternals/utilities/debugview.mspx), which catches debug output, like Watson does.
But it doesn't catch any of the DbgPrint calls in the driver code.<-Yes it does, just need to tick 'Capture Kernel'.
     
  DemoDriver is a kernel-mode driver.      
  Just so I don't forget:

Firstly run one of the WDK build environments for XP:
C:\Documents and Settings\user\Application Data\Microsoft\Internet Explorer\Quick Launch\WDK 6000\Build Environments\Windows XP

To build the driver:
cd C:\WinDDK\6000\src\WinBuild
build -cef

To load the driver:
cd C:\WinDDK\6000\src\WinBuild\libchk_wxp_x86\i386
InstallDriver DemoDriver load

To unload the driver (must do this then re-load each time it changes) :
InstallDriver DemoDriver unload
     
  Added DebugView to the Visual Studio 'tools' menu.      
  Tried to add all the WinBuild (example driver) stuff to SVN, but couldn't quite remember how to do it.
I'll just wait till I've set up the new driver under the Noctambule folder, that'll be easier.
     
  Tomorrow, if all goes well, I should be able to get that DDC pin doing its thing.
If the headset responds, that's obviously wonderful.  If it doesn't, I might try and get hold of a multimeter to check that the signal is coming through.
     
15-Nov-2007   0    
  (below) possible enemy inspiration: really gruesome baby dolls, suitably nightmarish:      
  http://www.autopsybabies.com      
12-Nov-2007   0    
  I'm completely tied-up with the band at the moment, so I'm not going to be able to make much/any progress till December.
I will almost certainly do a build in time for Christmas with the following features:
- native z800 head-tracking support (if you haven't seen this headtracker natively supported yet, you'll be amazed how good it is).
-
z800/x800 (frame sequential) stereoscopy mode - Note: this will only work if your PC can keep the game above 60Hz.
     
  (below) the band:      
  http://myspace.com/deathboy      
4-Nov-2007   10.5    
  Added envirornment variables:
SCITECH
SCITECH_LIB
C:\scitech\mgl60r23
     
  C:\scitech\mgl60r23\bin-win32\dmake      
  C:\scitech\mgl60r23\bin-win32>dmake C:\scitech\mgl60r23\examples\snap\graphics\hello\makefile
'C:\scitech\mgl60r23\examples\snap\graphics\hello\makefile' is up to date
?
     
  C:\scitech\mgl60r23>my_start-sdk.bat
Release build enabled.
Open Watcom C/C++ 1.0 Win32 GUI compilation environment set up.

C:\scitech\mgl60r23\examples\snap\graphics>
     
  C:\scitech\mgl60r23\src>dmake build
=======================================================================
** BUILDING: SciTech SNAP SDK libraries for current compiler
=======================================================================
START: Building PM Library
wcc386 win32\pm.c
dmake.exe:  Error -- wcc386: No such file or directory

dmake.EXE:  Error code 129, while making 'targets\pm'
dmake.exe:  Error code 255, while making 'single'
     
  C:\scitech\mgl60r23>my_start-sdk.bat
Release build enabled.
Visual C++.NET 7.0 32-bit Windows compilation environment set up
C:\scitech\mgl60r23\examples\snap\graphics>
     
  C:\scitech\mgl60r23\src>dmake build
=================================================================
** BUILDING: SciTech SNAP SDK libraries for current compiler
=================================================================
START: Building PM Library
....
k_cp n_ga.lib C:\scitech\mgl60r23\lib\release\WIN32\vc7
================================================================
DONE: Single compiler SNAP SDK build completed successfully!
     
  mkdebug and mkrelease (replacing dmake build) are also both successful      
  French strings for a doom-type game:
C:\scitech\mgl60r23\examples\mgldoom\d_french.h
     
  Couldn't get the Doom example to build:
C:\scitech\mgl60r23\examples\mgldoom>dmake
...
LINK : fatal error LNK1181:
cannot open input file 'mgl.lib'
dmake.exe:  Error code 130, while making 'doom.exe'
There is no mgl.lib anywhere :/ (?)
     
  C:\scitech\mgl60r23\examples\snap\graphics\gatest>dmake
...
LINK : fatal error LNK1104: cannot open file 'gatest.def'
LINK : fatal error LNK1141: failure during build of exports file
dmake.exe:  Error code 130, while making 'gatest.exe'
There is no gatest.def
     
  Made a gatest.def that just contains
NAME    GATEST
     
  C:\scitech\mgl60r23\examples\snap\graphics\gatest>dmake
cl /nologo @C:\DOCUME~1\user\LOCALS~1\Temp\mk000001
   Creating library gatest.lib and object gatest.exp
LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16
referenced in function _WinMainCRTStartup
gatest.exe : fatal error LNK1120: 1 unresolved externals
dmake.exe:  Error code 130, while making 'gatest.exe'
<-needed to change mystartsdk.bat to use 'c32' instead of 'w32', see below
     
  _WinMainCRTStartup defined in build\intel\mt_obj\wincrt0.obj      
  dmake -u to force rebuild      
  mainCRTStartup (or wmainCRTStartup) ---- An application using /SUBSYSTEM:CONSOLE; calls main (or wmain)      
  These example apps are CONSOLE apps; they have a 'main' rather than a 'WinMain'.
So the compiler (cl) arguments want to contain /link /SUBSYSTEM:CONSOLE, as shown here:
C:\scitech\mgl60r23\examples\snap\ddc\ddctest>cl ddctest.c /link /SUBSYSTEM:CONSOLE
cl is being called from dmake.exe<-needed to change mystartsdk.bat to use 'c32' instead of 'w32', see below
     
  C:\scitech\mgl60r23>mystartsdk.bat
Checked debug build enabled.
Visual C++.NET 7.0 32-bit Windows console compilation environment set up
C:\scitech\mgl60r23\examples\snap\graphics>
     
  Built the SDK libs with w32 again.      
  Well, I've now got as far as building an exe (snap/ddc/ddctest.exe) and actually being able to run it.
I now get this error message:
---------------------------
Fatal Error!
---------------------------
Unable to load SNAP device driver!
---------------------------
OK  
---------------------------
     
  COOL!  I can attach the debugger to the ddctest.exe process and get a call stack.      
  ddclib.c \ LoadDriver
looking for ddc.bpd
     
  Fixed that (set up a C:\windows\system32\snap folder), but now I get this:
---------------------------
Fatal Error!
---------------------------
Invalid license!
---------------------------
OK  
---------------------------
Up till now, I thought this thing was free :/<-it is free (GPL) see license.faq and license.gpl
     
  TODO: get C:\scitech into SVN      
  C:\scitech\mgl60r23>mystartsdk
Checked debug build enabled.
Visual C++.NET 7.0 32-bit Windows compilation environment set up
C:\scitech\mgl60r23>
SET CHECKED=0
C:\scitech\mgl60r23>
SET DBG=0
C:\scitech\mgl60r23>mystartsdk
Release build enabled.
Visual C++.NET 7.0 32-bit Windows compilation environment set up
     
  Hmm, I can't seem to build the SDK libs anymore, fails near the end.  It's fine until this point:
START: Building Techniques Class Library
cl /nologo @C:\DOCUME~1\user\LOCALS~1\Temp\mk000001 /c dlist.cpp
dlist.cpp
cl /nologo @C:\DOCUME~1\user\LOCALS~1\Temp\mk000100 /c list.cpp
list.cpp
cl /nologo @C:\DOCUME~1\user\LOCALS~1\Temp\mk00022a /c hashtab.cpp
hashtab.cpp
C:\scitech\mgl60r23\include\tcl\hashtab.hpp(46) : fatal error C1083: Cannot open
 include file: 'iostream.h': No such file or directory
dmake.exe:  Error code 130, while making 'hashtab.obj'
dmake.EXE:  Error code 129, while making 'targets\tech'
dmake.exe:  Error code 255, while making 'single'
     
  I don't seem to get an accurate callstack when I get the 'invalid license' message.  Can't see where the message comes from.  Can't find that string in any of the files.
isvLicense variable is NULL though
license.h just defines EMPTY_LICENSE, whatever that means
     
  Downloaded the pre-build MGL Doom demo; tried to run it but it instantly restarted the PC.      
  C:\WINDOWS\system32\snap\config\snap\config\ddc.log:
"Unable to validate license!"
     
  emailed license@scitechsoft.com asking about the licence problem.  I don't even know if the company still exists, and even if they do I doubt they'd answer my email, but you never know.
C:\correspondence\scitech
     
  Hmm, when I add a call to GA_getDaysLeft into ddctest.c, before the call to LoadDriver, I get this:
---------------------------
Fatal Error!
---------------------------
Unable to load nga_w32.dll!
---------------------------
OK  
---------------------------
     
  Hmmmmm........      
3-Nov-2007   7    
  Installed Ad-Aware 2007 Free
Installed Spybot S&D
     
#restore In Computer Management:
Disabled my printer port (in the Computer Management program), to see if it stops the 'found new hardware' thing every time I start Windows.<-didn't help; I've re-enabled it.  I'm too scared to 'uninstall' it because I don't know how I'd re-install it.
     
  ...also disabled the Windows Indexing Service.      
  Why are lsass.exe & csrss.exe constantly chipping-away at my hard drive?  I gather this is normal, but it's a bit irritating.      
  Installed Win3D Drivers (which I think use redraw-synced page flipping), but couldn't get the test app to work at all.  And they didn't include an SDK or any source.
Even in anaglyph mode it gives the same message: "this image cannot be queued for this eye".
     
  3DVisor: Here's a hardware mod that lets the visor take in dual monitor inputs (but it seems to require the removal of the headtracker hardware).  Presumably gives you 60Hz 3D.
Not useful for me, just interesting:
     
  http://www.tekgear.ca/index.cfm?pageID=90&prodid=571&section=103&nodelist=1,103&function=viewproducts      
  Been raking around on t'Internet trying to find the mythical WINx3D SDK.  Looks like exactly what I need, but no-one seems to know where it can be found anymore.
"...for page-flipped stereoscopy, the start address must change every time a vertical sync occurs on the video card. This is the primary purpose of WINx3D - to keep the image that is displayed on the video card synchronized with the VR gear. The DirectDraw Flip() function is inadequate for this"
Sent an email to a couple of people who were also looking for it, in case they still have the same email addresses and managed to find it:
     
  file://C:\correspondence\WINx3D      
  below: Some discussion of WINx3D.  Apparently David C. Qualman (davidq@win3d.com) is the author, but the SDK has been bought up and is no longer free:      
  http://www.stereo3d.com/discus/messages/21/1318.html?1081163732      
  Programming With VESA BIOS Extensions:      
  http://www.ddj.com/cpp/184403213?pgno=1      
  Another VBE programming article:      
  http://www.gameprogrammer.com/1-vbe.html      
  Installed the SciTech SNAP SDK      
  Started trying to get the DDC example 'project' to compile & link:
C:\Noctambule\SNAP\ddctest\ddctest.sln
Will come back to this.
     
  below: This chap has used the WINx3D SDK in the past (2003), so I ICQ'd him to ask if he still had it (awaiting reply)      
  http://www.stereo3d.com/discus/messages/21/2057.html?1081177263      
  So it was an evening of detective work.  But I can justify spending a bit of time on this - if I can manage to put all the pieces in place, it'll be amazing.      
2-Nov-2007   0    
  ...and it's just as well I did back up the project!
Just after writing that last entry, I noticed I'd picked up a virus, started heavy-handedly trying to weed it out, and ended up knackering my registry - leaving me unable to log in to Windows.
Had to crash on the Floor of Ubuntu while I worked out how to repair the registry files, but thankfully the procedure is simple and well-documented.
The registry rollback not only let me back into Windows, but also disabled the virus, which is nice.  Should maybe install some kind of anti-virus now though....<-DONE
     
  Installed AVG Anti-Virus Free Edition 7.5.503:      
  http://www.google.co.uk/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Ffree.grisoft.com%2F&ei=UIArR7X2Kpjy0QTznaHoBQ&usg=AFQjCNG5n3zvu8FfBUqDjiZLOqbTklsN2A&sig2=yuI3jPM5GyjKYeUfW--2pQ      
  Anyway, looking on the bright side, at least this didn't happen:      
  http://markstirton.blogspot.com/2007/11/my-toilet-exploded.html      
28-Oct-2007   2    
#backup Backed-up the project.