XBMC - Seamless Media/Gaming PC

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
denz13 Offline
Senior Member
Posts: 133
Joined: Apr 2012
Reputation: 0
Post: #1
Hi guys,
I'm looking for some advice, I've currently got a HTPC running Windows 8.1 with the AMD A6-3500 CPU, connected via HDMI to my living room TV.

I'm trying to get xbmc configured in such a way that it requires very little (or none at all) administration via keyboard and mouse.

I've made some tweaks to Windows 8.1 to make it start in 'desktop mode' with XBMC running at startup and also disabled password/user login. This seems to work well and fluently for the most part, but I can't seem to get the additional functionality I'm looking for to work.

I'd like to integrate some emulators and PC games and control them using a Xbox 360 controller. I've experimented a little using Xbmclauncher to ensure that XBMC doesn't loose focus when launching games, however I struggled to get it to work properly as it prevented a autohotkey file from running, which prevented me from using my harmony remote. I'm currently using Advanced Launcher to launch my PC games in conjunction with this script:

pssuspend XBMC.exe
cd "C:\Program Files (x86)\the elder scrolls v skyrim"
tesv.exe %1
pssuspend -r XBMC.exe

However I've found that xbmc doesn't always return to the set resolution after playing a game in any resolution other than 1080. often it's ultra zoomed meaning I'm unable to navigate xbmc until I restart it, which means that I have to rdp/Vnc onto the htpc with my laptop and restart xbmc manually.

Is there an easier way I could be doing this? Does anybody else have any advice for a keyboardless setup?
find quote
teeedubb Offline
Donor
Posts: 2,642
Joined: Mar 2010
Reputation: 62
Location: Down Under
Post: #2
I find it easiest to close xbmc when launching games - its less problematic. I can post the AutoHotKey script that I've been using with advanced launcher and battlefield 4 (I was using batch files before but AHK works better) when I get home if you like.

Also I find using eventghost to assign a remote button to kill and restart xbmc invaluable.

My Add-ons, only available for XBMC:
Steam Launcher|Music Party Mode|Reboot2oOS|Triple J Radio
find quote
denz13 Offline
Senior Member
Posts: 133
Joined: Apr 2012
Reputation: 0
Post: #3
Thanks man, I've also been reading about steam BPM which seems like a viable option for launching the games. So presumably I could modify and use your autohotkey script to close xbmc and open Steam BPM?
find quote
benholtby Offline
Junior Member
Posts: 30
Joined: May 2011
Reputation: 0
Post: #4
I have just switched to Windows to enable better support for Roms and Steam so would be interested in this script. Waiting for the servers to stabilise again so I can install Advanced Launcher and try some emulators out, but I have always found RCB seems to work a lot better than AL for emulation if you are planning on some retro gaming.
find quote
denz13 Offline
Senior Member
Posts: 133
Joined: Apr 2012
Reputation: 0
Post: #5
Have you ever considered launching your roms/emulators from within Steam BPM? I've seen some examples of this being done, I might have to give it a go myself.
find quote
teeedubb Offline
Donor
Posts: 2,642
Joined: Mar 2010
Reputation: 62
Location: Down Under
Post: #6
Here is the ahk script for bf4
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
#SingleInstance force
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir e:\games\origin-games\Battlefield 4

Run, bf4.exe

sleep, 2000

WinKill, XBMC
;Run %comspec% /c taskkill /f /im XBMC.exe
    
Process, Wait, bf4.exe
sleep 15000
Process, WaitClose, bf4.exe

Run %comspec% /c taskkill /f /im iexplore.exe

;WinKill, Origin
;WinKill, iexplore

Run, "c:\program files (x86)\xbmc\xbmc.exe" &

(2013-12-12 15:13)benholtby Wrote:  I have just switched to Windows to enable better support for Roms and Steam so would be interested in this script. Waiting for the servers to stabilise again so I can install Advanced Launcher and try some emulators out, but I have always found RCB seems to work a lot better than AL for emulation if you are planning on some retro gaming.
Same, I prefer RCB for emulators and AL for stand alone pc games.

(2013-12-12 15:22)denz13 Wrote:  Have you ever considered launching your roms/emulators from within Steam BPM? I've seen some examples of this being done, I might have to give it a go myself.

I tried adding a game once, but I couldnt add any fanart to steam bpm, so now I just use advnced launcher. Plus you would need to add each rom as a separate launcher.

My Add-ons, only available for XBMC:
Steam Launcher|Music Party Mode|Reboot2oOS|Triple J Radio
find quote
Tuxon86 Offline
Senior Member
Posts: 160
Joined: Apr 2010
Reputation: 0
Post: #7
(2013-12-12 22:12)teeedubb Wrote:  I tried adding a game once, but I couldnt add any fanart to steam bpm, so now I just use advnced launcher. Plus you would need to add each rom as a separate launcher.

Oh that would be fun with MAME...
find quote
gregh77 Offline
Junior Member
Posts: 43
Joined: Jun 2013
Reputation: 0
Post: #8
(2013-12-12 22:12)teeedubb Wrote:  Here is the ahk script for bf4
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
#SingleInstance force
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir e:\games\origin-games\Battlefield 4

Run, bf4.exe

sleep, 2000

WinKill, XBMC
;Run %comspec% /c taskkill /f /im XBMC.exe
    
Process, Wait, bf4.exe
sleep 15000
Process, WaitClose, bf4.exe

Run %comspec% /c taskkill /f /im iexplore.exe

;WinKill, Origin
;WinKill, iexplore

Run, "c:\program files (x86)\xbmc\xbmc.exe" &

(2013-12-12 15:13)benholtby Wrote:  I have just switched to Windows to enable better support for Roms and Steam so would be interested in this script. Waiting for the servers to stabilise again so I can install Advanced Launcher and try some emulators out, but I have always found RCB seems to work a lot better than AL for emulation if you are planning on some retro gaming.
Same, I prefer RCB for emulators and AL for stand alone pc games.

(2013-12-12 15:22)denz13 Wrote:  Have you ever considered launching your roms/emulators from within Steam BPM? I've seen some examples of this being done, I might have to give it a go myself.

I tried adding a game once, but I couldnt add any fanart to steam bpm, so now I just use advnced launcher. Plus you would need to add each rom as a separate launcher.

so just save this to a .bat file and run it? this will close XBMC and start BF4? and will restart XBMC after BF4 is closed?


thanks
find quote
teeedubb Offline
Donor
Posts: 2,642
Joined: Mar 2010
Reputation: 62
Location: Down Under
Post: #9
Save the script as "Battlefield 4.ahk", make any changes to file locations, install AutoHotKey and after installing it right click on the ahk file and select compile, youll end up with a file called "Battlefield 4.exe". I point advanced launcher to the directory full of similar .exe's. Yes it closes xbmc then restarts it when bf4 is exited.

My Add-ons, only available for XBMC:
Steam Launcher|Music Party Mode|Reboot2oOS|Triple J Radio
find quote
gregh77 Offline
Junior Member
Posts: 43
Joined: Jun 2013
Reputation: 0
Post: #10
thanks ill try it
find quote
marsilainen Offline
Junior Member
Posts: 17
Joined: Mar 2012
Reputation: 0
Post: #11
In bf3, punkbuster kicked you out if you had autohotkey script running.
find quote
teeedubb Offline
Donor
Posts: 2,642
Joined: Mar 2010
Reputation: 62
Location: Down Under
Post: #12
(2013-12-19 18:34)marsilainen Wrote:  In bf3, punkbuster kicked you out if you had autohotkey script running.

I havent had any problems with bf4 + ahk, but here is a batch file I use to launch gta4 which is similar to bf4 as another process is launched before the actual game process:

Code:
@echo off

set XBMCLaunchCmd="C:\Program Files (x86)\XBMC\XBMC.exe"
set GAMEWorkingDir="E:\games\int-games\Grand Theft Auto IV"
set GAMELaunchCmd="GTAIV.exe"
set GAMEProcess="RGSC.exe"
set XBMCPreLaunchCmd=""
set VBSLaunch="%appdata%\XBMC\userdata\addons\script.steam.launcher\resources\LaunchXBMC.vbs"

echo Starting %GAMELaunchCmd%...
cd /d %GAMEWorkingDir%
cscript //B //Nologo %VBSLaunch% "%GAMEWorkingDir%\%GAMELaunchCmd%"

:killxbmc

echo Stopping XBMC...
taskkill /f /IM xbmc.exe>nul 2>nul

:gameprocessloop

echo Loop while GAMELaunchCmd open
tasklist /nh /fi "imagename eq %GAMELaunchCmd%" | find /i "%GAMELaunchCmd%" >nul && (
echo %GAMELaunchCmd% is running, loop
timeout 1
goto gameprocessloop
) || (
echo GAMELaunchCmd is not running, now check for GAMEProcess
)

echo Loop while GAMEProcess open
tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i "%GAMEProcess%" >nul && (
echo %GAMEProcess% - %GAMELaunchCmd% is running, loop
timeout 1
goto gameprocessloop
) || (
echo GAMEProcess is not running, launch XBMC
cscript //B //Nologo %VBSLaunch% %XBMCLaunchCmd%
)

echo Check for 5 seconds to see if GAMEProcess has been restarted for what ever reason
tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 1 second
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 1
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 2 seconds
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 2
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 3 seconds
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 3
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 4 seconds
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 4
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 5 seconds, that was close...
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 5
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running
goto killxbmc
) || (
echo GAMEProcess is not running after 5 seconds, user must have quit
echo Script is exiting
)

EDIT: you need the vbs script file from rom collection browser or steam launcher for this to work.

My Add-ons, only available for XBMC:
Steam Launcher|Music Party Mode|Reboot2oOS|Triple J Radio
(This post was last modified: 2013-12-20 00:35 by teeedubb.)
find quote
Angelscry Offline
Skilled Python Coder
Posts: 3,343
Joined: Sep 2010
Reputation: 53
Location: MTL, Canada
Post: #13
(2013-12-12 15:13)benholtby Wrote:  I have just switched to Windows to enable better support for Roms and Steam so would be interested in this script. Waiting for the servers to stabilise again so I can install Advanced Launcher and try some emulators out, but I have always found RCB seems to work a lot better than AL for emulation if you are planning on some retro gaming.
RCB and Advanced Launcher are using the same external emulators applications and mostly start them using the same command lines. How game emulation could be better on one and not on the other?
(This post was last modified: 2013-12-20 13:31 by Angelscry.)
find quote
Hobs Offline
Junior Member
Posts: 27
Joined: Apr 2013
Reputation: 0
Post: #14
(2013-12-20 00:32)teeedubb Wrote:  
(2013-12-19 18:34)marsilainen Wrote:  In bf3, punkbuster kicked you out if you had autohotkey script running.

I havent had any problems with bf4 + ahk, but here is a batch file I use to launch gta4 which is similar to bf4 as another process is launched before the actual game process:

Code:
@echo off

set XBMCLaunchCmd="C:\Program Files (x86)\XBMC\XBMC.exe"
set GAMEWorkingDir="E:\games\int-games\Grand Theft Auto IV"
set GAMELaunchCmd="GTAIV.exe"
set GAMEProcess="RGSC.exe"
set XBMCPreLaunchCmd=""
set VBSLaunch="%appdata%\XBMC\userdata\addons\script.steam.launcher\resources\LaunchXBMC.vbs"

echo Starting %GAMELaunchCmd%...
cd /d %GAMEWorkingDir%
cscript //B //Nologo %VBSLaunch% "%GAMEWorkingDir%\%GAMELaunchCmd%"

:killxbmc

echo Stopping XBMC...
taskkill /f /IM xbmc.exe>nul 2>nul

:gameprocessloop

echo Loop while GAMELaunchCmd open
tasklist /nh /fi "imagename eq %GAMELaunchCmd%" | find /i "%GAMELaunchCmd%" >nul && (
echo %GAMELaunchCmd% is running, loop
timeout 1
goto gameprocessloop
) || (
echo GAMELaunchCmd is not running, now check for GAMEProcess
)

echo Loop while GAMEProcess open
tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i "%GAMEProcess%" >nul && (
echo %GAMEProcess% - %GAMELaunchCmd% is running, loop
timeout 1
goto gameprocessloop
) || (
echo GAMEProcess is not running, launch XBMC
cscript //B //Nologo %VBSLaunch% %XBMCLaunchCmd%
)

echo Check for 5 seconds to see if GAMEProcess has been restarted for what ever reason
tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 1 second
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 1
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 2 seconds
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 2
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 3 seconds
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 3
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 4 seconds
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 4
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running again after 5 seconds, that was close...
goto killxbmc
) || (
echo GAMEProcess is not running, wait one second, try again.. 5
timeout 1
)

tasklist /nh /fi "imagename eq %GAMEProcess%" | find /i %GAMEProcess% >nul && (
echo GAMEProcess is running
goto killxbmc
) || (
echo GAMEProcess is not running after 5 seconds, user must have quit
echo Script is exiting
)

EDIT: you need the vbs script file from rom collection browser or steam launcher for this to work.



Are you pointing Advance Launcher to that Batch file?

Also, What VBS script file are you referring to and where do I find it?



Hobs
find quote
teeedubb Offline
Donor
Posts: 2,642
Joined: Mar 2010
Reputation: 62
Location: Down Under
Post: #15
Yeah I think I setup AL as a file launcher (the one for emulators), with explorer.exe as the emulator and the bat/ahk script files as the roms, but I'd need to double check.

Probably best to get the vbs script from ROM collection browser, I've since modified the vbs script for my steam-launcher add on and can't tell you which version to use off the top of my head... Which reminds me I need to update my batch files as none of them will probably work now...

My Add-ons, only available for XBMC:
Steam Launcher|Music Party Mode|Reboot2oOS|Triple J Radio
find quote
Post Reply