SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   [WIP] Lighthouses mod (https://www.subsim.com/radioroom/showthread.php?t=228731)

MLF 07-15-17 05:52 AM

Hi Gap,

Very useful tool, but I must be doing something wrong as when I enter a new position in Lat and Long, the Locations and Units lat and longs don't calculate correctly eg:-

lat 43 5' 12" N, 3 12' 12" W gives a Location Lat of 0.000.043 and Long of -0.000.003 and a Units Lat of 5.170.400 and Long of -0.384.400.

:doh:

The position shows correctly on the maps though. Excel 2010.

Any idea what is happening?

Regards,

MLF

gap 07-15-17 08:58 AM

Quote:

Originally Posted by MLF (Post 2500336)
Hi Gap,

Very useful tool, but I must be doing something wrong as when I enter a new position in Lat and Long, the Locations and Units lat and longs don't calculate correctly eg:-

lat 43 5' 12" N, 3 12' 12" W gives a Location Lat of 0.000.043 and Long of -0.000.003 and a Units Lat of 5.170.400 and Long of -0.384.400.

:doh:

The position shows correctly on the maps though. Excel 2010.

Any idea what is happening?

Regards,

MLF

Hi MLF, and thank you for taking the time to test my spreadsheet :salute:

I think I know what's happening with it: I probably messed up lol :D
I have put in the formulas some string functions which replace commas (,) with dots (.) as decimal separators. The idea behind that, was enabling users to copy/paste output values from the worksheet directly into SHIII configuration files, without having to correct the decimal mark manually.

My computer is Italian-localized, and my formulas work perfectly on it. I thought they would have worked for other local settings, but obviously they are not. Indeed. the reason for the position still being plotted correctly on map depsite the error, is that the graph uses numerical values, not the strings extracted from those values.

If you tell me what kind of decimal mark you have set in your system, I can try tand fix the problem. :up:

On a side note: while we are waiting for Kendras to be back on duty (:O:), have you or anyone else tested the last version (alpha v5) of the Petite Vieille lighthouse? I am curious to know if, after my latest changes, the metal platform on top of the tower is still in its place (and with the correct texture), and if there are water reflections after I added the appropriate controllers.

P.S: in case you need them urgently, those are the correct values for the coordinates in your example:

Long= -3.203333
Lat= 43.086667

Long= -384399.960000
Lat= 5170400.040000

gap 07-15-17 10:35 AM

New version of my Silent Hunter coordinates calculator:

http://www.mediafire.com/file/mt173a...ulator_V3.xlsx

This version should fix the bug reported by MLF. Let me know if it works for you :salute:

MLF 07-15-17 06:14 PM

Hi Gap,

Sorry, been out shopping :yawn:.

The spread sheet works as expected now as far as Location is concerned - thank you for fixing that:yeah:. I'll check the unit output side of things tomorrow, if I can understand it - should be able to check against the readings in the mission editor?

I tried the new La Plate light last night - great model:Kaleun_Salute:. All seemed fine - set up as a land object. the lantern wasn't visible or flashing. Edited the eqp file so that the light was visible until 1945 and it showed OK. Haven't had a chance to get the rock showing, or to test if it is "collisionable". Will endeavour to do that tomorrow.

Thank you (and Kendras) for your dedicated work on these projects - I watch and learn with interest :salute:

Regards,

MLF

gap 07-15-17 06:51 PM

Quote:

Originally Posted by MLF (Post 2500475)
Hi Gap,

Sorry, been out shopping :yawn:.

The spread sheet works as expected now as far as Location is concerned - thank you for fixing that:yeah:. I'll check the unit output side of things tomorrow, if I can understand it - should be able to check against the readings in the mission editor?

I don't know: I have never used SHIII's mission editor :doh:, but if you create any single mission or a campaign mission layer, unit positions/waypoints are stored in the resulting mis file, in 'metric' format (as the one returned by my calculator), and if you place a new terrain object, Locations.cfg should be automatically updated with the position of the new object stored in 'decimal degrees' format. Both mis files and Locations.cfg can be open/edited using any ASCIII text editor.

Quote:

Originally Posted by MLF (Post 2500475)
I tried the new La Plate light last night - great model:Kaleun_Salute:

Thank you Sir :smug:

Quote:

Originally Posted by MLF (Post 2500475)
All seemed fine - set up as a land object.

As land unit you mean?

Quote:

Originally Posted by MLF (Post 2500475)
the lantern wasn't visible or flashing. Edited the eqp file so that the light was visible until 1945 and it showed OK.

What date had you set? The lantern was set to disappear around mid 1940 :yep:

Quote:

Originally Posted by MLF (Post 2500475)
Haven't had a chance to get the rock showing, or to test if it is "collisionable". Will endeavour to do that tomorrow.

Okay, let's leave the rock for when Kendras will be back. So the platform that the lantern is placed on was in place, and the model had water reflections? :)

Quote:

Originally Posted by MLF (Post 2500475)
Thank you (and Kendras) for your dedicated work on these projects - I watch and learn with interest :salute:

Thank you too for your precious feed-back :salute:

MLF 07-16-17 04:23 AM

4 Attachment(s)
Hi Gap,

I've tested the lighthouse more thoroughly this morning and here are my observations:-

After installation of files using Generic Mod Installer (JSGME)

As a Terrain object using Locations.cfg with following entries:-

[Location 785] ; Rock_LaPlate
Long=-4.759722
Lat=48.039167
Heading=270
OnLand=false
ShowOnMap=true
FileName=Rock_LaPlate
LocationName=Rock_LaPlate

[Location 786] ; LLH_LaPlate
Long=-4.759722
Lat=48.039167
Heading=270
OnLand=false
ShowOnMap=true
FileName=LLH_LaPlate
LocationName=LLH_LaPlate

Result:-
Light tower floating mid-air.
No Top structure or lantern (Only tower with platform and perimeter railings)
No flashing light
No reflection (possibly too high in the air)
The rock is on the seabed

As Land Unit after amending the eqp file date for the light and removing entries in Locations.cfg:-


Full light tower with upper structure and lantern showing on sea surface with base below sea surface level
Light flashing 9 times.
Reflection of tower
Top mark looks black (Tried different sun angles but still black)
No rock


I then added the rock to the Locations Cfg again, keeping the light as a Land unit:


the rock is on the seabed, but the light is not sitting fully on the rock - it's slightly to one side.
The top of the rock is not visible above the sea surface.


I hope these observations are helpful.
regards,


MLF

Screenshots:-

Ist one shows Lighthouse as Land Unit added in Mission Editor
2nd one shows as Terrain Object added via Locations.cfg
3rd one shows Light added as land unit and rock added as a terrain object (bit murky but look hard :03:)
And 4th one shows the top mark (I expect you guessed that:)).

gap 07-16-17 06:25 AM

Quote:

Originally Posted by MLF (Post 2500524)
Hi Gap,

I've tested the lighthouse more thoroughly this morning and here are my observations:-

Thank you very much! :salute:

After installation of files using Generic Mod Installer (JSGME)

Quote:

Originally Posted by MLF (Post 2500524)
As a Terrain object using Locations.cfg...

Result:-

Quote:

Originally Posted by MLF (Post 2500524)
Light tower floating mid-air.
The rock is on the seabed

That's normal: as discovered by Kendras, terrain objects' vertical positon is tied to the sea level, but for land units the same is relative to the sea bottom. My rock model is set for being used as a terrain object, and the rock as a land unit, thence their vertical misalignment during your test :)

Quote:

Originally Posted by MLF (Post 2500524)
No Top structure or lantern (Only tower with platform and perimeter railings)
No flashing light

Again, that could be normal, depending on your definition of 'platform'.

In v5, the base unit is composed by the concrete base plus the tower, nothing else. The remaing structures (top metal platform, lantern with flashing light effect, top mark) are set as configurable equipments and linked to the main model through eqp file, which only takes effect when the lighthouse is used as an unit.
Since during your test you could see the 'platform', I suspect you might have been testing v4 where the platfom (if by platform you mean the metal structure with ladder that lantern and top mark are placed on) is not an equipment but part of the main model. The two parts were separated in v5 :yep:

Quote:

Originally Posted by MLF (Post 2500524)
No reflection (possibly too high in the air)

Reflection controllers and models were added with v5. The model being too high for casting reflections is the most likely explaination, unless you made your tests using v4 instead of v5, in which case there shouldn't be any reflections at all.

Quote:

Originally Posted by MLF (Post 2500524)
As Land Unit after amending the eqp file date for the light...

Do you mean the EndDate? If so, if you set your mission before June 1940, there shouldn't be any need for eqp file amendments

Quote:

Originally Posted by MLF (Post 2500524)
Full light tower with upper structure and lantern showing on sea surface with base below sea surface level
Light flashing 9 times.

:up:

Quote:

Originally Posted by MLF (Post 2500524)
Reflection of tower

Good. If you saw water reflections, then you have probably tested v5, but again (see my considerations above) how comes that the platform was there when you tested the lighthouse as a terrain object? Something doesn't add up; I hope it is just a misunderstanding on our respective usage of the term 'platform' :hmm2:

Quote:

Originally Posted by MLF (Post 2500524)
Top mark looks black (Tried different sun angles but still black)

If you carried you tests on v4, lantern's metal frame uses the same material as the topmark; if your tests were done on v5, lantern and platform use the same material as the topmark. At this point I am pretty sure that the problem is not in the material, but in the 3D model chunk. I will try scrapping it and re-importing the topmark mesh into a fresh chunk. :hmmm:

Quote:

Originally Posted by MLF (Post 2500524)
No rock

I then added the rock to the Locations Cfg again, keeping the light as a Land unit:

This is the planned configuration :up:

Quote:

Originally Posted by MLF (Post 2500524)
the rock is on the seabed, but the light is not sitting fully on the rock - it's slightly to one side.

Kendras had reported something similar, saying that the rock mesh coordinates weren't on axis wit the lighthouse coordinates. I might have messed up, I will check that later... anyway, have you used my worksheet for setting light and rock coordinates in game?

Quote:

Originally Posted by MLF (Post 2500524)
The top of the rock is not visible above the sea surface.

This is as intended: the tourelle de la Plate was built on a submerged rock :up:

Quote:

Originally Posted by MLF (Post 2500524)
I hope these observations are helpful.

Very much Sir! Thank you again for your time, I appreciate that :03:

Quote:

Originally Posted by MLF (Post 2500524)
I'm having a problem taking screenshots as each time I try, SH3 freezes and I have to reboot my PC :k_confused:

:o

Quote:

Originally Posted by MLF (Post 2500524)
I will try to post some screenshots later if I can fix the problem.

Screenshots might help avoiding some misunderstandings as the one about the 'platform'. Fingers crossed :)

In the meanwhile I will check a few things in my files, and I hopefully I will release a new versione with some fixes and some new features :up:

gap 07-16-17 06:46 AM

Quote:

Originally Posted by MLF (Post 2500524)
Screenshots:-

Ist one shows Lighthouse as Land Unit added in Mission Editor
2nd one shows as Terrain Object added via Locations.cfg
3rd one shows Light added as land unit and rock added as a terrain object (bit murky but look hard :03:)
And 4th one shows the top mark (I expect you guessed that:)).

I have just seen your screenies, very helpful :yeah:

From them I get that:
  • You have been correctly testing version 5 :up:

  • There actually is a rock/lighthouse alignment problem. I hope this is only due to on an human error by me, and not to a misalignment of land unit/terrain location coordinates (provided that you have used my worksheet for setting them) :hmmm:

  • I finally know what's wrong with the top mark: if you look closely at its shaft, textures are rendered correctly on it. The problem only affects the triangular plates. Those are composed of two faces each, whit shared edges but normals pointing to opposite directions. Not a good configuration for SHIII which, trying to smooth those sharp edges, makes the surfaces black. Dumb me for not thinking of it before. The medicine will be splitting those edges, and if that's not enough, I will move the opposite faces apart by a few millimeters :sunny:

MLF 07-16-17 06:56 AM

1 Attachment(s)
Hi Gap,

yes definately V5.

Now used the Co-ordinate calculator to place the rock, and update the mission file and alignment mush better - Lat and Long obtained from Wikipedia. Excellent tool - thanks:Kaleun_Salute:

Screenshot of rock and base of lighthouse:-

gap 07-16-17 07:13 AM

Quote:

Originally Posted by MLF (Post 2500550)
Hi Gap,

yes definately V5.

Now used the Co-ordinate calculator to place the rock, and update the mission file and alignment mush better - Lat and Long obtained from Wikipedia. Excellent tool - thanks:Kaleun_Salute:

Screenshot of rock and base of lighthouse:-

There is still some misalignment, but much better than before. Super :yeah:

If you get time for yet another test, check that heading is set to 0 for both the lighthouse and the rock. If not, set them as I said, and run again your test mission. In the meanwhile I will make sure that the 3D coordinates of the two meshes are aligned correctly :up:

EDIT: just checked, and I had forgot to flip the rock model before importing it in S3d. If you have no other plans for the next thirty minutes, stay tuned for updates please :D

MLF 07-16-17 07:49 AM

1 Attachment(s)
Now set all headings to OOO.

Screen shot attached - still very slight mis-alignment.

Regards,

MLF

Got to go out for a few hours now.

gap 07-16-17 08:01 AM

Quote:

Originally Posted by MLF (Post 2500563)
Now set all headings to OOO.

Screen shot attached - still very slight mis-alignment.

Regards,

MLF

Got to go out for a few hours now.

No problem, take your time and when you are ready check the forum, please, for an update that will hopefully solve the issue :salute:

gap 07-16-17 12:48 PM

Tourelle de la Plate alpha v6
 
http://www.mediafire.com/file/qbbrvy...La_Plate_v6.7z

changelog:

- I have flipped rock's 3D around the X axis. I am confident that this will fix the slight misalignment reported by Kendras and MLF, still present even after setting the appropriate lat, long and heading settings for both the lighthouse and the rock.

- I have edge-splitted topmark's meshes. This should fix for good the problem of them being rendered totally black in game. Should it not, I can still move them apart, but I think it won't be needed.

- New feature: the lighthouse base should have caustics now.

@ MLF or Kendras:

besides testing the features above, can you please check (again) that the rock is collisionable? Should the StaticObject controller not work (yet), I think I know what is the issue with it, and how to fix it :salute:

MLF 07-16-17 04:45 PM

6 Attachment(s)
Hi Gap,

I've tested again.

The topmark now looks good (and rusty):yeah:

The icon on the map needs a severe talking to :o:nope: IMHO it should be a lot lot smaller.

The lighthouse/rock alignment is still out. If, in the rock dat file, you bring in the lighthouse file using s3Deditor, align the rock under the lighthouse using the translation values, and then delete the lighthouse node from the rock dat file and save, would that not align things - this has worked for me in the past.

The sub treated the rock like a Mcdonald's I'm afraid - complete drive through:doh::roll: thats the tailend of the sub sticking out the rock in the screenshot.

I'm not sure about the caustics - possibly OK as there are shadows etc depending on where the sun is - would need Kendras' ( or somebody who knows about caustics) input on this.

My own thoughts about the reflection is that it is far too faint. It can hardly be seen and the light house looks weird on the sea - sorry. see my last screenshot of a L/H I imported from Sketchup and put on your first rock.

Kind regards,

MLF

gap 07-16-17 05:58 PM

Quote:

Originally Posted by MLF (Post 2500675)
Hi Gap,

I've tested again.

Thank you Captain :salute:

Quote:

Originally Posted by MLF (Post 2500675)
The topmark now looks good (and rusty):yeah:

:up:

Quote:

Originally Posted by MLF (Post 2500675)
The icon on the map needs a severe talking to :o:nope: IMHO it should be a lot lot smaller.

Sure it should. :O:
Now the question is: do those tga masks get scaled to a fixed size on map, no matter what is their pixel resolution, or they are displayed in real size and at their own resolution; in other words: should I scale the whole file, or only the visible icon within it? :hmmm:

Quote:

Originally Posted by MLF (Post 2500675)
The lighthouse/rock alignment is still out. If, in the rock dat file, you bring in the lighthouse file using s3Deditor, align the rock under the lighthouse using the translation values, and then delete the lighthouse node from the rock dat file and save, would that not align things - this has worked for me in the past.

In theory, the lighthouse and the rock should be already aligned without need of adjusting node translation values. You can easily check that by exporting the two models and importing them in the 3D program you use. The point is being able to quicly place in game the two parts by just entering the coordinates provided by my spreadsheet. Either I am doing something wrong, I miss a piece of information, or the coordinate-based alignment is not as obvious as I initially thought.

Quote:

Originally Posted by MLF (Post 2500675)
The sub treated the rock like a Mcdonald's I'm afraid - complete drive through:doh::roll: thats the tailend of the sub sticking out the rock in the screenshot.

Okay, I think I know how to fix it :up:

Quote:

Originally Posted by MLF (Post 2500675)
I'm not sure about the caustics - possibly OK as there are shadows etc depending on where the sun is - would need Kendras' ( or somebody who knows about caustics) input on this.

I thought shadows didn't work in SHIII, and the model I sent you has no shadow models/controllers. Where are shadows coming from lol :)

Quote:

Originally Posted by MLF (Post 2500675)
My own thoughts about the reflection is that it is far too faint. It can hardly be seen...

Okay, I don't know if they can make reflections more obvious, but there are some properties in the water reflection controller that we can play with. I see your lighthouse has some nice reflections, how did you se them?

Quote:

Originally Posted by MLF (Post 2500675)
and the light house looks weird on the sea - sorry. see my last screenshot of a L/H I imported from Sketchup and put on your first rock.

Nice! What lighthouse is that? :D
I know a tower raising directly from the waves is a bit weird, if this is what you mean, but that's exactly how the Petite Vielle looks like. Other lighthouse will be more conventional :up:

http://www.dirm.nord-atlantique-manc...58-1-3714e.jpg

Kendras 07-17-17 08:32 AM

Hi, i'm back :Kaleun_Salute:

Well done gap and MLF. Tried v6 : all is ok, but rock and lighthouse are still not perfectly aligned. I've used your coordinates with excel sheet (nice tool :up:).

I may try to measure difference with your ruler.

:salute:

gap 07-17-17 10:54 AM

Quote:

Originally Posted by Kendras (Post 2500798)
Hi, i'm back :Kaleun_Salute:

Well done gap and MLF. Tried v6 : all is ok, but rock and lighthouse are still not perfectly aligned. I've used your coordinates with excel sheet (nice tool :up:).

I may try to measure difference with your ruler.

:salute:

Welcome back Kendras :salute:

I have checked again the rock and lighthouse meshes imported in the relative dat files, and they are perfectly aligned as far as their X and Z coordinates are concened. Anyway, I think I understood why they are not aligned in game even after using the ccordinates generated by my spreadsheet: in spite of unit coordinates being noted in .mis files as decimal numbers, decimal digits are probably ignored. A clue of that, is unit coordinates generated by Mission Editor having their decimal part always equal to '.000000'. This only applies to unit coordinates, not to terrain object's coordinates.
Don't waste your time with the ruler for now. Node displacement values in one of the dat files could be used to compensate for the ignored decimal digits in the mis file, without need of empirically measuring stuff in game. Unless my reasoning is totally off, the latter would be a valid method, but I think that updating my coordinates calculator insteas, would be a cleaner approach, and one that will make lighthouse placement much easier.

Stay tuned for new spreadsheet and lighthouse versions later today, please. Hopefully many bugs will be fixed, and new cool features introduced :D

Kendras 07-17-17 11:47 AM

Quote:

Originally Posted by gap (Post 2500826)
I have checked again the rock and lighthouse meshes imported in the relative dat files, and they are perfectly aligned as far as their X and Z coordinates are concened.

Yes, I saw that too. :up:

Quote:

Originally Posted by gap (Post 2500826)
Anyway, I think I understood why they are not aligned in game even after using the ccordinates generated by my spreadsheet: in spite of unit coordinates being noted in .mis files as decimal numbers, decimal digits are probably ignored. A clue of that, is unit coordinates generated by Mission Editor having their decimal part always equal to '.000000'. This only applies to unit coordinates, not to terrain object's coordinates.

So, why not delete decimal digits in mis.file, and find the exact coordinates for the terrain object with your excel sheet, "tout simplement" ? :D

But I don't think it will work. I think Mission Editor doesn't ignore decimal digits. But when you place yourself some units, they have no decimal digits because the resolution is not enough precise.

Kendras 07-17-17 11:57 AM

I have an idea :

I have opened the mission file, then I moved the LH land unit one pixel up, and one pixel down, then I saved. I opened the .mis file, and the new coordinates are :

Long=-571143.750000
Lat=5764737.500000

instead of :

Long=-571143.720000
Lat=5764737.720000


So, could you change your excel sheet in order we can calculate what are the new coordinates in degrees ? Sorry, I can't see the formula ("read only"). I guess I have to divide by 120000 ?

So the new coordinates are :

Long=-4.75953125
Lat=48.039475

instead of :

Long=-4.759531
Lat=48.039481

gap 07-17-17 12:08 PM

Quote:

Originally Posted by Kendras (Post 2500836)
So, why not delete decimal digits in mis.file, and find the exact coordinates for the terrain object with your excel sheet, "tout simplement" ? :D

Yep, you are right: you can remove the decimal part from mis file values, and divide the resulting integers by 120,000 to find the corresponding terrain coordinates. As long as the resulting decimal won't exceed 6 decimal digits, the alignment should be perfect. I was a bit busy this afternoon but before tomorrow I will update my worksheet and automatize the process. In the meanwhile, if you want, you can do the calculations manually and quickly test if my idea works :up:


All times are GMT -5. The time now is 04:15 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.