Forums » Air Combat & Civil Aviation » European Air War » What a waste of space!


Topic Options
Rate This Topic
Hop to:
#3491492 - 01/10/12 08:08 AM What a waste of space!
MrJelly Online   content
Hotshot

Registered: 04/30/02
Posts: 5855
Loc: Caux L'Herault, France
Working on the TM2 system I have been checking out the structure of eaw_ttd.dat files, and checking the relevant source code.
It is obvious that the game designers intended to do much more with the data in this file but they never got round to it.
It is set up like this.
There is a section for each tile which has a 20 byte header. Of these 20 they are all zero, except for byte 17 which has the number of TMods on the tile.
After that there are either 64 or 128 rows of 80 bytes depending on the maximum number of TMods per tile.
Of these 80 in a row:
The first two are the ID of the TMod. As this is a number between 0-255 only the first in used and the second is always zero.
The next two set the direction it points in.
The next four sets the X coordinate of its position, but as this is a number from 0-255 only the first one is needed, the other three are all zero.
The next four sets the Y coordinate of its position, again this is a number from 0-255 and only the first one is needed
That is 12 bytes.
The remaining 68 are all zero and not used.

So, in the header, 19 of the 20 bytes are not really needed.
Of a line only 5 of the 80 bytes are really needed.

Maybe we should simplify this for TM2?

wink Jel
_________________________
Install 1.28E (XP/Vista/Win7) and fly online or off with it.

The best EAW online games are at GameRanger:
http://www.gameranger.com/


Downloads from my site:
My new webpage

Teamspeak 3 channel: 62.48.74.45:8769

Now you can join a running game, and even use a second controller smile


Top
#3491538 - 01/10/12 09:20 AM Re: What a waste of space! [Re: MrJelly]
Col. Gibbon Online   hick
3DZ Model Builder
Veteran

Registered: 06/04/01
Posts: 11116
Loc: Fleet, Hampshire, England.
More's the question is what else did they have planned? Any clues in the rem'ed out code?
_________________________
Ah that's much better!

Wings Over Bytom

At home, with my great kids, Thomas, Jessica & little Nicola. smile

Top
#3491578 - 01/10/12 10:06 AM Re: What a waste of space! [Re: MrJelly]
Brit44 'Aldo' Offline
Every Human is Unique
Member

Registered: 01/26/06
Posts: 601
Don't let bytes fool you.

Some times you need a 32 bit intiger, but it is stored in a data file as an unsigned char. This allows for a loopable value of up to 256.

Another think to consider is that a 32 bit OS prefers to work with 32 bit blocks of memory.

It is better to look at the class for unused variables then blank bytes in a hex dump.
_________________________
TPA who TWI

Top
#3491614 - 01/10/12 10:47 AM Re: What a waste of space! [Re: MrJelly]
Col. Gibbon Online   hick
3DZ Model Builder
Veteran

Registered: 06/04/01
Posts: 11116
Loc: Fleet, Hampshire, England.
Hi Allen.

Are you free for a bit of tech advice?

We have a bit of code, which need grafting into the exe. Will wrote it, but has no time to finish it, but he says it should be easy to get going. wink
_________________________
Ah that's much better!

Wings Over Bytom

At home, with my great kids, Thomas, Jessica & little Nicola. smile

Top
#3491696 - 01/10/12 12:00 PM Re: What a waste of space! [Re: MrJelly]
Baron Von Martin Offline
Senior Member

Registered: 01/10/03
Posts: 2701
Loc: Peenemuende, MB.
Hello,

Very interesting.

S!

BVM

Top
#3491733 - 01/10/12 12:37 PM Re: What a waste of space! [Re: MrJelly]
MrJelly Online   content
Hotshot

Registered: 04/30/02
Posts: 5855
Loc: Caux L'Herault, France
Allen. I cannot post the code here, but there is a heap of stuff listed in the "typedef structs" relating to the eaw_ttd.dat including comments re "reserved for future expansion". When you search for the variables listed none are found anywhere else.

wink Jel
_________________________
Install 1.28E (XP/Vista/Win7) and fly online or off with it.

The best EAW online games are at GameRanger:
http://www.gameranger.com/


Downloads from my site:
My new webpage

Teamspeak 3 channel: 62.48.74.45:8769

Now you can join a running game, and even use a second controller smile


Top
#3492068 - 01/10/12 09:15 PM Re: What a waste of space! [Re: MrJelly]
Brit44 'Aldo' Offline
Every Human is Unique
Member

Registered: 01/26/06
Posts: 601
Jelly, your PM box is full.
driving I suspect it always is. I tried to include you with my PM to Gibbonss about Woody's email ..

I hope you and yours are well.
Admin is correct to keep code snipts banned. The logic and rules of programming are what is free to discuss.

You are working with C code on a C, 32 bit compiler.

You want a variable sized array within a defined C struct.

Google is your friend when you know what to ask..
_________________________
TPA who TWI

Top
Topic Options
Rate This Topic
Hop to:

Moderator:  Avimimus, sandbagger 

Forum Use Agreement | Privacy Statement | SimHQ Staff
Copyright 1997-2012, SimHQ Inc. All Rights Reserved.