Engine Update 001

I’m in the process of redoing my “testing” engine. I hope to make it robust, scalable, modular, while supporting a lot of other different technologies. This is the start of it using D3D9, but don’t worry, I’ll eventually port it over to d3d11. I’m going to skip 10 though. I have lots of things in the works for it too!

As you can see here, I have a few simple cubes and a triangle grid. Most likely the grid will turn into terrain. I haven’t decided what I wanted to name the engine yet. I’m leaning towards “Tornado.” I remember looking into a physics engine a while ago named “Cyclone” and I thought the name was interesting.

How to become great

I was reading an aigamedev.com article about the gaming industry and I stumbled across a piece of knowledge that I feel was very valuable. It’s something I try to do everyday and I believe you should to if you want to become good at what you do.

“Embrace diversity, and  try  to  find  something useful  and  worthwhile  everywhere, from  every  person.  Make  an  effort to understand what they are saying, deeply,  and  incorporate  it  into  your own  way  of  thinking,  so  it  can expand.  Keep  your  own  opinions and  convictions,  but  relish  every opportunity to learn.”

-Paul Tozour

VS2010 Extension – Better Fix Mixed Tabs

I frequently deal with code that has tabs in it that needs to be converted over to code without tabs, preferably without losing any formatting. Unfortunately I have yet to find an extension to do this. I thought an extension called “Fix Mixed Tabs” would do the trick, but it only untabifies or tabifies the beginning of a line, so I wrote this one which can be found in Microsoft’s Visual Studio 2010’s gallery.

It can convert between tabs and spaces, it doesn’t go just one way.

Title: Better Fix Mixed Tabs (because Fix Mixed Tabs doesn’t do what I needed)
Link on Microsoft’s site (recommended): Better Fix Mixed Tabs

Adding “edit with” to context sensitive menu

I manually installed notepad++ into my dropbox folder so I could use it anywhere. Unfortunately, it didn’t add the “Edit with Notepad++” entry for the context sensitive right-click menu. This trick works for almost any application that accepts a file name on the command line as the first argument.

To see if your application has this ability, open up a command prompt (start->run->cmd). For example, lets see if notepad has this ability. In the command prompt, type “notepad.exe file.txt” without the quotes and where file.txt is some text file in the directory the command prompt is currently in. Notepad will launch with file.txt loaded and showing. If you can do this with other apps (such as Notepad++), then you are good to go.

So to add the “edit with” menu option manually, you have to create a text file and add this to it:

Replace the path with wherever you installed the application you want to launch (in this case, it was notepad++.exe).

Two things of note: Make sure the path has double back slashes between each directory “\\” and make sure that after the “file.exe” file name, there is a trailing “\”. In this example it says “…\notepad++.exe\” This must be there.

You can make it say whatever you want in the menu by editing the words “Edit with Notepad++” to whatever you want.

Save the file with a .reg extension. After you do this, the file should have have an icon with little blue building blocks on it. Double click it, windows will ask if you really want to enter this into the registry, click ok/yes.

You now should be able to right click on any file and have the menu option come up. Clicking it will result it the application launching with the “clicked on” file loaded (if the application developer implemented this.)

Linking libraries in code with MSVS

If you use visual studio, you can use a #pragma to tell the linker to link in a library. This way, you don’t have to screw with project settings if you just want to quickly test something.  For example, if you wanted to link in the winmm.lib import library, it is done like so:

Header Guards

A lot of people don’t know this, but #pragma once is actually an optimization. It is faster than using the #ifndef blocks.

But you’re in luck because you can safely write portable code with it, in case the compiler doesn’t recognize #pragma once by doing this:

Books I’ve read before 2009

3/5 – Introduction to Game Development
This books has a little to say about a lot of the different areas of game development. If you don’t know anything about the game industry or how things work, it would probably be a very good read. The sections that helped me personally were the physics and the programming sections. The rest were not interesting to me. I’m sure they would be interesting to the people that took interest in those sections, obviously.

5/5 – Get in the Game! – Careers in the Game Industry
Goes over in depth of how a game dev studio works internally and what each position entails. If you’re trying to break into the industry, I would definitely recommend this book.

5/5 – Unix for Dummies
If you’ve never used linux or unix before, this is a good book. It’s easy to follow and is actually a decent reference. Although it doesn’t have advanced things, which I wouldn’t expect it to. For getting acquainted with linux/unix, it’s very good.


Books I’ve read in 2009

4/5 – Advanced Lighting and Materials with Shaders
Discusses a ton of different BRDF’s that I never knew existed. This book is really book and meant for advanced graphics programmers. There are a couple of things I dislike about the book: 1) Math formulas are glazed over and never really discussed, so you have to figure them out for yourself, which isn’t necessarily the end of the world. 2) Spherical Harmonic Lighting section was confusing. I’m not sure it was the books fault though because the concepts are really advanced. I just wish they were discussed in more detail. I had to read the section like 3 or 4 times and I’m still not 100% clear on some aspects. Overall, if you are into graphics, I highly recommend this book.

3/5 – Focus on 3D Models
This book is a little bit dated unfortunately. I’m not sure why it bothered discussing the obj model format, I feel it’s pretty worthless. You can be the judge though as the model formats it discusses are as follows: md2( quake 2), obj, milkshape 3d, 3ds, mdl (half-life), md3 (quake 3). I was looking for a good model format and so far I’ve settled on a possible few: milkshape 3d, x format, or possibly md5?  Milkshape 3d seems to be a good general one that can easily be converted to and from others.

5/5 – Programming Interviews Exposed
I learned quite a bit from this book, like solutions to problems that I’ve never really come across before but that could perhaps be useful in the future. Unfortunately, a lot of the questions are simple of you know the “trick.” Otherwise, it’s a good exercise and refresher if you’re rusty. I felt that this book helped expand my mind and helped me start thinking outside the box.

Joomla to WordPress migration

I moved my entire website over from Joomla to WordPress because I find wordpress easier to use. The interface is a lot cleaner and elegant. With Joomla, for example, I kept getting confused between a “section” and a “category” and it REQUIRES you to use both. WordPress just has “categories” and that’s all I need because you can make subcategories and subcategories within those subcategories. I also think it’s a bit faster too, but I also changed my hosting provider too from goDaddy. goDaddy used to be pretty good, but their website is a horrendous mess and my website was so unbelievably slow I wanted to throw stuff.

Anyways, wordpress is really nice because there are lots of ways to customize it easily, like with the addition of plugins. There are tags (which I didn’t have before), and for some reason, google didn’t really like my site when it was on joomla. I don’t think it was being indexed properly because Google only was able to pick up my main page. The only problem I had was the migration from Joomla.  I did find a tool, but it was for an old version of wordpress & joomla. It wasn’t too difficult to fix, but it did take a day or two. I reposted it under my “other projects” area though, the author didn’t seem to care. I was hoping he would repost it on his site, but he hasn’t contacted me back yet.

I did find some bugs in the tool regarding quotes in strings. That was a major pain because the quotes were ultimately going to be in the sql statement. I already had a lot of posts, and most of them looked ok, but only a handful of posts didn’t and I didn’t know why. After a little research I realized that, for some reason, I had uncommon characters in my post. Basically sql choked on these characters (i.e., didn’t say a thing and just died.)

Other than that, a lot of site specific stuff needed to be fixed. It probably isn’t all fixed, but periodically you may find stuff in the site that has the string “{jcomments}” in it. This was a thing in Joomla that allowed me to insert a “comments” plugin. So I had to through and fix a bunch of that kind of stuff. There were also some formatting issues that caused the entire site to blow up. There weren’t too many issues, but overall, it took about 20 – 40 to get things running smoothly. I still was hoping to check out a bunch of other cms’s, but as soon as I tried wordpress, I fell in love.. 🙂

Overall, the style of the site currently is Ok. I had to edit some stuff to get it to look the way I wanted though with the current theme, which I like with a few tweaks.

As a side note, I have support for LaTeX.  See math equation below for an example.

[math]\sum \sum \mathit{e5}+\mathit{r23}[/math]

Now that the site migration is practically finished, I can get back to work.

Software I Use

I am always on the lookout for the latest and greatest tools and evaluating and testing some of the best to make my life easier and my work go faster. The following tools are the ones that I find most valuable and useful for me. Almost all of this software is free except for a select few tools.

  1. Notepad++ – All around good editor with syntax highlighting
  2. FileZilla – a good stable ftp client
  3. SugarSync – backup files on the cloud, share, etc.
  4. Gmail – Email
  5. Visual Studio 2010 – Not free
  6. ViEmu Extension for VS2010 – Not free
  7. KeePass (use with sugarsync) – Manage passwords, cd keys, login information, etc.
  8. LogMeIn.com – Remote access your computer from any other computer through internet
  9. AntiVir Antivirus – Free and good
  10. Google Reader – Keep up on the latest
  11. Google Docs – Your docs can be accessed anywhere
  12. Nirvana (Nirvanahq.com) – Task management system. Get stuff done
  13. Google Calendar – Can create events and be notified on your phone.
  14. Local Website Archive – Save a single webpage for later
  15. WinHTTrack – Save an entire website for later
  16. CCleaner – Remove junk files from your computer from lots of different areas.
  17. f.lux – Adjusts monitor’s temperature according to daylight, makes easier on eyes.
  18. Secunia PSI – Finds all software on computer that has a security vulnerability
  19. Areca – Backup software, free
  20. Windows Grep – search inside of files for a specific word or string
  21. Directory Compare –
  22. Restoration – Allows you to possibly recover a file after deleting it.
  23. CPU-Z – Displays all sorts of information about your cpu, memory, motherboard..
  24. GPU-Z – Displays lots of info about your gpu, temps, etc.
  25. CPUID Hardware Monitor (HWMonitor) – Small, fast temperature monitor for your computer
  26. Input Director – Allows two computers to require only one mouse and keyboard.
  27. Startup Delayer – Makes startup faster by allowing you to schedule WHEN a startup app launches.
  28. Everything (http://www.voidtools.com) – Extremely fast and small file indexer, allows you to locate files instantly. Much better than win7 solution.
  29. Unlocker Assistant – Allows you to unlock files if their handle hasn’t been released by some program. Mainly for xp, I haven’t needed this on win7 a whole lot.
  30. Diskeeper 2010 – Not free, but the best defragger I’ve ever come across.
  31. RegAlyzer – A free more advanced registry editor. The main thing I use is the dropdown text box, so I can copy and paste entries from the internet into the box easily without having to navigate it manually.
  32. XML Notepad 2007 – Visually inspect and edit xml files.
  33. Google Chrome

Chrome Extensions:

  1. Google Shortcuts – Official firefox port
  2. Sexy Undo close tab
  3. Download All
  4. LastPass
  5. Google Mail Checker
  6. Neat Bookmarks
  7. FreshStart – Session Manager
  8. Speed Dial – An empty page has links to the most used pages you probably want to access.
  9. Xmarks – keep your bookmarks on the cloud and access them anywhere while keeping them synchronized.
  10. ReaderPlus
  11. Super Full Feeds For Google Reader
  12. RSS Subscription Extension (By Google)

I didn’t bother listing any of the reversing / assembly tools that I use as there are so many. You can find sites that has a list of tools that are popular.

Free Books Online

CG Tutorial
GPU Gems
GPU Gems 2
GPU Gems 3
ShaderX Series
GameDev.net D3D Book
The 3D Graphics Pipeline
Linkers and Loaders

C++ Casting

I created a table that has lots of useful information about c++ casts.

  1. Only can be used with pointers and references.
  2. Throws bad_cast if reference can’t be cast, returns null if pointer can’t be cast.
  3. Performs runtime checking.
  4. Makes sure cast is valid & results in a complete object.
  5. Down casts are not valid (base to derived) UNLESS base is polymorphic, gives compilation error.
  6. Up casts are ALWAYS valid (casting to base).
  7. Compilers must have RTTI turned on.
  8. Can cast any pointer type to void*.
  1. Does not perform runtime checking. (compile time only)
  2. Makes sure objects are related using hierarchy tree.
  3. Up & down casts are valid.
  1. Just copies the address over with pointers.
  2. No checking at all.
  3. Same as C-Style.
  1. Used to remove or set constness.

Books I’ve read in 2010

4/5 – How to make people like you in 90 seconds or less

This book is a pretty good book because it talks about things I probably wouldn’t have ever thought of. It can be used to network, get a date, or enhance your current social life. The book isn’t very long and at first the book didn’t seem to be that great. By the time I got to the end I was pleased with what I had read overall. I gave it 4/5 because I didn’t think the book was super awesome in any way, but I thought it was worth the read if you want to improve your social skills when meeting new people. I honestly don’t know what would make this book a 5/5 though since I’m not into reading these types of books very often.

5/5 – Game Development Essentials: Game Industry Career Guide
A very good book about preparing to enter the gaming industry. I wish I would have read this while I was actually in school.

5/5 – Pragmatic Programmer : Journeyman to Masters
Lots of really good general coding practices that I should have been taught but was not. All coders should read this to avoid sucking at their job.

4/5 – Effective C++
Although I knew quite a bit already, this book clarified the why’s. A good book overall. I still learned quite a few things.

3/5 – More Effective C++
Taught me why C++ sucks. Has solutions for things that I felt were hackish or incomplete (reference counting solution for example). At least take note of the table of contents. Worth the read if you plan on coding in C++ for your job though.

4/5 – Effective STL
Taught me all the problems the STL has. Basically, if you do advanced things with the STL, either know the STL inside and out, or avoid doing advanced things because it may cause you headaches. It discusses lots of STL special cases. My opinion after reading this book: the STL sucks because it requires a book to explain it and to discuss it’s pitfalls and problems. If an api/library is well written, it shouldn’t need a book to discuss all of its pitfalls and workarounds. Although, the STL is still better than whatever solution you could possibly come up with by yourself. For general coding it’s good, for advanced stuff, well…. you were warned. A lot of special cases are discussed by this book though, so if you plan to do lots of STL stuff, this book is definitely worth the read.

5/5 – Introduction to 3D Game Programming with DirectX 9.0c A Shader Approach
If you’ve never used D3D before, get this book. Although lots have changed since DX9, it still has lots of concepts (and more advanced things like skinning) that are still very much applicable. I wish I would have read this book a long time ago instead of fumbling through the API’s documentation (which is a good reference though.)


Azeem Khan wrote a script that allows the user to export data from joomla and move it over to wordpress.
Unfortunately it didn’t work with the latest: Joomla: 1.5.20 Stable and WordPress: 3.0.1.
So I extended it, you can find the script here: Joomla2WordPressV4

Azeem Khan’s site is here: http://azeemkhan.info/