SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-06-14, 11:36 AM   #3121
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Katze View Post
Searchlights look awesome with gap's destructible searchlight mod which includes colour correction and increased range:


Quote:
Originally Posted by TheDarkWraith View Post
Today the SH4 forums gave me a great idea for a new patch: have the flags blow in the wind's direction
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 04-06-14, 02:14 PM   #3122
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

having some trouble with the flags following wind direction patch. The law of cosines doesn't appear to be working correctly. I change wind direction to all different angles and it's not working. If unit's heading is 270 degrees @ 5knots and wind's direction is 45 degrees (blowing from 45 to 225 degrees) with a speed of 5 knots it works fine. Change wind direction to 90,135,180,225,270, and 315 and it's broken. Think I need to walk away from this a bit as my brain hurts If you all have any ideas fire away
TheDarkWraith is offline   Reply With Quote
Old 04-06-14, 03:03 PM   #3123
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Looks like I figured it out. Needed to account for which quadrant the wind was in (took COS of wind direction). Depending on whether the result of COS(wind direction) was positive or negative decided whether to add or subtract yaw amount based on wind from the flag's current yaw amount.
TheDarkWraith is offline   Reply With Quote
Old 04-06-14, 03:16 PM   #3124
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

How do you work out the direction of the flag in relation to the speed of the vessel ?
THE_MASK is offline   Reply With Quote
Old 04-06-14, 03:58 PM   #3125
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
How do you work out the direction of the flag in relation to the speed of the vessel ?
Still have problems

For your question see here: http://www.subsim.com/radioroom/show...postcount=3117

I'm missing something big time and I just can't figure out what it is


Basically what I'm trying to solve is:
flag has yaw value that puts it in line with course of ship (it's always parallel with length of unit)
I'm trying to get wind speed/direction to alter this yaw value
TheDarkWraith is offline   Reply With Quote
Old 04-06-14, 04:27 PM   #3126
Tonci87
Samurai Navy
 
Join Date: Jun 2012
Posts: 550
Downloads: 116
Uploads: 0


Default

Would this also work for flags attached to the submarine by mods? What exactly is the problem?
Tonci87 is offline   Reply With Quote
Old 04-08-14, 06:01 PM   #3127
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Tonci87 View Post
Would this also work for flags attached to the submarine by mods? What exactly is the problem?
Yes this will work with anything that has _FLG in it's name (towards the end of it's name) AND has a GlobalWind controller attached to it. Why the GlobalWind controller? The patch is looking for any object with _FLG towards the end of it's name. If it finds any object with _FLG towards the end of it's name then it checks to see if it has a GlobalWind controller attached to it. If it finds a GlobalWind controller then the patch knows that this object has to take the unit's course and wind direction into consideration for determining it's rotation values. The GlobalWind controller actually does nothing in this case - it's just an 'empty' controller attached to the object that I can quickly scan for

Finishing up the patch currently. What a freakin pain in the you-know-what this patch was. There were so many things that I had to discover/figure out first and through trial and error. Those discoveries though are needed for some future patches - I had to do it now or later. These new discoveries will help me in trying to develop a signal light for the player's unit. My idea is to attach a searchlight to the player's unit but have it hidden so it's not rendered. Then when you ask to use the signal light (via a new game command) it shows and you can rotate it and turn it on/off. So it would actually be able to be used as signal light to signal to other players (communicate to other players via light messages) or as a search light at night time

How this new flags affected by wind patch works:
- I use a vector to model ship's heading and speed
- I use a vector to model wind's direction and speed
Then using vector math I add the two vectors together. Convert the resultant vector into polar coordinates. This gives me a magnitude and an angle. The angle is the angle the flag will reside at on the unit. The magnitude is not being used but could be later (scaling of flag - i.e. if magnitude is very small then render flag small thus simulating flag not extended due to wind)

By doing the above the physics of the flag is modeled. This means unit's speed and heading and wind's speed and heading determine the resultant angle of the flag. Let's say unit is heading 270 @ 5 knots. Wind direction is 45 degrees @ 5 knots. The flag will be facing ~112 degrees:

No wind:
<-------unit @ 5 knots ------ flag @ 5 knots------->


With wind at 45 degrees @ 5 knots:

<-------unit @ 5 knots \
--------------------------------\
---------------------------------------\ flag

As in real life the game also uses how wind is defined. If you say wind is 45 degrees @ 5 knots that means it's blowing from 45 degrees to 225 degrees (SW) at 5 knots.

In the example above if the unit slows down then the flag's angle will increase (>112 degrees) or become more out of line with unit. If the unit speeds up the flag's angle will decrease (<112 degrees) or become more in line with the unit.

Because of how this patch works none of the flags defined in the stock flags.dat have GlobalWind controllers attached to them. Those will need to be added in order to see this patch work
TheDarkWraith is offline   Reply With Quote
Old 04-08-14, 09:16 PM   #3128
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Time to add a completely new idea/feature to the Silent Hunter franchise that's never been available before in any of it's titles

v1.0.162.0 released. See post #1

Starting with v1.0.162.0 added a new game file to the patcher: kernel.dll. Add a new patch to kernel: Objects follow wind direction. This new patch will have any objects that have _FLG in their name (flags for one) AND a GlobalWind controller attached to them take wind direction and speed into consideration. See the Files= and Notes= of the patch for more info.
TheDarkWraith is offline   Reply With Quote
Old 04-09-14, 12:42 AM   #3129
Sjizzle
Count Dracula
 
Sjizzle's Avatar
 
Join Date: Aug 2012
Location: 46°13′N, 24°47′E
Posts: 1,816
Downloads: 405
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
Time to add a completely new idea/feature to the Silent Hunter franchise that's never been available before in any of it's titles

v1.0.162.0 released. See post #1

Starting with v1.0.162.0 added a new game file to the patcher: kernel.dll. Add a new patch to kernel: Objects follow wind direction. This new patch will have any objects that have _FLG in their name (flags for one) AND a GlobalWind controller attached to them take wind direction and speed into consideration. See the Files= and Notes= of the patch for more info.

awesome work tdw thx
Sjizzle is offline   Reply With Quote
Old 04-09-14, 03:25 AM   #3130
Nufsed
Sparky
 
Join Date: Aug 2005
Posts: 156
Downloads: 500
Uploads: 0
WOW!......Just WOW!!
__________________
Mike Collins
Nullius in Verba

Nufsed is offline   Reply With Quote
Old 04-09-14, 07:07 AM   #3131
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

hats off
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 04-09-14, 08:50 AM   #3132
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
hats off
Any chance you can whip up some new icons for a signal lamp? I need icons for enable/disable signal lamp (this would make the 3D signal lamp visible/not visible on the player's unit), turn signal lamp on/off, and transmit message. That's all I can think of currently. If you or anyone else thinks I need some more then post up your ideas
TheDarkWraith is offline   Reply With Quote
Old 04-09-14, 08:56 AM   #3133
Sjizzle
Count Dracula
 
Sjizzle's Avatar
 
Join Date: Aug 2012
Location: 46°13′N, 24°47′E
Posts: 1,816
Downloads: 405
Uploads: 0


Default

@TDW

any news about the manual flooding balast tanks ?
will be awesome to have also manual flooding blasat tank.
Sjizzle is offline   Reply With Quote
Old 04-09-14, 09:00 AM   #3134
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Sjizzle View Post
@TDW

any news about the manual flooding balast tanks ?
will be awesome to have also manual flooding blasat tank.
Need icons for them I'm not a graphics artist nor do I claim to be. My graphics artist skills are beginner to intermediate at best. I don't like designing graphics art either - to me it's extremely boring and non-interesting work. I like to design and write code - to me that is art
TheDarkWraith is offline   Reply With Quote
Old 04-09-14, 09:11 AM   #3135
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Any chance you can whip up some new icons for a signal lamp? I need icons for enable/disable signal lamp (this would make the 3D signal lamp visible/not visible on the player's unit), turn signal lamp on/off, and transmit message. That's all I can think of currently. If you or anyone else thinks I need some more then post up your ideas
I will see what I can do

Quote:
Originally Posted by Sjizzle View Post
@TDW

any news about the manual flooding balast tanks ?
will be awesome to have also manual flooding blasat tank.
I agree
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:06 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.