How to do a Xna Log file

Although the title says XNA log file this is actually a C# log file, I’ve just thrown this title cause lot’s of people search for xna log instead of C# log file. Many have asked me why take time to do a log file when you can throw exceptions when something goes wrong. Well the answer is simple, to keep track of what’s happening, log steps, write to the file exactly what when wrong even if you are on Release mode, and more, if someone complains the game is crashing you simply ask for the log file and see what when wrong. ...

November 20, 2009 · 2 min · 350 words · David Amador

Using PerfHUD with XNA

I am definitely a fan of ATI cards. Had a few Geforces but didn’t liked them very much. I actually noticed image quality decrease when switching from an old Radeon 9800 to a Geforce 8k something. I’m very happy with my Radeon 4890, now for the downside, PerfHUD, a very handy tool for Game Developers is only available for NVIDIA chipsets and although ATI has it’s own GPUPerfStudio it’s not the same thing. Anyway for those who have one and are developing for XNA you may have noticed that it doesn’t run PerfHUD out of the box. You will get an error, something like: “This applications is not configured for using PerfHUD. Consult the User’s Guide for more information” ...

November 18, 2009 · 2 min · 293 words · David Amador

Unreal Engine 3 is now free

Epic decided to offer Unreal Engine 3 for free to non-commercial applications. Sounds kind of weird considering it’s one of the best and most licensed engine out there, but maybe the recent release of Unity 3d free for all uses made them consider this option. Named UDK (Unreal Development Kit) you can download it here and have access to all tools and features that the full commercial Engine contains, well, except for the source code of course. This opens a lot of doors to students and indie hobbyists as me. I just can’t wait to have the time to get my hands on this. ...

November 5, 2009 · 1 min · 104 words · David Amador

Force a wmv to download instead of opening in browser

I recently needed to force a WMV to download using Apache. The default behaviour for most browsers is to try to open the movie inside the browser itself. This works fine if the person has the plugin otherwise we just gonna have a blank page. Also for huge WMV is easier to download the file for later viewing. So just place this on your .htaccess on the root of your website. ...

October 30, 2009 · 1 min · 95 words · David Amador

Prototype for xna7day competition

I decided to make a game for the xna7day competition, in which we have to make a game that only uses 2 keys, so absolutely no analog input and it has to be built on xna of course. This is a great opportunity to test my engine Basalt. I decided to make a puzzle game, basically the rules are the same of a 3 in line game. This is what I have so far. ...

October 29, 2009 · 1 min · 74 words · David Amador

How to make a clickable div

Making a clickable text or image is easy, just add the <a> tag surrounding it. But this doesn’t work with divs and sometimes we need a whole div to be clickable and not just text. The following code is for JQuery but switching it to your favorite JS framework should be very easy. First start by adding this to your div <div class="clickable"> </div> Now a little css to simulate the pointer on that div ...

October 25, 2009 · 1 min · 108 words · David Amador

Accelero twin turbo

Because my Ati Radeon 4890 fan fried I had to buy another cooler. After a little research I discovered Artic Accelero Twin Turbo. Today I decided to finally try it. The assembly is rather easy, the package comes with several heatsinks for memories, and of course the fans themselves. There are three ways to connect the fans, either directly to the VGA card itself, directly to the PSU with 7V or 12V. My stock cooler was connected to the vga card so I left it the same. Bad choice, with the card idle I was getting around 70º, way hot. I switched the fans to the PSU with 12V and voila, the Artic promissed values, around 50º, a decrease of around 20º, which is great. As for the noise I can barely hear it. So if you buy one connect it to the board. ...

October 24, 2009 · 1 min · 144 words · David Amador

PHP Optimization Tips

As most languages PHP allows many ways to solve a problem. Some are faster then others. Here are a few ways to improve your PHP code. Loop At some point your program will require a loop. And loop is considered as efficiency killer if you have many nested loop (means loop in a loop) as one loop will required to run ‘n’ times and if you have 1 nested loop, this means your program will have to run n2 times. There are many ways we can define a loop in PHP. But how do you know which one is the best way to loop your data? Apparently, using a for loop is better than foreach and while loop if the maximum loop is pre-calculated outside the for loop! ...

October 22, 2009 · 3 min · 506 words · David Amador

Search and Replace in MySQL

I found something very handy today, search and replace on Mysql databases. You can do it on phpmyadmin or make a php script with this. After moving a wordpress site from server I discovered that all image links were broken because they are placed directly inside each post. They were still linking to the old server. Changing it manually would be a nightmare. Luckily MySql is your friend. To search and replace a text string, start up phpMyAdmin, and click on your database name that you want to run the search and replace through. At the top of the window, click on the “SQL” tab. ...

October 22, 2009 · 1 min · 123 words · David Amador

Test your website on multiple browsers

One of the most painful tasks of a web developer/designer is to ensure that his website is compatible with the majority of the popular browsers. Nowadays this includes Firefox 2.0 and 3.0, Internet Explorer 6, 7 and 8, Opera, and the newest Chrome. Well, you can have firefox, IE and Chrome all on the same system, but what about multiple versions? Most people still use IE6 (they should be shame by the way). ...

October 21, 2009 · 1 min · 106 words · David Amador