This is the journal section for my warcraft3 uber-clone game engine. I call it an uber-clone because it's a superior model of the war3 engine capable of faster framerates, high level shader language, better terrain manipulation, etc. It will hopefully be used for my friend's next game design. It's name is Casper.


November 6, 8:10pm( 5 hrs )

- Finished AI pathfinding completely. You can select any unit on the map and direct him to a location. He will avoid other units and terrain obstacles to get to that location, much like a starcraft unit does.
- I'm not going to do the dungeon siege resectorization. THere's too much involved there.
- Somethings that I want to implement next is:
   1. Efficient Terrain Sector traversal for rendering and selection compares. Right now we look through the entire array of terrain!
   2. Some sort of lightmap support and light entity support

October 31, 2:16pm( 4 hrs )

- First phase of terrain sector implementation. I'm overhauling the entire terrain system, from a AxB map to a list of sectors that you can create anywhere in the world. This overhaul is requiring a lot of changes, there are lots of places to re-optimize, such as using the TerrainSector pointer instead of storing i/j coordinates Will finish this later.

October 23, 8:26pm( 6 hrs )

- Fixed a lot of bugs today having to do with terrain height value interpolation and movement. I still need to put in the A* pathfinding algorithm for this. I was thinking of doing what doom3 does by differentiating route-searching and path-searching. route searching is used to find out how to get to a place in the map. path-searching is how to avoid objects on your route. What can happen are nodes get set up in the levels to determine the rough shape of paths in the level. During movement when an entity senses that the next step he takes will collide with an object, he sends a request to the pathfinder to find him the best way out.
- moved skybox up
- fastmath routines, added GUI renderscene, added AI walk functions phase 1
- AI movement phase 2, conforms to interpolated terrain height data using bilinear interpolation.

October 20, Changelist Entries( to most recent )

- made translation tool more robust, added bitmap icons to buttons, phase 1 of adding a bitmap icon to paint-tiles.
- added more renderstate params
- aligned data types for scenetree
- Fixed terrain painting on the wrong tiles because of 90degree rotation of the terrain now. Added a button that shows the texture of your current painting brush.

October 19, Changelist Entries( to most recent )

- Final Phase Translation/Selection tool

October 18, Changelist Entries( to most recent )

- Phase 1 Bounding box model selection and translation. Kind of buggy right now
- Phase 2 model selection/transformation. Selection is not buggy anymore
- hack, modified texture size minimums from 64 to 16.
- phase 3 translation/selection: Added an extrarenderitems list for GUI elements( need to finish ), added z-sorting extension to scenedescription, fixed bug with bounding box compute for skinned meshes(hack).
- Phase 4, Translation Gizmo update functionality. Changes color

October 16, Changelist Entries( to most recent )

- Added lifeform and lifeformtype( AI ). Should change to behavior class. Added a random animation critter as a sample test.
- Added ModelList iterator to go through static array of models

October 15, Changelist Entries( to most recent )

- fixed a shader bug where you have to commit changes for anything in between begin/endpass to take effect. World transforms weren't getting effected. Finalized model painting. Animated models load alongside regular models
- Added frunstrum and distance culling for both terrain and objects.
- Skybox optimization with inverse matrices, fixed bug where sector mouse selection was not correct. Models now appear at the correct height of the terrain.

October 14, Changelist Entries( to most recent )

- Phase 1, level editor's model handling. Can load files, except because the terrain has been flipped, deform and select terrain vertices need to swap y and z coordinates. Darn directx for having Y = UP.
- fixed selection when terrain is transformed around X by 90*. Completed model paint dialog box which populates a list box of models you can select from.
- phase 2 model editor. Need animations in and translate/scale/select model

October 13, Changelist Entries( to most recent )

- Animation check in phase 4. Fixed some things with original transforms. A small bug left and clean up to do. Probably two more phases.
- Phase 5 Clean up animations. Everything is good to go now. Next is to add animation blending or use keyframes as tracks in animation.
- Added more CPM model options, file loads through CPM now and instances xfile models so different CPMs can use the same xfile models to conserve space.
- animation sequences phase 1
- Extra Timer deleted. Fixed animation sequence bug where ((int)GetTime()) was forcing the variables a rounded int before multiplying by the AnimationScale. Animation done, model renderstate model added. No PS needed.
- asset update

October 12, Changelist Entries( to most recent )

- Animation sweep phase 2. Added animation data loading. Mostly test to see if it works, and unsure if we have to do a recursive matrix multiply.
- woot, primary rough animation in. It animates! this is phase 3. phase 4 and up are clean up stages

October 9, 10:38pm ( 5hrs )

- Whew, haven't coded for a while. Decided that I should finish my xfile loading function today. Initially I had set up an xfile parser, but after talking to a friend of mine, I realized that one could load an xfile very easily using the d3dxmeshload functions and then copying the mesh's vertices into your own custom vertex buffer object. So xfiles load properly now.
- Also changed the way packets were getting sent to the renderer. I have a VertexBufferInstance object this time, so you can mess with transform matrices, textures, etc of the same VB. Models will essentially load a base VB and use different textures, saving tons of space as opposed to loading a new VB/texture set every time.
- Next thing to do is to create my own model format which specifies the xfiles to use and the textures to grab. That and skinning will have to be addressed. I am tempted to say that models should use just one texture map at all times and maybe I will add composite models later, but this way, it's more efficient to render(1 DPC call and texture change) and also easy to code.

August 1, 3:09 ( 4hrs )

- added Gourand lighting support. Some glitches in lighting when normal angles become very steep and almost horizontal. For a smooth shading it works fine though. Been getting a LOT of bashing now. The lock logs have told me nothing. It seems that all locks pass! Lighting is now stored in the diffuse color component of the level. The lerp between the two textures is defined by the alpha component of the terrain's texture. Temporary key "L" is bound to recalculate lighting on the terrain.

July 31, 10:41 pm ( 4hrs )

- Ok added a skybox, added cube map texture support. The skybox moves with you. There was a lot of bashing going on when the camera was not reset properly, probably due to a lot of locks or something! Not sure yet, it's so elusive this bashing bug.

July 31, 5:47 pm ( 6hrs )

- Finished static Vertex and Index buffer Caching system which took most of my time today. I had to rewrite a bunch of things. Also seperated the original IB-VB pair model. Now it's more efficient because you can use an IB for multiple VB indexing. IBs can also be much bigger. - You don't have to do a big Optimizeandallocate call anymore, in fact, it is less than optimal since it still uses the IB-VB pairing model. In terms of VB space it might be more optimal however, when you have a lot of VBs deleted and reinstantiated it can clean up any loose gaps. - Terrain can be saved and loaded now, along with gametile data. - Next feature is the skybox, and maybe fixing some of the painting tile algorithms.

July 30, 12:02 pm( 3 hrs )

- Found out the problem with texture saving. The textures weren't being created in D3DPOOL_MANAGED. You can't lock DEFAULT pool textures, thus the function calls were failing.
- Added an initialization file to aid in switching between editor managed and regular default pools for the texture manager.
- Added loading of big terrain texture. Took out some asserts in texture manager that happened when someone tried to access a deleted texture. This happens when you queue up the texture, you delete it and the queue tries to render it.
- Next thing to do is to rewrite part of the VB manager class to be like the texture manager class, capable of dynamic unloading of static VBs, and dynamic loading of new VBs. Cache system of sorts

July 29, 11:10 pm ( 4 hrs or so )

- Added load save functionaliy of tilesets. Added a new terrain layer that is linearly interpolated with the tileset layer. Some bugs when saving tileset, D3DXSaveSurfaceToFile fails! Gotta figure that out tomorrow. Haven't had any crashes lately..I'm confused.

July 27, 10:19 pm ( 3 hrs or so )

- Ok, memory bashing when locking and moving vertices happens a LOT now. I think I have pinpointed the problem to the FullLockAndLoad() function, as with it disabled, I don't seem to get the crashing. The crashing always happens in conjunction with a move vertices and happens in the AVLNode class, which is weird why it happens there unless it's allocated right after vertices. Need to clean this up!
- Added a smoothing brush with scale settings, added a level class and a level editor class to maintain a more logical architecture.

July 24, 6:55 pm ~3-4 hrs

- Still no memory bashing. Fixed the program to run on Steven's computer using software vertex processing! What fun. Well that seemed to fix render target renders!! And I just found out why it hasn't been rendering in hardware!!#! A precision error in software allows it to bypass zclipping, where in hardware 1.0 is always == 1.0. I set the z depth of the quads to .5 and they now render in hardware as well. What a weird bug! Well next on my list is to finish the terrain material painting feature. It's almost done, all the tiles have been generated and all I have to do is make sure they are used properly. The textures are being generated correctly.
- Need to get more textures done, and the next thing for terrain is a shadow generation utility and an overall bitmap layer. The tiles will be the detail texture.

July 20, 11;50pm ~3-4 hrs

- haven't had memory bashing on my machine, but it crashes way too often on other people's machine so I have to start making logging work or something!
- added Windows interface, need to find out how to fix images onto windows buttons

July 19, 9:43 pm ~3-4 hrs

- I think the memory bashing is fixed. All I did was change a few pointer to BYTE from CasperVertex. Hopefully we don't get anymore bashing.
- Tiles now paint on all IB chunks
- You can scroll through available brushes by pressing B.
- I think I need to add an option for painting certain materials and it should automatically generate the border lines between them.

July 19, 2004, 12:01am ~3-4 hrs

- lots of memory leaks and memory bashing. It might be in the vertexbuffer lock and load function or it also might be in the general VB pointer manipulation. This happens mostly when you select a terrain vertex and try moving it around
- Testing with painting tiles, it works might need to add rotation feature so we can rotate painted weights.
- Need to find out what all this mem bashing is coming from!!! Otherwise the terrain part of the engine is almost complete

---Previous, quite a lot of man hours Finished basic optimized rendering engine capable of drawing optimized VBs fast to the screen.