View Full Version : moonlight effect solution - theretical
WernerSobe
02-23-07, 09:14 AM
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?
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. ;)
WernerSobe
02-23-07, 09:28 AM
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...
Someone else can answer about the 'invisible rules of modding', but that´s what I´ve heard. ;)
melnibonian
02-23-07, 09:37 AM
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;)
WernerSobe
02-23-07, 09:56 AM
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.
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.
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.
WernerSobe
02-23-07, 10:33 AM
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
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. :nope:
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.
WernerSobe
02-23-07, 11:10 AM
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.
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:
bigboywooly
02-23-07, 03:59 PM
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
Mush Martin
02-23-07, 04:21 PM
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.
bigboywooly
02-23-07, 05:28 PM
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
:nope:
WernerSobe
02-23-07, 07:35 PM
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.
melnibonian
02-23-07, 07:41 PM
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.
Just to make one thing clear here. I don't think anyone is telling you to edit or not to edit the code. That's totally up to you to decide. What we are telling you is that if you do it you will be doing something that is against the forum and modding rules. After that it's your decision;)
WernerSobe
02-23-07, 08:09 PM
ok let me decide. now back to topic. ideas anyone?
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.
You really don't know much of programming do you?
First dll files (also act) are library files for the executable file, modifying them is as illegal as modifying the exe, second, what you're asking (dissasemble the code) is extremelly difficult, and no one here with the hability to do that will do it, or at least discuss it in a public forum.
Everyone that had answered to you has suggested that this is not a topic for this forum, but you're not taking the hint, I recomend you to let this die before a moderator shuts it down...
Ref
zombiewolf
02-24-07, 03:51 AM
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;)
:|\\Wow like the the "Brain Police " will come and arrest you for thought crimes.As long as you don't charge for it you can modify anything you want.
So if I buy a toaster open it up look a the guts,change something to operate better and tell a friend about it I could be sued?
zombiewolf
02-24-07, 03:53 AM
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.[/quote][/QUOTE]
The word modify has only one meaning .All of the mods listed on this site have breached this but..
The agreement is nothing more than that an agreement, it holds no WATER.The key word is PRIVATE use.If I bring a car home and rebuild it to my specs,I have not broken the law.
I just can't sell it as my own creation.I have every right to sell the procedure to make the modification though.Because what you do with this information in the privacey of you garage is up to you.
I understand this forum has rules thats one thing ,but just knock off the illegal legal stuff.
:|\\Time you go back to 182.Hopefully I don't get banned
melnibonian
02-24-07, 06:27 AM
:|\\Wow like the the "Brain Police " will come and arrest you for thought crimes.As long as you don't charge for it you can modify anything you want.
So if I buy a toaster open it up look a the guts,change something to operate better and tell a friend about it I could be sued?
No one talks about "Brain Police" and no one will come and arrest you. If you read my post carefully you will realise that what I am talking about is not the source editing part. Strictly speaking changing a program (even the code) is not illigal if you do it in your own computer and your own copy. The moment you give it to someone else (free or not makes no difference) you breaking the rules. It's exactly the same as in the music case. You can copy your own CD (assuming you have the original to start with) but you cannot distribute it to others. Now from the moment you're in a public forum these kind of discussions are 'dangerous' to say the least.
melnibonian
02-24-07, 06:29 AM
ok let me decide. now back to topic. ideas anyone?
What is that you don't understand? We are on topic and we tell you what we think. What you're asking is for us to tell you how to break the rules, although we think it's not appropriate. Would you have agreed to that? Think a little bit about it;)
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.
sh3.dll = PROTECT.DLL
StarForce protection and the general winprog functions are in this file.
I think.
How ridiculous!
Do the "know-it-all" modders here have any idea of the amount of reverse-engineering of files that has gone on in SH3 since its release?
The idea that certain files are "off limits" is wrong.
This is just a myth that has grown up for some reason in the SH3 community!
Please see the example of games like Morrowind, where there were lots of .exe patchers and programs that messed with the core game files for a variety of effects.
For example:
Morrowind Script Extender (http://sourceforge.net/project/showfiles.php?group_id=172997)
Morrowind FPS Optimiser (http://planetelderscrolls.gamespy.com/View.php?view=Utilities.Detail&id=51)
Morrowind EXE Optimiser (http://www.angelfire.com/games6/timeslip/morrow.html)
All the above either directly modify the .exe file, or run as external programs while the normal game is run and modify "hardcoded" variables in realtime. Loads of great enhancements to that game have resulted, and uhh, it seems they haven't been shut down by anyone in the 3 or 4 years they've been around.
I seriously doubt that any legal trouble would result in doing anything to the SH3 core files like the .exe, .sim, .dlls - the only exceptions would be if you released the SH3.exe and files which would allow piracy in some way (for example if the StarForce protection was removed and you allowed the exe for download) To be on the safe side, you could just release a patcher rather than the .exe.
And if Ubi were really upset about it, all they have to do is contact the author and ask him to take it down, then the matter would be clear. Going by the EULA is foolish, because as others have noted, it technically prohibits all mods, including "unauthorised levels or scenarios"!! EULA's are legally invalid in some regard in most jurisdictions anyway.
In practical terms, Ubisoft do not care what mods you make as long as it's not along the lines of "import all data from SH4 to create uber-sim" and vice versa.
In fact, I believe at least one program that modifies a dll has already been released - I think it's called MultiSH3. Ah, yes, and on the main subsim downloads page to boot!
MultiSH3 (http://www.subsim.com/radioroom/../subsim_files/patches05/MultiSH3.zip) (278KB): this utility that will change the folder name in My Documents that Silent Hunter 3 uses to save campaign and career information. It does this by patching a file in the game's root folder called FileManager.dll.
"Not to be touched", indeed!
...
For example:
Morrowind Script Extender (http://sourceforge.net/project/showfiles.php?group_id=172997)
Morrowind FPS Optimiser (http://planetelderscrolls.gamespy.com/View.php?view=Utilities.Detail&id=51)
Morrowind EXE Optimiser (http://www.angelfire.com/games6/timeslip/morrow.html)
MultiSH3 (http://www.subsim.com/radioroom/../subsim_files/patches05/MultiSH3.zip) (278KB): this utility that will change the folder name in My Documents that Silent Hunter 3 uses to save campaign and career information. It does this by patching a file in the game's root folder called FileManager.dll.
1) May be they have received the sanction from developers?
2) It's very simple mod, it edits string "SH3" (data).
It can be made by text editor.
Ok, here´s a question.
Why nobody hasnt modded the core files yet? If it´s allowed, I´m sure someone would´ve modded them by now.
Anvart:
1) Unlikely, but you can ask whoever made it.
2) Simplicity or otherwise is not relevant. Anyone with a simple Hex editor can of course edit any SH3 file in any particular.
You don't seem to understand that under the terms of the EULA no public modding of any kind is allowed. But since Ubisoft obviously encourage mods (they have an official mod forum for example), the terms of the EULA relating to mods may be safely ignored until proven otherwise (i.e., a Ubisoft representative states that x or y type of mod is not allowed.)
You can also go by the experience of nearly every other game that has been modded, again, Morrowind is the best example.
What would really exercise the legal minds at Ubisoft would be taking SH3 art assets or code and using them without authorisation in another project - for example, importing SH3 data into SH4, or an amateur subsim using the SH3 music, etc.
Mods however are encouraged because they build a positive community response to the game and are believed to increase long term sales.
Dowly:
Did you read my post? The MultiSH3 mod directly changes a core (dll) file. The reason most people stay away from the "core" files is that they require significant programming experience and time to understand, which most modders do not have.
Well, I hope to get clearifying answer from Dan D when he has some spare time to check his emails. ;)
Anvart:
1) Unlikely, but you can ask whoever made it.
2) Simplicity or otherwise is not relevant. Anyone with a simple Hex editor can of course edit any SH3 file in any particular.
...
1) You give this fact, as an example. If you do not know you cannot set this example.
2) I think it's not unequivocally. Here it is not necessary recompilation or disassembletion, it is part of code opened for reading. And everyone can using the simple text editor to change string SH3 (for example) on SH0, Sh1, etc.
???
By gum this has gone waaaaaay off topic, please just list the file extenions that can't be touched & leave it at that!:yep: I think WernerSobe may have given up!:cry:
By gum this has gone waaaaaay off topic, please just list the file extenions that can't be touched & leave it at that!:yep: I think WernerSobe may have given up!:cry:
Not off top.
It's first problem.
Not extensions.
Files in "Data" folder are editable.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.