Fallout 2 mod FO2 Engine Tweaks (Sfall)

If it works, that would be a fantastic feature. Continuum! Wild Qwerty! are you reading this? I think we should at least try before scrapping that feature: that is potentially the best one yet.
 
Timeslip said:
The ammo damage patch can easily be included, if someone gives me the offset I need to modify and what I need to replace it with.

The routine in the exe I modify starts at 004249EC and extends to 00424A61. But I only change code starting from 004249FC extending to 00424A57.

Timeslip, please forgive me but when I created this mod I had to teach myself basic assembly to accomplish it and so I understand how/what it is I am doing when I change something and save it into the existing exe. But I am not familiar with how you apply code through a dll to affect/change existing code in the exe.

I can provide you with assembly code of what I want to accomplish with my Ammo Mod but if you need something more then I may or may not be able to provide it. Plus I have what may seem like a dumb question but here it is:

When I modify the code in the exe I am limited to the amount of space/memory that cane be used, is this the same when you apply a change through a dll? (I think I know the answer but I still need to ask)
 
Dude101 said:
If it works, that would be a fantastic feature. Continuum! Wild Qwerty! are you reading this? I think we should at least try before scrapping that feature: that is potentially the best one yet.
I'm not sure how to create 16 bit frm (I don't even know about such possibility). There's an option in Frame Animator to select the palette (.pal or .act), but where I can find 16 bit color .pal file? :P

-------------EDIT
I'll try to save unique color table from the image as .pal or .act. and next convert the image to frm with custom palette.
 
Glovz said:
I can provide you with assembly code of what I want to accomplish with my Ammo Mod but if you need something more then I may or may not be able to provide it. Plus I have what may seem like a dumb question but here it is:

When I modify the code in the exe I am limited to the amount of space/memory that cane be used, is this the same when you apply a change through a dll? (I think I know the answer but I still need to ask)
The assembly is all I need. But no, you aren't limited in space like you are if you modify the exe directly, (I can just inject a jump instruction to jump into a longer piece of code stored in my dll,) so you can write something longer if you want.

Edit: Never mind, just noticed that it was included in the download in your sig. I'll include that patch in 1.17, but if you want to write something else with the extra space there's no reason why I can't include more than 1 option.

Continuum said:
I'm not sure how to create 16 bit frm (I don't even know about such possibility). There's an option in Frame Animator to select the palette (.pal or .act), but where I can find 16 bit color .pal file? :P
I don't know the frm file format, which is why I haven't tried myself. If it was possible, you wouldn't need a .pal file at all. The frm file format docs on TeamX don't list anything that look like they might support that, but there are a few unknown bytes which could potentially contain a 16 bit flags.

I'll see if I can find the frm loading code and see what it's doing.
 
Timeslip said:
I don't know the frm file format, which is why I haven't tried myself. If it was possible, you wouldn't need a .pal file at all. The frm file format docs on TeamX don't list anything that look like they might support that, but there are a few unknown bytes which could potentially contain a 16 bit flags.

I'll see if I can find the frm loading code and see what it's doing.
Yes, but you're converting images with tool(s) which are using palette(s). So, you must rewrite that tools to not do that, otherwise you'll always get 256 colors images after conversion. But from other hand my knowledge about that = 0 :P




In the meantime...

Top image - conversion to FO' palette

Bottom image - FRM created with custom palette (220 colors) and loaded into Frame Animator with that palette

snap046ig3.jpg



Image after saving the project to .fpr:

45566000000xn8.jpg
 
Continuum said:
Yes, but you're converting images with tool(s) which are using palette(s). So, you must rewrite that tools to not do that, otherwise you'll always get 256 colors images after conversion. But from other hand my knowledge about that = 0 :P
Good point. :oops:

Anyway, I found the drawing code used in 16 bit mode, and it draws each image in 8 bit to an 8 bit 640x480 image in memory, and then only converts that to 16 bit when it draws it to the screen. Since fallout can't draw the individual images in 16 bit, this whole idea is out. :(
 
@Timeslip

I will provide you with new assembly code, please do not use the version in my signature.

I use labels in my assembly to indicate where jumps should lead to, I assume you can understand what I mean and can handle it in the dll.

This new piece of assembly should fix any possible issues that have previous occured given I am not limited now.

Thanks so much for your help!
 
Glovz said:
@Timeslip
I will provide you with new assembly code, please do not use the version in my signature.
Lucky timing; I already had your old one included and working, and was about 30 minutes from releasing 1.17. :P

How long do you think you'll take? If it's not going to be done today I'll release 1.17 without your patch and include it in the next version whenever you finish. (I'm only in a rush because there's a bugfix in there for killap's expansion.)
 
It will be today, but I'm at work right now. So not for 7hrs yet. I anticipated your answer and wrote the new assembly code last night, but the file is on my computer at home. :(
 
@Timeslip

I was able to re-write the assembly code while at work :obsessed:

Please have this replace offset block 004249EC to 00424A61

Code:
bJmp:
MOV EDX,DWORD PTR DS:[ESI+4] ; start of damage loop
MOV EAX,DWORD PTR DS:[ESI]
MOV EBX,DWORD PTR SS:[ESP+18]
CALL fallout2.00478448
ADD EBX,EAX ; raw damage

SUB EBX,DWORD PTR SS:[ESP+28] ; damage minus threshold

TEST EBX,EBX ;
JLE SHORT nJmp ; no damage

MOV EAX,DWORD PTR SS:[ESP+20] ; assign value of difficulty setting
SUB EAX,DWORD PTR SS:[ESP+2C] ; subtract damage resistance adjustor from difficulty setting

TEST EAX,EAX ;
JLE SHORT nJmp ; no damage

IMUL EBX,EAX ; damage multiplied by new damage resistance adjustor
IMUL EBX,DWORD PTR SS:[ESP+24] ; damage multiplied by damage multiplier

MOV EAX,0C8 ;
TEST EBP,EBP ;
JLE SHORT dJmp ; negative or zero divisor

IMUL EAX,EBP ; damage divisor multiplied by two hundred

dJmp:
MOV DWORD PTR SS:[ESP+30],EAX ; assign new damage divisor value
MOV EDX,EBX ; 
MOV EAX,EBX ; 
SAR EDX,1F ;
IDIV DWORD PTR SS:[ESP+30] ; damage divided by the new damage divisor
MOV EBX,EAX ; assign new damage value

TEST EBP,EBP ;
JLE SHORT aJmp ; add damage

CMP DWORD PTR SS:[ESP+24],4 ;
JG SHORT aJmp ; add damage
SAR EAX,1 ; divide damage by two
CMP DWORD PTR SS:[ESP+24],4 ;
JE SHORT zJmp ; JHP ammo damage decrease of twenty-five percent
CMP EBP,2 ;
JNZ SHORT aJmp ; add damage
CMP DWORD PTR SS:[ESP+28],4 ;
JGE SHORT xJmp ; AP ammo damage increase of twenty-five percent
JL SHORT yJmp ; AP ammo damage decrease of twenty-five percent

xJmp:
IMUL EAX,3 ; multiple damage by three
ADD EBX,EAX ; add result to previous damage value
JMP SHORT aJmp ; add damage

yJmp:
ADD EBX,EAX ; add result to previous damage value
JMP SHORT aJmp ; add damage

zJmp:
CMP DWORD PTR SS:[ESP+28],4 ;
JL SHORT aJmp ; add damage
SAR EAX,1 ; divide damage by two
SUB EBX,EAX ; subtract result from previous damage value

aJmp:
ADD DWORD PTR DS:[EDI],EBX ; accumulate damage

nJmp:
MOV EAX,DWORD PTR SS:[ESP+1C] ; no damage
INC ECX
CMP ECX,EAX
JL SHORT bJmp ; loop back to beginning
 
Thanks. With that done, 1.17 is up. :)

>Added an option to use Glovz's AP ammo patch
>Added some upscaling filters (By Dream, from Fallout.ru)
>Fixed ForceEncounter preventing the encounter with horrigan if it was used to soon

I haven't removed the 16 bit modes yet, and the upscaling filters can only be used in DX9 mode. (i.e. graphics mode 4 or 5.)

Edit: On the too many items bug front, has anyone tried fixing it by using a script to set all holodisk global variables back to 0? I've never had the crash problem, but I only get the disappearing skilldex/timer buttons when I read every holodisk I can find.

Edit2: Sorry, didn't notice that holodisks had already been mentioned as a possible cause... It would still be worth resetting them, saving, exiting fallout and reloading to see if that fixes a game already hit by the vanishing interface button bug.

Edit3: A script that added all the holodisks I could find (15) to the pipboy didn't trigger the bug, so I guess there's something else involved too.
 
Hi all

2 Timeslip:
1. Upscale filters 1-4 not worked in 1.17
2. Why removed linear/anisotropic filters? look this
http://dream.maxdsl.ru/img/FalloutFilters.png
3. IMHO SafeWrite32...&LoadD3DHook not need. It work with LoadD3DHook2(); in SetCooperativeLevel . Without any "SafeWrite" plugin must work in any 640x480x8 game (tested on StarCraft)
 
Dream said:
1. Upscale filters 1-4 not worked in 1.17
They all work for me. Is anyone else having problems?

Edit: Actually, I see the problem. Looks like the black band at the bottom of scaled image was supposed to be there...

Edit2: No I don't. Those algorithms return 3 lines less then they should anyway, so shifting the image down shouldn't matter.

Edit3: Looks like filters 1-4 expect the input image to be 1 pixel bigger in each direction than half the size of the output, so it's reading out of bounds. Will fix in the next release.

Edit4: 1.17b is up. Should be fixed now.

Dream said:
2. Why removed linear/anisotropic filters? look this
http://dream.maxdsl.ru/img/FalloutFilters.png
Sorry, my mistake. I thought that textures used linear filters by default. I'll add a linear filter option next time. (anisotropic filters don't need to be included, because they're identical to linear for a 2d surface.)

Dream said:
3. IMHO SafeWrite32...&LoadD3DHook not need. It work with LoadD3DHook2(); in SetCooperativeLevel . Without any "SafeWrite" plugin must work in any 640x480x8 game (tested on StarCraft)
Placing the LoadD3DHook2 call in SetCooperativeLevel causes my copy of fallout to crash before the first movie. It's a weird error, (a memory allocation fails inside one of the later fallout initialization functions,) so I'm not surprised if it doesn't effect everyone. :|
 
Timeslip said:
They all work for me. Is anyone else having problems?
Crash on startup in 1.17, but works in 1.17b

Timeslip said:
Placing the LoadD3DHook2 call in SetCooperativeLevel causes my copy of fallout to crash before the first movie
Hmm... It work for me...
 
1.17c is up. The only change is that I've made the world map speed patch independent of the processor speed.
 
Isn't it possible to create a kind of a speed-calculator?
 
An up to date windows 9x version is finally up, for anyone who was waiting for it. Please could someone confirm that it does actually work on windows 9x before I throw away the older version?

Lexx said:
Isn't it possible to create a kind of a speed-calculator?
What for? 30 fps is 30 fps regardless of your processor speed.
 
Timeslip said:
What for? 30 fps is 30 fps regardless of your processor speed.

Well, I thought, that the travel speed is based upon the processor speed. So, if the processor speed is a valid number you could create a mathematical formula for calculating the worldmap travel speed. That was my small idea, that comes into my mind.
 
Back
Top