WebGL GTA1 (GTA1 in your web browser)

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
niklasvh
Ped
Ped
Posts: 3
Joined: 01 Jan 2012, 10:39

WebGL GTA1 (GTA1 in your web browser)

Post by niklasvh »

Hi,

I am working on a WebGL implementation of GTA 1 (currently renders all the CMP map files), but having issues getting the colors correctly for tiles fetched from the G24 (24-bit version). I've gone through the DMA CityScape Data Structure documentation, but there is really no information on the G24 format, just briefly mentions that instead of using a palette, it uses instead a palette_index and CLUT data to correctly define the colors for a tile.

If someone is familiar with the format, could they give some insight on how the colors are set for a tile? What is the relation from tile<->palette_index<->clut data?

I am currently using pre-fetched tile sprites made by other tools, but as I want the game to be able to run custom tiles in their original format, I'd want it to be able to directly fetch them from the G24 files.

Thanks!
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA 1 .G24 style file format

Post by Sektor »

WebGL GTA1 would be cool. I'll ask some experts. Did you try looking at the OpenGTA source code? http://ogta.fifengine.de/download.html
niklasvh
Ped
Ped
Posts: 3
Joined: 01 Jan 2012, 10:39

Re: GTA 1 .G24 style file format

Post by niklasvh »

Thanks, I'll have a look at your link.

Got some progress on the palettes, managed to load the first 9 tiles correctly (probably just because they use the same palette or something), but at least some progress now...

User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA 1 .G24 style file format

Post by B-$hep »

Always wear safety glasses while programming.
niklasvh
Ped
Ped
Posts: 3
Joined: 01 Jan 2012, 10:39

Re: GTA 1 .G24 style file format

Post by niklasvh »

Thanks, got it sorted :)

A few screenies: https://plus.google.com/photos/11503058 ... 4170119697

Still some issues with the transparent palettes... appears that it isn't just transparent materials which use them...
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA 1 .G24 style file format

Post by Sektor »

I didn't link gta1-gta2-tool-source-code.7z since I don't remember it having any GTA1 style tools.

I see you posted on G+ that you added Box2d physics. That could be fun.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: G24 style file format WebGL GTA1

Post by Sektor »

Good new, Niklas released a walk around the city demo:

http://experiments.hertzen.com/webgl-gta/
Try it (takes a while to load and uses a lot of system resources)

Bad news, "I currently have no plans of continuing developing this any further in the near future". [frenzy]

At least the source code has been released, so others can improve it. :)

http://gtamp.com/2012/05/03/webgl-gta1-demo/

I get 59 FPS in Chrome, 30-46 in Firefox 12.
Post Reply