Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

Tuesday, 16 July 2013

If you want something done...

I had to head home early from work today due to what feels like heat exhaustion. As I was resting, I had mad fever dreams about how best to fix the flickering from UltraMon.

After some heavy research, It seems to be a symptom of DirectX - after all, I'm trying to capture hardware overlays. I decided that I'm using a lot of system resource, and an imperfect solution to resolve this issue. In response, I've developed my own little solution.

I've posted the Source Code below. Though the interval on the timer should be 50, not 25. It seems quite simple, but it's the result of a few hours of research and coding. I began with BitBlt calls from GDI, but ultimately settled on Graphics.CopyFromScreen() (basically the same thing, but a lot easier to code).

I added in some command-line parameters to override the hard-coded screen coordinates if needed.

Finally, the application presented the same problems that Ultramon did, in that the display flickered every few frames. As a workaround, I recorded the pixel values of random locations for every frame. This allowed me to identify which frames were blank. As I'm now using my own code, it was simple to ignore these blank frames.

The end result is a constant output with far less flickering, and far less impact on system performance. The frame rate is sporadic, only updating approx 2/3rds of the output desired, and there is no hardware overlay. However, the dimensions of the output are now almost perfect, and it's a lot better than a constantly flickering device. As a nice bonus, I can now "activate" the display by launching a single application - currently it's in the Windows Startup folder!

I've been looking into Direct X Hooks to capture the true 3d output. This would be the best result, and tests with SlimDX on my desktop were very promising, however there seems to be some comparability issues on the gaming rig, so for now, this will have to do.



Wednesday, 19 June 2013

Target Locked...

Checked in with the support forum at UltraMon today, and got a couple of pointers back VERY quickly. As it happens, the application was operating exactly as expected. There's a couple of caveats with the resolutions switching, but in essence, having the primary monitor on the left causes the screen area to shift. 

I borrowed the wife's monitor this evening, set it up as a secondary monitor, told Windows it was on the left (It isn't, just in case the pics below confuse you).

It only took a short while to prove that the concept works! 

Running the mirror in a Window for testing.
When not in flight, the screen is blank as the mirrored screen area is invalid.



XWA switches to 640x480 during the start screen, and in the flight hanger, whilst running the game engine in HD means I am trying to capture an area around the (700,800)-(1300,1080) mark. This means that from the point the application is started, to the point one is in flight, the second screen is blank. As soon as the game starts, the targeting screen hits the display. PERFECT

Running the mirror in full-screen, between missions.
There's no way I could "Draw" over the Direct 3D image.
A bit of Tape helped to find the correct area.
I have the exact settings saved, but they will change when I settle on a final resolution.

The images below are taken after turning off the cockpit.This has no effect, it's just by habit.

 
In Flight, no target.

The final image below shows the main monitor (physically left) running the updated game engine at 1920x1080. The game plays with no noticable impact on performance.

The portion of screen containing the targeting computer is shown, real-time and full screen on the second monitor.
Pew! Pew!

There seems to be an issue with flickering on the target display... but only on occasion. Generally it runs as hoped. A little tweaking or extra memory should fix this.

At the moment, it seems low quality, but it's stretched to a widescreen 19" panel.

Now that I know this works as well as it does, I will be looking to get hold of a small monitor, something like a Lilliput, but it will have to be quite a bit cheaper!

Tuesday, 18 June 2013

Here's Where the Fun Begins...

(Amusing Note: Apparently the Blogger.com spell-check doesn't recognize the word "blog")

So far, this blog has recorded me setting up a PC, installing a couple of programs, and setting up a retro Joystick. This isn't much to get exited about. Now that I have the basics done and dusted, it's time to start branching into the more esoteric.

My aim is to make the game a little more immersive. The first idea I had is to pull some information off the screen, and put it directly in front of the user.

If you recall, in the original movie trilogy the X-Wing had a nifty little targeting system/range finder 

Which incidentally, is available as an awesome GPS App!

This was replicated reasonably well in X-Wing, but had a major overhaul in XvT and XWA.

XWA targeting display:

This shows information about the currently selected target. I want to port this to a second screen: Just for kicks at the moment, but should I succeed in my cockpit desire, I want this front and center.

Some games support multiple displays. Sadly, XWA is not one of them. It's possible to map the screen across a number of monitors, but as far as the game is concerned, there is one screen, and one screen only.

The target display is different on each craft, but is always in the same location. Sadly, this location is hard-coded in the application, and better minds than mine have been unable to alter this.

Recently, I stumbled upon the application UltraMon. This application gives one far greater control over multi-display systems. Usually this allows for a second task bar, easy screen switching etc. One of the less-used features is a partial screen clone/zoom, allowing one to clone part of ones monitor, and display it solely on a second display. This is aimed, no doubt, at the visually impaired, or those wanting to run presentations or the like.

In my last post, I mentioned I would be using the iPhone. This was to be via an application called iDisplay. iDisplay is a handy little app available in the App Store (not very expensive) that connects to an application on your desktop and turns your iOS device into a wireless, touch-screen monitor. I've used it once or twice while programming (need to leave the room but don't want to disconnect from what you're reading? Just pick up and walk... obviously I don't mean work while walking... unless you wanted to). This was going to be my second monitor while testing, not least because it's about the right size.

Sadly, this was a no-go. The iDisplay desktop application is quite resource-heavy. Even setting it lower down on the process priority list did nothing to alleviate the lag on the system. Evidertly the single core low-spec system is not up to the task.

At this point I am merely proving a concept, so I will just run with UltraMon and a second monitor for now.

Intermission!

The next thing on my to-buy list is a second monitor for my desktop PC. At the moment I only have one. I looked at the wife's monitor, and really couldn't be bothered to disconnect the various cables and paraphernalia. Instead, I connected the second port of the monitor to the PC, and I've been switching between modes to review the output.

UltraMon didn't work!

There's an option to enable/disable 3D acceleration, but it didn't make a difference. Fortunately, there's a plugin called MirrorMon that allows multiple mirroring (multiple screen sections? Interesting...) which seems to handle Direct3D a lot better:


MirrorMon running on Monitor 2 (Windowed Mode)
Full Screen, this is an exact replica of Monitor 1

The Hardware Acceleration was disabled...
Swapping the Displays resolved this.
Look at the difference!!

Output from Second Screen

At this point, Ultramon has successfully cloned a 1920x1080 Direct X display to a second monitor.
Sadly the performance on the main display isn't great, and the redraw rate on Monitor 2 is unbearable.

Changing the resolution of the second screen had an interesting result:


 It's mapped the output to the correct size, and performance is perfect, but the monitor itself is still at the same resolution as Monitor 1. This is a conundrum.

As previously noted, I will be playing in a resolution supported by the Projector, which will have an impact, but for now, I'm leaving this here.

Next Step is to connect a second monitor and see if I can get better results. Particularly, I want to map a portion of the screen to display 2, not the entire screen. This is proving very difficult with only one screen to test with.

Monday, 10 June 2013

A Little Eye-Candy

Not that I'm obsessed or anything, but I spend most of this evening hacking a BIOS Rom file.
Running an unusual Phoenix BIOS makes it much harder than normal to do this, as the Logo image isn't stored in the usual place.Adding a logo prevented the flash utility from running, removing the existing file from a downloaded ROM didn't seem to help either. In the end, I backed up the current BIOS image, removed the attribute corresponding to the system logo and inserted the Incom logo instead.

Once confirmed working, I updated the Windows Kernel with a new boot screen. After resolving the ubiquitous Blue Screen(s) Of Death, I set a desktop image (again, the Incom Logo), removed the Recycle Bin (simple Registry entry) and hid the start menu. Finally, I set XWA to launch on startup, and set the Windows sound theme to "None"

Nothing technical achieved, but I think every little thing helps.

BIOS Splash screen

Windows Boot Screen

Desktop - It reads "Incom Corporation"... Honest

Tuesday, 4 June 2013

Hardware, baby

Choosing the right hardware for any gaming project is important.
This game is 14 years old, so there will be little demand for a high-cost rig.
The upgrade project adds a  hell of a lot in terms of graphics, sound and game-play, but it doesn't change the fundamental core of the game. 

One of the biggest contributors on hardware is the HOTAS system. Both the throttle and joystick use a 15-pin game-port connector. There are convertors available to use USB, but they are unreliable at best. I've been playing X-Wing on a dual boot OS on my desktop (I run windows 7 x64 at the moment, with literally NO hope of talking to the game-port).

To separate my gaming from my desktop, I have a second PC, which will be used specifically for this project.

  • 1.8Ghz Single Core CPU (The game won't recognize a second core, and I wont be running much else on the system. XP will be happy with this).
  • 756MB DDR2 (I did want 1 - 1.5GB, but this is all I have spare at the moment, and to be honest, I can't see me needing anymore)
  • Creative Sound Blaster Live! -  This was mainly to provide the system with a game port, but this 13 year old PCI card blows the crap out of the on-board sound anyway.
  • GeForce 7200 GS - Probably overkill, but I want dual monitor support (more on that later)
  • 2 x SATA HDD - Again, probably overkill, but I want to run the CD audio from a Disk Image on the second drive - I find this to be more reliable (and less noisy) than running CD Audio from the Optical Drive.
I'll be running Windows XP for the game(s). This presents a problem with the Thustmaster WCS, as programming the unit cannot be done from an NT-based system. To resolve this, I dug out another old piece of kit:



Running a Windows 98-based version of DOS from an internal 100MB ZIP drive allows me to configure the Sound Card, and the HOTAS from a compatible kernel.



Choosing the Game

I've been playing the original X-Wing on my desktop for a week or so, but there's better options available.

I've always enjoyed XvT more than the other games, but it's the last game in the series, X-Wing Alliance, that has the strongest Modding Community, support, and even today it has people playing online. Add in the better graphics and device support, and it puts Alliance head and shoulders above the other games.

The first thing to consider was bringing the game up to date. If we compare the original SSD model against the updated model available in X-Wing Alliance Upgrade:


It's worth noting that the Upgrade rescales the SSD to it's proper size (17km!)

That thing is 9km away!