Skip to main content
GameDev.net gamedev.net
🔒 Locked

Streaming Game Content over TCP/IP: A Discussion

Started by Gotterdammerung Jul 26, 2004 at 4:17 PM 18 replies 3.7k views
Original Post
Gotterdammerung
Gotterdammerung
I am attempting to develop a method of allowing a user to stream game data from a remote server using a piece of software I want to write. I am also trying to figure out how I could allow the user to "stream" game data from the server and have the game be playable in real time. Now let's take this one step further... The game is not something I wrote and do not have access to the code base (e.g. a commercial game I took off the shelf). Is anything like this possible? Perhaps if I overrode the API that the game uses to load the files from disc with functions of my own, then have that stream the file data from the main server. However this method is difficult because it depends COMPLETELY on what functions they use, and also the programming language (I believe). I'm asking for any input at all, especially input which follows the Keep It Simple Stupid ideology ;) Cheers
DrEvil
DrEvil
Other than the legalities of streaming someone elses game over the net, it sounds like it would be a very difficult problem. The closest thing to what you're talking about is the Steam content delivery system that Valve is developing. You aren't going to be able to stream any reasonably complex game without having load screens and having to wait.
Gotterdammerung
Gotterdammerung
Yes, minus legalities of course ;)

Steam allows you to do something along the lines of clicking "Play Half-Life 2" and then the game pops-up after downloading the initial binary and the content of the game is streamed to you as it is needed by the game? The point of the system is to allow such things to happen. Hopefully making this work would NOT involve the need to circumvent cd copy protection and attaching an injector program to the game's .exe process to hi-jack specific API calls to the registry and the filesystem. A system like that would require much tweaking for any game you attempt to make playable with that system.
peter_b
peter_b
Im not sure i quite understand what it is you want to do. You want to write your own client software for a existing game, no? I have to point out that if this is a commercial game, doing that is probebly prohibited.
And it would be very hard unless you know what their network protocol looks like. You could analyze packets and try to figure it out, it has have been done, i don't know much about the process but i imagine it would be a huge amount of work.
Shields up! Rrrrred alert!
Gotterdammerung
Gotterdammerung
Casting legalities aside, I am (apparently) looking to create a system like Valve's Steam that would work for ALL (or at least most) commercial games.
Gotterdammerung
Gotterdammerung
hmm I was afraid of that, but I figured that would be the case. I will continue to think about it though
Fingers_
Fingers_
Actually, what you're trying to do is (a) "run a game installed in a shared folder on another computer", or (b) "copy a game from another computer to yours and run it". Whether there's a launcher app doing this or not, that's what it boils down to if you're talking about a game not designed for this purpose.

Option (b) obviously needs the developer's approval. You can sometimes do (a), even over the internet if your connection is good enough. But most games aren't set up to work this way. Especially on Windows, they tend to use the registry to store things, check if the CD is in the drive and so on. On Mac it's a bit more likely to work as most programs live happily in their own folders. Also, older DOS/Windows games may work better (Doom, Quake, maybe Q2 and Q3 since the CD check was removed).
Gotterdammerung
Gotterdammerung
As far as registry access I have a way of intercepting how it trys to access the registry and even files by overriding the API calls with functions I create (overriding them at runtime after attaching to the process and replacing the functions' pointers) but that is iffy because of how many ways you can do things such as access files.
Gotterdammerung
Gotterdammerung
I guess my target would have to be commercial games running on windows written in c/c++. Thankfully this is almost all commercial games ;)
AlternateReality
AlternateReality
This may or may not be OffTopic..

and it may even hurt performance a little.. but would developing a virtual machine and running the downloaded binary inside it work ??

Yeah.. it may be.. as we say .. going around the elbow to get to the thumb... but it would allow such neat tricks as saying that we have a CD in the drive when we actually don't.. and so on.

Just my opinion.

A.R.
Gotterdammerung
Gotterdammerung
I've contemplated such a thing before as well, but have not yet hammered out the dynamics of such a beast :D
JonStelly
JonStelly
It's not "too" bad, but this is probably the easiest option under the conditions you've mentioned. Take a look at a sourceforge project ext2fsd: http://sourceforge.net/projects/ext2fsd/

Basically you want to create a filesystem driver that forwards all requests to a network server.
bpopp
bpopp
From a file system perspective, it's not a complicated problem. The trickiest part would be ensuring that your environment was prepared to run the files once you had them. By that I mean that most windows apps nowadays won't run without the correct registry entries. You could easily include these with your package in a registry file that gets imported prior to execution. You've also got to ensure that any dependencies have been met (DirectX, OpenGL, etc.)

There's a couple resources I know of that might help you research this. Gentoo (linux) has a really nice distribution system which uses rsync to distribute a large collection of packages which can then be automatically compiled and installed. It handles dependencies and environment changes fairly well. But of course, it's linux so it's not "exactly" what you're looking for.

Another very interesting read is this article on a project called Zero Install. Again, it's linux, but it might give you some ideas.
Gotterdammerung
Gotterdammerung
Using the method of overriding file i/o and registry API calls to control how the game gets it's data, what would I have to do to circumvent the cd protection most commercial games have? I'm not asking for a way to pirate or crack anything, but this is an issue. Any thoughts?
Pxtl
Pxtl
This would be super-easy to do at the filesystem level by running a file-wrapper that simply treats all content as internet-based and caches things locally. So you simply treat it all as if it were on your own computer, and its just that some file requests have long wait times.

Depending on how fast and often the game requests files or directories, you could be able to have the golden "fetch files only as needed at the beginning of each map" or a horrible "wait in the middle of the game while I load texture X" or a pointless "the whole game is fetched at first launch, wait till that's done, then play".

Really, you need access to the client for this to be feasible.
-- Single player is masturbation.
Gotterdammerung
Gotterdammerung
One thing I just remembered that is making things difficult is that the fopen/read/close/etc functions are all in the runtime :F If the runtime doesn't even show up as a module being used by the application, how can I override the pointers to those functions with my own?
hplus0603
hplus0603
Questions about overriding specific functions should go in the General Programming forum, methinks. If it stays too far off networking, the thread may be closed.

enum Bool { True, False, FileNotFound };
dizzydog
dizzydog
It's sounds a bit like you're trying to recreate the games on demand stuff that some companies are offering. They stream parts of the game to you before you start, then once you start playing they stream the rest to you in the background either on an as-needed basis, or just a continuous trickle. Examples of folks doing this are:

www.atariondemand.com
gamesondemand.yahoo.com
www.rcninteraction.com
www.comcast.net/gamesondemand/

I dunno about the details of how they schedule the downloads or anything, but if you start with those and dig around you might be able to find some info.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.