Thursday, August 31, 2006

Xbox 360 DVR?

it's so simple. as a consumer, it's so simple that it's annoying. microsoft's xbox 360 could be the grandmaster of the living room. just one thing - offer a DVR peripheral.

no one will question that the Xbox 360 is a good video game console. even the hardcore sony playstation fans - who are still waiting anxiously to shell out $600 US for a PS3 - will tell you that the Xbox 360 is a good (maybe they would say "decent") video game console. however, try going to buy pretty much any other appliance for your living room and see how often the Xbox 360 comes up in conversation. sure, the guy trying to up sell the average joe to an HDTV may say something like "and if you're interested in video games for your kids, then this will work great with the Xbox."

but the Xbox could do so much more. oh wait, it can do so much more. microsoft took a hint from the Xbox modding community when they added media center capabilities right into the Xbox 360. the Xbox could easily run the applications, but users of the original microsoft console were forced to add microchips that skirted the grey areas of law books in order to get most media center features.

but that's not the case with the 360. right out of the box, the new Xbox can show pictures, videos and play mp3s - it can even play them right off your computer or mp3 player. as they say in the red vs. blue episode that ships preloaded on the Xbox 360 hard drive "it's a total entertainment package." well, not quite.

the Xbox 360 is missing the one killer feature that would enable it to cut a wide swath through the landscape of living room appliances: it's missing a digital video recorder (DVR).

without a DVR, the Xbox 360 is what it is - a gaming console that gets talked about whenever gaming consoles come up in conversation. with a DVR, the Xbox 360 is a monster; it will start to be mentioned along side traditional adult home appliances.

whether you're looking for a VCR, Tivo, or even a stereo, the DVR-equipped Xbox 360 would be an option that the average consumer should seriously consider. it's not as expensive or complicated as a traditional computer (read: microsoft media center edition) and hey... it's also a video game console.

Wednesday, August 30, 2006

XNA Game Studio Express

the beta download for XNA game studio express is out!

this is the software designed for the Xbox 360 creator's club

update: is a great place to start with XNA GSE.

"XNA Game Studio Express enables individuals and small teams to more easily create video games using new, optimized cross-platform gaming libraries for Windows and Xbox 360. This beta release targets the development of games for Windows. The final version of XNA Game Studio Express will be available this holiday season and will enable development of games which target Windows and upon purchase of a XNA Creators Club subscription, the Xbox 360 as well."

Tuesday, August 29, 2006

robotron 2084 strategy

I've been using my genetically garnered superhuman powers to play the xbox 360 version of robotron 2084 for a couple of days. one of my buddies at microsoft brought his arcade version to work, so I had the benefit of playing that for many relaxing hours. the xbox 360 version is better, IMHO, to the xbox version. I found that one difficult to play because the controls weren't precise - as you fans know, robotron is all about precision movement.

while I've moved up a bit in 360 standings, I haven't achieved anywhere near the scores that I was getting on the arcade machine. partly to remind myself, I thought I'd create this post and share my thoughts about the game's strategy. I'll add some of this to the wikipedia article as well - although, I guess it's original work and therefore shouldn't really be in there.

humans - humans are the key to the game. every 25,000 points, you receive a bonus life. humans are worth the most points, so they will largely be responsible for your bonus lives. shooting a grunt will gain you 100 points, but collecting a human can gain you 5000 points.

but not only do you need to collect humans, you need to collect them in bulk. one human will get you 1000 points, but if you get another before you die, you will receive 2000 points. this is true up to 5000 points. once you've worked up to 5000, every human you get on the level is worth 5000 points. when the level ends, you go back to 1000 for the first human.

the fact that humans are worth so much - and worth so much more in bulk - is the most important strategy point in robotron. successful robotron games are a balance between aggressively collecting humans and knowing when to protect yourself. humans are important but no one human is worth dying for.

grunts - these are the red robotrons that make up the bulk of the robotron force. they don't fire projectiles, so it's tempting to try and dodge them to get to people. for example, on the first wave, you should dodge the grunts and pick up the people. however, as time goes by on each level, the grunts accelerate and they will quickly exceed your speed.

electrodes - electrodes are stationary and don't fire projectiles. you may think that this means that you can simply ignore them. I recommend that you fire at them whenever you aren't firing at something else. while they are stationary, they restrict your movement and therefore should be eliminated when possible.

hulks - hulks are big green robotrons that destroy people. you cannot kill hulks, but you can move them ever so slightly by shooting them.

spheroids - spheroids are arguably the most dangerous enemy in the game. they appear on many waves and they spawn enforcers. the key to most levels is destroying the spheroids before they spawn too many enforcers. enforcers fire quick rounds and they fire many rounds.

enforcers - don't mess with enforcers, take them out ASAP. note that enforcers will sometimes camp in a corner and fire wildly at you, when this happens, you should forget everything else and destroy the enforcer.

quarks - quarks are similar to spheroids, but they aren't as common and they spawn tanks instead of enforcers. you will first see them on wave seven. just like spheroids, they represent an impending threat and you should destroy them first.

tanks - tanks will stop shooting if 20 shots are fired currently on the game field and no tank is destroyed. if a tank is destroyed, the counter will reset to zero.

brains - brains turn people into progs and they fire snake-like projectiles. some people find the snake rounds to be the most dangerous projectiles in the game. this is probably true, but I'll still target a sphereoid before a brain. brains are dangerous, but they don't spawn many new attackers - each with their own projectiles.

there are only a few types of waves that rotate around. obviously, the goal is to collect enough people that you are gaining more lives than you are losing through each cycle of waves.

wave 1 - easy... take your time and get the people.
wave 2 - just shoot the spheroid and you'll have an easy time.
wave 3 - get out of the middle and use any extra rounds to shoot at the spheroids.
wave 4 - pretty much the same as wave 3.
wave 5 - this is the key wave. you want to get lots of people (the mother) on this level. try to take out the sphereoids and the brains while picking up the people and avoiding the grunts. if you get killed, you want to have just grunts left with the remaining people. there are so many people available in this wave that it will make or break your game as you cycle through the waves.

there is a subtlety on wave 5 that can make a huge difference in your game. when everything appears, there is one boy human and numerous mother humans. the brains will not turn the mothers into progs until the boy human has either died, or has been rescued. so, the best plan is to prevent the brains from getting the boy without picking him up; this will allow you to pick up more mothers because the brains won't be converting them to progs. note that this will only work for your first life.

wave 6 - another level where you just want to get to the side right away and target the spheroids.

wave 7 - this level is fun :P the quarks will spawn tanks if you don't get rid of them quickly, so forget about everything else - just worry about shooting the quarks. if you happen to get some people, that's great, but don't let it distract you from getting those quarks. once the tanks have spawned, they are difficult to deal with. note that the worst place to be (as with many levels) is in a corner. by strafing up and down along a side, you can best deal with the tank projectiles.

wave 8 - another wave where you must get the sphereoids.

wave 9 - the infallible logic of the grunts dictates that they rush you like the last beer at an open bar. get out of the centre ASAP and then rotate around the edge while you fire into the mass of grunts and any enforcers. the best way to do this is to quickly identify the area of the screen with the least objects (you should make this decision before you spawn) and fight your way through that area. don't worry about anything but survival. if you don't get out of the center with your first attempt, the grunts accelerate and this level gets very difficult.
wave 10 - this one is crowded, but part of that crowd is vital human beings. use your weapon to clear a path as you collect as many as possible.

- "bullets follow walls" - US Army Ranger talking about the incident that inspired Black Hawk Down. on many levels, it is a good idea to get to the edge of the screen quickly. however, once you have done this, it is a good idea to avoid being right against the side. many rounds will follow the edges of the screen and hit you. definitely stay out of the corners.

- you can move faster going diagonally than you can horizontally or vertically.

- many lives are lost because people try to move before the full screen has been drawn. often a little move will get you fragged because there was a quark or some other obstacle that hadn't yet fully appeared.

Friday, August 25, 2006

Calling a C++ lib from C#

a few months back, I found myself having to use a C++ .lib file from C#. it took a bit of looking around to figure it out, so I figured that I'd publish my cheat sheet here. I posted a number of questions about this subject to the C# interop newsgroup and found that the MVPs were excellent. if you search, you'll find these posts and be able to get better code from there - I've tried to get the examples in this post right, but the line breaks may cause confusion.

BTW - I grabbed this stuff from all over. I've tried to credit the sources, but I may have missed some. I've created a separate post about handling the unsigned char* data type from a C .lib file.

first of all, this is an awkward thing to do. if you have the choice, get a DLL instead of LIB.

1. create a C++ Win32 DLL Project from VS.Net


Creating a Win32 dll:
- Open the New Project Wizard.
- Select Win32 Dynamic-Link Library.
- Name the project "DemoDll."
- In the next screen, select "A dll that exports some symbols" radio button.
- Click Finish.
The dll project will be created.

Now open the file DemoDll.cpp. You can see a function definition for "DEMODLL_API int fnDemoDll(void)".

Replace this function with the following code:
DEMODLL_API int fnDemoDll(int a,int b){return a+b;}

Open the DemoDll.h file and insert the declaration "DEMODLL_API int fnDemoDll(int a,int b)"

Create a new file named "DemoDll.Def" and add the following code in that file.

; DemoDll.def : Declares the module parameters for the DLL. LIBRARY "DemoDll"
DESCRIPTION 'DemoDll Windows Dynamic Link Library'
; Explicit exports can go here

Remember to add this DemoDll.def file to the project.
Build the project. The DLL will be created.

Using the DLL
This part explains only the dynamic loading using loadlibrary. The following sample code has to be used in a new console application.

#include <windows.h>
#include <iostream.h>

typedef int (*ADDITIONFUNCTION)(int a,int b);

void main()
hDll = LoadLibrary("Pathofdll");
if(hDll == NULL)
cout<<"Error loading win32 dll"<<endl;
return ;
addFunction = (ADDITIONFUNCTION)GetProcAddress(hDll,"fnDemoDll");
int result;
if(addFunction != NULL)
cout<<(addFunction)(10,11)<<endl; else { cout<<"error:"<<GetLastError()<<endl; } } 2. test this DLL from a C# project by calling the example method. copy the file into the C# project bin/debug folder - you can't add a reference.

Now open a blank solution, and add a new C++ MFC Class Library Project. Let's call it MyUnmanagedDotNetVCWrapper. We will implemenet a wrapper for MyUnmanagedVC6Class:

#include "MyUnmanagedVC6Header.h"

class __declspec(dllexport) MyUnmanagedDotNetClass
MyUnmanagedVC6Class* _class;
MyUnmanagedDotNetClass(int x)
_class = new MyUnmanagedVC6Class(x);
void DoSomething(int x,double d)

This should be located in MyUnmanagedDotNetHeader.h.

Note: If you have all the sources for the original DLL you can open it in VisualStudio .NET, and it will convert it for you into a DLL you can use for the later step. This can save you the time for the first wrapper.

4. add methods to your new DLL that wrap the method in the original lib that you're trying to access from C#. newsgroup post about this topic.

Random Notes:

; Explicit exports can go here
MyMMCPropertyChangeNotify @1
MyMMCFreeNotifyHandle @2
MyMMCPropPageCallback @3

after this I added the following line to mymmc.h #pragma comment(lib, "mmc.lib")

I changed one project setting and it compiled. In the General setting: Use MFC in a shared DLL.

reference this page if you have questions about marshalling data types:

Example of syntax for calling the functions

// Cawood: import an ARTag sample function
[DllImport("ARTagWin32DLL.dll", EntryPoint="artag_create_marker_wrapped")]
//public static extern int artag_create_marker_wrapped(int artag_id, int scale, unsigned char *image);
public static extern int artag_create_marker_wrapped(int artag_id, int scale, [MarshalAs(UnmanagedType.LPStr)] StringBuilder image)

Wednesday, August 23, 2006

McAfee virus view

this cool "Virus View" is a feature of the McAfee SecurityCenter.

- the 'Infected Computers' view option

it's an interesting way to look at the world. personally, I'd like to see the numerical values be configurable. I'd like to know how 'hot' those red (1000+) areas really are.

Tuesday, August 22, 2006

xbox 360 modchip

well it was only a matter of time...

a modchip for the xbox 360 has been released. the NME-360 will start shipping in about a week. this chip is inserted between the DVD drive and the xbox console so that games can be copied and then run without the DVD.

the makers say that the chip is meant for 'backups,' which is a legal loophole to enabling copying of software programs. but it might be enough to keep 'team underdog' out of court. the only makers of modchips who have been prosecuted are those who were caught distributing pirated games.

although this is a fraction of the functionality that was available with the original xbox modchips, one has to have faith that there are more chips on the horizon.

Saturday, August 19, 2006

xbox creators club

I was excited about the recent xbox 360 creators club announcement.

the idea is that xbox 360 users will pay an annual fee to get access to the option of developing xbox games on their PC - using the XNA platfrom - and then uploading them to an xbox 360 community space. MS says that the development tools will work with the free VS Express packages, so it may be cheap for people to get onboard.

autodesk is also involved, so maybe gmax will make a triumphant return. these days, modders basically have to rip-off 3ds if they want to create their own game elements for games like HaloCE.

it sounds like a fantastic community program, but some questions remain unanswered. will the creators' club provide the average user access to the same potential game quality as the companies that have access to the Xbox dev kits or will it be a digital kids' table? also, what are they going to do when people knock off space invaders, gauntlet or bejeweled?

update: the XNA team blog answered some of my questions: "The program we are building, however, is more than a beginner tool. You will be able to write full-on games with shaders and high-end graphics if you want to go deeper. For example, we have an excellent relationship with Garage Games. They’ve been creating a managed code version of their tools and engines that work the XNA technologies. They’ve built a souped up version of Marble-Blast entirely in C# that is just rocking."

- XNA game builder screen

Friday, August 18, 2006

faster right-click menus

sometimes you will find that a software package installs options into the 'context menu' that you do not need. this is the menu that appears when you right-click on something in windows (e.g. a file context menu will give you options such as cut, copy, etc). the problem is that all context menu options add extra work for your machine. some go so far as to noticeably slow down performance.

I ran into this issue with an image management application that adds a preview of the image to the right-click menu. in other words, every time I right-clicked on an image, I had to wait for my computer to create a thumbnail of the image and draw a rather large context menu. this wasn't acceptable to me, but I also didn't want to remove the image application outright.

if you are lucky, the people who coded the offending software will provide you with a configuration option to disable individual context menu options - not to mention that they should also give you the option to forego these time wasting add-ons when you install their software. however, this is not always the case. the solution is the Shell Extensions Manager or 'ShellExView.' using ShellExView, you can see all of the context menu options installed on your machine and you can specify which ones you want to enable or disable.

while ShellExView is a great app, sadly, it isn't a panacea. once you have looked at what is installed, you might find that the software makers of your particular offending program have not separated the options that they have added to your context menu. in other words, to disable the ones that you don't want, you may find that you have to turn off all the options for that app. this is certainly frustrating, but I have found that ShellExView is so easy to use that there are cases where I'm willing to turn off all the menu items until I want to use one of them. obviously, this is only a reasonable option if you aren't using the context menu feature all that frequently.

if you are having performance issues with your context menus, I recommend that you grab the ShellExView app and start turning off all the extra digital lint that lazy coders have forced upon you.

Tuesday, August 15, 2006

dell batteries are hot

the other day I picked up my dell latitude laptop and I thought to myself, "wow, there's a lot of heat coming off this thing."

now dell has announced that 4.1 million batteries are being recalled. it is the largest consumer electronics recall ever.

I bought my batteries during the time period covered by the recall... so it wasn't just my imagination.

Saturday, August 05, 2006

my iPod thinks it's japanese

so a few days ago, I blogged about apple refusing to pay out on my iPod claim.

today my iPod mysteriously decided that it's Japanese. all of the menus are in Japanese characters.


BTW - this problem occurs frequently enough that apple provides instructions for setting the iPod language that don't require that the user can read the menu items.