News | Mail Archive | OS Software Downloads Ad Info ::
Subject: Databases | Java | Linux | Open Source | XML | Data | Tech

Login
 Username
 Password
 Remember me


 Become a Member!
 Login Problems?


Contribute:
· News/Reviews/Release
· Submit a New App!

Misc:
· My Account
· Editorial Feedback
· Logout

News via email
Enter your Email



IT Discussion Community for software programmers, web developers, and linux fans alike.

Recently Updated Mail Archives
AndroidBeginners
general
users-tapestry-apache
debian-x-debian
hbase-dev-hadoop-apache
cocoa-dev
kde-commits
debian-user-portuguese-debian
linux-kernel
users-spamassassin
kwin
kde-bugs-dist
java-dev.lucene.apache.org
java-dev
hive-dev-hadoop-apache
pgsql-committers
fedora-list
guile-devel-gnu
bazaar
discuss-gnustep-gnu
Popular Mail Lists: windows linux solaris osx ubuntu fedora enterprise crm ruby python java xml perl php cvs subversion version contol db
database mysql postgresql mobile telephony voip apple apache
all
sitemap (mail)



Posted Mar 29, 2005

Multi Theft Auto: Hacking Multi-Player Into Grand Theft Auto With Open Source

      

By Howard Wen

Multi Theft Auto adds networked multi-player to the Windows versions of Grand Theft Auto 3 and Grand Theft Auto: Vice City. This ingenious "giant hack" illustrates just how far a commercial game can be extended beyond a typical "mod," even if one does not have access to the original source code. The developers sum up what it took to create their unofficial mod: open source software (RakNet and Crazy Eddie's GUI System), along with lots of time, persistence and junk food.

"This project is a giant hack, and making it 'clean' has also been quite an undertaking," says Kent Simon, a 22-year-old computer science student at the University of Kentucky in Lexington, Kentucky, USA, who is responsible for the 3D math and physics calculations in the code of Multi Theft Auto.

Multi Theft Auto adds networked multi-player to the Windows versions of Grand Theft Auto 3 and Grand Theft Auto: Vice City. This ingenious "giant hack" illustrates just how far a commercial game can be extended beyond a typical "mod," even if one does not have access to the original source code. The developers sum up what it took to create their unofficial mod: open source software (RakNet and Crazy Eddie's GUI System), along with lots of time, persistence and junk food.

Rockstar Games, publisher of the Grand Theft Auto games, doesn't publicly endorse Multi Theft Auto. But neither does the company mind its existence: For the time being, it has a policy of permitting fan-produced projects like it, so long as they are not made for profit.


Figure 1: Multi Theft Auto hacks networked multi-player into Grand Theft Auto 3 and GTA: Vice City, thanks to its developers' use of open-source tools RakNet and Crazy Eddie's GUI System. Here we see Vice City enhanced with Multi Theft Auto. (larger version)


Version 0.5 of Multi Theft Auto was released on January 31, 2005. In an interview conducted during the time they were readying it for this date, Kent and three others among the project's main developers discussed its evolution and technology. They include:

Ed Lyons -- An 18-year-old university student in London, England, who is in charge of the development of the next version of the Multi Theft Auto engine core, codenamed "Blue."

Chris McArthur -- The 22-year-old Lead Programmer of Multi Theft Auto, who works as a Systems Maintenance Specialist in Toronto, Ontario, Canada.

Derek Abdine -- A 21-year-old computer engineering student at California State University, Long Beach in Long Beach, California, USA, who handles code in Multi Theft Auto related to Direct3D/DirectInput.

OSDir.com: What is the current development status of Multi Theft Auto?

Kent Simon: Currently, MTA is undergoing a huge renovation. The new core -- codenamed "Blue" -- is something much of the team has focused on for the past year now. The features of which include a renovated networking layer, a new interface to aid in programatically controlling GTA, and a much more modular design, which allows for such cool things as user-created gamemodes, the ability to draw custom graphics within GTA, and much more.

Ed Lyons: We believe that the new core, which is written from the ground up, will give players a multi-player experience that goes way beyond what we offer now and have offered in the past. Writing the new core gave us the opportunity to totally re-think the way multi-player should be implemented, and allowed us to include hundreds of features that have been asked for by our community ever since our first release.

Chris McArthur: The current in-development version of MTA is vastly different than any other mod currently in development, for GTA or any other game. We use extremely low-end technologies to expose the game's internal functionality, so that we may build a layer on top that we can easily manipulate. We are programming interfaces to everything -- from the network layer to the interface layer. It truly is an amazing project that is full of learning experiences.

OSDir.com: So how did you add an online multi-player component into Grand Theft Auto? Basically, how does Multi Theft Auto work?

McArthur: To break it down, MTA works by injecting itself into the game, intercepting code, and executing our own code as if it was originally programmed to be there. We are able to manipulate the game's internals and force it to react to conditions as we see fit; hence, the ability to mimic multi-player functionality in a single-player game.

Lyons: The new core of Multi Theft Auto, Blue, creates an interface that can control many elements of Vice City, as well as receive a lot of information on what is going on in the [game world].

We then have an add-on system that allows third-party developers to write their own modifications using Blue's interface. These have a lot of control over the engine, including using the Vice City mission scripts, DirectX, and access to information over the network.

Finally, we have a network layer that passes information between the client and server. The server also has a similar system set-up, whereby third-party developers can create add-ons for the server that, with the client add-ons, can create very diverse and exciting games.

Abdine: It's funny. About a year ago people would kill to know how to do what we were doing with the game. The answer is research. This includes looking up information on compilers, operating systems, and spending literally about three months worth of time getting an intimate knowledge of the way Grand Theft Auto works. Once you have the research done, the rest is a piece of cake.

OSDir.com: What programming language have you been using to write Multi Theft Auto?

McArthur: The early versions of MTA were coded in Visual Basic 6 using Winsock and some basic Win32 API Functionality. Since then, we have ported the entire code base to C++ and used its functionality, power and cleanliness to bring the best possible multi-player experience to our end users.

Derek Abdine: Coding in C++ makes it easier for the team to break down work into modules, and creates a logical flow which we can work with for future enhancements to the game. Additionally, low level coding can only be done in C++, which is the primary driving force of our current technology.

Lyons: Personally, I also use significant amounts of ASM, as this is often required to make Vice City perform how we wish.

OSDir.com: Did you incorporate code or libraries into Multi Theft Auto which you did not originally develop?

McArthur: The current version of Multi Theft Auto is using a free networking API, called RakNet from Rakkarsoft, which provides us with TCP-like reliability over UDP and a vast feature-set for all of our networking needs. The team is also utilizing a heavily modified version of Crazy Eddie's GUI for the in-game interface.

Abdine: They were chosen because they provided all the functionality and robustness our team desired, allowing us to focus on other areas of our software.

Simon: The team also utilizes The All Seeing Eye SDK for a server listing option, and the new core will utilize All Seeing Eye's server browser SDK. The All Seeing Eye SDK frees up a ton of resources and time that would have been spent implementing a good server browsing option. Now we can focus our efforts on the "guts" of MTA and making a fun game.

OSDir.com: What advice do you have for other developers when it comes to using Crazy Eddie's GUI System?

Abdine: Crazy Eddie's GUI System is a very powerful GUI system that allows game creators such as ourselves to spend time working on the "meat and potatoes" of the game rather than additional cosmetic parts. It is very robust, and therefore requires some attention initially to get it to look, work, and feel the way you want it to. I'd recommend it as a necessary part of any game developer's arsenal. Oh, and the best part is that it's free!

OSDir.com: What about RakNet?

McArthur: RakNet is an extremely powerful networking system designed to be integrated into any type of application in a short time frame. RakNet provided us with the ability to push our modification to the next level with a stable and robust architecture which suits our exact needs. RakNet includes support for Distributed Network Objects, Remote Procedure Calls, Master Server, Voice Communication and many other features that make it the all-around package to fit our project. The code is well-documented, and the community is great and answers questions extremely quickly. An amazing open-source networking architecture that we highly recommend.

Simon: If you are looking for an easy way to implement networking code into a game, then I highly suggest this product. It really saved us a lot of time.

OSDir.com: Was the open-source nature of RakNet integral in hacking the networking components into the GTA3 and Vice City engines? In other words, would this feat not have been possible if you did not have the RakNet source?

Lyons: Not really. We've made almost no changes to the RakNet sources -- it'd be a great system to use, even if it was closed source.


Figure 2: Bored of interacting with the computer-controlled denizens of Grand Theft Auto 3 and GTA: Vice City? Now you can carjack other players across the Internet with Multi Theft Auto.(larger version)


Simon: We chose RakNet because it saves us a load of time in packing together memory for creating packets. RakNet provides a nice, object-oriented way of putting your variables into packets, and also handles other complicated tasks such as reliable UDP packets. Its open-source nature is nice, in that if we ever have to change something, we can -- though we have found that this product is quite nice and we haven't had to edit very much of the original source.

OSDir.com: What technical limitations are there in Multi Theft Auto, for the time being?

Simon: The old core has been stretched to its limits. Right now, the gamemodes must be coded within the SCM file (GTA's mission scripting system), and the way MTA interfaces with GTA's memory is fairly unstable. Both of which are relieved by the new core.

The new core will be much more stable and will not depend on the SCM at all. We have extended the SCM functionality to the add-on DLL's interface to GTA. What this means is users can now call SCM functions from within their own DLL in a C++ syntax. (The older method of coding SCM for GTA resembled a "quasi-ASM" syntax)

The biggest technical limitation of MTA is probably related to the lack of source code. Without the source code to the original game, much of our time is spent debugging and disassembling the game. Some find this fun, which is a good thing considered the amount of work in this area that is required.

Lyons: As Grand Theft Auto: Vice City's developer, Rockstar, didn't design the game with modding (at least of the sort we're doing) or multi-player in mind, it does make developing this mod so much harder. On the other hand, part of my motivation for developing MTA is the challenge posed by this.

OSDir.com: What have been the biggest technical challenges the team has had to deal with in developing Multi Theft Auto?

McArthur: Interfacing with the game. Most of our interface with the game is developed by researching when events happen within the game, and figuring out how we can manipulate the game in the way we wish to.

Abdine: Looking at thousands of lines of assembly code and trying to guess at what's happening becomes a very daunting task after a short while.

Lyons: Personally, I've spent four or five months trying to make shooting work well. This has been mostly successful. The main problem with shooting is that Vice City was designed with the idea that the (local) player is the only one who can shoot properly aimed; other players will auto-aim at other players, but they can't target shooting properly.

Simon: In MTA, all other players you see are a different data type than your player is. Everything, from animations to weapon firing, is handled vastly differently between the two. As a result, many of the features we'd like to implement involved reworking how Rockstar Games originally coded something.

Also, anti-cheating measures are very difficult to [make] work effectively. Aside from CRC-checking different files that people would want to modify, it's difficult to prevent people from hacking GTA to gain an unfair advantage in MTA. This mainly is due to the fact that GTA wasn't designed to be multi-player, and the server is completely unaware of the inner workings of GTA. The map data, physics, health, etc. all have to be controlled client-side.

OSDir.com: Throughout this project, did you learn anything interesting technically about the GTA3 and Vice City game engines? Are they different from one another greatly, or are they essentially the same engine?

Lyons: Doing a project like this, it is essential that we understand the inner working of the game. We've probably reached the point where we can do whatever we want with the game (within reason).

The GTA3 and Vice City game engines are very similar. From my analysis, we'd guess that about 95 percent of the code in Vice City exists in GTA3. Most of the visible changes between the two games occur because of the RenderWare (the middle-ware graphics engine that both games use) version used, as well as changes to the streaming and level-of-detail [LOD] systems.

OSDir.com: Could the code you've been creating for Multi Theft Auto be recycled for use in another game?

Lyons: We've designed Blue so that we can port it to any game fairly easily. We've done this by keeping the game layer and the networking separate. This means that we can just change the game layer over without much work. Of course, this applies most easily to games in the GTA series, though we could apply it to any game, in theory.

In developing Blue, by far the largest amount of time has been spent on research. If it were to be ported to another game, more research would have to be done for that game, too.

Simon: The team has considered working on other games. The new core was designed in such a way that we could easily port it to other games. The question always comes back to how much demand there is, and how difficult it will be.

OSDir.com: Do you plan to release the source of MTA to the public in the future? Or at least parts of it that might be useful to other developers wanting to hack multi-player into other commercial games?

Simon: Unfortunately, making the game entirely open source is not an option.

In a normal multi-player game, the server is able to know exactly what is going on in the game world at all points in time. Without the source code from GTA, it makes it quite difficult to do these things server-side. Because of this, a lot of "trust" must be given to the client. With that in mind, it makes it much easier to write cheats for a game like MTA, and there's little we could do about them if the project were open source.

Lyons: We'll be releasing an extensive SDK which will allow anyone with some C/C++ experience to have a go at doing all sorts of things with the GTA engine, many of which aren't very practical or possible with the current tools. We'll be including the full source for a few sample modifications with this, most likely a racing modification and a team deathmatch modification.

As it stands, we aren't planning on open-sourcing the entire project, as we believe it would increase cheating online, and fragment the community (many different incompatible versions would exist).

We have thought about porting Blue to other games, and have developed with this in mind, so that only minimal changes would need to be made to change to another game. Even though we aren't planning to open source Blue, we'd be happy to hear from any developers who have an interest in developing Blue for another game.

OSDir.com: So what would be the major issues one needs to keep in mind when attempting to add a networking feature to a pre-existing a game?

Simon: It's quite an undertaking, and takes quite a lot of time to reverse a game to the point that you can begin to get the kind of control you need to add a multi-player component.

McArthur: Understand that it is not as easy as it may look, and you will have to pour a lot of time into the project before you see the slightest results.

Lyons: Developing full multi-player takes a long time -- MTA has taken over a year and a half. Not many games keep their popularity over that length of time.

Technically, it's possible to add multi-player to any game, the difficulty just varies enormously. Some games are better suited than others.

Max Payne, for example, would be a bad game to do. It'd be very hard to [add] in multi-player due to [its] "bullet time" [feature]. In the game, bullet time makes you harder to hit and other people easier to hit. If you were to do this online -- slow yourself down -- you'd make yourself an easy target.

Also, you do need to find a team with a plenty of knowledge. Although it's possible to start your mod with one team member, you will find that you need many more if you wish to do it properly.

OSDir.com: Got any final advice you'd give to somebody who is interested in adding network play to a pre-existing game?

Simon: It can be quite rewarding, but make sure you have a good source of people who can help you out, as it's quite a daunting task.

I'd say most of all, though, working on a project like this requires dedication and good communication. At some points in time, three or four people will be working on the same sections of code. So keeping code readable and not stumbling over other people's work is very important.

Lyons: Do plenty of research before you start coding. If you want a team, make sure you get people you can trust, who have spare time and, most importantly, know what they're doing. We've seen many Vice City and GTA3 multi-player mods fail because the teams developing them didn't work well together, or [were not able to] dedicate the huge
amounts of time required to do this.

McArthur: Good luck, and I hope you have an easier time then we did. Hopefully, a great community can help drive your project and you enjoy each and every moment of development. A word of advice: Choose a game that you like, as it will benefit you in the end -- you have to play the game...a lot.

Abdine: Better have a lot of Hot Pockets and Diet Cokes lined up.

Howard Wen is a freelance writer who has contributed frequently to O'Reilly Network and written for Salon.com, Playboy.com, and Wired, among others.
Login/Become a Member! | 0 Comments
Threshold
Comments are owned by the poster. We aren't responsible for their content.


Advertise With Us! | Comments are property of their posters.
Copyrighted (c) 2009, but we're happy to let you use what you wish with attribution. OSDir.com
All logos and trademarks are the property of their respective owners.
OSDir is an inevitable website. super tiny logo | Contact | Privacy Policy

Page created in 0.946219 seconds.