Categories

Navigation

MVP

Microsoft MVP (since 2006) in the XNA/DirectX category

Tag cloud

Ajax (8) All (206) Arena Wars (21) Boo (4) BroodWar (8) Conferences (1) Development (44) Game Development (142) IronPython (3) Lost Squadron (17) Lua (6) meinSport.de (4) Other (150) Polynapping (12) Programming (156) Racing Game (7) Reviews (76) Rocket Commander (49) Silverlight (10) SQL (1) StudiHelp.de (2) XNA (40)

On this page

A new more effective keyboard layout for programmers
Lost Squadron, Day 19: Shoot'em'up
Lost Squadron, Week 4, Day 2: Getting back to the game.
Lost Squadron, Week 3, Day 2: Getting back on track
Lost Squadron, Day 14: Effects and Game Unit Testing
Lost Squadron, Day 13: One week more plz ^^
Lost Squadron, Day 12: Back to the game
Lost Squadron, Day 11: Another day with the shaders.
Lost Squadron, Day 10: Editor finished
Lost Squadron, Day 8: Editor and more UI controls.
Lost Squadron, Day 7: Still struggeling with shaders.
Lost Squadron, Day 6: And there were lights.
Lost Squadron, Day 5: Exciting stuff soon ^^
Lost Squadron, Day 4: Why can't I just press start and play?
Lost Squadron, Day 3: No screenshot today.
Lost Squadron, Day 2: Looking good right now.
Lost Squadron Part 1: Daily development screens

Archive

Popular

My Bookmarks
CR_Commenter Update v1...
Contact
A new more effective k...
Getting XNA to work in...
How to write a CodeRus...
NormalMapCompressor v1...
English Rocket Command...
Migrating ASP.NET VS20...
The year 2005 - Review...
Rocket Commander V1.1 ...
New look for www.exDre...

Blogroll

Projects

Arena Wars (2004)

Rocket Commander (2006)

Pizza Commander (2006)

Rocket Racer (2006)

Coop Commander (2006)

Flower Commander (2006)

Fruit Commander (2006)

Euro Vernichter (2003)

Lost Squadron (2005)

Zombie Quest (very simple 2D Adventure, 2006)

Freifunk Hannover project (GoogleMaps support)

Older projects (2000 and earlier)

MeinSport.de - German Sport Community Site

About

About me: Contact

Send mail to the author(s) Email:

Total Posts: 213
This Year: 9
This Month: 0
This Week: 0
Comments: 403
Made with

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

My brothers

netfreak.de

mirkman.de

Sign In

 Wednesday, May 04, 2005
Wednesday, May 04, 2005 12:16:20 AM UTC (  |  |  |  |  |  )
Hey now, I'm back again. Lets just pretend I didn't stop blogging the last couple of months ^^ From now on I will try to post stuff every other week, I still got some interessting topics.

Quick links


About Lost Squadron

The project was paused because I got noone modeling the missing models (my intern Ivo quit in the middle of the project because he had to find a job), most of the engine and game logic is pretty much finished (and has gotten way more complicated than planed). I will post some screens and info from time to time, usually I will finish up projects like this some later time when I got the missing resources or time (maybe next chrismas). Sorry for not informing you about the latest progress, but I talked myself into continuing the project and realised to late I can't finish it on my own now.

Currently we at exDream have finally started working on the next project and will produce a nice graphic demo/prototype in the next 3 month. I will try to sneak in a couple of screenshots of it from time to time.


Todays topic

A new effective keyboard layout for programmers, especially for c# and c++:

abi/blog/abiKeyboardV9.zip">Download AbiKeyboardV9 installer
abi/blog/CountMostUsedKeys.zip">Download the CountMostUsedKeys program (see below)
abi/blog/CountMostUsedKeys_src.zip">CountMostUsedKeys source code for anyone interessted.

2 years ago I was talking with a friend about my english keyboard layout and discussing why it is way better than the german keyboard layout for programming (for some keys you even need a special alt gr key combination). The english keyboard is better because the symbol keys like ()[]{}'":;/ etc. are positioned more effective. This is the english keyboard for comparsion with Dvorak and my own layouts below:

We talked a bit about other keyboard layouts like Dvorak, which is way more effective and relaxing than any qwerty layout, but I got no free time back then. You will need around a week to learn to type at low speeds and at least a month to get back to a better typing speed.


Dvorak

This is the Dvorak us keyboard layout (you can simply select it in windows, it is pre installed and can be used like any other keyboard layout):

After Arena Wars was finished last year I got finally some time to start learning Dvorak. Dvorak seems very nice (see the links below for additional information) and has a lot of advantages for typing "normal" text (but some people exaggerate "a little").

Anyway, while playing around with Dvorak (us default layout) I really found some things VERY annoying, especially for coding and playing games:

  • It is fairly hard to learn a new layout and getting really back to the old speed again. Additionally hotkeys you typical need on a computer are totally crazy and unusable. Hard to learn when you used QWERTY all your life, learning can be done in a week or so, but really being able to get back to your old speed can take months (and is painful).
  • Ctrl+X, Ctrl+C, Ctrl+V can't be used as easy. I always use my left hand while my right hand can use the mouse, especially for browsing, code comparing, getting text from one place to another, etc. and all this happens VERY often! I know you can also use Shift+Insert, Ctrl+Insert, Shift+Delete, but these shortkeys are just plain unuseable, maybe for lefties, but the keys still suck.
  • Hotkeys can't be used the way they used to be, for some games its possible to change hotkeys, for others not (like starcraft, at least its not easy to change) This does not only apply to games, but also a lot for applications, especially when you remembered just the location where to press and not the name of the hotkey, e.g. when using photoshop, you have to re-learn the hotkeys. Also stuff like Ctrl+S, Ctrl+O, Ctrl+F, Ctrl+R, etc. is usually remembered by the positions on the keyboard and not by the key and relearning this keys is pretty hard!
  • Dvorak is optimized for typical english words, but not for programming, some keys are even worse than the german keyboard layout. But what I really don't like is the way Dvorak handles symbols like []{};:?+-/, etc.
    Its not that QWERTY is really good for coding, especially when typing stuff like () or -, = or +, but overall it performs still better than Dvorak (counting only symbols).

I've also collected some interessting facts when comparing Dvorak and QWERTY considering c#/c++/java code. Click this link to test it yourself.

  • When pasting random stuff into the Keyboard Compare Applet, QWERTY performs almost twice as good as Dvorak (Note: We are not random key generators, usually we type text or code which makes sense ^^).
  • When just pasting c# code stuff without much text like
    if ( a == 0 )
    {
    doIt( a!=0?a:0 );
    } // if

    QWERTY still outperforms Dvorak, which can't be good!
I wanted to code faster and not slower, I don't know anyone using Dvorak anyway and I could not care less if others can use my keyboard layout or not (since I use an english keyboard layout anyway and other (german) people can't even use that ^^).

I created my own keyboard layout to solve all the problems (yeah, now its getting real geeky), but I based it on the Dvorak layout, which is really efficient and nice for typing "normal" text (which is still required a lot, even by crazy coders).
To solve the Ctrl+X, Ctrl+C, Ctrl+V problem I simply moved that keys to the QWERTY position and exchange the other keys accordingly. This didn't matter much because there isn't much of a difference between X,C,V and Q,J,K according to the key usage (see below).

At this time I was already using Dvorak for about a week or two and had spend a lot of effort into learning and thinking about improvement, I wanted a perfect solution. I checked typical c# and c++ code and wrote a program to count how often each key is used. Now I got the most important keys and asigned the best spot for each symbol using the distance (see the Keyboard Compare Applet) and how much it is used. Using shift is also a major impact IMO, especially when keys are far away.

So I wrote a little test program to count the used keys in all my *.cs files in my code folder, check out the results below.

Screenshot of the program (I improved it yesterday, it was a console tool before):

abi/blog/CountMostUsedKeys.zip">Download the CountMostUsedKeys program.

abi/blog/CountMostUsedKeys_src.zip">And the source code for anyone interessted
(may be useful if you want to write some line count tool yourself)


CountMostUsedKeys results:
Search mode=Everything, File type=*.cs, Directory=C:\code\
Number of files=4041, Number of lines=2031908, Number of keys=67829575

Type: Keycode: 3210,1%(6851259 times used)
Type: eKeycode: 1017,21%(4887698 times used)
Type: tKeycode: 1165,2%(3525648 times used)
Type: aKeycode: 974,13%(2802961 times used)
Type: rKeycode: 1144,06%(2754960 times used)
Type: iKeycode: 1053,93%(2663137 times used)
Type: nKeycode: 1103,68%(2494441 times used)
Type: oKeycode: 1113,39%(2298022 times used)
Type: sKeycode: 1153,24%(2195958 times used)
Type: lKeycode: 1082,61%(1769538 times used)
Type: /Keycode: 472,52%(1710099 times used)
Type: uKeycode: 1171,99%(1349478 times used)
Type: mKeycode: 1091,91%(1298573 times used)
Type: cKeycode: 991,77%(1201477 times used)
Type: dKeycode: 1001,77%(1198823 times used)
Type: .Keycode: 461,42%(964040 times used)
Type: pKeycode: 1121,41%(956931 times used)
Type: gKeycode: 1031,23%(832686 times used)
Type: fKeycode: 1021,22%(827820 times used)
Type: yKeycode: 1211,15%(783356 times used)
Type: hKeycode: 1041,11%(753548 times used)
Type: )Keycode: 411,09%(739711 times used)
Type: (Keycode: 401,09%(736841 times used)
Type: ;Keycode: 590,86%(580753 times used)
Type: bKeycode: 980,79%(532778 times used)
Type: ,Keycode: 440,76%(512629 times used)
Type: =Keycode: 610,74%(503579 times used)
Type: wKeycode: 1190,62%(419356 times used)
etc.
Note: This stuff does NOT represent every key pressed, hotkeys and errors and corrections are obviously not saved in the text files.

Same results without space and letters, very useful to assign the most important symbol keys:
Search mode=ExceptLetters

Type: /Keycode: 472,52%(1710099 times used)
Type: .Keycode: 461,42%(964040 times used)
Type: )Keycode: 411,09%(739711 times used)
Type: (Keycode: 401,09%(736841 times used)
Type: ;Keycode: 590,86%(580753 times used)
Type: ,Keycode: 440,76%(512629 times used)
Type: =Keycode: 610,74%(503579 times used)
Type: "Keycode: 340,38%(255445 times used)
Type: <Keycode: 600,32%(213786 times used)
Type: >Keycode: 620,3%(203429 times used)
Type: }Keycode: 1250,28%(187354 times used)
Type: {Keycode: 1230,28%(187017 times used)
Type: +Keycode: 430,27%(181705 times used)
Type: -Keycode: 450,24%(159515 times used)
Type: ]Keycode: 930,19%(130828 times used)
Type: [Keycode: 910,19%(130687 times used)
Type: _Keycode: 950,13%(89213 times used)
Type: *Keycode: 420,12%(83203 times used)
Type: :Keycode: 580,11%(77487 times used)
Type: !Keycode: 330,1%(64444 times used)
Type: &Keycode: 380,09%(58918 times used)
Type: #Keycode: 350,07%(47258 times used)
Type: |Keycode: 1240,05%(34348 times used)
Type: 'Keycode: 390,05%(31284 times used)
Type: ?Keycode: 630,03%(19709 times used)
Type: \Keycode: 920,02%(15340 times used)
Type: %Keycode: 370,01%(7019 times used)
etc.


Based on that I created my own keyboard layout, which was updated 9 times until I was happy with it.

Version 1 looked like this (pretty much like dvorak, some cosmetic changes at the right side):

Version 2: The next thing I did was moved the Z X C V keys back and copied some keys around, () are moved to normal keys, () is used much more than [] or {}.

In Version 3-6 I tried moving some keys around based on the distance and effectiveness, but I moved most of them back because they felt really uncomfortable and were bad for hotkeys. One bigger change was moving the . , () keys back down, which improves typing speed a lot because we really need more keys on the left side when using the mouse with the right hand and when typing the right hand can easily handle most of the symbol keys on the right side.

Version 7 was pretty much the final version, I trained this version a week and except some minor cosmetic changes in the upper row everything stayed this way till the last version:

Version 8 and 9 changed only the positions of J D F K B and the ? | and + - keys, at first I didn't like the position for b at the right side, but b is used a lot in combination with vocal keys unlike j, it is much better to have it on the right side. The + - key on the upper left is now the same as the key on the lower right (which is not present on all keyboards).

This is the final Version 9 I am using for nearly 6 months now, I got up to my old speed in the first 1-2 months and now I type even faster and more relaxed than before (maybe around 400 keystrokes per minute for normal text if I try hard). I wouldn't suggest changing your keyboard layout just because you might be a little faster with Dvorak or my keyboard layout, I think the comfortablity is at least as important as the speed. In my option the greatest thing about my keyboard layout (or dvorak for normal text) is the fact you can type most of the time without moving your fingers much (90% of the most used keys are directly on the center row).

abi/blog/abiKeyboardV9.zip">Download AbiKeyboardV9 installer

I was not trying to create the best keyboard layout ever or to make Dvorak obsolete, I just want to improve it for me and other interessted programmer. If you get started with Dvorak or my keyboard layout you should use some keyboard training tool and spend a couple of hours (but not much longer) each day training it. I found this website very useful: Learning Dvorak

The main reason I wrote this article now was the nagging of some people I told about this and who wanted to know more, so keep nagging if you want to see articles like this :)

If you got comments or some ideas to improve this even more, let me now!


Useful links

Introducing Dvorak
Keyboard Compare Applet (nice)
Best keyboard layout creation tool, hidden and hard to find, but this is the only free useful keyboard layout creation tool.

The Dvorak Keyboard and You
Changed Dvorak for similar symbol keys
Learning Dvorak
Pic of Dvorak default Layout (us)
Critik to Dvorak
Keyboard Layout Manager (allows to change keyboard layouts) It's shareware.
Some discussions about Dvorak (coder related):
Dvorak discussion 1 Dvorak discussion 2 Dvorak discussion 3
 Saturday, January 08, 2005
Saturday, January 08, 2005 10:10:36 AM UTC (  |  |  |  |  |  |  )

Day 19:
Some effects in action, the shoot line helps you to see where you shooting at (will be improved with a special texture, its just a line now). Some 3D to 2D converting is also not correct and needs some fixing. In the next days I will try to bring together all the completed parts and start with the mission design in the beginning of the next week.
Ratta ratta, peng peng, boom!

Shoot'em'up

Yeah, hey now. This time I had way to much fun when generating this screenshot, now it is actually possible do aim with the tank and shoot at stuff (with all the new effects and sounds). It is a lot of fun.

Warning, this is a long post (I've written it in the last 2 days), but I have a nice idea: Content links, just click on them to jump to a section:

Troubles with IIS

I had some trouble the last few days with my IIS (Internet Information Server, the thing producing ASP.NET web sites), it keept crashing and hanging up with out of memory errors (this page was down a couple of times, sorry!) Really strange, that thing is running for over an year now and I never had much troubles with it. The memory usage was also pretty high (total ~900MB, IIS worker process alone had ~400 MB), I guess this has something to do with dasBlog using .NET 2.0, dunno (there are no errors logged anywhere). I had a lot of page hits this week after all the posts on other blogs about me.
The memory consumption of IIS goes constantly up and I had over 200MB mem usage again after a couple of hours, hmm? Don't wounder if the site is down or you get some errors, may happen because of these memory errors ...

I also optimized the page from 50 entries max to 10 and cut down the number of entries you will see on the start page. I hope that helps a bit, my server is really crappy and old and needs a lot more memory (had only 256MB, but I upgraded to 512MB recently, but its slower memory. I guess I need a gig or 2, lots of other services are also running on that server). I also changed the app pool to a special one and set some timeouts for requests and processing, maybe this will help (had no problems since that change).

RenderState errors

Another annoying thing is the RenderState property of the DirectX device, it will tell you you can "get and set" some state like FogEnabled, well you can set it, but if you try to get the state it will just throw an exception. A lot of RenderState gets will throw an exception actually, I'm really impressed by that. Great work not to mention any of these things in the docs (the docs are pretty useless anyway, most descriptions are trival anyway and IntelliSense helps you just as much).

Light-Effects in DirectX

The light effects for the effect engine were pretty easy in DirectX, I remember this was very hard to do in OpenGL (had to invert the alpha color, and with different color settings everything got messed up, so a lot of special cases had to catched and handled).

Basically this code is used (the light effect is a white texture with a spotlight effect in the middle as the alpha channel):

Device.RenderState.AlphaBlendEnable = true;
Device.RenderState.SourceBlend = Blend.DestinationColor;
Device.RenderState.DestinationBlend = Blend.SourceAlpha;

Now make sure both the color channel and the alpha channel will modulate from the texture color and the diffuse color. Switching back to normal SourceAlpha - InvSourceAlpha causes also no troubles with that. I like that :)

DirectX OutOfVideoMemory

Another problem I did have the last days when unit testing was running out of video memory all the when creating the DirectX device (getting D3DERR_OUTOFVIDEOMEMORY exceptions) after ~10 tests. When restarting VS, everything worked again for some time.

I worked with that problem all week and found no solution, I changed a lot of debug settings and changed some parts of the code, but nothing helped and there wasn't any solution for out of video memory exceptions posted anywhere (my card has 128MB, how can I run out of vid mem after a couple of tests?). Then I saw that some part of the screenshot generation code wasn't finished and I saw the presentParams.SwapMode was set to Flip instead of Discard (Discard is somewhat faster, but Flip allowed me to easily catch the back buffer for the screenshot generation). I changed that, reduced the back buffer count to double-buffering and reduced the resolution for tests from 1024x768 to 800x600 and never had any Out of Video Memory exceptions since then. Maybe they happen after over 50 or 100 unit test runs, but then I can just restart VS and it is not as annoying as before.

VS2005 needs a lot of RAM

But VS2005 consumes still a lot of RAM (>800MB, I got only 512MB ram on my dev machine). I guess I have to buy some more RAM soon, everything gets very slow and crashes more often when all the ram is used (and I can't work without VS2005 anymore). Restarting VS helps, but with that much complex unit tests the memory comsumption goes up very fast again. For example todays screenshot is actually just a unit test with around 50 lines of code, making very simple unit tests helps a lot to force you to refactor and simplyfy your code constantly.

Todays Links

The links for today are The Z Buffer and Managed world, both great Managed-DirectX sites.

GosuGamers.net

If any StarCraft fan reads this, the guys from www.StarCraftGamers.com did have a lot of troubles with their hosting partner and left the partner. StarCraftGamers.net was one of the greatest StarCraft community sites ever IMO, the new site is called www.GosuGamers.net. Looks like the crew will continue their great work there, so check it out (the site has still some bugs because it is new): Good luck www.GosuGamers.net

Tropical-Islands

I'm now going to visit the Tropical-Islands resort (new big thing here in germany) with my brothers and some friends :) Development will continue tomorrow.
 Wednesday, January 05, 2005
Wednesday, January 05, 2005 6:36:35 AM UTC (  |  |  |  |  )
Welcome to 2005 :) Last week I didn't get much code done and run in a couple of problems with Lua and the hardest part about it: debugging lua scripts called from c#. Over the weekend I even tested if it might be worth to switch to Python and tested out the IronPython implementation and written some Python test programs. Python has definitely much more powerful libraries than lua and you can do great stuff with it, the OOP is also much nicer than writing Lua code and having to worry about every . : ] ) and } symbol much more than in any other script language I know of. But Python and especially IronPython is not only a total overkill for a small application and trying to get something quickly to work, the language has also a lot of disadvantages when comparing to Lua. Its not only very large and complex and therefore much harder to learn, but to get something working is much more complicated on the c# side. I also think Lua is much more customable and allows modifying much lower level methods and calls.

Ok, so I skipped that idea and returned back to Lua and finished the EffectManager on the Lua side making only a couple of calls to c#. This did not only help to learn more about Lua and scripting, but I also improved the c# engine very much and spend a lot of time simplifying code of the engine. Creating textures, making unit tests, error handling, etc. all got much easier (this comes when working with Lua and then looking at c# code and thinking everything is overly complicated). Anyways, Ivo and Fabian didn't do much either on the game and so we got stuck in the development and started today again and made a new schedule to finish the game at the end of next week. We will include some left out ideas and have gotten some new improvements on the game, the editor and some units. Ivo did also start some new objects (buildings and enemy units), there might be some fresh graphics for that soon.

Over the chrismas and new years eve weekends I read some more of my Lua and Rapid development books and yesterday I started reading Code Generation in .NET by Kathleen Dollard, which is also very interessting and got me in a lot of thinking how to improve coding in general (not only using scripts and code generation techiques, but going 1 step ahead and create new ways to handle coding and reusing existing code).

Well, first of all Lost Squadron has to be finished :-)

Useful links today:


Day 16:
This screenshots shows my Lua EffectManager rendering effects with help of c# classes (this is just a small unit test testing some effects), it is very fast and calling Lua up to 20 times a frame produces still over 500 fps in debug mode and won't slow down the game at all (using Lua is goooood ^^). I wasn't posting updates since the last week because there wasn't much going on to produce fancy screenshots and I worked at other stuff (internal parts of the engine and Lua scripting). I will now try to post a screenshot at least every 2 days or so. Tomorrow I will hopefully finish the unit shooting and exploding part and post a ingame screenshot again.
 Wednesday, December 29, 2004
Wednesday, December 29, 2004 11:42:35 AM UTC (  |  |  |  |  )
Omg. I have become a total slacker the last couple of days, no updates here :( I didn't had much time over christmas to code, but I read some more of my Rapid Development book (abi/blog/PermaLink.aspx?guid=42bdcd49-2490-4f60-af1c-3ff54c1be1d1">see last post) and it is still interessting and insightful. Yesterday I still was in vacation land and had to force myself to get back to coding ^^

I also reconsidered some choices I made and came to the conclusion that this project was originally started to make a quick little game with DirectX9 in c# and also to write a new base engine for upcoming DirectX9 projects. I did obviously spend too much time researching shaders (DirectX9 fx high shader language) and saw last week there is no way to implement that nicely in 2 weeks (when the game is running with all the other parts finished I will reconsider implementing shaders). For the engine part of the deal this is still great work and I have a lot of base classes for any shader effect development ready, but for the "quick little game" Lost Squadron part it is not looking so good. It is a conflict of interests because finishing up something quickly does not work hand in hand with researching and implementing new techniques. For this project I think it is better to focus on developing a solid base engine, next project will be planed much straighter.

Yesterday I collected a lot of effect graphics and sounds and made some new ones. I got now a nice collection of effects with graphics and some funny sounds for the effect engine and made a couple of effect types (parameters, testing, etc.), but when adding more and more effects it became very obvious that this would be a great think for scripts. Instead of hating myself later for not using scripts right away, I just went crazy and implemented the whole effect system in LUA scripts and can add new effects there without changing any code of the engine. I did the base code for that a month ago (check out LUA.NET for doing that in c#) and have read the great book Programming in Lua by Roberto Ierusalimschy.

LUA links in case you are interessted:

The effect engine needs still some testing and I haven't worked with lunit yet (will do that tomorrow), everything should be up and running tomorrow and I will post a new screenshot with some nice effects then. The rest of the base classes except wayfinding and enemy ai is also pretty much complete, so I hope I can finish up a small demo till New Years Eve (driving around, shooting at some stupid enemies).

Sorry for no screenshot today and sorry for the long pause. Fabian is ill (my intern helping me out a bit with Lost Squadron), hope you get better till next week :) Tomorrow the LUA effect engine should work and I will post a screenshot of the actual gameplay finally (I want to kill some stuff).

 Friday, December 24, 2004
Friday, December 24, 2004 9:43:25 AM UTC (  |  |  |  )
First of all: Merry christmas to everyone and thanks for reading all this stuff, my page views increased a lot since I do this daily series.

I spend the last couple of hours trying to get Unit Testing on the engine level to work and I finally got now everything up and running. This is really one of the greatest things ever in Game Development IMO! Normally I would spend a lot of time changing code to just test stuff or even write small test application only to check the behaviour and graphical output of effects, newly imported textures or models or new game features. Now I can just write a VERY short Unit Test for that INSIDE my project, no more extra projects, no more messing around in the code.

Just to make this clear: This is not a usual Unit Test like in other parts of the engine, like when checking file input/output, internal methods or some logic issues. These Game Unit Tests (thats how I will call them from now on, or just GUT, which is german for good ^^) give you all the features and easy testing possibilities like normal unit tests, but you can initialize the whole engine, see visually whats going on and shut down everything automatically or by user input. Let me give you an example how this looks:


Note: This code uses .NET 2.0, if you want to read about Anonymous Methods click here.

Same thing is of course possible with a couple of lines more code when not using Anonymous Methods (using Events or just duplicating the code in TestInitEngine). This code will create all the stuff required for the game engine, then execute the initialization code to create the effectManager. Then it will proceed to the game loop and execute the render code each loop there, everything will be shut down if the user quits the form, presses some key or if we set a timeout to quit automatically. There is a lot of hidden code behind all that, but this is exactly the code executed when just running the game and testing that is always good :-)

In the next 2 days I will not code much (visiting family, chrismas, etc.), but I will to read 2 nice book from Steve McConnell: Code Complete 2 and Rapid Development. I already read a couple of pages of Rapid Development and it is really written good and very interessting.

The next Lost Squadron screenshot will be posted presumably in 2 days.


Day 14:
The game itself did only get some minor improvements today, I spend most of the time on the engine. As you can see on the screenshot, there are now effects like that explosion effect (there are already over 20 effect types), but the EffectManager isn't complete yet. Additionally to the road it is now possible to set railroads and I imported some new objects and new graphics into the editor (not on the screenshot).
 Thursday, December 23, 2004
Thursday, December 23, 2004 9:19:14 AM UTC (  |  |  |  )
Hey everyone. Today I made some improvements on the graphical side, mainly because I received some mixed feedback about the current graphics. Doesn't look too pretty right now. For that reason and because a lot of classes for the game handling are not finished yet (and only 1 day left till chrismas) I think its much better to give this project 1 week more. Maybe this time will be enough to finally implement shaders and shadows for all objects. Especially shadows will add so much to the game, it is pretty much impossible to tell how height an object is when looking straight down. Shadows would not only make the scene more realistic but would also improve the gameplay (you would see what your unit can and can't see).

As you can see on the screen I completed the roads stuff and added some new objects. Also as planed yesterday the moving around and mouse aiming does work now, but I'm screwed again with those X files, there are totally messed up (rotation wrong, each object is rotated differently, meshes do not fit on top of each other, the upper part of the tank does not have the same pivot point, really annoying), grr, but I don't have the time to write an own 3d-model format (or import any format into the engine, 3ds would suck at a similar level).

I also started the game message classes and most classes needed for gameplay are existing now, but most of the functionallity is missing. I will try a new approach this time to write that code: Unit Testing. Many smaller methods of the internal engine are already checked, but I never done large Unit Tests for a whole game. The tests should be able to run the whole game (creating units, moving around, blowing stuff up, doing graphic effects, winning, losing, etc.). I will report back how that works. Later today (when I slept a couple of hours ^^) I will start that stuff with my intern Fabian :-)

So the new date for the first Demo version of Lost Squadron is 2004-12-31. It might be playable tomorrow already a bit, but I don't think it is wise to release it so early. The first experience should be very nice and for a quick look you got the screenshots here ^^

Here is a fun link about Programming Languages and why some of them failed and others not:
why-microsoft-can-blow-off-with-c.html


Day 13:
Some new models, but still a lot of problems with x files (man they suck, I can't imagine anyone is actually using them for anything except test projects). Note: Don't expect that this screenshots will fully represent the final game, everything can change (just check the screenshots of the first days, there have nothing to do with the current state).
 Wednesday, December 22, 2004
Wednesday, December 22, 2004 9:52:57 AM UTC (  |  |  |  )
Yes! Finally I got back to the game code after all this Editor and Shader coding and run into some problems when rendering some models with transparency. First of all the models had to be rendered from back to front, but even then the models with multiple alpha layers were completly messed up. So I had to split up the alpha layers to multiple meshes and tryed to render them back to front, but DirectX tries to render per materials and not per meshes, so that didn't work easily.

I had another idea to just test the alpha values for 50% alpha and then skip writing to the frame buffer and that didn't work either (framebuffer is full of false pixels anyway). Instead of banging my head into the wall I just steped back and thought about needing this feature at all and no, there is no need for that in this game: I can just delete or don't use anything with multiple alpha layers. For example the palm had 3 layers of palm leaves, but I killed 2 of them and no everything is working perfectly (I still have to sort objects and to render first solid, then alpha materials, but thats pretty fast). I'm happy I got this solved :-)

The Editor was also improved a bit and everything needed for a full mission can be set there. As you can see on the screenshot there are a couple of new features for the map: Roads, some more neutral objects and some enemy units. Shadows and shaders would be nice too, but there is no time for that right now. Maybe I will be able to put that into the engine next week.

Moving around with the tank and aim and shoot on stuff should work tomorrow. Effects and AI won't be complete till christmas, there will be most likely only a couple of standard effects. Also collision detection is another big issue.


Day 12:
Lots of dummy objects (especially the red car), but lighting works, loading maps from editor works and roads are going to work soon too ^^ Also a lot of gameplay classes done today. More objects will be made and imported soon to improve the game feeling.
 Tuesday, December 21, 2004
Tuesday, December 21, 2004 5:42:51 AM UTC (  |  |  |  )
Well, this shader stuff is really annoying. I got a new shader for the landscape in a test app working and implemented some test textures there. But when changing the light to a spotlight I ran into many problems, not so easy as I thought. At least I know now how to pass all that vertex buffer data to the vertex shader, but for a ground shader with works nice with all the lights there is still some work to do and I don't have the time for that. So I will skip now all the normal mapping stuff until later when the game is complete. For meshes normal maps are working (at least with directional light), maybe I will use some of that.

Anyways, time is running out, I wrote down all the weapons, powerups and enemies today and created some classes for that, but there is nothing finished yet, so no screenie today. Sorry. Worked the last couple of hours on shader stuff anyway and I told myself it I don't get it working today, I will leave shaders out and add them maybe later.

 Monday, December 20, 2004
Monday, December 20, 2004 8:13:54 AM UTC (  |  |  |  )
I was working still on the Editor today, not that much editor features were missing, but a lot of other stuff eat up a lot of development time. Drawing lines for example is really bad in DirectX, either you just draw some primitives and get slow when drawing a lot of them and have a lot of overhead each time setting all states (and recovering from some crazy states the caller might have left, nothing is working as espected) or you use this stupid Line class wrapper thing, which will cut your framerate by the factor 2 or 3 (really great, no wonder noone uses it). Or you can just draw stuff with vertex buffers, but thats also very annoying because you have to create the vertex buffer and handle all that vertex creation, and also obviously not the right approach for a single line.

So I ended up writing a nice LineManager class, which collects all lines draw each frame and put them in a vertex buffer and because the lines are only changed when some big change happens, the vertex buffer can stay the same for a long time and thats really fast. Everthing gets rendered at the end of the frame (used for on screen controls and other stuff anyways). Same thing for filled boxes, color blending effects, etc. lots of helper classes.

The texture blending (as you can see in the image) was also not a piece of cake, but the blending over 5x5 vertices is now a nice technique. The textures are not really fitting good together, when you just put them besides each other, but with this blending technique it looks really good (or maybe I'm just to tired to tell anymore ^^). Another bonus is my new vertex format, which is compatible with a test shader I wrote 2 days ago (which didn't run correctly back then, I only managed to do some basic stuff). Seems like some arguments where missing and the vertex shader wasn't complaining, but crashing some time later (after couple of calls, not really funny to debug).

There isn't much time left, so maybe some features might have to be put on hold because I really want to finish the base game this week (just 1-2 missions, only basic features to see if its really as much fun as I imagine). If its playable a small demo or some sort of beta-version will be available before chrismas this week. Anyways, till new-year the game and the final demo-version should be finished, lets see. Maybe in the next couple of days things can be done more quickly because all the base classes and the complete framework are now completed.


Day 10:
Yup, yesterday no screen, I was too tired. The editor is now finished, only setting objects and the roads is missing, but that should be easy. All the other sub menus and UI is now complete too, even the multiplayer stuff has a UI now waiting for implementation (dunno if there is enough time this week for that, would be nice though). Time for some gameplay this week :-)
 Saturday, December 18, 2004
Saturday, December 18, 2004 4:21:08 AM UTC (  |  |  |  )
Today was Editor-Day. Our intern Fabian helped my out a little with the map file and we implemented all the UI controls for the Editor, all of them are working now, at least on the UI side. The Map Editor itself will be finished tomorrow, still a lot of smaller things to do before everything can run smoothly.

The UI needed also some improvements, so I made completly new graphics for them and updated all UI controls and added some we needed for the Editor. All this little things, like writing UI code, writing smaller classes for the ground textures, the road logic, neutral objects and the enemy units can really keep someone busy. I still hope the basic engine for this game can be finished this week, so we got next week to make some cool missions and the advanced stuff (shooting, effects, multiplayer).

About all this shader stuff from the last couple of days: I managed to get some basic shaders to work, which is really nice now, but still no clue how to implement all that spotlight normal mapping with alpha blended textures. Maybe I will just use some sort of directional light for the bump effects (or maybe a point light if I can pull that off, but then all the lighting calculation has to be done inside the shader as well, uhh complicated).


Day 8:
Half-time, 1 week has gone by for this project. This is a image of the editor, you can easily create new maps or change existing maps with this nice tool :)
 Friday, December 17, 2004
Friday, December 17, 2004 4:54:06 AM UTC (  |  |  |  )
Some internal work for the Editor was done today and I wanted to finish up all this shader stuff, but run again into a lot of problems. Vertex Shaders are really a pain in the ass to debug, everytime anything goes wrong the whole app crashes (I catch exceptions everywhere, but DX will just fail at everything and the app has to be shut down). There are also a lot of problems with the shaders to support spot lights and some other stuff in the engine like blending textures over each other.

Because of all this problems there is no real screenshot this day (with all this shader errors Lost Squadron isn't looking pretty today ^^), but you can see my first shader version of normal mapping on the right. Tomorrow will be the last day I will try out to get this goddamn shaders to work, else I will just leave them out and finish the rest without any high level shader support and maybe add them later ...


Day 7:
Shader test (extra program I wrote), works ok after lot of testing finally, but shader needs lot of improvements to work correctly with spotlights.
 Thursday, December 16, 2004
Thursday, December 16, 2004 6:24:42 AM UTC (  |  |  |  )
I completed the landscape rendering class and object loading today and played around with light effects. Directional lights were pretty easy, but very boring for this top-view-camera. So I tried out Point lights and they are nice, but why not test Spot lights? Well, now I know why, they are very hard to maintain. Setting all values properly is not that easy. But I like the effect (you can even rotate the light direction).

Other than that I tried also to implement the ground normal map shader I developed yesterday for the last couple of hours, but I can't get it working. Some mul operation always crashes inside my shader and is very hard to debug. Maybe I need to debug everything with DEBUG_PS and DEBUG_VS. Well, I hope I get that working tomorrow.


Day 6:
A big spot light effect on the landscape. The objects are not final yet and have no effects. But lighting does work well, maybe there is even some time to implement shadow maps later this week. We will see.
 Wednesday, December 15, 2004
Wednesday, December 15, 2004 5:23:04 AM UTC (  |  |  |