Creating animated sprite sheet for effects
Posted: 2025-06-29 06:39
Formula for how to generate animation sprite sheets for Battlefield 2 Engine by [R-DEV]Arab
Files:
https://www.mediafire.com/file/ct5fzgyk ... e.zip/file
You will need:
-BF2Editor Installed, and Effects folder loaded (Mod, Mod Manager…, Editor Content tab, select the ‘Effects’ checkbox.)
-Paint.net
-Notepad++
Place the e_dAmb_datboi.con and e_dAmb_datboi.tweak files in pr_edit/effects/ambient/DynamicFx/.
Place the anim_datboi.dds file in pr_edit/effects/textures/animated folder.
Basic calculation for Horizontal and Vertical sprite sheets:
Find the gif you want, use a website like EZ Gif Splitter to extract the frames.
Open each frame, use the magic wand tool to select the image and crop to selection. Then resize to 128x128, or 256x256 etc. 128 is good for optimization, 256 is for high-quality.
Make sure there are no spacing, i.e. use the magic wand tool to select the image and crop to selection. Save all.
Use a website like https://www.codeandweb.com/free-sprite-sheet-packer to pack it.
In 'Settings', select Horizontal/Vertical and apply a padding of 30 - if the sprite is 128x128. If the sprite is 256x256, increase padding to 60 and so forth.
Download the png, resize it as Width (Height x Number of Frames) x Height (128). Save as anim_(name).dds with DXT5 compression.
Horizontal, Vertical sprite sheet BF2Editor configuration:
So basically, it is divisible 2 frame size (pixel width x pixel height, cropped image with no spacing) x 30 px padding via sprite sheet packer then after generating, image is resized according to frames.
There will be a BF2Editor glitch where the animation breaks upon changing AnimationFrameCount values. Typing in the AnimationFrameHeight and Width again fixes it.
Make sure the .dds animated sprite sheet follows the power of 2 rule. If any texture sheet is not following this rule, or ends in an odd number, the BF2Editor/Game will crash when loading the files.
Height and Width can be both the same number or different, as long as it's power of 2. So 1x1, 2x2, 4x4, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512, 1024x1024, 2048x2048, 4096x4096, 8192x8192
Width Resize Value: 3 frames on the top means frame size x 3 = Width Resize Value
Height Resize Value: 2 rows of frames means frame size x 2 = Height Resize value
Basic calculation for Compact sprite sheets is same as above, but change 'Settings' to compact and different BF2Editor settings:
Compact sprite sheet BF2Editor configuration:
There doesn't appear yet a limit on how heavy or wide you can make the file size of the texture. You can alternatively link effects to each other to time them if you added an additional effect via ObjectTemplate.addTemplate line in .tweak and play with the following settings:
Which will allow you to, theoretically, play a movie
(untested, and would be a lot of work and a lot of sprite sheets but I think it's doable)
Files:
https://www.mediafire.com/file/ct5fzgyk ... e.zip/file
You will need:
-BF2Editor Installed, and Effects folder loaded (Mod, Mod Manager…, Editor Content tab, select the ‘Effects’ checkbox.)
-Paint.net
-Notepad++
Place the e_dAmb_datboi.con and e_dAmb_datboi.tweak files in pr_edit/effects/ambient/DynamicFx/.
Place the anim_datboi.dds file in pr_edit/effects/textures/animated folder.
Basic calculation for Horizontal and Vertical sprite sheets:
Find the gif you want, use a website like EZ Gif Splitter to extract the frames.
Open each frame, use the magic wand tool to select the image and crop to selection. Then resize to 128x128, or 256x256 etc. 128 is good for optimization, 256 is for high-quality.
Make sure there are no spacing, i.e. use the magic wand tool to select the image and crop to selection. Save all.
Use a website like https://www.codeandweb.com/free-sprite-sheet-packer to pack it.
In 'Settings', select Horizontal/Vertical and apply a padding of 30 - if the sprite is 128x128. If the sprite is 256x256, increase padding to 60 and so forth.
Download the png, resize it as Width (Height x Number of Frames) x Height (128). Save as anim_(name).dds with DXT5 compression.
Horizontal, Vertical sprite sheet BF2Editor configuration:
Code: Select all
AnimationFrameWidth: 128
rem First sprite dimension settings, allowing for 30 px top, sides, bottom.
Open Paint.net, use the selection icon to draw 128 from the top-left corner to the right.
AnimationFrameHeight: 128
rem First sprite dimension settings, allowing for 30 px top, sides, bottom.
Open Paint.net, use the selection icon to draw 128 from the top-left corner to the bottom.
AnimationFrameCount: 5
How many frames in total for the engine to count.
AnimationFrameCountX: 5
How many frames in each row.There will be a BF2Editor glitch where the animation breaks upon changing AnimationFrameCount values. Typing in the AnimationFrameHeight and Width again fixes it.
Make sure the .dds animated sprite sheet follows the power of 2 rule. If any texture sheet is not following this rule, or ends in an odd number, the BF2Editor/Game will crash when loading the files.
Height and Width can be both the same number or different, as long as it's power of 2. So 1x1, 2x2, 4x4, 16x16, 32x32, 64x64, 128x128, 256x256, 512x512, 1024x1024, 2048x2048, 4096x4096, 8192x8192
Width Resize Value: 3 frames on the top means frame size x 3 = Width Resize Value
Height Resize Value: 2 rows of frames means frame size x 2 = Height Resize value
Basic calculation for Compact sprite sheets is same as above, but change 'Settings' to compact and different BF2Editor settings:
Compact sprite sheet BF2Editor configuration:
Code: Select all
AnimationFrameWidth: 128
AnimationFrameHeight: 128
AnimationFrameCount: 5
AnimationFrameCountX: 3
Code: Select all
ObjectTemplate.timeToLive CRD_NONE/-1/0/0
ObjectTemplate.emitTime 4
ObjectTemplate.emitDelay 0
ObjectTemplate.animationSpeed 6
ObjectTemplate.animationPlayOnce 1