2006-12-10

This commit is contained in:
Anonymous Maarten committed 2015-12-03 01:37:02 +01:00
commit 78c27f03c8
153 files changed
+24678

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
Cityscape Data Structure
http://azz.gouranga.com/files/cds.zip
Do not miss the rest of these gems:
http://azz.gouranga.com/index.php?page=8
GTA Mission Template Description (can be found elsewhere)
http://www.fileplanet.com/19571/10000/fileinfo/2/0/section/General
GTA2 Format Docs (somewhat related ;-)
http://files.filefront.com/GTA2+Format+Docs/;10536;;/fileinfo.html
The unofficial Grand Theft Auto Reference Handbook
http://gta.mendelsohn.de/Reference/
Corrections and Notes regarding DMA GTA technical doument [cds.doc v12.10]
http://www.fifengr.com/gtacars/topic.html
--- other links ---
A Stream-based Time Synchronization Technique For Networked Computer Games
http://www.mine-control.com/zack/timesync/timesync.html
Fix Your Timestep!
http://www.gaffer.org/game-physics/fix-your-timestep/
Car Physics for Games - by Marco Monster
http://web.archive.org/web/20051218060818/http://home.planet.nl/~monstrous/tutcar.html
+133
View File
@@ -0,0 +1,133 @@
i emailed you all this but am posting it here just-in-case:
hi, i declare myself an expert on gta1 and gta2 map format, i can help you with anything you ask, email me at jernejcoder@gmail.com, let's get straight to answers:
* Can anyone tell me more about the height/size of blocks as drawn in-game? Currently I texture a unit-cube, but that doesn't look right (may have other causes).
one gta cube is 1*1*1 unit big
* When looking at the "slope type" bits in "type_map" (CDS.DOC) I am not sure howto interpret something like "1- 2 = up 26 low, high"; is it 26 degrees, pixel or another unit?
use it like this:
* 1- 2 = up 26 low, high
* 3 - 4 = down 26 low, high
* 5 - 6 = left 26 low, high
* 7 - 8 = right 26 low, high
* 9 - 16 = up 7 low - high
* 17 - 24 = down 7 low - high
* 25 - 32 = left 7 low - high
* 33 - 40 = right 7 low - high
* 41 - 44 = 45 up,down,left,right
there are 3 types of slopes in gta1, (90°, 45° and 7°) all change level for just one cube.
take parts 1 and 2, these when used together make a pass from lower to upper level over 2 cubes, cube 1 is lower and cube 2 is upper part for this.
* Concerning the FON files; the GTA hacking handbook (http://gta.mendelsohn.de/Reference/Fil_index.html) seems to define them, but the link is broken; the older (zip) version doesn't contain that file. Is that fileformat documented somewhere?
this is very easy format:
Quote:
type
TFon_file_header = packed record
NumPics:byte;
height:Byte;
end;
type
TFon_image_header = packed record
width:byte;
end;
the file starts with TFon_file_header which tells you num pics and all pictures height
then for NumPics there are repeatitous data for characters starting with TFon_image_header that tells you character width, following that you get charwidth * fontheight of 8 bit bitmap data.
last 768 bytes in a file is palette (RGB format)
i have sound format as well:
Quote:
grand theft auto .sdt format
this file is copyright 2002 Delfi delfi@volja.net
data types are named as used in borland delphi's object pascal language
warning!
this is for GTA1 and GTA:L only
gta2 and gta3 use different format...
sdt files contains info for raw sound data files with same name but raw extension
divide size of sdt file by 12 to get number of sound records
each record contains information on how to use raw file
here is delphi packed record:
Tsoundentry = packed record
rawstart: longword;
rawsize: longword;
samplerate: longword;
end;
you can export sound like this:
make new empty file and write wav file header:
TWave_data = packed record
ChunkID: array[0..3] of char; // 'RIFF' text
ChunkSize: Longword;
Format: array[0..3] of char; // 'WAVE' text
Subchunk1ID: array[0..3] of char; // 'fmt ' text
Subchunk1Size: Longword;
AudioFormat: Word;
NumChannels: Word;
SampleRate: Longword;
ByteRate: Longword;
BlockAlign: Word;
BitsPerSample: Word;
Subchunk2ID: array[0..3] of char; // 'data' text
Subchunk2Size: Longword;
end;
set info in header
Wave_data.ChunkID := 'RIFF';
Wave_data.ChunkSize:= 49188;
Wave_data.Format:= 'WAVE';
Wave_data.Subchunk1ID:= 'fmt ';
Wave_data.Subchunk1Size:= 16;
Wave_data.AudioFormat:= 1;
Wave_data.NumChannels:= 1;
Wave_data.SampleRate:= sample rate of entry
Wave_data.BitsPerSample:=8;
Wave_data.ByteRate:= sample rate of entry
Wave_data.BlockAlign:=1;
Wave_data.Subchunk2ID:= 'data';
Wave_data.Subchunk2Size:= raw data size
now copy raw data and write it after this header
if you did everything correct you will be able to play wav file with any program...
something interesting from GTA Wave gta sound editor readme file:
In GTA, all the sounds are in 8-bit mono format, except for those in
LEVEL000. The sounds in this file are 16-bit, the first three being
stereo.
should this be all for now, i have slope cubes in a 3d format representation if you want, email me at jernejcoder@gmail.com or MSN - stdcall@gmail.com (messenger only)
i'm onto a similar project, a gta1 / gta2 clone project, but gta formats are too limiting for me, and i went onto coding my own gta game clone, you can get screenshoots & demo http://gtatools.com/tdc/, it is written with opengl and delphi 4, i've gotten rendering pretty much perfect, and made my own map and sprite editor, but won't be compatible with gta file formats, but converters can be easily done, here is a picture:
gtatools.com/tdc/tdcware.jpg
best regards, Jernej L.
+20
View File
@@ -0,0 +1,20 @@
GTA Settings runs fine here. Winex 2.2.1.
---
In order to run "GTA Settings.exe" you need a legit Windows install (so you have MFC42.DLL to be specific). The DLL needs to be in your WineX "windows\system32" directory.
---
no need to use the setup tool, drop this into your system.reg:
[Software\\DMA Design\\Grand Theft Auto]
"Language"=dword:00000000
[Software\\DMA Design\\Grand Theft Auto\\Controls]
"Control 0"=dword:000000cb
"Control 1"=dword:000000cd
"Control 2"=dword:000000c8
"Control 3"=dword:000000d0
"Control 4"=dword:00000039
"Control 5"=dword:0000001c
"Control 6"=dword:0000001d
"Control 7"=dword:0000002d
"Control 8"=dword:0000002c
"Control 9"=dword:0000000f
+79
View File
@@ -0,0 +1,79 @@
== OpenGTA project overview ==
- \subpage Fileformats
- \subpage Rendering
\namespace Audio
\brief Making noise.
Very incomplete wrapper around \e SDL_sound and \e SDL_mixer.
\namespace Loki
\brief From: http://loki-lib.sourceforge.net/
Loki is a C++ library of designs, containing flexible implementations
of common design patterns and idioms.
I only use the \e Singleton a lot, but there is some nice code there.
\namespace OpenGL
\brief Drawing stuff
A bunch of quite experimental code; the highlights:
- #OpenGL::TextureCache
The following are used as \e Singletons:
- #OpenGL::Camera --- #OpenGL::CameraHolder
- #OpenGL::Screen --- #OpenGL::ScreenHolder
- #OpenGL::SpriteCache --- #OpenGL::SpriteCacheHolder
\namespace Util
\brief This and that
- #Util::ci_string
- #Util::Log
- A bunch of exceptions derived from std::exception
And a \e Singleton object:
- #Util::BufferCache --- #Util::BufferCacheHolder
= Fileformats of the GTA1 data files =
Fortunately some documentation exists, specifically about
the most important formats.
Reading _(cds.doc) is probably vital; you may want them all.
So in no particular order:
include(`doc/doc_links.txt')dnl ~oh m4, your glorious thing~
Support for the following formats is implemented:
- CMP (compressed map) #OpenGTA::Map
- FNT (font bitmaps) #OpenGTA::Font
- FXT (text strings) #OpenGTA::MessageDB
- GRY (8bit graphics) #OpenGTA::Graphics8Bit
- G24 (24 bit graphics) #OpenGTA::Graphics24Bit
- SDT (RAW sound offsets) #OpenGTA::SoundsDB
= Rendering the scene =
The central part is #OpenGTA::CityView, which renders the #OpenGTA::Map
using the graphics loaded inside a derived instance of
#OpenGTA::GraphicsBase.
CityView maintains a couple of #OpenGL::TextureCache (s) to store the
texture-ids (for the static city blocks).
#OpenGTA::BlockData contains the vertex data and texture coords for
each of the of the possible blocks; this corresponds to
#OpenGTA::Map::BlockInfo::slopeType.
Drawing of objects (sprites) is being moved into #OpenGTA::SpriteManager,
though this is not yet complete.
#OpenGL::DrawableFont can display strings using the bitmaps from
a #OpenGTA::Font.
+80
View File
@@ -0,0 +1,80 @@
2006/8/21, tok@openlinux.org.uk <tok@openlinux.org.uk>:
> I have got it; quite a lot in there.
>
> Guess I have to try my luck with dosbox, wine and such; last time I
> tried neither m1win nor junction25 were working very well (if I remember
> correctly).
thats weird, since i can run both topdown j25 and 3D beta j25 just
fine, only M1win doesn't work (on xp) for some reason. i sent you old
M1 for DOS in the pack i sent you the url to.
> Thanks for the other tips; now the main problem are the incorrect
> tex-coords. I think I have a pretty good idea why it breaks and a few
> on how to fix it.
> I found the off-by-one in the tile-indices on my own on the same afternoon.
some of your side tiles are rotated, there is no side rotation, sides
only have a bit flag which means "mirror" - no rotations.
cds says about side tiles that bit 5 and 6 in type_map_ext contain the
mirroring:
bit 5 means that textures on north and south sides should be mirrored,
bit 6 indicates same for east and west side of that cube.
> I have started with the g24 files and hit a small snag; I don't
> understand 'palette_index' (so far) and the actual way tiles
> (lid+side textures; not working with sprites so far) index the clut
> isn't working either. [but don't tell me yet]
the pal_index reindexes virtual palette numbers into actual - physical
palette numbers.
it works like this:
you take tile palette index, you add palette_index
for sprites for example you need to skip clut dedicated to tiles:
pal_index = (g24_header.tileclut_size div 1024)+ activesprite.clut;
for tiles it is just simple, but remember - if it is lid you need to
add side tiles to the number (and side tiles + lid tiles for animation
/ aux tiles):
pal_index[tile number]
please_see_attached_illustration which also shows the palclut visualized :)
> I have put a few new screenshots (after your fixes) up and removed the
> code until I have worked out the license.
> I am soon going on vacation for some time, so there won't be any updates
> for a few weeks. You'll hear from me when I am back.
>
> these already look a lot better
> http://skybound.portland.co.uk/gta/nyc_3d__two_bugs_down_2006-08-21.jpg
In the nyc i can clearly see you are rotating side tiles, where they
shouldn't be, side tiles are never rotated in gta1 (they are in gta2)
in gta1 they just have mirroring flag in type_map_ext.
> http://skybound.portland.co.uk/gta/far_out_2006-08-21.jpg
and i am seeing this right? - the san andreas map on screenshoot -
unless you rotated the camera itself, should be rotated 180° left (i
know how it shouls look, since i drawn entire san andreas map layout
in mspaint with alt + tabbing 7 years ago ;) ).
> http://skybound.portland.co.uk/gta/texture_coords_are_next_2006-08-21.jpg
this looks quite right, but it appears lid rotation is wrong in blocks
where the type_map_ext mirror flags are used.
i have a delphi project written in pascal, which can render all tiles
from g24 files, i can send you whole source code for it, it may help
you understand how g24 files work :)
thats all for now, and enjoy your vacations! :)
> Best regards,
> tok
>
+115
View File
@@ -0,0 +1,115 @@
you should only work with g24 files, since most, if not all mods for gta
only use g24 files, they are much better quality and are not any harder than
gry files (actually there are also GRX files described in cds.doc for use by
editor but nobody has these).
you should take a look at how the slope models work, it is all in very
simple order, you could simplify things a lot, since gta1 maps don't use
more complex things.
my friend steve made some nice code for rendering map slopes some time back,
here is how it works in pascal, basicly it modifies edge heights for the
cube depending on slope number, slope 0 is normal cube and other slope
levels modify the height, the bottom vertices stay where they are, so you
can easily draw quads using this:
// 1---2
// | z |
// 3---4
// calculate slope (lid vertex z values)
case s of
1..8: // 2 blocks
begin
z1:=(((s-1) mod 2)+ord(s in [1,2, 5,6]))/2;
z2:=(((s-1) mod 2)+ord(s in [1,2, 7,8]))/2;
z3:=(((s-1) mod 2)+ord(s in [3,4, 5,6]))/2;
z4:=(((s-1) mod 2)+ord(s in [3,4, 7,8]))/2;
end;
9..40: // 8 blocks
begin
z1:=(((s-9) mod 8)+ord(s in [9..16, 25..32]))/8;
z2:=(((s-9) mod 8)+ord(s in [9..16, 33..40]))/8;
z3:=(((s-9) mod 8)+ord(s in [17..24, 25..32]))/8;
z4:=(((s-9) mod 8)+ord(s in [17..24, 33..40]))/8;
end;
41..44: // 1 block
begin
z1:=ord(s in [41, 43]);
z2:=ord(s in [41, 44]);
z3:=ord(s in [42, 43]);
z4:=ord(s in [42, 44]);
end;
else // no slope
z1:=1; z2:=1; z3:=1; z4:=1;
//z1:=0; z2:=0; z3:=0; z4:=0;
end;
i don't recomment display lists for this, i tried it in my game and got huge
slowdowns, maybe if you compiled bigger parts of maps into it, but you will
need to take into account that the game uses sprites, and sprites + slopes
don't mix too good, in my game i solved this by rendering without any depth
buffer at all, but i have to do some painful sorting of rendering order, if
you want to render map with zbuffer you could use projected textures for
cars or render map in layers bottom to up, switching off zbuffer when
rendering sprites.
if a cube is set to flat, all faces on it use transparency, and if left +
right faces use same texture the right face is folded into left double-sided
tile one to form fences (same applies to up and bottom tiles, they create a
double-sided fence on north tile only)
transparency rule in gta this:
every palette index 0 is transparent if the map tile is set to use it. i
recommend you to convert graphical data, take the 8 bit graphic and palette
and create 32 bit image and upload it to opengl, create alpha transparency
channel using palette index 0.
every tile can have 4 shading levels, in g24 they are stored in palette
clut, i recommend you to ignore the shading data as whole, and use glcolor
commands to apply shading levels, also gtacars g24 editor has a terrible
habbit of generating these shades wrong and they look ugly in some mode.
for sprites, they use one palette, except peds (pedesterian and cop) and
cars,
i suggest your game should render all ped sprites into one bigger texture,
using vertex coordinates to address each of these, you will need to create
around 30 or more different recoloured remaps while loading g24 file (all
tiles would fit into 256*512 texture if you use block sorting algorythm to
optimize room usage), every ped remap would cost 524.288 bytes, 30 remaps
would so end up at 15728640b - 15 mb, too bad that all new hardware comes
without support for palettized textures, they would help a lot here, gta1
for windows for example uses driectdraw and the renderer is custom built.
cars are even more difficult, they come in 16 different color variant, and
each of cars can have delta damage or doors or special police light
animations on them, i talked to dma employee working on gta2 and he said
that each car simply uses its own texture, which is created, modified and
destroyed as needed, don't worrs about speed, i done tests for my own game
and i can say that this is not a problem, the deltas don't change too often,
and when they are they are cached as long as the car is onscreen.
some fonts in gta1 have limited use, such as pager messages or score counter
so they are missing characters or use modified order, a lot of font stuff is
hard-coded, but i found out that some onscreen fonts such as score
multiplier and lifes counter fonts are actually remapped using a palette in
G24 file (!!), i suggest you to just use the font as-is and ignore the
recoloring variants, probably very few people would notice this, but then
you can recolour them with glcolor commands aniway.
the idea of a project website sounds good, don't worry about legal troubles,
take2 won't bother about this little project for a older game that they
released as free few years ago on rockstar classics website (
http://www.rockstargames.com/classics/), they did discreetly interfere when
a member on gtaforums ran a project to bring gta vice city map to unreal
tournament engine, and for hot cofee fiasco they knew it was their fault all
the time, and they even supported us with emails that aren't for the public,
as for the CDS and MTD docs, they were officaly released to public with no
licenses (same for gta2 too) so using them is not legal trouble.
also when you have time check out http://www.dmadesign.org/ it is DMA Design
history website ran by Mike Daily who worked on gta1 graphical engine for
gta1, gta1 prototypes and created lemmings game, it has some history pages
and a forum, altrough it looks inactive it is not, if you want you can ask
him questions in the forum :)
+1413
View File
File diff suppressed because it is too large. Load diff