Jump to content

[REL|SA|VC|III] GTATools - Open-Source Engine/Libraries for GTA


Alemarius Nexus

Recommended Posts

Alemarius Nexus

GTATools

 

 

A collection of cross-platform (currently Linux and Windows, but other UNIXes should work without major changes), open-source tools, program libraries and an engine for working with files of the GTA III game series (SA/VC/III).

 

You might find gtatools useful for developing tools like map editors or who knows what in C++. At some point I had envisioned actually building a full open-source version of the game out of it, but that is really kinda utopian.

 

The project is mainly intended for developers.

 

 

 

Source Code, Binaries and Further Information

 

The project is hosted open-source (under the GPLv3) on GitHub here: https://github.com/alemariusnexus/gtatools

 

Some more information can be found on GitHub. Binary versions as well as precompiled dependencies for Windows can be found on my server here: http://alemariusnexus.com/gtatools. You can also find some boring screenshots of the engine in action there.

 

And yes, I know how cluttered, buggy and undocumented this code is. It is due to the way in which it was developed, as well as general lazyness on my side. :sarcasm: Feel free to ask me stuff about it though.

 

 

 

Background and Features

 

I've been developing this project for years now. It started as a learning project for C/C++, but has been rewritten several times and is quite a big project now.

 

At the core, it is a C++ library for reading (and for some formats also writing) files of various formats found in the GTA III series. Currently supported are DFF, TXD, IMG, COL, IFP, IPL, IDE, GXT as well as some minor stuff like a gta3.dat parser. It should support these formats for all three games, but only the PC version. Writing support (experimental!) is included for IMG and TXD.

 

On top of that, there is a library with a streaming engine that is capable of rendering the game's static map, animations (including skeletal animation for e.g. peds), as well as some very basic physics using OpenGL.

 

There are command-line programs for working with IMG and TXD files, and there is a GUI tool for displaying and analyzing all kinds of GTA files. For testing the engine, there is a small program that displays all map objects of the game, with some ped animations and a free camera to move around.

 

It is far from being stable. Basically, do a wrong click and all hell will break loose. I decided to publish it now because I am not sure if I will continue developing it (depends on the amount of interest), but didn't want it to get lost on my hard drive. Consider it a bleeding-edge development preview.

 

 

 

Here is a screenshot of the engine rendering the map of GTA San Andreas, with some animated peds (you can't see the animation here, duh!):

gtatools-test.png

Edited by Alemarius Nexus
Link to comment
Share on other sites

So it's like a open source implementation of RW engine using same files?

First thing I see is no alpha bug on vegetation :)

Link to comment
Share on other sites

Alemarius Nexus

Yep, that's basically what it is. But it does not have to be used as a full engine. You can also just use it to play around with files, convert them, change stuff and the like.

 

I'm using the Depth Peeling transparency algorithm. It should give pixel-perfect order independent transparency in most cases, and it works really well.

  • Like 2
Link to comment
Share on other sites

'Swell tool you got there dude. My only concern/question would be the RW framework most tools depended on for compilation. Dexx's SA GFX relied on that, and thus he wasn't able to release it as open-source due to the RW SDK headers being non-free. Did you do a libre implementation of it?

Link to comment
Share on other sites

Alemarius Nexus

Yes, I depend in no way on anything in the RW SDK. All my code as well as external dependencies are open-source and free. The headers and API are not compatible with RW (that wasn't what I wanted it to be). I got most of the information about the file formats from the GTAModding Wiki, this forum and some other open-source libraries.

Link to comment
Share on other sites

Ive been aware of this and waiting for you to release for a good long while. Thanks for compiling and showing to the world. Your awesome!

At some point i will be interested in GTA again enough to need this so for what its worth heres a vote to continue its development :r*::cookie:

Link to comment
Share on other sites

Looks awsome, even with the bugs that can be seeing on the pic.

Link to comment
Share on other sites

Alemarius Nexus

Looks awsome, even with the bugs that can be seeing on the pic.

 

Which bugs do you mean? Apart from maybe some things that are just not implemented (like the sky and procedural objects, for grass etc., and a weapon for the cop) and a few visual artifacts like aliasing, I don't see anything wrong.

Link to comment
Share on other sites

Good stuff. It's nice to see someone else is still interested in researching old-gta formats.

Txd and (mostly) Dff formats are incompleted and outdated, means it's not possible to create high-quality txd/dff tools with this. That's bad/

Edited by _DK
Link to comment
Share on other sites

Alemarius Nexus

Good stuff. It's nice to see someone else is still interested in researching old-gta formats.

Txd and (mostly) Dff formats are incompleted and outdated, means it's not possible to create high-quality txd/dff tools with this. That's bad/

Outdated? In libgtaformats, TXD should be relatively up-to-date. DFF is incomplete, but I could implement basic writing support relatively easily. I don't know much about reverse engineering, so I can only work with what's already known. If there is anything specific that you think should be implemented, please tell me. I usually only implement what I currently need.

Link to comment
Share on other sites

For texture format, check this

http://gtamodding.ru/wiki/Texture_Native_(Секция_RW)#PC_.2F_XBOX

And for dff, I could send you my own project, but later.

Edited by _DK
Link to comment
Share on other sites

Alemarius Nexus

Just looked at that TXD page. I currently don't have this cube texture stuff, I'll take a look at that. Apart from that, I'm only missing one or two of the flags in the RasterFormat struct I think.

 

Doesn't look difficult to add, I'll give it a go.

 

 

Seems like you just changed that in the English wiki, too. Very nice!

Link to comment
Share on other sites

do you even opengl texture native

still me, still existent, still.. everything~

Link to comment
Share on other sites

Alemarius Nexus

do you even opengl texture native

 

I do, but that is not part of libgtaformats on purpose. libgtaformats does not use any rendering system, it just gives you a nice object-oriented view of the TXD archives and textures in there, with the actual pixel data as a block of bytes. That is done on purpose, because not all things you might want to do with the textures are related to rendering stuff. For instance, gtatxd (the command-line TXD tool of gtatools) uses libgtaformats' TXD system to convert TXD textures to PNG files. libgtaformats strives to be general-purpose.

 

The actual conversion to OpenGL textures is done inside the engine in libgta, which builds on top of libgtaformats. You can find the code in Texture.cpp.

Link to comment
Share on other sites

 

do you even opengl texture native

I do, but that is not part of libgtaformats on purpose. libgtaformats does not use any rendering system, it just gives you a nice object-oriented view of the TXD archives and textures in there, with the actual pixel data as a block of bytes. That is done on purpose, because not all things you might want to do with the textures are related to rendering stuff. For instance, gtatxd (the command-line TXD tool of gtatools) uses libgtaformats' TXD system to convert TXD textures to PNG files. libgtaformats strives to be general-purpose.

 

The actual conversion to OpenGL textures is done inside the engine in libgta, which builds on top of libgtaformats. You can find the code in Texture.cpp.

 

nope, i meant the RW 'native texture' section for the OpenGL RW render system. kind of irrelevant unless making TXDs to be loaded by the mobile versions' leftover TXD loader, which however also supports D3D8/9 textures for some reason.

still me, still existent, still.. everything~

Link to comment
Share on other sites

Alemarius Nexus

 

 

do you even opengl texture native

I do, but that is not part of libgtaformats on purpose. libgtaformats does not use any rendering system, it just gives you a nice object-oriented view of the TXD archives and textures in there, with the actual pixel data as a block of bytes. That is done on purpose, because not all things you might want to do with the textures are related to rendering stuff. For instance, gtatxd (the command-line TXD tool of gtatools) uses libgtaformats' TXD system to convert TXD textures to PNG files. libgtaformats strives to be general-purpose.

 

The actual conversion to OpenGL textures is done inside the engine in libgta, which builds on top of libgtaformats. You can find the code in Texture.cpp.

 

nope, i meant the RW 'native texture' section for the OpenGL RW render system. kind of irrelevant unless making TXDs to be loaded by the mobile versions' leftover TXD loader, which however also supports D3D8/9 textures for some reason.

 

 

Hmm, I didn't know something like that existed. All I'm loading is this. I'm only targeting the PC versions for now though.

Link to comment
Share on other sites

 

Looks awsome, even with the bugs that can be seeing on the pic.

 

Which bugs do you mean? Apart from maybe some things that are just not implemented (like the sky and procedural objects, for grass etc., and a weapon for the cop) and a few visual artifacts like aliasing, I don't see anything wrong.

 

Wrote it in a PM:

Edited by cj2000
Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.