homepage

More 160 Dunkirk

Posted By: Moggy

More 160 Dunkirk - 02/28/17 11:53 PM

Nice to see that all all the things we worked on in 128/129, smoky tmods, all the single mission stuff, sunrise and sunset, all still there and functioning in 160.

Still recovering Dunkirk:

[Linked Image]

[Linked Image]



Posted By: MrJelly

Re: More 160 Dunkirk - 03/01/17 03:29 AM

Great Moggy smile
I have been working on the railway page of the target editor.
Where a line crosses a bridge it can calculate the direction of the line, which can be set as the direction of the bridge smile


Attached picture bridge.jpg
Attached picture bridge1.jpg
Posted By: Moggy

Re: More 160 Dunkirk - 03/01/17 09:59 AM

That's good stuff. At some point I will have to get my head around the way railways now work.

It was also my original intention to make a set of "canal" tiles, since there were many canals in the Dunkirk hinterland which are inaccurately currently inaccurately represented by river tiles. Am I right in thinking convoys now run on "invisible railways", and so it would be possible to have barge convoys running on such invisible tracks?
Posted By: Rotton50

Re: More 160 Dunkirk - 03/01/17 11:49 AM

Oh sure, NOW you fix the bridge thing. Talk about a lot of labor, whew!

What I finally did with the ETO2015 target upgrade package was to edit the rail lines so that they crossed the rivers at 0, 90, 180, 270 degrees. That way placing the bridge was pretty straight forward.

I did the same thing with the railroad stations and warehouse districts That way adding TMODs was fairly easy because everything was in a straight line.

FWIW, I recorded the number of meters that various buildings needed to be placed near the rail lines so that they looked as real as possible.

Actually I have a lot of that type of info for other TMOD placement so if you want those numbers let me know.
Posted By: MrJelly

Re: More 160 Dunkirk - 03/01/17 11:55 AM

Try this one smile
Fly a 190 mixed interdiction to London but follow the Thames as you fly through the city.
Alternatively fly an allied mixed interdiction to Paris and follow the Seine. There are barges on the Elbe too near Harburg and Hamburg.

Attached picture Barge.jpg
Posted By: Rotton50

Re: More 160 Dunkirk - 03/01/17 01:04 PM

i don't know if you're interested but you could add this modification to the target package. I ran out of steam on the target upgrade package before I could wrap my head around the barges so I just put some static groups of them in the middle of some of the rivers.

I'm up to my ears in plane upgrades so i won't be able to do it for quite a while.
Posted By: Moggy

Re: More 160 Dunkirk - 03/01/17 02:38 PM

Oh good. It's possible then.

Ray - currently on the old Dunkirk layout I also have static ships and barges on the rivers near target areas.
Posted By: Rotton50

Re: More 160 Dunkirk - 03/01/17 05:12 PM

Moggy, if you're interested I can tell you how to put targetable cargo on the decks of the ships. You can see what I mean if you load the ETO2015 package in 1.5.

Fly a mission to Portsmouth and check out the convoy just outside the harbor.
Posted By: Moggy

Re: More 160 Dunkirk - 03/02/17 07:08 AM

I will have a look thanks. I half redid the layout when working on the 129 version, so I will need to revisit the layout in some places.
Posted By: Rotton50

Re: More 160 Dunkirk - 03/02/17 10:14 AM

OK.

I won't go into great detail but basically I took regular TMODs like the ground planes, put them in a different TMOD slot and raised them up some distance above ground level using 3dz Studio.

Then using the target editor I placed them over a freighter and offset them by a small amount. It took a lot of trial and error to get the offset numbers correct but in the end I had rows of vehicles and planes on the decks of the freighters. I recorded all these numbers for future use.

The other thing I had to do was make some full height damage models for the freighters otherwise if you destroy the ship the vehicles would be hanging in mid air. These also needed their own separate TMOD slot. Fortunately we have 1000 now so there's plenty of room for this type of thing.
Posted By: Moggy

Re: More 160 Dunkirk - 03/02/17 10:45 AM

Ingenious ideas. I will try that out.

Talking of offsets and trial and error reminds me of how I did initial layouts by hex editing, before the days of Jel's editors. That sort of thing can drive you crazy! I used to drop tmod markers into the game, take screen shots, draw a lot of lines, and work out manually the grid reference entry for tardata.dat for each target.

[Linked Image]

Then Jel rescued our sanity
Posted By: Rotton50

Re: More 160 Dunkirk - 03/02/17 12:57 PM

I did something similar when laying out the various structures around the airfields.

As you know we have about 10 or so airfield shapes but they don't show up in the target editor. All you see is a red circle.

So to get an outline of the airfield I used the target editor to put a grid of about 100 radar towers right across the airfield.

Then I observed the towers in the game ( towers gave good visibility ). Next I started deleting towers in the editor simply guess which ones might be at the edges of the field. I kept doing this until I had an outline of towers around the filed. As you can imagine there was a lot of deleting and observing.

Once I had the outline I could start replacing towers with actual airfield related objects as well as add more.

I did this with each airfield outline and then I varied the airfield structures to that they didn't all look the same.

On a related note, don't forget we have the ability to switch TMOD models based on which side of the front line they're on.
Posted By: Moggy

Re: More 160 Dunkirk - 03/02/17 02:01 PM

Great minds consistently think alike smile

I haven't done much with the tmod/tmog/tmof thing. Something else to wrap my head around. At least there's more time now.

I intend to get a basic 160 version of Dunkirk working so I can share it. The good thing is that 160 is a lot easier to work with than I imagined. Jel was right all this time smile I just have to get used to the different file loading priority, and how it deals with default files.

After that, next up would be a look at where I was with the 129 version of Midway with the proper geographic layout (with added atolls), and see how easily that can be brought into 160.
Posted By: MrJelly

Re: More 160 Dunkirk - 03/02/17 02:55 PM

I have been working on the target editor, focussing on one that is specifically for railway building.

The attached opening screen is a map built from the eaw32.tm and eaw16.hm files together. It is effectively a height map picture. I am using squares and not circles as a did previously.
This allows the user to keep the railway tracks in low flat areas and avoid steep slopes.
To make the three tracks shown in the attached picture I clicked on the "Draw railway" check box so that it was checked. clicked on the start point, then on the next, and so on until I had finished.the first line.
I clicked on the "Draw railway" check box so that it was no longer checked. Doing this caused the editor to put the nodes into the railways grid, and cleared the (X,Y) coordinates list., ready for the second line.
Repeating the process allowed me to make the second and third lines.
When it was finished I went to the "Railways" page, re-set the section numbers and saved my new "EAW_RRD.dat" file wink

Selecting an area allows fine tuning, on the "Railways" page but the lines created on the first screen are a great starting point, and much better than the ones created by previous versions smile
For my own convenience I have made the form much bigger. I had trouble reading the stuff on the old editors, now that I am using a 1920x1080 screen.

Attached picture RailwayTED.jpg
Posted By: Moggy

Re: More 160 Dunkirk - 03/02/17 03:56 PM

thumbsup
Posted By: Moggy

Re: More 160 Dunkirk - 03/06/17 09:00 AM

A few beach screenies:

[Linked Image]

[Linked Image]

[Linked Image]

[Linked Image]

[Linked Image]
Posted By: MrJelly

Re: More 160 Dunkirk - 03/06/17 12:54 PM

Moggy are you getting the smoky TMods in 160 with your current version of Dunkirk?
If so please send me your "TMod.dat" and your "GEAWTTD2.dat" files, plus any modified "TModxyz.DAT" files

It looks as though Ralf's code only applied to objects placed by "GEAWTTD2.dat", and it would be nice to have them smoking when placed by 'tardata.dat".
Posted By: Moggy

Re: More 160 Dunkirk - 03/06/17 03:45 PM

Hello Jel,

I'm using 160OldMapV6, and I'm getting smoky tmods as placed on tiles by GEAWTTD2.dat. That seems to be working okay. As I recall I think Ralf's code only did apply to TTD objects.

The files are in your folder.
Posted By: MrJelly

Re: More 160 Dunkirk - 03/06/17 03:59 PM

I just rewrote a lot of Ralf's smoke and fire code.
To test it I made a quick "GEAWTTD2.dat" file with at least one hangar on every coastal tile.
I had the "TMod027.dat" file open in the editor.
Using the hangar in place of a factory with a chimney then this is what I achieved:
Unlike Ralf's code my routine reserves the values of "SmokeOffsetX" and "SmokeOffsetZ" to position the smoke.
The size of the smoke is dependent on the "Smoke" value smile

Attached picture 002.jpg
Attached picture 003.jpg
Posted By: Moggy

Re: More 160 Dunkirk - 03/06/17 06:18 PM

That is good stuff Jel.

Have you kept Ralf's controls on smoke colour and occurance of fire with the smoke?
Posted By: MrJelly

Re: More 160 Dunkirk - 03/06/17 07:29 PM

Ralf's version with a long line shortened for this post:
Code
if (pTarget->Type->Smoke)
{
	if (dist < 1 MILES || dist < 2 MILES && pTarget->Type->SmokeOffsetX > 6  || dist < 4 MILES && (pTarget->Type->SmokeOffsetX > 30 || pTarget->Type->SmokeOffsetX == 10)) 
	{
		if (!(pTarget->Status & TAR_DESTROYED))
		{
			if (!(pTarget->Type->TargetType & TAR_TYPE_MGO)) 
			{
				if (smoke_counter%17==0)
				{
					smoke_counter = 0;
					start_size = 1.0f * ((pTarget->Type->SmokeOffsetX + 1)>>1);
					create_smoke(SPT_SMOKE0, pTarget->X, pTarget->Y, pTarget->Z + pTarget->Type->SmokeOffsetZ + (pTarget->Type->SmokeOffsetX<<4).......
					if (pTarget->Type->SmokeOffsetX > 10)
					{
						create_fire(pTarget->X, pTarget->Y, pTarget->Z, start_size);
					}
					smoke_counter ++;
				}
			}
		}
	}
}


The long line begins "create_smoke(SPT_SMOKE0," so in this code he is setting the smoke sprite, and therefore the colour was fixed.
In full it reads

create_smoke(SPT_SMOKE0, pTarget->X, pTarget->Y, pTarget->Z + pTarget->Type->SmokeOffsetZ + (pTarget->Type->SmokeOffsetX<<4), start_size, 0.8f, 0.001f * (pTarget->Type->SmokeOffsetX), -0.01f/(pTarget->Type->SmokeOffsetX), ((pTarget->Type->SmokeOffsetX + 1)>>1), 0, FALSE);

My problem with this code is that he is using SmokeOffsetX and SmokeOffsetZ values to create effects and losing their basic purpose for positioning the smoke.
I will find a way of creating fire independently of these values. My goal was to have a factory with a chimney which has smoke coming out smile
Posted By: Moggy

Re: More 160 Dunkirk - 03/06/17 10:41 PM

It is possible with Ralf's original to have either white, grey, or black smoke

In tmodXX.dat:

Quote

1. smoke > 0 (8 = grey smoke, 11 = black smoke, 14 = white smoke)


I agree it would be best to use the smokeoffset values for their original purpose to be able to exactly position the smoke.
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 07:55 AM

Out of the sprite table we have this:

SPT_SMOKE0, // 8 grey smoke
SPT_SMOKE0A, // 9 grey smoke, alpha masked
SPT_TRAIL0, //10 grey smoke trail
SPT_SMOKE1, //11 black smoke
SPT_SMOKE1A, //12 black smoke, alpha masked
SPT_TRAIL1, //13 black smoke trail
SPT_SMOKE2, //14 white smoke
SPT_SMOKE2A, //15 white smoke, alpha masked

In his code Ralf specified "SPT_SMOKE0" which is 8 and grey smoke.
You can also see the "SPT_SMOKE1" and "SPT_SMOKE2" for black and white smoke, 11 and 14 respectively.
I do not think that the "Smoke" setting in the TModXYZ.dat file is the sprite number, but I will check further smile
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 08:49 AM

I have related the fire to the "Smoke" value, which also affects the size of the smoke.
Above 50 there is fire
The screenies are for 50, 51 and the max of 255
I could include a random factor to produce sprite values of 8, 11 or 14 to vary the smoke colour.




Attached picture 004.jpg
Attached picture 005.jpg
Attached picture 006.jpg
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 10:28 AM

My new code
Code
if (pTarget->Type->Smoke)
{
	smoke_sprite = 14;   // white 
	if (pTarget->Type->Smoke > 17)  smoke_sprite = 8; // grey
	if (pTarget->Type->Smoke > 33)  smoke_sprite = 11;  //black
	if (pTarget->Type->Smoke > 50)  smoke_sprite = 8+ 3*(get_random()%3);  // mixed, with fire
						
		if (!(pTarget->Status & TAR_DESTROYED))
		{
			if (!(pTarget->Type->TargetType & TAR_TYPE_MGO)) 
			{						
				if (smoke_counter%17==0)
				{
					smoke_counter = 0;
					start_size = 2; 
					create_smoke(smoke_sprite, pTarget->X, pTarget->Y, pTarget->Z + pTarget->Type->SmokeOffsetZ, start_size, 0.8f, 0.001f * (pTarget->Type->Smoke), -0.01f/(pTarget->Type->Smoke), ((pTarget->Type->Smoke + 1)>>1), 0, FALSE);
					
					if (pTarget->Type->Smoke > 50) 											
					create_fire(pTarget->X, pTarget->Y, pTarget->Z, pTarget->Type->Smoke);	
				}
				smoke_counter ++;
			}
		}				
}

It uses the smoke value to determine the colour
It starts with white smoke, but if it is bigger than 17 it uses grey smoke. Then if it is bigger than 33 it uses black smoke.
If it is bigger than 50, it uses mixed smoke, and this condition also generates the fire.

The values in the four pics were 17, 20, 35 and 51


Attached picture 007.jpg
Attached picture 008.jpg
Attached picture 009.jpg
Attached picture 0099.jpg
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 10:59 AM

.... and Ralf was mistaken if he believed that the smoke value (his 8, 11 or 14) related to the sprite number and hence the colour frown
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 12:08 PM

What I have been working on for me is the railway rendering code.
The old "train32.ter" is a 256*256 picture and the exe was programmed to use the top 256 x 32 area in order to render the track.
All sorts of things are involved, but I have an axe which reads a file for a factor (f = 1 to 8) which applies to the current section being drawn.
It now reads the top 256 x (32 x f) so it can read 256 x 32, or 256 x 64, or .............256 x 256 using the whole picture.

The files I have been working with are a dummy blank 256x256 "train32.ter" file which serves as a base for a corresponding "train32.BMP" file

The screenie is one where the factor is 8. The train is rendered in the middle, and the whole width is shown.
The other pic is the "train32.BMP" converted to JPG for posting.

Where I am heading is to have wider roads for vehicle convoys, the trains are fine smile

Attached picture 001.jpg
Attached picture 000.jpg
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 12:57 PM

The factor file "TrainSet.mpf" reads like this:

8
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1


Sections with a flag exactly divisible by 5 are rendered, so the values correspond to section flags of 00, 05, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, and 95.
The flag is a two digit value so 95 is the last one exactly divisible by 5
The section in the screenshot was flagged as 0, so the first value (8) was used..

That combination of a dummy ter/tpc file and the real "BMP" file is wonderful- it makes editing so easy smile
Posted By: MrJelly

Re: More 160 Dunkirk - 03/07/17 01:35 PM

Here is a quick shot with a hastily made road BMP graphic and factor = 2 wink

Attached picture 000.jpg
© 2024 SimHQ Forums