Files
fallout2-ce/SFALL_COMPATIBILITY.md

15 KiB

Sfall Compatibility

This document tracks Fallout 2 CE compatibility with sfall. This is for modders who need to know which Sfall features work in CE.

For now, this covers opcodes/metarules, and hooks. In the future, it will include other ways of modifying the engine (like ini files), and other Sfall-specific behaviour.

HRP EDG Scroll-Blocker Support

CE supports the .edg file format from the HRP (High Resolution Patch), which defines per-map scroll boundaries and square-level render clipping.

How it works in CE:

  • On map load, maps/<mapname>.edg is read if present. Missing file = silent fallback to the scroll-blocker object system.
  • The .edg file defines per-elevation rectangle boundary zones. Multiple chained zones per elevation are supported.
  • When loaded, these zones are used for both scroll blocking and visible area clipping (black bars), replacing both vanilla scroll blocking and CE hi-res stencil system.
  • v2 EDG files also contain a SquareRect that defines "Angled edges", or square-grid stencil. This is also supported.

Settings (ddraw.ini → fallout2.cfg / game.cfg)

Settings previously read from ddraw.ini have been moved into standard CE config files.

Most settings that control game behavior (premade characters, extra message files, combat tweaks, worldmap, etc.) have been moved into <DAT>/config/game.cfg, which is a content-mod config file intended to be overridden by mods. See that file for the full list with descriptions.

The following settings were moved into fallout2.cfg instead:

ddraw.ini section ddraw.ini key fallout2.cfg section fallout2.cfg key
Misc SkipOpeningMovies ui skip_opening_movies
Misc DisplayKarmaChanges ui display_karma_changes
Misc DisplayBonusDamage ui display_bonus_damage
Misc NumbersInDialogue ui numbers_in_dialogue
Misc AutoQuickSave ui auto_quick_save
Main EnableHighResolutionStencil ui enable_high_resolution_stencil
Misc ConsoleOutputPath debug console_output_path
Misc GaplessMusic sound gapless_music
Misc ScreenshotsFormat system screenshots_format
Misc UseWalkDistance qol use_walk_distance
Misc AutoOpenDoors qol auto_open_doors

The following settings were moved into <DAT>/config/game.cfg:

ddraw.ini section ddraw.ini key game.cfg section game.cfg key
Misc StartingMap start map
Misc StartXPos start worldmap_x
Misc StartYPos start worldmap_y
Misc ViewXPos start worldmap_view_x
Misc ViewYPos start worldmap_view_y
Misc StartGDialogFix dialog start_gdialog_fix
Misc DisableSpecialMapIDs maps disable_special_map_ids

Opcodes / Metarules

See https://sfall-team.github.io/sfall/ for documentation on specific functions.

Group Opcodes In Group Compatibility Notes
Direct memory access read_byte,short,int,string
write_byte,short,int,string
call_offset_vX
🚫 Not possible. Open an issue if you need functionality not covered by other opcodes.
Stats get/set_pc_base_stat
get/set_pc_extra_stat
get/set_critter_base_stat
get/set_critter_extra_stat
CE uses engine stat helpers here instead of sfall's direct proto-field behavior, so derived-stat update behavior can differ.
Stats / Alter min/max get/set_stat_min/max
set_pc_stat_min/max
set_npc_stat_min/max
not implemented -
Skills get/set_critter_skill_points
get/set_available_skill_points
set_skill_max
set_critter_skill_mod
set_base_skill_mod
mod_skill_points_per_level
not implemented -
Graphics graphics_funcs_available
force_graphics_refresh
get_screen_width
get_screen_height
set_palette
implemented: only get_screen_width, get_screen_height -
Shaders load_shader
free_shader
activate_shader
deactivate_shader
set/get_shader_*
🚫 likely will not implement direct compatibility
Perks and traits set_perk_image
set_perk_*
set_pyromaniac_mod
apply_heaveho_fix
set_swiftlearner_mod
has/set_fake_perk
has/set_fake_trait
set_selectable_perk
set_perkbox_title
show/hide_real_perks
perk_add_mode
clear_selectable_perks
add/remove_trait
seq_perk_freq
not implemented -
Virtual file system fs_create
fs_copy
fs_find
fs_read/write_*
fs_delete
fs_size
fs_pos
fs_seek
fs_resize
🚫 Open an issue if you have a use case for these
Combat / Knockback set_weapon_knockback
set_target_knockback
set_attacker_knockback
remove_weapon_knockback
remove_target_knockback
remove_attacker_knockback
not implemented -
Maps and encounters in_world_map
force_encounter{_with_flags}
set_map_time_multi
get/set_map_enter_position
exec_map_update_scripts
get/set_terrain_name
set_town_title
get/set_can_rest_on_map
set_rest_heal_time
set_rest_mode
set_worldmap_heal_time
implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi, get_terrain_name, set_terrain_name -
Maps and encounters / Worldmap get_world_map_x/y_pos
set_world_map_pos
-
Audio play_sfall_sound
stop_sfall_sound
play_sfall_sound currently supports .acm, .wav, .ogg formats, and can load from .dat archives. .mp3 is not yet supported.
Combat / Weapons and ammo get/set_weapon_ammo_pid
get/set_weapon_ammo_count
-
Sfall / Version sfall_ver_major
sfall_ver_minor
sfall_ver_build
CE currently reports 4.3.4
Utility / Math log, exponent, round, sqrt, abs, sin, cos, tan, arctan, ceil, ^, floor2, div -
Keyboard and mouse key_pressed
tap_key
get_mouse_x/y
get_mouse_buttons
-
Lists list_begin
list_next
list_end
list_as_array
party_member_list
-
Explosions set_attack_explosion_pattern
set_attack_explosion_art
set_attack_explosion_radius
set_attack_is_explosion_fire
set_explosion_radius
set_dynamite_damage
set_plastic_damage
get_explosion_damage
set_explosion_max_targets
item_make_explosive
except item_make_explosive -
Animations reg_anim_combat_check
reg_anim_destroy
reg_anim_animate_and_hide
reg_anim_light
reg_anim_change_fid
reg_anim_take_out
reg_anim_turn_towards
reg_anim_callback
reg_anim_animate_and_move
except reg_anim_callback -
Art and appearance art_exists
art_frame_data
refresh_pc_art
art_cache_clear
-
Tiles and paths get_tile_fid
tile_under_cursor
tile_light
tile_get_objs
tile_refresh_display
obj_blocking_tile
tile_by_position
get_tile_ground_fid
get_tile_roof_fid
obj_blocking_line
path_find_to
objects_in_radius
-
Utility sprintf
typeof
atoi
atof
-
Utility / Strings string_split
substr
strlen
charcode
get_string_pointer
string_find
string_find_from
string_format
string_format_array
string_replace
string_to_case
string_compare
get_string_pointer is deprecated and intentionally omitted.
Interface / Tags show_iface_tag
hide_iface_tag
is_iface_tag_active
set_iface_tag_text
add_iface_tag
Legacy BoxBarCount, BoxBarColors ddraw.ini settings not supported.
Global variables set_sfall_global
get_sfall_global_int
get_sfall_global_float
except get_sfall_global_float Current CE storage is int-backed; set_sfall_global stores integer values
Hooks / Hook functions init_hook
get_sfall_arg
get_sfall_args
get_sfall_arg_at
set_sfall_return
set_sfall_arg
register_hook
register_hook_proc
register_hook_proc_spec
See below for implemented hooks. init_hook is deprecated and will not be implemented. register_hook_proc and register_hook_proc_spec both add hooks to the end of the hook list, instead of beginning and end, respectively.
Arrays / Array functions create_array
temp_array
fix_array
get/set_array
resize_array
free_array
scan_array
len_array
save/load_array
array_key
arrayexpr
-
Perks and traits / NPC perks set_fake_perk_npc
set_fake_trait_npc
set_selectable_perk_npc
has_fake_perk_npc
has_fake_trait_npc
not implemented -
Global scripts / Global script functions set_global_script_repeat
set_global_script_type
available_global_script_types
except available_global_script_types -
Combat attack_is_aimed
block_combat
force_aimed_shots
disable_aimed_shots
get_attack_type
get/set_bodypart_hit_modifier
combat_data
get/set/reset_critical_table
get_last_target
get_last_attacker
set_critter_burst_disable
get/set_critter_current_ap
set_spray_settings
get/set_combat_free_move
except block_combat, force_aimed_shots, disable_aimed_shots, get_last_target, get_last_attacker, set_spray_settings -
Car set_car_current_town
car_gas_amount
set_car_intface_art
implemented: all except set_car_intface_art -
Interface / Windows and images interface_art_draw
interface_print
draw_image{_scaled}
get_window_under_mouse
create_win
get_window_attribute
message_box
set_window_flag
win_fill_color
interface_overlay
dialog_message
get_text_width
hide_window
show_window
create_message_window
except interface_print, interface_overlay -
Interface / Outline outlined_object
get_outline
set_outline
-
Interface / Main interface intface_is_hidden
intface_redraw
intface_hide
intface_show
set_quest_failure_value
implemented: only intface_redraw intface_redraw only supports the zero-argument form; the optional-argument path is explicitly unimplemented.
Interface / Inventory display_stats
inventory_redraw
critter_inven_obj2
get_current_inven_size
item_weight
except get_current_inven_size -
Interface / Cursor get/set_cursor_mode -
Locks lock_is_jammed
unjam_lock
set_unjam_locks_time
not implemented -
INI settings get_ini_setting
get_ini_string
get_ini_section
get_ini_sections
get_ini_config
get_ini_config_db
set_ini_setting
modified_ini is intentionally omitted as deprecated.
Objects and scripts set_self
set_dude_obj
real_dude_obj
remove_script
get/set_script
obj_is_carrying_obj
loot_obj
dialog_obj
obj_under_cursor
get/set_object_data
get/set_flags
set_unique_id
set_scr_name
obj_is_openable
get/set_proto_data
get_object_ai_data
except set_dude_obj, set_scr_name get/set_object_data maps supported object and C_ATTACK_* offsets instead of exposing arbitrary raw memory offsets.
Other / Game management set_movie_path
stop/resume_game
mark_movie_played
game_loaded
get_game_mode
get_uptime
signal_close_game
implemented: game_loaded, get_game_mode, get_uptime, signal_close_game -
Gameplay tweaks set_pickpocket_max
set_hit_chance_max
set_xp_mod
set_critter_hit_chance_mod
set_base_hit_chance_mod
set_hp_per_level_mod
gdialog_get_barter_mod
get/set_unspent_ap_bonus
get/set_unspent_ap_perk_bonus
set_base_pickpocket_mod
set_critter_pickpocket_mod
get/set_inven_ap_cost
set_drugs_data
get_kill_counter
mod_kill_counter
set_pipboy_available
implemented: gdialog_get_barter_mod, get/set_unspent_ap{_perk}_bonus, get/set_inven_ap_cost -
NPCs inc_npc_level
get_npc_level
npc_engine_level_up
not implemented -
Hero Appearance set_dm/df_model
hero_select_win
set_hero_race
set_hero_style
not implemented -
Events add_g_timer_event
remove_timer_event
create_spatial
spatial_radius
not implemented -
Other get_year
active_hand
toggle_active_hand
get/set_viewport_x/y
get_light_level
message_str_game
sneak_success
unwield_slot
add_extra_msg_file
get_metarule_table
metarule_exist
except get/set_viewport_x/y, sneak_success input_funcs_available, nb_create_char are deprecated in sfall and intentionally absent in CE. add_extra_msg_file does not support the explicit fileNumber form in CE.

Hooks

Hook ID Compatibility Notes
ToHit HOOK_TOHIT -
AfterHitRoll HOOK_AFTERHITROLL Overriding defender leaves a lot of attack variables in previous state (e.g. distance, ->oops, roundsHitMainTarget)
CalcAPCost HOOK_CALCAPCOST -
DeathAnim1 HOOK_DEATHANIM1 🚫 Use DEATHANIM2 instead
DeathAnim2 HOOK_DEATHANIM2 -
CombatDamage HOOK_COMBATDAMAGE -
OnDeath HOOK_ONDEATH -
FindTarget HOOK_FINDTARGET 🚫 (maybe)
UseObjOn HOOK_USEOBJON -
UseObj HOOK_USEOBJ CE notes an sfall-matching inconsistency around return code 2 behavior between interface contexts.
RemoveInvenObj HOOK_REMOVEINVENOBJ -
BarterPrice HOOK_BARTERPRICE -
ItemDamage HOOK_ITEMDAMAGE -
MoveCost HOOK_MOVECOST -
AmmoCost HOOK_AMMOCOST Requires check_weapon_ammo_cost=1 if you want pre-attack ammo validation to respect per-shot/per-round overrides.
KeyPress HOOK_KEYPRESS Third hook arg is currently 0; CE doesn't use VK codes.
MouseClick HOOK_MOUSECLICK -
UseSkill HOOK_USESKILL -
Steal HOOK_STEAL -
WithinPerception HOOK_WITHINPERCEPTION -
InventoryMove HOOK_INVENTORYMOVE -
InvenWield HOOK_INVENWIELD -
AdjustFID HOOK_ADJUSTFID Second hook arg currently matches the first because CE has no internal FID modifiers like Hero Appearance.
CombatTurn HOOK_COMBATTURN -
StdProcedure HOOK_STDPROCEDURE -
StdProcedureEnd HOOK_STDPROCEDURE_END -
CarTravel HOOK_CARTRAVEL 🚫 -
SetGlobalVar HOOK_SETGLOBALVAR 🚫 -
RestTimer HOOK_RESTTIMER CE is slightly more strict: only ret0 == 1 interrupts. Ticks wrap every 6.8y; do not rely on them for absolute game time.
GameModeChange HOOK_GAMEMODECHANGE -
UseAnimObj HOOK_USEANIMOBJ 🚫 Et tu; (maybe)
ExplosiveTimer HOOK_EXPLOSIVETIMER -
DescriptionObj HOOK_DESCRIPTIONOBJ 🚫 Et tu
UseSkillOn HOOK_USESKILLON -
OnExplosion HOOK_ONEXPLOSION 🚫 (maybe)
SubCombatDamage HOOK_SUBCOMBATDAMAGE 🚫 (maybe)
SetLighting HOOK_SETLIGHTING 🚫 Et tu; (maybe)
Sneak HOOK_SNEAK 🚫 -
TargetObject HOOK_TARGETOBJECT 🚫 (maybe)
Encounter HOOK_ENCOUNTER -
AdjustPoison HOOK_ADJUSTPOISON 🚫 (maybe)
AdjustRads HOOK_ADJUSTRADS 🚫 (maybe)
RollCheck HOOK_ROLLCHECK 🚫 -
BestWeapon HOOK_BESTWEAPON 🚫 -
CanUseWeapon HOOK_CANUSEWEAPON -
BuildSfxWeapon HOOK_BUILDSFXWEAPON 🚫 -