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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 02-23-07, 09:14 AM   #1
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default moonlight effect solution - theretical

Hi guys.

Ive tried to render moonlight in my environment mod in the past but i couldnt synchronise it to the moon so ive given up someday. Im still trying to find a solution so i want to share my findings with other moders and hope to ignite someones idea.

the theory:

- neither the moon nor the sun is rendered dynamic.
there are just three kinds of static light effects.
1. being ambient light wich covers 360°
2. being sun direct light wich covers 115° towards the sun
3. being sun reflect light wich covers 55° on the opposite to direct light.

- the color and intensity for each light effect at different daytime and weather are controlled in env\Env_Colorsxxx.dat

- sun reflect light effect is almost unused. It is overshined by ambient light during the day and it is gone at night. You can however increase its brightness at night and turn it into beautiful directional moon light effect, you can even make it appear only at clear nights.

now the problem:

sun reflect light is synchronised with the sun. Of course you dont see the sun at night but it is there, its just invisible. The moon follows its own orbit which is very different to the sun ones so the moonlight does not match to the moon itself.

my conclusion:

there must be a hard-coded formula (which i didnt found yet) that describes the orbit of the sun and another one for the moon orbit. I think there is one more for the stars.

the sun orbit formula controlls the direction of light effects, the sky texture, sky reflection texture and the sun bitmap itself. While the moon orbit formula controlls just the moon bitmap.

the trick is to find where the sun reflect color is tied to the sun orbit and connect it to the moon orbit. The process itself shouldnt be hard but i just cant find that place.

thoughts? ideas?
WernerSobe is offline   Reply With Quote
Old 02-23-07, 09:21 AM   #2
Dowly
Lucky Jack
 
Join Date: Apr 2005
Location: Finland
Posts: 25,052
Downloads: 32
Uploads: 0


Default

Quote:
Originally Posted by WernerSobe
there must be a hard-coded formula
We are allowed to mod everything else but the hardcoded stuff. Playing around with the SH3.exe is a big no-no.
Dowly is offline   Reply With Quote
Old 02-23-07, 09:28 AM   #3
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default

well we dont have to change that formula but the index where the connection between sun reflect color and the sun orbit. It might be hardcoded might be not but i dont think so.

And where does it say that we are not allowed to alter hardcoded areas? I think we may do anything as long we dont charge money or call someone elses work ours...
WernerSobe is offline   Reply With Quote
Old 02-23-07, 09:31 AM   #4
Dowly
Lucky Jack
 
Join Date: Apr 2005
Location: Finland
Posts: 25,052
Downloads: 32
Uploads: 0


Default

Someone else can answer about the 'invisible rules of modding', but that´s what I´ve heard.
Dowly is offline   Reply With Quote
Old 02-23-07, 09:37 AM   #5
melnibonian
Ocean Warrior
 
Join Date: Jul 2006
Location: Reading UK
Posts: 3,473
Downloads: 90
Uploads: 0
Default

Quote:
Originally Posted by WernerSobe
And where does it say that we are not allowed to alter hardcoded areas? I think we may do anything as long we dont charge money or call someone elses work ours...
I think if you check the licence agreement you signed with Ubisoft (when you bought and install the game) there is a clause that doesn't allow the modification of the code. In any case playing with the source code is illegal as there are copywrite issues involved. If you want to do it you're obviously free but you should know that none of the modders will accept a mod like that. After all don't forget that Ubisoft and SH will be around for years to come and I don't think anyone would like to piss the Devs off There are also issues with respect of the Devs' work and so on but the important thing is that playing with the code is a BIG NO NO
melnibonian is offline   Reply With Quote
Old 02-23-07, 09:56 AM   #6
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default

huh? please quote where it does say that.

1. there are already mods around that have changed hard coded areas and noone cried.
2. nonone was going to deal with the source code. Just becase the source code was never published. Im talking about disassembling the game files while propably it wont be necessery.

Anyway this is all going off topic. If you want to talk about what we may do and what we may not lets start another thread for that. please stay at topic guys.
WernerSobe is offline   Reply With Quote
Old 02-23-07, 10:09 AM   #7
Dowly
Lucky Jack
 
Join Date: Apr 2005
Location: Finland
Posts: 25,052
Downloads: 32
Uploads: 0


Default

Mate, just believe Mel. He knows about it. And as far as I see, this has all been on-topic. Go ahead, make the mod, but if you change the hardcoded parts of SHIII, you are doing something illegal and you can forget the support of 90% of the community´s modders.

And please, point me out to the mods that have changed hardcoded stuff?

Your idea is great, but if it is hardcoded, you cant do nothing about it LEGALLY.

Not trying to bring you down or anything, just telling you how it works.

Quote:
3- Use of the Multimedia Product

The User is authorised to use the Multimedia Product in accordance with the instructions provided in the manual or on the packaging of the Multimedia Product.
The Licence is granted solely for private use.

It is not permitted:
- To make copies of the Multimedia Product,
- To operate the Multimedia Product commercially,
- To use it contrary to morality or the laws in force,
- To modify the Multimedia Product or create any derived work <--- Meaning in today´s games that modding is OK as long as you dont touch the hardcoded parts without the permission of the rights holder, in this case Ubi.
- To transmit the Multimedia Product via a telephone network or any other electronic means, except during multi-player games on authorised networks,
- To create or distribute unauthorised levels and/or scenarios,
- To decompile, reverse engineer or disassemble the Multimedia Product.

The User cannot sell, sublicense or lease the Multimedia Product to a third party.
Dowly is offline   Reply With Quote
Old 02-23-07, 10:33 AM   #8
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default

The last point does say you may not reverse hardcoded areas not the point that you have marked. That one just says you may not modify anything it does not separate between code and data files. In that case any mod is illegal so what are we doing here then?

Any mod that touches files that cointain more then just data (.dat, .cfg .tga ...) is actualy touching hardcoded areas.

back to the topic
WernerSobe is offline   Reply With Quote
Old 02-23-07, 10:56 AM   #9
Dowly
Lucky Jack
 
Join Date: Apr 2005
Location: Finland
Posts: 25,052
Downloads: 32
Uploads: 0


Default

WE ARE ON-TOPIC FFS!

But as you seem to ignore what I added to the part where it says we are not permitted to mod any files, good luck.

Like I said earlier, I´m not trying to bring you down, but think about it, if we would be approved to mod hardcoded stuff all the supermods would be a lot better than what they are now. But as we arent allowed to mod the .exe we have to work with what we have.

End of my discussion, good luck with your mod.
Dowly is offline   Reply With Quote
Old 02-23-07, 11:10 AM   #10
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default

uhm the least of game code is in .exe.

Most of it is in .sim files and actualy in any file that does contain more then simple data like texture, sound files or data containers.
WernerSobe is offline   Reply With Quote
Old 02-23-07, 03:50 PM   #11
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by WernerSobe
uhm the least of game code is in .exe.

Most of it is in .sim files and actualy in any file that does contain more then simple data like texture, sound files or data containers.
:rotfl:
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 02-23-07, 03:59 PM   #12
bigboywooly
Rear Admiral
 
Join Date: Apr 2006
Location: Swindon, England
Posts: 10,151
Downloads: 35
Uploads: 0
Default

The protection - starforce - is in the exe
Mess with the exe and its the same as piracy
Not to be touched

Now if Ubi release the SDK then its touchable
__________________


My mediafire page http://www.mediafire.com/?11eoq19bq9r41
bigboywooly is offline   Reply With Quote
Old 02-23-07, 04:21 PM   #13
Mush Martin
Eternal Patrol
 
Join Date: Dec 2006
Posts: 4,398
Downloads: 4
Uploads: 0
Default I believe its quite doubtful

I think that the time has passed where it would be worth it for ubi to
release an sdk theres no percentage in it for them now.
__________________
RIP Mush



Tutorial
Mush Martin is offline   Reply With Quote
Old 02-23-07, 05:28 PM   #14
bigboywooly
Rear Admiral
 
Join Date: Apr 2006
Location: Swindon, England
Posts: 10,151
Downloads: 35
Uploads: 0
Default

Quote:
Originally Posted by Mush Martin
I think that the time has passed where it would be worth it for ubi to
release an sdk theres no percentage in it for them now.
IIRC they are using a tweaked version of the SH3 engine for SH4 so no chance of an SDK yet
__________________


My mediafire page http://www.mediafire.com/?11eoq19bq9r41
bigboywooly is offline   Reply With Quote
Old 02-23-07, 07:35 PM   #15
WernerSobe
Commodore
 
Join Date: Jul 2006
Posts: 625
Downloads: 5
Uploads: 0
Default

im not going to touch the exe there is realy not much of game code in it.

most of game code is in sh3.dll and in simdata.dll. Im almost sure the formula for the sky objects is in one of these. The index for the connection between the sun and sun-reflect light might be somewhere else, not in exe though.
WernerSobe 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 10:19 PM.


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