Help creating GTA2 similar engine

Started by
9 comments, last by Predator106 15 years, 9 months ago
Hello, I have been doing 2D game programmming lately, and have just moved to C++ and SDL, from C# and XNA, because I now hate Windows, and am more of a Linux person. Anyways, I have done 2D game making ONLY. But I have gotten really excited about attempting to create a copy of GTA2 (or as close as I can get to it, but hopefully better in other ways). It seems like they use some type of tile engine, I know that the cars, and the peds are all simple sprites. But what I do not understand, is the buildings....Please enlighten me on this issue as quickly as possible.
Advertisement
I'm just beginning game programming, but I've worked with 2d engines before. Correct me if I'm wrong, but I'm almost positive that the buildings are tiles as well, just made to look 3-dimensional. Eye tricks, ya know? ;) You just have to add shadowing and lighting effects to make the tile look slanted or 3d.

Hope this helped you out.
I'm pretty certain its just a straight-down 3D viewpoint, with sprites for people and vehicles as you say. Its possible that you could achieve the same effect with some clever math tricks, but it wouldn't have been worth the effort.

From what I can tell, the level layout is tile-based. The buildings may be built out of a sort of 3D tile, but there's enough variance and detail that I won't say for certain... then again, its been a long time since I've played GTA2 and memory is foggy, still my favorite GTA though.

On the plus side, the straight-down view simplifies *tons* of things. For example, a simple quad-tree can be used for spacial partitioning, rather than a complete oct-tree and all the physics, collision-detection and other gameplay code can be done in only 2 dimensions.

Even if you "upgraded" to 3D models for the vehicles, and possibly even people, you could easily get away with 2D gameplay code.

throw table_exception("(? ???)? ? ???");

I'm pretty darn sure they are actually 3d, it would be quite difficult to pull off any other way.

edit:
Ravyne beat me to the post.
Hopefully this will help you guys' memory...

http://www.gta.ru/images/gta2/gta2pp.jpg

So, for a 16-yr old that has only done 2D programming, do you think that it would practical for me to try and create that, if so, what resources would you recommend(through SDL hopefully). If not, I would still-even want to go for the same route, except without the whole 3D idea, what would be the best way to "simulate" it. And, bare in mind that I am a terrible artist, like absolutely quite horrible.
Hhhmm, well now I'm debating using Allegro instead of SDL, because of it's "ease of use" being image rotation, and other stuff.
If you're doing 3D, without doing it manually, you're using OpenGL in SDL. So don't use Allegro, as you'll be using 3D primitives to render your sprites, and not some ancient hokey 'sprite rotation'.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
take a look at this thread
http://www.gamedev.net/community/forums/topic.asp?topic_id=498908

I'm in a similar situation than you, but I want to do only 2D (GTA2 buildings are 3D), and I'll try with SFML instead of SDL (SDL is not hardware accelerated, unless you are using OpenGL to render)
As an aside, Rockstar released this game as a free download: HERE

Good luck on your project~
0xa0000000
Hi there,

I myself have been working on a GTA2 clone a few years back to learn more about professional gaming and found some documents fully specifying the file format for the GTA2 levels and sprite sets. It's done like this:

Level:

The level is a huge 3D table of 256x256x8 cubes. For every cube, one of 64 default shapes is specified (45 degree ramp left, corner top-left , etc) and for every shape 5 textures are specified. That is pretty much it, except for some extra data for tile types (pavement, road) and that sort of information.

Sprite sets:

The sprite sets are 256x256 images using a 256-color pallet. All sprites are packed in these sprite sets. The locations of all sprites are specified within the file format as the set-number and coordinates or something like that.

Scripts:

Well, I did not look into the scripts very well, but there is some online information on it and the scripts are human readable (although you probably have to extract them first) so you should be able to understand these after some experiments.

I was able to rip the levels and sprites and have used them in the past in all my game programming attempts as I am not much of an artist.

I've searched on my computer and placed the documents online, and for fun I put some screen shots of my 3D engine using GTA2 levels. I was actually aiming for a RTS, so I preprocessed the GTA2 levels to add all kinds of information for fast long range path finding and much faster object-to-wall collision detection, but I used the GTA2 levels as direct raw input into my level preprocessor.

Link:
http://www.van-antwerpen.net/Dietger/GTA2/

There is also an official GTA2 level editor I put online, which is very useful for reverse engineering the format details, but it has some issues on windows 2k and XP machines as it was intended for windows 98.

Well, have fun, and I may add, using existing file formats for your game will be an immense help for making hard design decisions (they are already made for you) so in my opinion, there's no better way to learn game programming.

Greatz,
Dietger

[Edited by - dietepiet on June 25, 2008 11:13:22 AM]

This topic is closed to new replies.

Advertisement