SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: Zelenium on April 11, 2024, 05:41:23 PM

Title: Sniper range
Post by: Zelenium on April 11, 2024, 05:41:23 PM
Hey!
I decided to increase the range of the snipers, however I was unsuccessful.
The thing is that a standard sniper rifle can shoot at 300 meters. However, AI snipers use a maximum of 60-70 range and this is clearly exaggerated figures.
I wanted to fix this and did the following:

Lua:
SetMemoryPoolSize("Aimer", 999)
SetDefenderSnipeRange(200)
SetAttackerSnipeRange(200)


Weapon:
MinRange        = "32"
OptimalRange        = "100"
MaxRange        = "200"
LockOnRange        = "0.0"
LockTime         = "0.0"
LockOnAngle        = "1.0"


Ordnance:
LifeSpan         = "0.10"
Velocity         = "2000.0"


But really it doesn't work. Snipers don't even try to shoot from long range.
I think the AI has a limitation written in the executable file.
Probably it can be around 50 meters (maybe 48), but I don't rly know.

Is there someone who can help me with this question? Maybe I've made a mistake somewhere?
Title: Re: Sniper range
Post by: Zelenium on April 14, 2024, 01:29:46 PM
So, I found out that the limit is very close to the value of 60.
Also, there is no limit if AI shoots at vehicles
Title: Re: Sniper range
Post by: AnthonyBF2 on April 14, 2024, 11:53:12 PM
Quote from: Zelenium on April 14, 2024, 01:29:46 PMSo, I found out that the limit is very close to the value of 60.
Also, there is no limit if AI shoots at vehicles

I think there are other AI commands that need to exist in the Lua script.

Play around with these:

AISnipeSuitabilityDist(number) -found in the Jabba's Palace scripts with value 30
SetAIViewMultiplier(number) - found in Dagobah scripts with value 0.35
SetTeamAggressiveness(team, value) examples: rep, cis, imp, rep, or 1 and 2 to represent team 1 and team 2
Title: Re: Sniper range
Post by: Giftheck on April 15, 2024, 06:33:06 AM
Before I respond, I need to ask: is this question specifically for SWBF1, or was this for SWBF2 and you've put it in the wrong board?
Title: Re: Sniper range
Post by: Zelenium on April 15, 2024, 08:07:02 AM
Quote from: Giftheck on April 15, 2024, 06:33:06 AMBefore I respond, I need to ask: is this question specifically for SWBF1, or was this for SWBF2 and you've put it in the wrong board?

Yes, it's about Battlefront 1
I like the first game more

Quote from: AnthonyBF2 on April 14, 2024, 11:53:12 PMPlay around with these:

AISnipeSuitabilityDist(number) -found in the Jabba's Palace scripts with value 30
SetAIViewMultiplier(number) - found in Dagobah scripts with value 0.35
SetTeamAggressiveness(team, value) examples: rep, cis, imp, rep, or 1 and 2 to represent team 1 and team 2

Okay, thank you. Let's check:
AISnipeSuitabilityDist(number) - I have not found this command in the specified location (in the first game). Also, when added to my script, everything stopped working, indicating that this command is missing in the first Battlefront.
SetAIViewMultiplier(number) - The same result
SetTeamAggressiveness(team, value) - As far as I've noticed, the command doesn't affect the shooting range.

Moreover, commands
SetDefenderSnipeRange(1)
SetAttackerSnipeRange(1)

didn't give any results (what is rly weird).
I do my tests on the Bespin2 map

And one last important thing:
I think there must be something like INTEGER < 61 because bots shoot a little farther than 60.

Is there anyone here who has worked with the executable before? I would like to get your experience, if you don't mind.
I have some experience with executables, but I don't want to waste time learning what is already known.
I am interested in what areas have already been explored to shorten my search.
Title: Re: Sniper range
Post by: Giftheck on April 15, 2024, 08:14:11 AM
Most of those commands do not exist in SWBF1. The only one that does is SetTeamAggressiveness,.
Title: Re: Sniper range
Post by: Zelenium on April 16, 2024, 11:06:57 AM
Just in case, I'll post my findings in the executable here (maybe someone could use it someday)

001548eA - I changed the value from 60 to any other and players cannot reload on his own anymore on the R key
I think it is related to the area of memory that stores a weapon's current ammo value

0002990 - Number (60), which has something to do with map processing, because changing this number leads to crashing at the map loading stage

000A2174 and 000A2190 - Numbers (59) related to sounds. Changing them made all the game's sound disappear
Title: Re: Sniper range
Post by: Led on April 18, 2024, 04:49:36 AM
If you are using Cheat Engine, search the forum for the CheatEngine table for SWBF1.  You may find something there.
Title: Re: Sniper range
Post by: Zelenium on April 22, 2024, 01:51:25 PM
All right, I have done it.
It was really hard. The specific number (59) is nowhere to be found, it uses very strange formulas (that don't make sense, I checked).

All bots can now calmly fire at the maximum weapon firing distance. Eventually I'll create a topic where I'll collect my findings on the executable, so that everyone can choose what they need.
Current Instruction:
1. Using HexEditor, navigate to address "141D80"
2. Сhange the code from "D9 44 24 1C" to "D9 E8 90 90"
3. Enjoy snipers killing you through the entire map
EhPortal 1.34 © 2024, WebDev