Academy for Modding Excellence
Welcome, Guest. Please login or register.

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : MEMBERS WANTED!

Players & Builders of NWN & NWN2 needed to join the AME panel
October 17, 2019, 02:56:27 PM
+  Academy for Modding Excellence
|-+  Academy of Modding Excellence Public Forums
| |-+  General Discussion
| | |-+  NWShader
Advanced search
  0 Members and 1 Guest are viewing this topic. « previous next »
Pages 1 2 Go Down
Author
Topic: NWShader  (Read 17438 times)
Reply #15
« on: May 02, 2010, 04:36:06 AM »
Andarian Offline
AME Chairman and Site Admin
Administrator
Platinum Dragon
*****
Posts: 2381

WWW

While looking into installing this latest version of NWShader, I see that installing NWShader requires literally replacing the main EXE for the game.

Preface: I haven't had time to look at this at all or to personally check any of these claims. But if it's true that NWShader replaces the main game executable, then isn't it in violation of the NWN EULA? Perhaps I'm misremembering (and someone correct me if I am), but as I recall it the EULA prohibits altering the game's executable code without permission. Adding new executable code to run on the GPU is one thing, but I would think that replacing a Bioware executable would be something else altogether.

I still think this is an very intriguing idea. But I also tend to agree that Invisig0th has a point that installing something like is a bigger deal than I'd first thought.
Logged

 
Reply #16
« on: May 02, 2010, 07:47:24 AM »
peachykeen Offline
Dragon Egg
*
Posts: 13



While looking into installing this latest version of NWShader, I see that installing NWShader requires literally replacing the main EXE for the game. Are you out of your mind?

Actually, I am. Otherwise I wouldn't have tried to add shaders to a game made before they were invented. Tongue
But it doesn't replace the engine. It hooks into it, similar to how NWNCX does, or the camera hack. I think you're going by the final appearance of having a backup of the engine. The method NWShader uses has been developed and distributed as a tool by Microsoft, the same company that made the executable format. Not only does it make an internal backup (the modified EXE actually has a backup of the original stored in it), but I make an extra backup for safety's sake. If the patch can't make a backup, it stops itself and doesn't even touch anything. I honestly can't think of more safety measures to add.

Now, it is (in rare cases) a risky thing to do. Using Microsoft's tools to do it makes it easier and safer, but it is something of a drastic change. To get NWShader to work how it should, it's the best way (I've tried 3 or 4 different methods, and this one is all-around the most stable, safest and simplest, believe it or not).

To explain, I may get a bit technical, but here's how NWShader works:
You run the hook program to attach NWShader. Now, almost all programs on Windows use DLLs. DLLs have code that is separate from the program, but the program can use. DLLs can be upgraded easily and by other companies (a video card company can make driver DLLs and upgrade them without updating every game using them).
By default, Neverwinter Nights asks Windows to load the file OpenGL32.dll, which is the video drivers. The hook program in NWShader asks Detours ( http://research.microsoft.com/en-us/projects/detours/ ) to change that to NWShader.dll, which loads OpenGL32.dll itself.
So now, once Detours does its thing, NWN loads NWShader, which loads OpenGL. It's just a basic go-between layer, the only way it modifies the executable is changing the name of the file the game asks for.

Now, for those of you familiar with how a program is set up, all the names are stored in something called an import table (described here http://en.wikipedia.org/wiki/Portable_Executable#Import_Table ). The program is made of sections; first comes code, imports, exports, then resources and text. What NWShader does, through Detours, is change one entry in the import table. Detours, by design, copies the original table to the end of the file (so it can be restored later) and modifies the selected entry.

None of the game code is changed or touched, at all.

The source code for the patch is publically available here:
http://nwshader.svn.sourceforge.net/viewvc/nwshader/tools/hooker/src/hooker.cpp?revision=21&view=markup
So anyone worried about what's going on inside can see exactly what happens (or have their programmer friends take a look). Nothing NWShader does is hidden, the full source is available for anyone interested or concerned.

Quote
Only people who know exactly what they are doing, and who are willing to reinstall the game if anything gets messed up, should even *consider* such a thing.
Well, since NWShader only changes the NWMain file (one file in the game) and makes a backup first, hopefully any reinstalls can be prevented.
That's the only file it touches, so nothing else can get broken, even if things go horribly wrong.
In case things do go wrong, it makes a backup and the install page tells users to keep the backup safe.

Quote
I'm sure you're ready to respond by telling me about all the extra effort you have put in to prevent such problems. And while all that may be true, you and I both know that this does not mean you can guarantee that no serious problems will occur. Everyone who replaces their core game files by installing this tool is taking a very serious risk, and you currently do not appear to be taking ANY steps to notify people about that. At the VERY least, you should have a disclaimer on your download page clearly explaining that the NWShader installation changes the core game files, that you cannot guarantee that serious problems will not occur due to those changes, and that anyone who installs NWShader must do so at their own risk. That is exactly what any responsible developer would do here.
Oh, certainly. I've been working yesterday and today to update the wiki with info on the new version, and I'm working on a more detailed page of how NWShader works. In the install instructions, I already added a line mentioning that NWShader modifies that file and warning users to keep a backup safe incase anything does go wrong.
Going with the GPL's usual disclaimer line, NWShader itself warns the user every time it's run that it has no warranty and all that, as does the license included with it. I don't think I can pack that disclaimer into too many more pages. Tongue

Quote
With all sincerity, I truly mean no disrespect to you personally or to what you are trying to do here.You definitely have a high level of knowledge of the subject matter, and NWShader will be an interesting experiment for those people who are familiar with these types of things.  And I do think what you're doing is interesting on a very esoteric, academic level.  But the way you're going about this is terribly irresponsible.  If you honestly think that encouraging people not familiar with these things to alter their core game files without warning them of the potential risks is a good idea, then clearly there are some very important things that you don't understand at all.
Well, can you think of another way to go about it? Not to be smart, but when tweaking graphics code after-market, there are very few methods that make it possible.

You can add an OpenGL32.dll to the game directory, which I tried (in two flavors).
The first try required copying your system drivers into the NWN dir also, which was a serious pain and caused problems for me in development and users.
The second adds that file and dynamically linked to the drivers, which would have worked (and would have been the ideal solution), except NWN refused to see the OpenGL start function and so didn't run, at all.
I'm limited by both what the system can do and what NWN can do/wants to do, so my options are pretty narrow. If you can come up with another way to do it, and not touch NWmain, I'll definitely try to use that, but I'm out of ideas at this point, and Microsoft is handing out a neat, clean solution.

Quote
Someone will definitely have to warn your users about the serious potential risks of what you are doing here, and it would be best if those warnings came from you as the developer. I would encourage you to take a good, hard look at all this. And this is exactly what I have been saying since your first post. The way in which you are going about this project sends up all sorts of red flags. I realize this is your baby and that it's natural to be overly optimistic, but please consider showing more concern for your users and for the NWN community as a whole. People will have a lot more respect for what you are doing here if you err on the side of caution. And the more radical the nature of what you are doing, the more reasonable it is to be overly cautious. If something does go seriously wrong, at least people cannot say they weren't warned of that possibility. Please do the right thing.
I'll add extra notes to the install page and the thread.
As far as erring toward caution, honestly, everything has been done to make this as safe as possible. I understand the risks and what could happen (being familiar with the PE format, I may have a better idea of what can really happen than most). I think you may be over-reacting a tad, but hopefully the links above and the code example will help you understand what's really happening and how it works.

Quote from: Andarian
Preface: I haven't had time to look at this at all or to personally check any of these claims. But if it's true that NWShader replaces the main game executable, then isn't it in violation of the NWN EULA? Perhaps I'm misremembering (and someone correct me if I am), but as I recall it the EULA prohibits altering the game's executable code without permission. Adding new executable code to run on the GPU is one thing, but I would think that replacing a Bioware executable would be something else altogether.
NWShader doesn't use a new copy of the file, or replace it, or anything like that. It uses the same sort of thing as the camera hack and NWNCX to modify a small chunk of the file.
As far as I know, from the mods that've done it for NWN and a half-dozen other, similar projects for different games (using very similar or identical EULAs), and a few people checking with their lawyers (actually, Bethesda Softworks ran it by their lawyers at one point), it's allowed on a few conditions.
The main thing is that it be made as a patch. If I were sending out a copy of the executable, that would obviously open all sorts of copyright issues and break EULA. Using a byte-patch to change a file on the user's system is allowed, as long as it doesn't have the code in it. NWShader uses a patching system developed by Microsoft, which meets that limit.
If anyone is really worried that this particular method for this, in NWN, isn't allowed, I can try to get in touch with the developers. I've sent them a couple messages and haven't gotten replies yet. Seeing as I wasn't able to get official word, I went with the patching method that's been allowed previously.



Now, in summary: this is a radical change. There's no other way to go about it.
I've made it as safe as possible, and there is more than one warning. The wiki mentions it, the log file mentions it, the readme mentions it, and the license file mentions it. If it can be made safer, I'll certainly do so.
Once you understand what's really happening, it's not nearly as scary as it looks at first. It's also not nearly as drastic. I haven't seen anyone scared of the camera hack, and that's built using a cracking tool (the byte-patcher used in it is more commonly used for piracy and injecting viruses).

Edit: Actually, I just had a though. Would you all be more comfortable with using this if I made a copy of the executable and changed the copy instead? So you have the old one, plus a new NWShader-enabled one. I could whip up a quick launcher to make it simple for players, and even make it optional (make a modified copy for "safe mode" or backup and modify for "in-place" mode). Opinions on that?
« Last Edit: May 02, 2010, 07:55:54 AM by peachykeen » Logged
 
Reply #17
« on: May 02, 2010, 09:01:32 AM »
Andarian Offline
AME Chairman and Site Admin
Administrator
Platinum Dragon
*****
Posts: 2381

WWW

NWShader doesn't use a new copy of the file, or replace it, or anything like that. It uses the same sort of thing as the camera hack and NWNCX to modify a small chunk of the file.

As far as I know, from the mods that've done it for NWN and a half-dozen other, similar projects for different games (using very similar or identical EULAs), and a few people checking with their lawyers (actually, Bethesda Softworks ran it by their lawyers at one point), it's allowed on a few conditions.

The main thing is that it be made as a patch. If I were sending out a copy of the executable, that would obviously open all sorts of copyright issues and break EULA. Using a byte-patch to change a file on the user's system is allowed, as long as it doesn't have the code in it. NWShader uses a patching system developed by Microsoft, which meets that limit.

Here's a link to the NWN Eula for reference. This is the part that I was remembering:

Quote
3. End-User Variations. So long as you fully comply, at all times, with this License, Infogrames grants to you a limited, personal, revocable, non-exclusive right to: (i) use the Software's toolset feature to create your own NEVERWINTER NIGHTS modules ("Modules"), and (ii) create your own modifications to work with the Software (e.g., custom data files not created using the toolset) (the "User Conversions", and together with the Modules, the "Variations"). Your rights to create Variations are subject to the following restrictions: (1) your Variations must only work with the full commercial version of the software game NEVERWINTER NIGHTS; (2) your Variations must not contain modifications to any executable file; [emphasis added]

As I read this, mods that involve modifications to an executable file are expressly disallowed by the EULA. Whether Bioware cares or intends to enforce the terms of the original EULA I don't know. I would actually tend to doubt it at this stage of the game (pun intended). It's probably also worth noting in that connection that point (3) immediately following goes on to prohibit "pornographic" mods as well -- a provision that's hardly been enforced during the entire history of NWN.
Logged

 
Reply #18
« on: May 02, 2010, 09:19:53 AM »
peachykeen Offline
Dragon Egg
*
Posts: 13



Here's a link to the NWN Eula for reference. This is the part that I was remembering:

Quote
3. End-User Variations. So long as you fully comply, at all times, with this License, Infogrames grants to you a limited, personal, revocable, non-exclusive right to: (i) use the Software's toolset feature to create your own NEVERWINTER NIGHTS modules ("Modules"), and (ii) create your own modifications to work with the Software (e.g., custom data files not created using the toolset) (the "User Conversions", and together with the Modules, the "Variations"). Your rights to create Variations are subject to the following restrictions: (1) your Variations must only work with the full commercial version of the software game NEVERWINTER NIGHTS; (2) your Variations must not contain modifications to any executable file; [emphasis added]

As I read this, mods that involve modifications to an executable file are expressly disallowed by the EULA. Whether Bioware cares or intends to enforce the terms of the original EULA I don't know. I would actually tend to doubt it at this stage of the game (pun intended). It's probably also worth noting in that connection that point (3) immediately following goes on to prohibit "pornographic" mods as well -- a provision that's hardly been enforced during the entire history of NWN.

I've seen that before (aren't all game EULAs basically the same?). If I remember right (it's been a while since I last heard any official standpoint on this), the reason such things are allowed plays off a technicality. My patcher doesn't contain a modified executable file. It contains code to modify the file. You still have to have the file in the first place, so there's no chance of helping pirates by handing out copies. That's my understanding of this, at least. Not being a lawyer myself, I can only go by what they've told me, so... Hopefully it is allowed. If BioWare complains, I'll change things around somehow. Smiley
« Last Edit: May 02, 2010, 09:23:32 AM by peachykeen » Logged
 
Reply #19
« on: May 02, 2010, 10:09:13 AM »
Invisig0th
Guest

There's no doubt it is a direct violation of the EULA. As such, discussing NWShader on nwn.bioware.com is probably forbidden according to forum rules, and the upload of NWShader to NWVault is also probably not allowed. Whether or not they will want to enforce those rules is an open question. But hacking the game code, for whatever reason, is definitely against the rules. In fact, I'm not even sure at this point if is appropriate to discuss this here. I'm not sure if we have a policy regarding game hacks/cheats. Not my call, of course, but it is disturbing that this question even needs to be asked.

You're welcome to discuss with Bioware whether or not you have violated your EULA by distributing this tool. However, it is undeniable that you are indeed making "modifications to (an) executable file". Your tool literally change the code of the game executable, and is therefore a hack by definition. That obviously is something you are responsible for disclosing BEFORE people install your tool. Once again, the fact that you are comfortable with the risks here does NOT mean that it is okay for you to assume that the people who download your tool will agree and will want to do the same thing on their own machines.

Sorry, peachykeen, but it's clear you have some unrealistic assumptions about the concerns that end users are going to have about what you are doing here and how you are doing it, and you also have some unrealistic assumptions about the range of skills among the people in the NWN community.  I would guess that a large number of the people who have already installed this tool "just to try it out" are not programmers, and are people who will not understand how to undo the changes you are making, and *certainly* don't realize that you have replaced their game executable.  Those people will not be visiting your web site to read a disclaimer or read through the source code. In some cases you will literally be dealing with people who would need assistance just to change a file's name.  As a long time member of the NWN community, I can assure you with absolute certainty that even if you did attempt in good faith to properly warn people beforehand about the inherent risks related to your tool, many people would be installing your tool without any clue that you are altering their game files. To not even attempt to provide those warnings (for the people who would bother reading them) is amazingly reckless.

I do understand that you have gone to extreme lengths to address any concerns you could possibly think of. Unfortunately, it is is the concerns that you could NOT possibly think of that often cause the biggest problems. And it won't be just you that pays if that happens. It could be a healthy chunk of the NWN Community. ALL software is flawed, sometimes deeply flawed, despite the best efforts of the developers. That is a well established fact in the field of software development. The best developers accept the fact that their software may fail, perhaps catastrophically, and attempt to manage that risk in ways besides simply fixing known bugs. I don't see you doing that here.

You, from an highly informed point of view, are clearly willing to accept the risks related to your tool. That is perfectly reasonable. Mess with your game files however you like -- that's your business. However, that doesn't mean you can assume that other people much less informed about these topics are just as willing to accept those risks. Allowing someone you do not know to change executable files on your computer is always a Very Bad Thing (or at least a Very Risky Thing). No matter how awesome and thorough that person may be, it can end badly.
 
As you move forward on this, I would encourage you to be extremely careful about what you do, how you do it, and how thoroughly you inform people about the risks related your tool. I really am surprised that I have to explain this to you. So far you've raised a lot of red flags from my point of view as a Microsoft certified .NET Architect with 15 years of experience in the corporate world. Based on my background and this discussion, I regret to say that I would not recommend that anyone unfamiliar with these things install your tool. It's far too risky, and it's being handled in a way that does not properly address those very real risks, which only makes things worse. I suspect you're going to find that many tech-savvy people will be happy to accept the risks and work with you to test and improve this tool. But amateurs (which make up the majority of the NWN community) should seriously avoid the kinds of things you are doing here.

It really is a shame, though. The underlying thing that you are trying to here is actually pretty cool. But even an excellent idea can be ruined if it is handled badly. And I'm certain that you are an *excellent* programmer, but you seem to be falling short on the 'people' side of this equation. If you decided to approach all this in a *much* more responsible manner, I do think you could address almost all of the concerns mentioned here. There are still going to be a fair number of unavoidable risks here no matter what you do, but taking appropriate steps to reduce the danger of those risks (and thereby doing whatever you can to protect your end users from bad results) is the very best way to ensure that your project is successful.
« Last Edit: May 02, 2010, 10:44:50 AM by Invisig0th » Logged
 
Reply #20
« on: May 02, 2010, 10:51:04 AM »
peachykeen Offline
Dragon Egg
*
Posts: 13



Sorry, peachykeen, but it's clear you have some unrealistic assumptions about the concerns that end users are going to have about what you are doing here and how you are doing it, and you also have some unrealistic assumptions about the range of skills among the people in the NWN community.  -snip-, I can assure you with absolute certainty that even if you did attempt in good faith to properly warn people beforehand about the inherent risks related to your tool, many people would be installing your tool without any clue that you are altering their game files. To not even attempt to provide those warnings (for the people who would bother reading them) is amazingly reckless.
I have provided the warning. I can't force users to read anything, but I can provide the text. It has been available since the release of this new version yesterday, and I'm currently expanding it and making it more obvious. The warnings have been provided.

Quote
I do understand that you have gone to extreme lengths to address any concerns you could possibly think of. Unfortunately, it is is the concerns that you could NOT possibly think of that often cause the biggest problems. -snip- The best developers accept the fact that their software may fail, perhaps catastrophically, and attempt to manage that risk in ways besides simply fixing known bugs. I don't see you doing that here.
You haven't read the code. It has general try-catch blocks linked to the disable portion, designed to gracefully exit and log any errors I haven't added specific handling for or haven't seen before.

Quote
You, from an highly informed point of view, are clearly willing to accept the risks related to your tool. -snip- Allowing someone you do not know to change executable files on your computer is always a Very Bad Thing (or at least a Very Risky Thing). No matter how awesome and thorough that person may be, it can end badly.
That's one of the reasons all the code is open source. If anyone is worried about security, they can look at it. If anyone has any suggestions, they can try them out and send them to me to be added (or ask to be given subversion access).
 
Quote
It really is a shame, though. The underlying thing that you are trying to here is actually pretty cool. But even an excellent idea can be ruined if it is handled badly. If you decided to approach all this in a *much* more responsible manner, I do think you could address almost all of the concerns mentioned here. There are still going to be a fair number of unavoidable risks here no matter what you do, but taking appropriate steps to reduce the danger of those risks (and thereby doing whatever you can to protect your end users from bad results) is the very best way to ensure that your project is successful.
You've harped on this point for most of your posts, but what steps do you suggest be taken? I've pointed out what steps I have taken, up to (and including) the best general error-catching available in C++. If you have a better method, please let me know.
Hell, if you feel so strongly about it, I'll add to you to the project (as long as you promise not to edit every page to start with "don't use this!" Tongue) or we can go over the code and discuss each problem you see. I'm completely willing to try and improve the project as much as possible.
Another thing you need to consider is this is still alpha. It's only a few months old at this point, and I just recently finished implementing the basic blocks. This latest release was the first one with a major focus on anything but feature-adding, and is the first one that's not just a proof of concept. If you see so many issues, help me fix them.

Edit: Apologies if the above seems rude, I was on the way out to mow the lawn before the rain started.
However, while mowing I got a spark of inspiration that may, if it works out, let me avoid modifying any executables, which will lay all EULA questions to rest. It'll also render a few of your concerns null, and won't cause me any extra trouble. I'll be testing that out tonight.
Now, another thing, I'm not entirely familiar with the NWN community yet. I'm pretty new here, this is my first project for NWN. So I may be misjudging. In the community/game I'm from, and where most of my experience is from, it's a common question to ask "are you running MGE?" when someone mentions a crash or visual error. That mod (essentially the same as NWShader) has become an established part of the community. If I can work out the bugs in NWShader and make it both stable and safe, I can imagine it doing the same (of course, it'll probably take a similar timespan of 4 or 5 years before it fully catches on). This is all still alpha. I'm still getting it working right. At this point is it best suited for people who understand what's going on, I'm only starting to make it more user-friendly (and obviously not doing so great Tongue).
Because of that, feedback at this stage, from both the "yay I like!!!" and "wait, it does what?!" sides is important. As you mentioned, I can't think of everything, so I need as many suggestions and contributions as possible to get everything I haven't considered. You seem to have a lot of concerns, many of which are valid. If you have the time or are willing to help fix them, it'd be much appreciated. If not, if you could at least suggest a better way, I'll see if it can be done. Smiley
« Last Edit: May 02, 2010, 11:30:37 AM by peachykeen » Logged
 
Reply #21
« on: May 02, 2010, 12:13:34 PM »
Invisig0th
Guest

I have provided the warning. I can't force users to read anything, but I can provide the text. It has been available since the release of this new version yesterday, and I'm currently expanding it and making it more obvious. The warnings have been provided.
Yeah? Where?

As I write this, on the download page for NWShader on NWVault, there is no indication that this tool is an alpha or prerelease. There is absolutely no mention of the fact that installing the tool will change your game executable. In fact, there is no sort of warning or disclaimer *at all* on that page regarding the various potential risks or the assumed skill level of the user. At this point, the information that is currently provided on the NWVault download page would lead one to believe that this product is finished, stable, and safe.  Even the people who do take the extra time to read the download description you have up there now will be completely unaware of any potential risks. The closest thing you have to a warning is that "NWShader is under rapid development". That doesn't exactly cover it. That could simply mean that you're working on version 2.0.

So if you honestly think you're taking the appropriate steps to provide people with good information about the pros and cons of what they are downloading, I'm sorry to say that you really haven't. If you have posted any warnings on that page, I certainly can't see them -- and if I can't see them when I'm specifically looking for them, then it's safe to assume that most people won't see them.  As a general rule, people simply aren't going to go to your web site or surf your Wiki before installing a game add-on, no matter how much you beg them to.  You need to provide that information on the NWVault download page in a very obvious manner -- probably highlighted in the download description and also included in the documentation for your tool included in the download. It's your responsibility as the developer, particularly with experimental tools, to make sure the people considering using your tool have easy access to all the information they need to make an informed decision regarding whether or not to proceed.  Saying that it is the user's responsibility to dig around for that information is just ignoring the reality of how such things work in the real world. You will save yourself a lot of headaches by simply accepting the fact that it will be up to you as the developer to provide this information as explicitly as possible.

I appreciate the deep and sincere dedication you have to improving the code of your tool in order to reduce problems. I really, really do. But you are letting a lot of other things slip through the cracks, things that are decidedly not code related. Those things can cause lots of problems, too. Those are the things that will make or break your project. As of this writing, you simply have not addressed these issues, not even at a bare minimum.
« Last Edit: May 02, 2010, 12:31:09 PM by Invisig0th » Logged
 
Reply #22
« on: May 02, 2010, 01:22:20 PM »
peachykeen Offline
Dragon Egg
*
Posts: 13



Alpha label (next to the project name):
http://sourceforge.net/projects/nwshader/
That label actually shows up on all the base SourceForge pages, including the download page.

Note on how the new method works (added yesterday at release-time, added onto today):
http://sourceforge.net/apps/mediawiki/nwshader/index.php?title=Installation

There's also a mention that the file will be changed and a warning to keep the backup safe in the install section of the readme.

Quote
I appreciate the deep and sincere dedication you have to improving the code of your tool in order to reduce problems. I really, really do. But you are letting a lot of other things slip through the cracks, things that are decidedly not code related. Those things can cause lots of problems, too. Those are the things that will make or break your project. As of this writing, you simply have not addressed these issues, not even at a bare minimum.
You keep mentioning this point and referring to the basics of how NWShader works. I've already said I'm updating the docs to add these warnings (which weren't an issue before the latest release, roughly 24 hours ago).
Past that, what are these things that are such a problem in your view?
I can't fix them unless you point to specifics (other than warning people to hang onto a backup file). In addition, the entire project is open source. If you feel so strongly that it is poorly done and needs fixing, then help fix it! Smiley

Edit: I've added a note to the Vault page. That means that the main download page clearly states the project is alpha and the readme, instructions, and Vault link (which sends you to the SF download page or wiki) all have notices.
I also noticed that you skipped over the potential fix I suggested in one of my posts, mentioning making a copy then modifying that. You point out flaws with the project, but have yet to discuss real solutions. I'd like to find a way to fix these issues, instead of just going over the fact they're there.
« Last Edit: May 02, 2010, 01:32:34 PM by peachykeen » Logged
 
Reply #23
« on: May 02, 2010, 05:30:44 PM »
Invisig0th
Guest

Well, you just got done claiming that you couldn't think of any possible additional way to notify people that you are changing the nwmain.exe file, even though you had literally mentioned nothing at all about any of this on the NWVault download page. I understand that you are frustrated, but I think we can also agree upon reflection that you had hardly exhausted all options.

In all seriousness, do you honestly not understand the value of putting important information like this on the NWVault download page? Or do you see some benefit to not posting that information? Do you not believe that some people would get very upset with you if you did not take reasonable steps to inform them that their critical game files will be altered by your tool? These things seem completely obvious and self-evident to me. 

Regardless, thank you very much for mentioning on the download page that the NWShader replaces the nwmain.exe file. That's definitely a step in the right direction. It will continue to puzzle me that you were reluctant to do this. That tells me that there's still a huge gap between what you consider necessary and important (as a programmer) and what your end users will consider necessary and important (as average NWN players, who may in fact not even be all that computer literate). Writing solid code is frequently the easiest part of a project -- it's dealing with the needs of the end users that is generally the most difficult. Based on this discussion, it's likely that this is going to continue to challenge you throughout this project. But at the end, I guarantee you that you will be glad you made that journey. It is astounding difficult for a programmer to see things from the point of view of an end user, but the most successful programmers are the ones who never stop trying to do so.

As for implementing alternative approaches -- when you upload a different solution, I'll be happy to give your tool another look. I've already taken time out of my schedule to give you exactly what you had asked for here -- detailed feedback, based on my considerable knowledge of the NWN community and past NWN projects. I'm under no obligation to solve fundamental design problems for you, but I promise you I will do my best to try to offer useful suggestions as development progresses.  You're clearly a smart guy and open to learning new things, so I have no doubt this project will be successful.
« Last Edit: May 02, 2010, 05:41:19 PM by Invisig0th » Logged
 
Reply #24
« on: May 02, 2010, 06:01:55 PM »
peachykeen Offline
Dragon Egg
*
Posts: 13



Well, you just got done claiming that you couldn't think of any possible additional way to notify people that you are changing the nwmain.exe file, even though you had literally mentioned nothing at all about any of this on the NWVault download page.-snip-
In all seriousness, do you honestly not understand the value of putting important information like this on the NWVault download page? -snip-
Actually, I'd just forgotten to add it to that page. Between being the documents-reading sort myself and knowing exactly what's going on here, I missed there. I'd like to have someone helping handle documentation, but so far I'm the only one on this (I did have some help with getting the wiki setup), so I have to keep track of everything and split my time. Especially around release times, I'm sure you can understand how that goes.

Quote
Regardless, thank you very much for mentioning on the download page that the NWShader replaces the nwmain.exe file. -snip- Based on this discussion, it's likely that this is going to continue to challenge you throughout this project. But at the end, I guarantee you that you will be glad you made that journey. It is astounding difficult for a programmer to see things from the point of view of an end user, but the most successful programmers are the ones who never stop trying to do so.
Not reluctant, just forgot to (the Vault page is mainly a link page, so it's the last one I update after the project pages). The whole reason I started this topic was to try and get in touch with more users, so I guess it's working (albeit in a somewhat different manner than I was going for Tongue).

Quote
As for implementing alternative approaches -- when you upload a different solution, I'll be happy to give your tool another look. I've already taken time out of my schedule to give you exactly what you had asked for here -- detailed feedback, based on my considerable knowledge of the NWN community and past NWN projects. I'm under no obligation to solve fundamental design problems for you, but I promise you I will do my best to try to offer useful suggestions as development progresses.  You're clearly a smart guy and open to learning new things, so I have no doubt this project will be successful.
Just to be clear, I'm not asking for you to solve the problems, just point out any you see that I miss and if an idea comes to you, let me know (if it's no trouble). Any outside views are helpful, and I'm trying to get as many as possible. You understand how programming goes, and those times when something looks so clearly like the best solution (but you missed something important). This particular way of hooking was one of those, it's wicked simple code-side and guaranteed to be stable. I didn't anticipate players having a complaint with the whole patching bit. :facepalm:
I've done some work on a new method, which looks like it might work, if the engine cooperates. It's a bit more unstable (more prone to infinite loops, in particular), but doesn't modify anything (just drop the files in). I'm going to have to try and get it working and iron out the new issues if I can.
Thanks for your offer of help. I'll let you know when/if I have a different way working. Smiley
Logged
 
Reply #25
« on: May 02, 2010, 07:03:44 PM »
Invisig0th
Guest

Sounds good. Will do.

If it turns out you can avoid replacing the main program executable, I think that will clearly be a better solution for lots of reasons.

Also, I probably shouldn't have used the word "reluctant" there, because overlooking something is very different than avoiding it. My apologies for the poor wording.
« Last Edit: May 02, 2010, 07:07:48 PM by Invisig0th » Logged
 
Reply #26
« on: May 03, 2010, 06:59:06 PM »
peachykeen Offline
Dragon Egg
*
Posts: 13



Aright. After trying a couple different way (preprocessor definitions for standard calls are a great thing, easy to change), I think I may have pinned down a working one. I also need to even out my hair to cover the missing spots... Tongue

I tried dropping an OpenGL32.dll into the NWN directory, which failed. NWN refuses to see the wglCreateContext from my DLL (creates the window and starts OpenGL in it). So you end up with a black screen. The function can be exactly the same as the Windows one, it still won't use it. I have absolutely no idea why, and a thorough run-through with IDA Pro (which I have loaded with the full debug symbols for the client, so it's the next best thing to having the source) couldn't tell me a thing. I had to scrap that. It was also prone to (easy to avoid) stack overflows and needed a huge number of dynamic functions (very time-consuming to code).

I was experimenting with other methods, and eventually took another look at NWN's import table. Now, it generally uses OpenGL, but for the mouse/keyboard, Direct Input is used. It just so happens that the Dinput.dll has 1 function imported. Only one, compared to the 80+ in OpenGL32.dll (over 170, when you consider Cg and GLEW, which NWShader needs). Not only that, but by dropping a DInput in, there's no chance of NWShader causing any infinite loops and it doesn't sit directly between the game and the drivers (better for a quick exit).

So, at this point, I have a solution that appears to work, and involves extracting a couple DLLs into your NWN folder.
No install, no hook, no patch, nothin' sketchy. You extract and play. Don't want it, delete them (or just rename them to test something).

The only similarity it has to the other method is using Detours to attach to a few functions in memory (NWShader tells Detours to hook them when the DLL starts, and whenever NWN calls a couple OpenGL functions, Detours sends them to NWShader and then on to the system). No files are modified, just a few DLLs added.

Not only that, but this method allows NWShader to completely detach itself at runtime (even a script could tell it to shut down) and I've already noticed better error prevention (a couple mistakes I made while coding were logged and NWShader removed itself, which honestly took me completely by surprise and was pretty awesome).

I can provide an example build if you want to see it in action, but (if this solution pans out to be as stable as the other), does that take care of your concerns? (both legal and file-wise)
« Last Edit: May 03, 2010, 07:00:56 PM by peachykeen » Logged
 
Reply #27
« on: May 04, 2010, 08:22:57 AM »
Tybae Offline
AME Whippinig Boy
Administrator
Platinum Dragon
*****
Devourer of Worlds, Lover of Kittens Posts: 2010



First off, Welcome to our forums.  It is nice to see new people popping in who aren't spam bots.  Wink

Second, the forums are not very active for a few reasons.  First being we are in the middle of a cycle and when we are judging work, playtesting, etc., we don't often get the time to post in the public forums.  Second being I have been out of the loop for the last month or so due to RL issues that will be over soon, so I'll be able to stoke the forum fires from time to time.

Third, as far as the EULA goes, each potential violation of Bioware's EULA lies solely with Bioware's legal team and we do not want them getting involved.  There's a reason the employees call Legal "The Sleeping Dragon".  Also, the EULA is a very touchy subject which can, and has, resulted in emotions running high.  While this has not happened in this thread, I just want to make sure that we continue to be civil to everyone (I know it seems obvious, but it needs to be said).  On a personal note, I really like the healthy conversation going on here and the fact that no one has taken anything personal up to this point. 

Also on a personal note, I really like the idea behind NWShader and wish you success. 
Logged

I live by the motto:  "Safety 3rd"
 
Reply #28
« on: May 13, 2010, 03:35:52 PM »
peachykeen Offline
Dragon Egg
*
Posts: 13



Thanks for the welcome. As far as EULA issues go, I think those have all been settled in the latest revisions. I'm testing a new version now with an install-free system, seems to be working fine. I added partial support for translations while doing that, so hopefully I can get this localized for all NWN's languages pretty soon. Between optimizing some things, I've also overhauled the material system, which makes for some nice looking screenshots and videos. Here's a brief example:
http://www.youtube.com/watch?v=8pC7IgFsti8

Testing is going on for the new version and I'll have a complete guide on how to update from all previous versions. Hopefully any future issues can be avoided, it looks like this solution is both stable and simple. I've done a bit to simplify things this time around, and will keep working on speed and simplicity with future updates.
Logged
 
Print  Pages 1 2 Go Up
« previous next »
Jump to: