Sign in to follow this  

Help creating GTA2 similar engine

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Well, I will have a look at SFML, which will hopefully be better than SDL. I'm beginning to think that implementing 3D buildings will be quite tough, and is not worth it....But even without them, I still have a lot to learn, AI, physics(car, especially).

Well, Allegro seems not for me I think...SFML seems great, but the lack of documentation is what bugs me.... Any good sites you know of, aside from their main one?

[Edited by - Predator106 on June 25, 2008 7:38:17 PM]

Share this post


Link to post
Share on other sites

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this