dbc17 hacks: fearsome tweak v1.51

thanks Plotinus, it seems windows10 doesnt like it, i've read it happens. If you want to do another test, i can upload a DLL made by another modder, so i can check
if i made a mistake.
I'm happy to give it a go. Have you thought about contacting Big Ant to see if they would let you develop an official mod? I don't know if they have an sdk that would make your life easier. The changes that you've introduced to both DBC14 and DBC17 have been indispensable for me...I never run either without your hack running in the background.
 
uploaded the new test (dbc14hook3).
USAGE:
It's not difficult, just follow the instructions. There are 3 files in the zip.

open dbc14hook3.exe
Run the game.
open extremeinjector.exe, click on "add DLL" and select the file d3dprologger.dll.

Go now in the top menu where it says "Process name" and click on "Select". Find "cricket14.exe" list and select it.
Go back and click on "Inject". Check now on the game screen if it's drawing the menu (2 grey windows).

If it's not drawing, go to my program and press START, then select "prevent dbc14 drawing". Now check if the menu has appeared.
 
I'm happy to give it a go. Have you thought about contacting Big Ant to see if they would let you develop an official mod? I don't know if they have an sdk that would make your life easier. The changes that you've introduced to both DBC14 and DBC17 have been indispensable for me...I never run either without your hack running in the background.

i have talked with them a couple of times, they said that they appreciated the mod. Actually there was a discussion to introduce the bat pad with a mod, but in the end
they added themselves, probably because console players couldnt have used then. They feared @blockerdave's wrath.
 
uploaded the new test (dbc14hook3).
USAGE:
It's not difficult, just follow the instructions. There are 3 files in the zip.

open dbc14hook3.exe
Run the game.
open extremeinjector.exe, click on "add DLL" and select the file d3dprologger.dll.

Go now in the top menu where it says "Process name" and click on "Select". Find "cricket14.exe" list and select it.
Go back and click on "Inject". Check now on the game screen if it's drawing the menu (2 grey windows).

If it's not drawing, go to my program and press START, then select "prevent dbc14 drawing". Now check if the menu has appeared.
Well as soon as i clicked on inject after the selection of dll and cricket14.exe the game crashed to desktop. It generated a error note in the extracted folder saying 'Failed to find Windows7 D3d VTable'.
 
Well as soon as i clicked on inject after the selection of dll and cricket14.exe the game crashed to desktop. It generated a error note in the extracted folder saying 'Failed to find Windows7 D3d VTable'.

my bad, it seems that the dll is for win7. Thanks for trying tough. Can you tell me if the mod program worked? (when you click "prevent dbc14 drawing).

Maybe i'll do one more test later, this time on dbc17. I have tested a dll and it draws correctly on the screen, but i'm curious to see if it works on win10.
 
my bad, it seems that the dll is for win7. Thanks for trying tough. Can you tell me if the mod program worked? (when you click "prevent dbc14 drawing).

Maybe i'll do one more test later, this time on dbc17. I have tested a dll and it draws correctly on the screen, but i'm curious to see if it works on win10.
Yes the mod program did work i.e. when clicked on start in the game menu by checking on that prevent thing it didn't crashed.
 
Franco great that you are still active and doing your thing. I am lurking from afar, still without a gaming PC, and not sure when that situation will change, but I can't wait to get my hands on DBC again.

great to hear from you mate, i'm still doing some work on the game.
If you are intersted, I was just uploading a couple of the decompiled Lua files used by the game, these are two of the main controllers of the player mentality.
It's not explained how they works, but it gives a general idea of what's happening. I remember you wanted to see how things work for the mentality, so just
download the file scripts.zip and open the files with Word.
 
Hey @francobaldo1, kind of a random request out of nowhere but have you ever come across where the physics for the stumps are calculated? It's a tiny bit weird how the stumps always fly out pretty much every time they are hit, even off the slowest of spinners, and would be great if this could be tweaked to only very rarely happen for balls under ~85mph.

Fantastic work as always. Cheers! :cheers
 
-added Lua console tools (link in the first post)

this is a powerful tool, there are Lua consoles for dbc14 and dbc17. Most of the relevant gameplay code is based in Lua, so this allow a lot of customization.
I wanted to post more today, but i have a little cold so cant work a lot.

Here is how to use. Load dbc14 or dbc17 and open the correct console. Then press START. Now you can type your code in the window, then
click EXECUTE to run it.

Here is some code that you can test (i think it works both for dbc14 and dbc17)

//this will make the HUD disappear. Change "return false" to "return true" to restore it.
//I suggest to use it when you are in game.
function _G._CLASSES.Universe.getHudRenderEnabled(mytable)

return false

end

//this will create an edge/lbw chance for every ball.
//First we save the original function so we can restore it

xyzzy=getfenv(_G.import)
xyzzy=xyzzy.REGISTERED["ai.batting.striking_ai"]

oldfunction=xyzzy.striking_ai_phases.edgehelper.edgetuneable.getShouldEdgeBall

//now we change the original Lua script with our script, we simply make the script getShouldEdgeBall()
//return true everytime
xyzzy=getfenv(_G.import)

xyzzy=xyzzy.REGISTERED["ai.batting.striking_ai"]

function xyzzy.striking_ai_phases.edgehelper.edgetuneable.getShouldEdgeBall()

return true
end


//to restore the original function, just use

xyzzy.striking_ai_phases.edgehelper.edgetuneable.getShouldEdgeBall=oldfunction
 
Last edited:
Nice stuff, I managed to get both of the scripts working!

Is there a way you can recommend to look through the game's Lua code so we can see what sort of stuff we should be playing around with?

Edit: Hmm having played around some more I don't seem to be able to get the edge script to work again. The Hud script works perfectly every time but the edge script either seems to have no effect or will crash the game.
 
Last edited:
Nice stuff, I managed to get both of the scripts working!

Is there a way you can recommend to look through the game's Lua code so we can see what sort of stuff we should be playing around with?

Edit: Hmm having played around some more I don't seem to be able to get the edge script to work again. The Hud script works perfectly every time but the edge script either seems to have no effect or will crash the game.

EDIT: there was an error, to save the old function, use
xyzzy=getfenv(_G.import)
xyzzy=xyzzy.REGISTERED["ai.batting.striking_ai"]
oldfunction=xyzzy.striking_ai_phases.edgehelper.edgetuneable.getShouldEdgeBall

there are a couple of small problems when loading the script, sometimes it doesnt like the way the code is written and it causes to crash. For
example i couldnt use a negative number at the start of the string, like:
a=-5

instead i had to use "a=0-5". Another example: i cannot use "a=0.05", but i have to use "a=1/20", and some other things.

So, if it crashes, it can be one of these problems, or an error in the code.

in dbc17 i think the edge script works if it's possible in the current situation. To test it, restart the game and use only in this code:

xyzzy=getfenv(_G.import)

xyzzy=xyzzy.REGISTERED["ai.batting.striking_ai"]

function xyzzy.striking_ai_phases.edgehelper.edgetuneable.getShouldEdgeBall()

return true
end

Later i will post some code that allows to "search" the Lua environment, there are some variables that control the stump collision physics, if you are interested.
 
Last edited:
@Spoobir the main ways to explore Lua are:
-download wouldy's blobset creator, open the blobset and search the lua files.
-use this script in the Lua console, it shows the content of a Lua table, in this case it's the game
main environment. It will generate a txt file (state_dump.txt) of 4.5mb in the game folder. You will need a lot of time to read
that.

xyzzy=getfenv(_G.import)

local dump = io.open("state_dump.txt","w")
local aprased = {}

function tab_find_exists(tab,data)
for k,v in pairs(tab) do
if v == data then
return true
end
end
return false
end

function dump_table(fi,tab,depth)
table.insert(aprased,tab)
for k,v in pairs(tab) do
if type(v) == "table" and not tab_find_exists(aprased,v) then
for i=1,depth,1 do
fi:write(" ")
end
fi:write(tostring(k),":\n")
dump_table( fi, v, depth+1 )
else
for i=1,depth,1 do
fi:write(" ")
end
fi:write( tostring(k)," = ",tostring(v),"\n" );
end
end
fi:write("\n")
fi:flush()
end

aprased["test"]=true
dump_table( dump ,xyzzy,0 )
dump:flush()
dump:close()
 
Last edited:
That script seems to crash my game every time.

Anyway I had a quick look through the blobset after extracting and the only thing I could find that seemed even remotely promising was in:data-0.blobset\cricket17\script-game\game\physics\physicsfactory.lua

with the line:

setEnabledeactivatebailRestitutionbailMassbailLengthbailRadiusbailMiddleHeightcreateBail bailModelstumpRestitutionstumpMassstumpRadiusstumpBurialDepthstumpHeightAboveGroundposcreateStump

I'm pretty much a complete layman about this sort of stuff so if anyone else who is more knowledgeable is able to take and look around this file that would be great.
 
That script seems to crash my game every time.

Anyway I had a quick look through the blobset after extracting and the only thing I could find that seemed even remotely promising was in:data-0.blobset\cricket17\script-game\game\physics\physicsfactory.lua

with the line:

setEnabledeactivatebailRestitutionbailMassbailLengthbailRadiusbailMiddleHeightcreateBail bailModelstumpRestitutionstumpMassstumpRadiusstumpBurialDepthstumpHeightAboveGroundposcreateStump

I'm pretty much a complete layman about this sort of stuff so if anyone else who is more knowledgeable is able to take and look around this file that would be great.

what windows do you have?
it's working for me, anyway i edited the code in the previous post, it should avoid a possible bug. However i will upload the state_dump.txt so you can check.
I will also write a guide about the Lua files in the next days, if anyone is interested.

If you want to do another test: there are 3 variables used by the AI to select a front foot, back foot or advance shot.
FrontFootShotConnectionOffset = 0.65
BackFootShotConnectionOffset = -0.25
AdvanceShotConnectionOffset = 2.25

to change one of them type this (it will set the frontfoot to -0.30, it's written in this way to avoid the various loading bugs):

myvalue=0-(30/100)

xyzzy=getfenv(_G.import)
xyzzy=xyzzy.REGISTERED["ai.batting.striking_ai"]
xyzzy.striking_ai_phases["FrontFootShotConnectionOffset"]=myvalue

This will make the batsmen select the backfoot more often
 
what windows do you have?
it's working for me, anyway i edited the code in the previous post, it should avoid a possible bug. However i will upload the state_dump.txt so you can check.
I will also write a guide about the Lua files in the next days, if anyone is interested.

If you want to do another test: there are 3 variables used by the AI to select a front foot, back foot or advance shot.
FrontFootShotConnectionOffset = 0.65
BackFootShotConnectionOffset = -0.25
AdvanceShotConnectionOffset = 2.25

to change one of them type this (it will set the frontfoot to -0.30, it's written in this way to avoid the various loading bugs):

myvalue=0-(30/100)

xyzzy=getfenv(_G.import)
xyzzy=xyzzy.REGISTERED["ai.batting.striking_ai"]
xyzzy.striking_ai_phases["FrontFootShotConnectionOffset"]=myvalue

This will make the batsmen select the backfoot more often

I'm using Windows 10 64 bit. Still seems to crash every time for the dump script

That shot selection code is working for me however, I managed to get the AI so confused by changing the numbers to something extreme that they won't even play a shot! :lol
 

Users who are viewing this thread

Top