Gamedev tricks used by developers

🧵 origin thread In 2018 I started a thread on Twitter (later renamed X 🙄) where I shared some game development tricks devs used to get around bugs, software, hardware and/or time constraints. Later I kept adding more posts to that thread, and there’s some cool information there. But because I now went through the process of replicating that thread on both Mastodon and Bluesky; it got me thinking, I should probably put this on my own blog, a single post, which is easier to read, also in case those websites are ever gone. If I find more I’ll add them later. This page may take a bit to load due to images, gifs videos etc. ...

November 15, 2024 · 7 min · 1414 words · David Amador

Detecting C++ memory leaks in Visual Studio - again

I made a small post about detecting C++ memory leaks in Visual Studio in 2010. At the time that seemed to suffice, but some months ago someone told me about Visual Leak Detector and boy does it work. According to the website itself Visual Leak Detector is a free, robust, open-source memory leak detection system for Visual C++. It’s pretty easy to use. After installing it, you just need to tell Visual C++ where to find the included header and library file. ...

June 3, 2012 · 1 min · 154 words · David Amador

Find/Replace in Visual Studio using regular expressions

Usually Find/Replace gets the job done for what I need, although sometimes using “Replace All” can break more stuff that it fixes. But today I had this function I wanted to get rid of and simple change it with a public variable. So I had something like this. object->setLayer(/*BLABAL BLA CODE, */); I want to replace it with something more simple object->Z = /*BLABAL BLA CODE, */; So using Visual Studio Find/Replace in regular expressions mode I used this as a search string ...

January 14, 2012 · 1 min · 207 words · David Amador

Basalt code swarm

I discovered code swarm a while ago and decided to test on my own repositories. This is a test on Basalt, and although I’ve been working on the engine since January 2010, only in 2011 did I placed in on a repository so a bunch of stuff is added right on the beginning. This is the result.

December 23, 2011 · 1 min · 57 words · David Amador

Blog new look

Spent a little time giving my blog a new look. It’s not that I didn’t like the old one but sometimes it was a bit of a mess, I’ve been getting many new readers so it was time for a cleaner look. My main concern was getting all code posts to be readable but I think they are class XPTO { public: XPTO(); }; Let me know if you find any errors, since I’m not going to dig up the whole blog finding errors =P Also feedback on the new layout is most appreciated. ...

March 22, 2011 · 2 min · 249 words · David Amador

So where is that motivation?

I follow a couple of dev blogs, some are game developers, others make websites or software. In the last couple of months I’ve been reading a lot of them complaining about lack of motivation to develop their idea of the lack of motivation for development in general. Happens to me too, heck it happens to everyone once in a while… It’s something that happens usually half way though or after you get the initial prototype running. Around one year ago (Feb 2010) when I started developing our first game it was all great, new stuff every day, things starting to work, replacing my crappy programmer art by Rita’s drawings. The real endurance was after we had a working demo, and the decision of actually finishing the game. ...

March 9, 2011 · 3 min · 527 words · David Amador

Viewing Windows Phone 7 Marketplace on the simulator

Since I’m out of the countries where WP7 Marketplace is available it’s been a real pain to check out new games and most of all if Vizati was already available. Btw it’s out there, go give it a try, there’s a trial mode. It’s great fun 🙂 So searching some forums I found a neat code to check this on the simulator. Basically create a new WP7 Silverlight App and write this main page code ...

November 17, 2010 · 1 min · 129 words · David Amador

Tracking memory leaks in Visual Studio

I just discovered this useful piece of code for all who don’t have (including me) any memory leaks tracking code or software. I know there are other and better solution but this can be handy for quick findings without much hassle. First place this code in your entry point file, generally main.cpp inside your main() function #ifdef _DEBUG int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); flag |= _CRTDBG_LEAK_CHECK_DF; // Turn on leak-checking bit _CrtSetDbgFlag(flag); #endif Now just run you game/program as you would normally, in debug mode of course. ...

October 19, 2010 · 1 min · 165 words · David Amador

Using Isolated Storage to save/load files on Windows Phone 7

I’m seeing a lot of forum threads with people asking how to save/load files on Windows Phone 7, well for XNA 4 in general. You can use IsolatedStorage for that using System.IO.IsolatedStorage; Both save and load can be done by creating a IsolatedStorageFile, I then use a Filestream and write with a binaryWriter IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); // grab the storage FileStream stream = store.OpenFile("test.txt", FileMode.Create); // Open a file in Create mode BinaryWriter writer = new BinaryWriter(stream); float myvar = 5.0f; writer.Write("something"); writer.Write(myvar); writer.Close(); For loading is pretty much the same thing: ...

October 10, 2010 · 1 min · 153 words · David Amador

Instance based Callbacks in C++

One of the things that was probably forgotten but the dudes who made C++ standard were callbacks, there’s no out of the box solution for Instance based Callbacks, just for functions. When I moved to C# I was really happy with the way delegates work, it’s simple, easy and most of all, it works. On game development one of the things callbacks are usually used is for Buttons, you have a menu and want to attribute a function to each button. Sure you can point it to the same one and make a bunch of if’s and then point to a Global var which does the correct action, but this is not elegant and sure as hell not easy to add/modify stuff. ...

July 14, 2010 · 2 min · 296 words · David Amador