Aller au contenu

Photo

Idea: Game Engine Alteration: Weapon Visuals


  • Veuillez vous connecter pour répondre
40 réponses à ce sujet

#1
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 875 messages
I do not know if anyone out there has the skill to alter the NWN game engine in the way I'm thinking of (I certainly don't have the skill), but I thought I'd throw this out there as an idea someone might be able to implement someday.

Problem: The visual effects for weapons (such as flaming and dripping acid) are limited to the 7 existing types, with no ability to really add any new types.

Idea: Alter the game engine to actually USE iprp_visualfx.2da to determine the effects models used so custom content makers can add new effects.

Right now, iprp_visualfx.2da is mostly a reference for lines from dialog.tlk to name the property in the toolset.  It can also be modified slightly to add a "none" visual effect type (which seems to work by calling a non-existant/non-specified model in-game).

If the game engine/graphical displays were able to be modified to use an additional column from this file (example follows), it would allow builders/content makers to add brand new visuals instead of just replacing existing ones.  The game already uses different models, with the correct files picked based on the weapon type (base model names specified in baseitems.2da) and a suffix.

Example modification to iprp_visualfx.2da:
        Label       Name        ModelSuffix
0       Acid        83393       acid
1       Cold        83394       cold
2       Electrical  83395       elec
3       Fire        83396       fire
4       Sonic       83397       sonc
5       Holy        83398       holy
6       Evil        83399       evil
7       None        202         none
8       Shadow      16872207    shad
9       Psionic     16872208    psnc
10      FireGreen   16872209    fgrn
11      FireBlue    16872210    fblu
12      FireRed     16872211    fred
13      GlowBlue    16872212    gblu
14      GlowYellow  16872213    gyel

I have no idea if this would be possible.  I just figured with things like the camera modifications and NWShader floating around, there'd be a small chance this would work.  It's just too bad I didn't think of this back when NWN was still being patched by BioWare.

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
We lobbied heavily for bioware to do this before 1.69 went live. It would've been a simple enough change, but it requires a client hack, meaning a new patch. Perhaps with the client extender from ElgarL...

Funky

Modifié par FunkySwerve, 03 août 2011 - 03:25 .


#3
Greyfort

Greyfort
  • Members
  • 234 messages
Client extender??? from ElgarL could you go into more detail about that Funky if you have time?

Oh and shadow might be intrested in the idea for his 170patch Amth-dragon

Modifié par Greyfort, 03 août 2011 - 01:00 .


#4
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Shad is using ElgarL's work in the 'patch'. He hasn't tackled anything like exe edits, though, so far as I know.

Funky

#5
Calvinthesneak

Calvinthesneak
  • Members
  • 656 messages
Has anyone heard from Elgar since oh about Christmas. I was involved with it for a bit, but Elgar sorta dropped off face of the world.

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
@Gray Fort.

Most of the information about ElgarL's project come from:  Coming to a screen near you soon!

#7
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages
I wrote to ElgarL about an unrelated matter a few weeks ago and he indicated that he had moved on to modding Minecraft.   He will be missed and I hope he decides to come back to NWN.

In the mean time, I had decided to try out an idea I've been kicking around.  I'll state at the outset that it failed but maybe someone with more experience in hex editing knows where I might have gone wrong. 

Looking at the strings from NWMain.exe, I can see that while the suffixes for weapon vfx are hardcoded (_fxacid, _fxholy, etc.), iprp_visualfx (the .2da) is not.  My definition of hardcoded means the string for (whatever) is actually contained in the nwmain.exe (or nwtoolset.exe, etc.).  If it's not in the string dump, it's not hardcoded.  That's a little misleading but you get the idea.  For instance, the iprp_visualfx.2da isn't hardcoded by my definition but it is invoked in itempropdef.2da, whose loading is.

Anyway, thanks to AD's description it was really easy for me to understand the problem though, of course, it didn't work for me either.  So I figured I'd crack open a Hex editor.  I noticed the following:
Posted Image
The names of the suffixes that it looks for are a total of 8 bytes (A) unless the name runs long (B) in which case there are 4 bytes of padding between the suffix and the next entry.  My idea was, if I can shorten the long suffixes, I might be able to squeeze in one extra weapons vfx suffix to search for, like so (C):
Posted Image
If you look at the above you'll see I shortened _fxsonic to _fxsonc and a couple of others to get the extra space.  Unfortunately, it didn't pan out like I hoped and the edited executable displayed the weapon vfx fine until it came to my shortened entries and, starting at _fxsonc, wouldn't display any suffix after that point, though _fxneg and _fxholy worked because they came before the first of my edits.

Maybe something like that is possible but I was just doing it wrong?  One extra VFX is probably not going to rock the world but if the idea works, there are other things in the executable's strings I'd like to apply it to.

BTW,  I saw a modification either on the NWVault or on here where someone had edited the toolset.exe (I believe) to make the combo box window wider so viewing CEP appearance names was easier.  That sort of thing seems promising in lots of different ways- does anyone have  a link to that?  I forgot where it was posted/uploaded.

Modifié par OldTimeRadio, 03 août 2011 - 07:16 .


#8
virusman

virusman
  • Members
  • 282 messages

OldTimeRadio wrote...

I wrote to ElgarL about an unrelated matter a few weeks ago and he indicated that he had moved on to modding Minecraft.   He will be missed and I hope he decides to come back to NWN.

Could you ask him if he could at least release the sources for his modification? It'd be pity to see all this work lost. I or anyone else at NWNX could continue this work and merge with NWNCX.

In the mean time, I had decided to try out an idea I've been kicking around.  I'll state at the outset that it failed but maybe someone with more experience in hex editing knows where I might have gone wrong. 

Looking at the strings from NWMain.exe, I can see that while the suffixes for weapon vfx are hardcoded (_fxacid, _fxholy, etc.), iprp_visualfx (the .2da) is not.  My definition of hardcoded means the string for (whatever) is actually contained in the nwmain.exe (or nwtoolset.exe, etc.).  If it's not in the string dump, it's not hardcoded.  That's a little misleading but you get the idea.  For instance, the iprp_visualfx.2da isn't hardcoded by my definition but it is invoked in itempropdef.2da, whose loading is.

Anyway, thanks to AD's description it was really easy for me to understand the problem though, of course, it didn't work for me either.  So I figured I'd crack open a Hex editor.  I noticed the following:
Posted Image
The names of the suffixes that it looks for are a total of 8 bytes (A) unless the name runs long (B) in which case there are 4 bytes of padding between the suffix and the next entry.  My idea was, if I can shorten the long suffixes, I might be able to squeeze in one extra weapons vfx suffix to search for, like so (C):
Posted Image
If you look at the above you'll see I shortened _fxsonic to _fxsonc and a couple of others to get the extra space.  Unfortunately, it didn't pan out like I hoped and the edited executable displayed the weapon vfx fine until it came to my shortened entries and, starting at _fxsonc, wouldn't display any suffix after that point, though _fxneg and _fxholy worked because they came before the first of my edits.

Maybe something like that is possible but I was just doing it wrong?  One extra VFX is probably not going to rock the world but if the idea works, there are other things in the executable's strings I'd like to apply it to.

The location you found is data section. You can modify the text values, but you won't be able to add more effect types because it's controlled by code, where they're hardcoded to 7 types.
The code references these values by absolute address, that means you can't move them, only modify in-place.

BTW,  I saw a modification either on the NWVault or on here where
someone had edited the toolset.exe (I believe) to make the combo box
window wider so viewing CEP appearance names was easier.  That sort of
thing seems promising in lots of different ways- does anyone have  a
link to that?  I forgot where it was posted/uploaded.

http://www.nwnx.org/...opic.php?t=1798

Modifié par virusman, 03 août 2011 - 09:59 .


#9
virusman

virusman
  • Members
  • 282 messages
Done.
http://data.virusman...x/nwncx-0.1.rar
http://data.virusman..._tweaks-0.1.rar
(Visual C++ 2010 runtime is required)

Modifié par virusman, 03 août 2011 - 09:59 .


#10
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 875 messages

virusman wrote...

Done.
http://data.virusman...x/nwncx-0.1.rar
http://data.virusman..._tweaks-0.1.rar
(Visual C++ 2010 runtime is required)

Wow.  That was fast!  I'm going to test it out in a couple hours when I get some time. :D


Quick question before I get started:

Is this something each player needs to have installed on their computer (it is called a "client extender", after all), or can it just be run server-side (like other NWNX2 plugins)?

I know PCs would need the models, but that's something I could just load into a hak for them once I get this running.

#11
virusman

virusman
  • Members
  • 282 messages

The Amethyst Dragon wrote...

Quick question before I get started:

Is this something each player needs to have installed on their computer (it is called a "client extender", after all), or can it just be run server-side (like other NWNX2 plugins)?

This is a client plugin, so players will have to install NWNCX to see the visuals.

#12
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 875 messages
I'll have to play around with this some more. Can't seem to get the extender to work on my game (Windows Vista).

I've tried the loader version - pops up a blank little window titled "Cmd", then looks like it starts to load nwmain.exe, but doesn't.

Then tried the "patch" version - updated nwmain.exe just immediately crashes.

I'll take another crack at it tomorrow when I'm not tired, to see if there's something I've missed. And yes, I did download and install Visual C++ 2010 runtime before starting.

#13
virusman

virusman
  • Members
  • 282 messages
Try this version:
http://data.virusman...x/nwncx-0.2.rar

#14
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 875 messages
Version 0.2 didn't work for me either...right away.  Then I thought I might be having problems since my nwmain.exe had previously been altered adding a camera hak.  So, I backed it up and copied over a "fresh" copy from one of my other computers.

1) "loader version" - same result as before, except the delay was longer before it popped up the Cmd Line window thing, then shut down when I clicked Ok.

2) "patch version" - This one works for me. :wizard:  Of course, now I need to update my PW's hak file so that I can see the regular weapon visuals (since they now properly read from the 2da!).

Now, I'm off to do some more experimenting to see if there's anything that this breaks for me.  I'll let you know the results.

Thanks, virusman! 

#15
OldTimeRadio

OldTimeRadio
  • Members
  • 1 400 messages
Thank you very much for the explanation, Virusman!  Also, thanks for the additions to CX.  I wrote ElgarL a day or so ago, BTW.  I'll let you know if I hear back.  I gave this a try and had errors similar to Amethyst Dragon but in my case (I needed to reinstall the critical update to get a clean NWMain) but now it's complaining about me missing a jvm.dll.

I'm about 99% sure that has nothing to do with your stuff but probably either something from Remigus or Elven in the way of a Java plugin.  I'm going to try to clean up my installation a bit more because this would be an incredibly useful addition to the game!

Virusman, would this work for both servers and clients, as long as both had ther required plugins, etc?  To imagine something like this would be available in both single and multiplayer leaves my head spinning with possibilities.

#16
Shadooow

Shadooow
  • Members
  • 4 465 messages

The Amethyst Dragon wrote...

Version 0.2 didn't work for me either...right away.  Then I thought I might be having problems since my nwmain.exe had previously been altered adding a camera hak.  So, I backed it up and copied over a "fresh" copy from one of my other computers.

1) "loader version" - same result as before, except the delay was longer before it popped up the Cmd Line window thing, then shut down when I clicked Ok.

2) "patch version" - This one works for me. :wizard:  Of course, now I need to update my PW's hak file so that I can see the regular weapon visuals (since they now properly read from the 2da!).

Now, I'm off to do some more experimenting to see if there's anything that this breaks for me.  I'll let you know the results.

Thanks, virusman! 

Good work both of you. AD could you once you get this working send me new 2da? I would add it into my unofficial patch (except of those extra lines of course). So it will be compatible with this h2ck by default.:devil:

#17
Greyfort

Greyfort
  • Members
  • 234 messages
Q1: Is this for windows and linux
Q2:
NWNCX requires Visual C++ 2010 Runtime, download it here:
http://www.microsoft...ls.aspx?id=5555

-- Launch modes --

There are two options:
* Run a loader that launches nwmain with NWNCX attached (NWNCX_Loader.exe)
* Patch your nwmain.exe to attach NWNCX automatically when you run the game (nwncx_patch.exe)

there more detail with these instructions I've missed some ware Virusman?

edit: ADD

I forgot to mention, I have had a issue with service pack3 causing problems with nwn as anyone figured out or had simalar issue.  I ask because the visc++2010 needs SP3 for XP profesional ver 2002

Modifié par Greyfort, 05 août 2011 - 09:42 .


#18
virusman

virusman
  • Members
  • 282 messages
NWNCX is Windows only.
NWNCX is a client extender, it will work for both multiplayer and single-player modes. It does not require the server to run NWNX.

OldTimeRadio wrote...

I gave this a try and had errors similar to Amethyst Dragon but in my case (I needed to reinstall the critical update to get a clean NWMain) but now it's complaining about me missing a jvm.dll.

I'm about 99% sure that has nothing to do with your stuff but probably either something from Remigus or Elven in the way of a Java plugin. I'm going to try to clean up my installation a bit more because this would be an incredibly useful addition to the game!

Copy only the plugins you really need into your nwn folder. Most likely, you've copied NWNCX->NWNX Bridge plugin, and one of your NWNX plugins requires Java. Delete NWNX Bridge plugin unless you really need NWNX in single-player mode.

Modifié par virusman, 05 août 2011 - 10:51 .


#19
virusman

virusman
  • Members
  • 282 messages

Greyfort wrote...

I forgot to mention, I have had a issue with service pack3 causing problems with nwn as anyone figured out or had simalar issue.  I ask because the visc++2010 needs SP3 for XP profesional ver 2002

If you can't install VC++2010 redist, drop this dll into the nwn folder:
http://data.virusman...cx/msvcr100.rar

Modifié par virusman, 05 août 2011 - 10:55 .


#20
Greyfort

Greyfort
  • Members
  • 234 messages
I'm getting errors, I press f9 and I see the area splash loading screen then I get...
Neverwinter Nights has encountered a problem and needs to close. We are sorry for the inconvenience.
error signature:
AppName: nwmain.exe     AppVer: 1.6.9.0     ModName: unknown
ModVer: 0.0.0.0     Offset: 5f290001

my nwnx.ini:
; NWNX2 configuration file
; These are the default values for NWNX2. Values specified on the command
; line take precedence "Genesis IIServer" "houndsilver_v11a105" "AO_saveLOCv13" "module_zero_forgev106".
; "pw_cust_v101" "pw_cust_v200" "Coin Test (No CEP)v6" note "houndsilver_v11a106" is hakreq


[NWNX]
ServerPort = 5121
ModuleName = "AO_saveLOCv13_starwars"
WatchdogProcess = yes
UpdateIntervalProcess = 5
WatchdogGamespy = no
UpdateIntervalGamespy = 20
GamespyRetries = 5
OldGamespyProtocol = no
RestartDelay = 5

[ODBC2]
; Log file
MaxLogSize = 512 ; in KByte
LogLevel = 2 ; 0=nothing, 1=only errors, 2=everything

; Use these two settings for the SQLite internal database
source = sqlite
file   = sqlite.db

; Use these two settings for ODBC connections
;source = odbc
;dsn    = pwdata

; Use these five settings for MySQL connections
;source = mysql
;server = localhost
;user   = nwn
;pwd    = nwn
;db     = nwn

; Set hookscorco to false if you want to disable hooking of
; StoreCampaignObject and RetrieveCampaignObject entirely
hookscorco = true

[PROFILER]
MaxLogSize = 512 ; in KByte
LogLevel = 1 ; 1=overall statistics, 2=full script callstack

[FUNCS]
;Number_of_Skills, the amount of skills from skills.2da (last row+1)
Number_of_Skills=28

;debugLevel: 1 should only show basic information, 2 should include errors and 3 should log pretty much everything
debugLevel=3

;Set this to 1 to use the CustomTrapGeometry functions
HOOK_CustomTrapGeometry=1

[TMI]
Unlimited=0
Limitlevel=4

[FIXES]
;copy_vars = 0            ; Copy local variables on stack split and on store transaction,
                         ; fire OnDisturbed when you merge a stack from a placeable
;compare_vars = 0         ; If set to 1, items with different local vars don't stack
;keep_hidden_in_conversation = 0 ; If set to 1, creatures don't unhide when they start a conversation
;hp_limit = -127           ; Negative HP limit - values up to -127 are allowed

;hide_charlist_all = 0            ; Hide the whole online characters list on login (appears empty)
;hide_charlist_levels = 0         ; Hide the class(es) (displays nothing instead of class list)
;hide_charlist_portraits = 0      ; Hide the portrait (shows default male/female portrait)
;hide_charlist_dms = 0            ; Should be self-explanatory
;cap_ability_inc = 12
;cap_atkbonus_inc = 20
;cap_skill_inc = 50
;cap_ability_dec = 30
;cap_atkbonus_dec = 60
;cap_skill_dec = 50
;portalcrash = 1
;spelluses_fix = 1
;healkit_poison = 1
;healkit_disease = 1

;Paste these inte NWNX.ini and configure as desired
;1 = no, 0 = off
;all hooks are disabled by default

[EVENTS]
event_script=nwnx_events
log=1
DownloadCharacter=0
PickPocket=0
Attack=0
ExamineItem=0
ExamineCreature=0
ExaminePlaceable=0
ExamineDoor=0
ToggleMode=0
StealthMode=0
DevastatingCritical=0
UnPolymorph=0
TrapTrigger=0
EndDialog=0
RemoveSanctuary=0


Another thing I noticed is its not launching nwnx or server as usual, and I took out the network bridge and it runs but not in dm client :(

Modifié par Greyfort, 06 août 2011 - 06:55 .


#21
virusman

virusman
  • Members
  • 282 messages
NWNCX (client extender) is completely separate from NWNX (server extender). It has its own plugins and config, so nwnx.ini (server config) is useless here.
Post the contents of logs/nwncx.txt and logs/nwncx_tweaks.txt here.

#22
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 875 messages
Thanks again for the work on this, virusman!  I've been playing around with it, and right after I got it working, I put it to use. :)

New (Additional) Weapon Visual Effects (VFX) - a topic in the custom content forum (with screenshots!)

Wonderful, wonderful opportunity for this game.  Between NWNCX and NWNX (and NWNTX), not to mention module and content makers out there, I still see years of growth and development for our little hobby.

#23
Greyfort

Greyfort
  • Members
  • 234 messages
nwncx log:
NWN Client Extender 0.2
© 2008-2011 by virusman
* Loading plugins...
* Loading nwncx_disablems.dll...
nwncx_disablems.dll: Doesn't implement the plugin interface
* Loading nwncx_dmtest.dll...
nwncx_dmtest.dll: Doesn't implement the plugin interface
* Loading nwncx_nwnxbridge.dll...
nwncx_nwnxbridge.dll: Doesn't implement the plugin interface
* Loading nwncx_tweaks.dll...
nwncx_tweaks.dll: Doesn't implement the plugin interface
* NWNCX activated.

nwncx_tweaks:

NWN Client Extender 0.1 - Tweaks plugin
© 2011 by virusman
CNWCItem::LoadVisualEffect hook: 0
Hooked successfully

Forgive the delay there are the logs you asked for virus

#24
virusman

virusman
  • Members
  • 282 messages
Delete nwncx_nwnxbridge.dll.

#25
Greyfort

Greyfort
  • Members
  • 234 messages
Im not getting the dm client... it works like standard, cameras angles alterd though.

nwncx log
NWN Client Extender 0.2
© 2008-2011 by virusman
* Loading plugins...
* Loading nwncx_disablems.dll...
nwncx_disablems.dll: Doesn't implement the plugin interface
* Loading nwncx_dmtest.dll...
nwncx_dmtest.dll: Doesn't implement the plugin interface
* Loading nwncx_tweaks.dll...
nwncx_tweaks.dll: Doesn't implement the plugin interface
* NWNCX activated.

nwncx_tweaks log

NWN Client Extender 0.1 - Tweaks plugin
© 2011 by virusman
CNWCItem::LoadVisualEffect hook: 0
Hooked successfully
CNWCItem__LoadVisualEffect_Hook: 6
sFxName: WSwDg_fxneg
CNWCItem__LoadVisualEffect_Hook: 6
sFxName: WSwDg_fxneg
CNWCItem__LoadVisualEffect_Hook: 3
sFxName: WSwRp_fxfire

Modifié par Greyfort, 07 août 2011 - 06:25 .