Forums » Air Combat & Civil Aviation » European Air War » The perils of programming


Topic Options
Rate This Topic
Hop to:
#3504588 - 01/27/12 02:28 AM The perils of programming
MrJelly Online   content
Hotshot

Registered: 04/30/02
Posts: 5855
Loc: Caux L'Herault, France
Working on possibilities for changing the height at different parts of a ground tile I decided to change the names of the tiles. They were:

Field8.ter
Grass.ter
Water.ter
Coast1.ter
Coast3.ter
Coast2.ter
Field1.ter

etc

In the game code things like "BN", "LR" and "BP" are added to the front of these producing the real tilenames such as "BNField8.ter" and so on.
Not having the "BN", "LR" and "BP" in the list of names gives flexibility, so I decided to further extend the flexibility by removing the "ter" at the end so that different extenders could be used and create names like "Field8.mpf".

So I changed the routine to use the shortened name, and added lines to add "ter" where it was needed.

All I needed was a new tile list file without the "ter" at the end.
So using the text version I blanket deleted the "ter", saved the file, and converted it to a string file.

Now, programmers invariably assume that when they make a change and the new version generates an error that they did something wrong, so they go back, change tweak and re-test.
That happened to me, I spent half the morning doing that and getting nowhere. My new version gave a CTD as soon as I clicked on single mission.

I did a cursory check of the stringfile with the names, and the number was right, so I was beginning to tear my hair out. Then I looked a bit closer and spotted something.

In my haste to remove the "ter" extender I had not considered that "water" also contains "ter", and the blanket removal in notepad had reduced "Water.ter" to "Wa."

There had been no error in the programming, but the new exe was crashing when it could not find "BNWa.ter" smile

I re-did the whole thing, by removing the entire ".ter" extender, creating a new stringfile, and then changing the program code to add the ".ter" extender where needed.

It worked smile

In case you are wondering where this is heading I'm looking at adding a mini height map to selected tiles named "Field8.mpf", "Grass.mpf" etc so that the names match the tile names.

The effects we might get are something like this




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
#3504618 - 01/27/12 04:00 AM Re: The perils of programming [Re: MrJelly]
Col. Gibbon Online   hick
3DZ Model Builder
Veteran

Registered: 06/04/01
Posts: 11116
Loc: Fleet, Hampshire, England.
Nice bumpy land Tony, but is it solid? wink
_________________________
Ah that's much better!

Wings Over Bytom

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

Top
#3504782 - 01/27/12 08:12 AM Re: The perils of programming [Re: MrJelly]
MrJelly Online   content
Hotshot

Registered: 04/30/02
Posts: 5855
Loc: Caux L'Herault, France
No! You should be able to see that it is made of ice cream smile
_________________________
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
#3505447 - 01/27/12 08:49 PM Re: The perils of programming [Re: MrJelly]
Brit44 'Aldo' Offline
Every Human is Unique
Member

Registered: 01/26/06
Posts: 601
Very cool. It's great to see you are making progress. It would be great if you could do that with the cloud layers frown

Another method of working with stings is to load the name into a temp string, count the string length and place a null charecture fourth from the end. You can also load the name into a temp string and replace the first "." with a null.

The public can access MSDN help files for programming. Google a key define and you can find the MSDN help files.

I know I have been an uber, poison person lately in this forum, sorry but I still drink and any appology is therefor bogus.

Top
#3506215 - 01/29/12 02:19 AM Re: The perils of programming [Re: Brit44 'Aldo']
mikew Offline
Member

Registered: 02/26/01
Posts: 2256
Loc: UK
Originally Posted By: Brit44 'Aldo'
Another method of working with stings is to load the name into a temp string, count the string length and place a null charecture fourth from the end. You can also load the name into a temp string and replace the first "." with a null.
Great tip!

Thanks. thumbsup

Top
#3520721 - 02/17/12 08:45 AM Re: The perils of programming [Re: MrJelly]
MrJelly Online   content
Hotshot

Registered: 04/30/02
Posts: 5855
Loc: Caux L'Herault, France
Episode two smile

Moggy is updating Dunkirk for 1.28F
I update my eaw_ttd.dat editor so that it can produce the new Geawttd2.dat file which the TM2 system uses.
The in game results are not quite right.
Moggy, new to using the editor, assumes that he is doing something wrong.
I, the programmer, assume that there is a bug.
We have spent a week trying to fix it. The editor seems OK, the files seem OK.
However, one particular tile type is meant to display barrage balloons.
Sometimes it does, sometimes it does not.
We then started to look for some reason in the eaw.exe code. No joy there either- more hair torn out.

Finally, last night, I recalled that the TMod which Moggy is using for the barrage balloons is normally the radar tower.
In the early part of the war Germany did not have radar, and the exe will not display radar towers in German territory.
Using the first free TMod slot (it's nice to have 256) we switched the balloon from #21 to #121.
They appear smile

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
#3520817 - 02/17/12 10:15 AM Re: The perils of programming [Re: MrJelly]
Col. Gibbon Online   hick
3DZ Model Builder
Veteran

Registered: 06/04/01
Posts: 11116
Loc: Fleet, Hampshire, England.
I bet there was a lot of banghead and then some sleepy then more mycomputer before reading and duh . biggrin
_________________________
Ah that's much better!

Wings Over Bytom

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

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.