Welcome To Australia's No.1 Media Center Community!
You Are Currently Viewing As A Guest - you'll need to register in order to participate in our community and make this annoying message disappear!
By registering you'll be able to post & reply to questions, set up your own image gallery & blog, communicate privately with other members, create & respond to polls, access downloads and other "members only" features.
Registration is fast, simple and absolutely free - so why not join our community today - you'll be glad you did! If you experience any problems with the registration process or your account, please send a message to Mike
Launching games from MCE
this thread has 54 replies and has been viewed 26979 times
Well, Im just playing around trying to find a decent way to launch games from the MCE interface.. I'm simply too lazy to close MCE and click on an icon.. anyway, here's my first attempt after a little research, for anyone who's interested;
Steps: 1. Open the Start Menu\Programs\Accessories\Media Center\Media Center Programs folder under your Documents and Settings directory 2. Create a .MCL file with the name of your game, eg. Call of Duty 2.mcl 3. Copy the following into it;
<application
name = "My Game"
SharedViewport = ""
NowPlayingDirective = ""
run = "My Game.lnk"
>
<capabilitiesrequired
directx="True"
audio="False"
video="False"
intensiverendering="True"
console="False"
cdburning="False" />
</application>
3. Replace the name="" with whatever you want displayed in MCE 4. Replace the run="" with the full path/filename of the SHORTCUT you use to launch your game with. If you use the exe directly, its current directory will be C:\windows\ehome, and obviously it wont run properly.
OK, so when you go to My Programs from MCE, you'll see an icon for your game there. Launch it, any running media will stop and the game (should) load. The only problem now, is getting MCE to reappear once the game has closed. Apparently you can use some code to get it back (http://msdn.microsoft.com/library/de...Developers.asp) but I cant see anyway to do it without writing a prog that launches the game and, when done, reinstates MCE.
So.. thats my first go at getting a game to launch directly from MCE, I hope it helps someone out there. If anyone has anything else to add or any ideas on this problem I'd love to hear em. Let the games begin.
This is interesting. I'd like to take it one step further and be able to do the following.
* Have a 'My Games' menu with game cover art etc.
* Be able to use the MCE remote to perform some operations, like for example the 'record' button should save your progress in the game. Basically you should be able to map MCE remote buttons to keyboard commands.
* Have categories for the games, even be able to use emulators that can take command line arguments etc.
I realise the MAME frontend exists but it doesn't tie in with MCE enough (both look and functionality) for my liking. A 'My Movies' style plugin for games would be so much better.
This is interesting. I'd like to take it one step further and be able to do the following.
* Have a 'My Games' menu with game cover art etc.
* Be able to use the MCE remote to perform some operations, like for example the 'record' button should save your progress in the game. Basically you should be able to map MCE remote buttons to keyboard commands.
* Have categories for the games, even be able to use emulators that can take command line arguments etc.
I realise the MAME frontend exists but it doesn't tie in with MCE enough (both look and functionality) for my liking. A 'My Movies' style plugin for games would be so much better.
Me too. There is a certain other front end that does it just fine, so why not M$?
__________________
Well, that's another fine post you have made there. Maybe next time you'll pick a subject that you actually know something about....
For people who tried out the MCL approach to starting games from MCE, but are having problems getting MCE to restore after the game has finished, here is a small loader app (and source code) that will do the trick. All you have to do is call 'GameLoader.exe <full path to app exe>' to start the game, and when its done the loader will reinstate the MCE interface for you.
To use it, all I did was create the MCL file as mentioned in the first post, but then modify the game shortcut that is referenced by the 'run' statement, and appended 'GameLoader' to the start of the target within that shortcut (go to the properties for the .lnk file and edit the target). eg;
C:\WINDOWS\GameLoader.exe "C:\Program Files\Electronic Arts\The Godfather The Game\godfather.exe"
Note: The source code and executable are provided as-is with no warranty. It can be reused, modified and redistributed in any way without permission. All source code was written and compiled in VS2003 to run on Windows XP.
No probs amos, glad to hear she works okay
I did notice however that when LiveTV was running and you start a game, in some cases the TV kept playing away in the background while the game was running - made for some interesting sound effects mid-game
How to set it up:
1. Open notepad
2. Copy & paste the example above.
3. Change the location of the game to match the one you want to run. (Leave the 'gameloader' part untouched)
4. Save the text document as .bat instead of .txt (in the same directory as the game's exe file) If your version of Windows has a "Save as type" option, choose "All files", otherwise it will save as a text file.
5. Create a SHORTCUT to the .bat file, (rename it if you want) then add the shortcut's location to the .mcl file (instructions at beginning of post).
You MUST have downloaded the GameLauncher & extracted it into your C:\WINDOWS directory! (it only works from that location)
(By the way, if you want to run a trainer, or something else with the game; add another 'start line' (after the echo line) and type the full path to the extra item).
All credit to Nick, your a legend
Last edited by amos_82; 11th April 2006 at 05:13 AM..
Thats a good idea amos, nice work. Give me a couple of days and I'll (hopefully) extend the GameLoader code to do a little more work -
1/ Add a command line switch to gracefully shutdown MCE, something like:
Code:
GameLoader.exe [-k] <full path to app exe> [app command line]
Where -k will close the MCE interface (if running), giving it a chance to execute shutdown code. Killtask terminates the MCE process without warning it, so things like codecs and memory allocations may not get cleaned up. In my case, I'm using ffdshow and NVIDA PureVideo which both have icons in the system tray when running. If you kill the MCE process using killtask, those icons stay around, indicating they havent been detached by MCE smoothly.
2/ Add the MCELauncher code to GameLoader. This code basically creates the Direct3D context correctly before the game loads. In the MSDN doco linked above it explains how games need correct timing to ensure the context is created AFTER MCE has closed its own context - if they dont, it can cause the game to crash during initialization. You will only get this in some cases depending on your system spec and other factors, but will improve reliability when using the GameLoader.
Oh well.. I got bored today, so I fixed the app. Now it does everything mentioned above, with the syntax given (make sure you use the correct order, '-k' (which is optional of course) BEFORE the exe path, otherwise it will be passed to the game instead).
Nice one Nick,
i was a bit worried about killing the ehshell.exe like that, looks like it will do the trick.
The only thing is i cant get it running Ive downloaded the new gameloader and extracted it to the windows directory as before, but i cant get it to work; MCE minimises and returns as it was a second later.
I tried double clicking on the GameLoader.exe to check the syntax & got this error report:
GameLoader.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
Error Signiture:
AppName: gameloader.exe AppVer: 1.0.1.153 ModName: gameloader.exe
ModVer: 1.0.1.153 Offset: 00001326
Maybe im using the wrong syntax? Heres an example from one of my shortcuts:
Sorry, my bad I've fixed that crash when you run it without any parameters. But the problem you've got is with the [-k], the square brackets are just a way of saying the -k is optional, don't actually include them in the statement. Use:
and obviously, just -k if you only want to close MCE before launching. The DX9 tests can actually cause problems with games that dont need it, so only use it if you're experiencing problems with a certain game loading up.
Cheers
Nick.