* change the body replacement sequence with the blood stains so that items are dropped after the blood is created
* chore: auto-format with clang-format
* typo
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* show weight instead of size in loot dialog
* chore: auto-format with clang-format
* added configuration
* chore: auto-format with clang-format
* added percentage mode only
* chore: auto-format with clang-format
* use percentage for simple indiator in containers, remove the percentage mode only, change default to simple indicator
* Update src/settings.h
typo
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
* changed the threshold to be applicable only to the containers and se it to 50%.. changed the colors for the weight indicator and the party member name in the loot dialog.. also tweaked label position for bigger critters like Marcus
* restore font to the previous value in case threshold filters out the indicator
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* missing leading space in weight indicator comments in fallout2.cfg
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* use actual runtime value of the size of the columns instead of trusting the setting value
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
* minor reformulation of the comments in fallout2.cfg
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
* explicitly use std::ceil() over ceil() to follow convention in this file and to make copilot happy
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* change HitMode, HitLocation, CriticalHitDescriptionDataMember and CombatBatShot to its respective underlying integer types and enforce enum usage in the functions
* chore: auto-format with clang-format
* renamed CriticalHitDescriptionDataMember to CriticalHitDataMember. implemented isValid functions for the refactored enums in combat_defs.h. created template function for getting validated enum value in interpreter.h.. used isValid enum functions around the place
* chore: auto-format with clang-format
* changed gCombatState from uint handling to bit flags enum
* chore: auto-format with clang-format
* remove unused valid/interpreter method for CombatBadShot
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
For some RPU elevator transitions, I was seeing the screen partially not update. This was due to rejecting the setCenterTile due scroll blockers (I think). This turns those off if EDG support is enabled.
This also seems to fix some of the jittery scrolling I was seeing in diagonal areas like SF
* Fix elevator cancelation in RPU
If you step into an elevator in RPU and cancel the floor selection, the door closes behind you (sometimes with glitchy graphics). This is a latent bug in the elevators code that vanilla doesn't hit
- elevator_select_ mutates the caller’s elevation to a UI/display level before the modal loop.
- Escape/cancel returns 0 without writing a destination tile.
- Caller then sees map == current map and elevation != current elevation, so it closes the nearby door.
- tile is still -1.
* NovaRains approach
* dont default to first floor if not found
* We call skillGetValue(gDude, SKILL_SNEAK) for every target
* For non-critters, that can result in OOB memory reads
* We only need it for gDude for sneaking
So let's only call it when dude is sneaking and is the target
* Fix out-of-bounds write in wmWorldMap_load when numCities exceeds wmMaxAreaNum
* use ENTRANCE_LIST_CAPACITY to properly isolate city entrances
And read a rest to dummy struct
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* adds debug print warning regarding extra data in .sav
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Correct `get_object_data` indexes
Currently they are raw offset pointers. This does not work with CE since pointers are wide (64bit) on some (most) platforms. So, we can treat these offsets like constants and return the appropriate fields instead.
There are already used for the most part as enum constants:
* Sfall fix for > 160 maps for automap code (RPU triggers this)
* Logic fix for action menu, where actionIndex was incremented unconditionally and could go out of bounds. This was a regression from vanilla
Add equipment slots to the companion loot screen.
Items can be equipped directly from player or companion inventory. This also allows switching between party members so you can manage all companion's inventories easily. Does not allow equipping items that would otherwise be disallowed.
Also:
Calls HOOK_UNWIELD when adding/removing equipment, meaning mods like npc armor work
Uses HOOK_CANUSE for weapon use checks
Ctrl-click to equip is not implemented since it already transfers items between the two inventories. I tried making it work only for equippable items (and otherwise transfer), but that felt awkward and random. Ctrl-click unequip is implemented.
* handle unimplemented fs_copy/fs_create/fs_find more gracefully from the script point of view
* chore: auto-format with clang-format
* moved to sfall_opcodes
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add offset tracking to --scan-unimplemented
* Add a bunch of missing opcodes
* Hardcode a list of implemented hooks to avoid filtering a long list of hooks that are already done
* Add tracking of specific offsets accessed in unsafe scripting so we can plan replacements
Sample output
```
OFFSET write_int (0x81d1 - 0x1d1 - 465):
0x5190f8 (5345528):
- ./mods/InventoryFilter.dat/scripts/gl_InvenFilter_debug.int
- ./mods/InventoryFilter.dat/scripts/release_gl_InvenFilter.int
0x59e95c (5892444):
- ./mods/InventoryFilter.dat/scripts/gl_InvenFilter_debug.int
- ./mods/InventoryFilter.dat/scripts/release_gl_InvenFilter.int
```
Then we can corrlated it with source:
```
// 0x5190F8 curr_rot
static int gInventoryWindowDudeRotation = 0;
```
* PR feedback
* Grow ability for `ce-dat-tool` to extract a list of files
This is needed for Et Tu installation, which selectively extracts files from fo1's master.dat. (It doesn't work if everything is extracted)
* cache entry list to avoid O(n) cost when extracting many files
Currently it isn't playing at all, since we're not doing renderPresent() during the animation loop.
This fixes that. Also, it optimizes the time the animation takes by starting it before the interface combat start/end animation. This saves half a second or so.
* Remove hidden items when trading with Goris
Also, fix the fix to allow looting with Goris
This adds major simplification and deduplication to inventory.cc, including the start of an "InventoryScroller" class that can manage inventory events without duplicate handling everywhere. This is needed as we add more complexity to the page.
* Fix crash due to corrupted `whoHitMe`
It's possible for some object's `whoHitMe` to contain `-1`. It's supposed to be resolved to `nullptr`, but doesn't reliably happen in all cases, esp outside of combat. The main fix here is to normalize to nullptr when loading the object, instead of just map load, or combat paths.
At some point I thought the problem might have been attacker being a non-critter. Added some guards against that regardless. Also, found several bugs and messiness in `apply_damage` which are now fixed.
Fixes https://github.com/alexbatalov/fallout2-ce/issues/368
* Fix ddraw.ini -> game.cfg migration on unix-y systems
We were using `compat_splitpath` on a windows path. We want to work on windows paths, so that's good. This fixes compat_splitpath so that it works with both folder separators. Also tweak `compat_makepath` to recognize both, for consistency.
This means that filenames with `\` will be broken, but I think we can (and should) live with that)
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* chore: auto-format with clang-format
* fix
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Better fix for directory detection
A couple places we used compat_file_exists to distinguish between files and folders/dirs, but this breaks on POSIX. This attempts to fix it more holistically
* Make compat_file_exists to be consistent
All platforms now return false for folders/dirs
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Most are of this type
```
warning: 'size' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
sfall_arrays.cc:313:26: note: overridden virtual function is here
313 | virtual ProgramValue GetArrayKey(int index, Program* program) = 0;
|
```
* Change `use_walk_distance` to match sfall setting
It's pointless to set this to 0,1 because you don't move if the target is adjacent or yourself, so sfall changes this to "number of spaces" between player and target. We were reading the old ddraw.ini setting before, incorrectly.
Also add a small optimization to not compute path for adjacent targets
* add comment
* return true when distance is self/adjacent
Similar to HRP/Sfall, except:
Does not support non-aspect-ratio-preserving scale mode
Uses vanilla art if it fits without scaling (e.g. 640x480 or non-scaling res like 800x480). The scaled-down HR assets looks considerably worse.
* Bundle Sfall's gl_highlight.ssl
Most mods/distributions assume this is exists since it is bundled with Sfall. It's also a highly requested feature
I decided to merge this as a first-class game config instead of continuing to read mods/sfall-mods.ini. I think most people to this to be a default capability that can be toggled in-engine. Open to other thoughts on the matter. Lost of people will already have sfall-mods.ini configured, which is a reason to keep it the way it was.
* PR feedback
* Fix aiPacketRead overwriting packet_num from savegames, leading to corrupted state on subsequent loads and crash
* Mark variable as unused and add comment
* Change output sound buffer to 44.1 kHz
This allow CE to play 44.1 kHz input files without loss of precision. In particular, it plays HQ music that ships with RPU.
There is a very similar fix in Sfall
* use generic sound loading path to allow .ogg/.wav music files
* rm a few dangling references
* PR feedback
* rm references to audio file
* rm audio_file.cc/h
* restore default audio io
* PR fixes
* Implement `set_unique_id`
* save/load watermark, including compat with previous saves (would be `0`)
* metarule to set and reset unique_id
* inventory stacking rules
* HRP's edg file support (WIP)
* Update docs and fix bug
* chore: auto-format with clang-format
* EDG: proper scroll blocking based on pre-calculated rects, exactly as in HRP
* chore: auto-format with clang-format
* EDG: fix scrolling past pixel-space bounds with sub-hex map edge mod
* EDG: review fixes
* EDG: proper edge clipping matching HRP logic
* chore: auto-format with clang-format
* EDG: code review fixes and refactoring
* chore: auto-format with clang-format
* EDG: fix clamping
* EDG: show arrow cursor and block events when over clipped area
* chore: auto-format with clang-format
* EDG: option to disable
* EDG: deobfuscate code
* chore: auto-format with clang-format
* EDG: get rid of rect2 and simplify algebra
* EDG: update docs, clarify that squareRect is not implemented
* EDG: square mask support
* chore: auto-format with clang-format
* Code review fixes
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This bring CE much closer to sfall's load order, and fixes RPU install.
master_patches > critter_patches > mods_order.txt > PatchFileXX > patchXXX.dat > sfall.dat > critter_dat > f2_res_patches > f2_res_dat > master_dat
Also fixed typo in `showMessageBox`, and added a debugPrint in that function, so errors are visible in the log (LLMs otherwise find it hard to figure out what happened)
* Add "trade/loot" context menu for party members.
This was an idea I saw listed on NMA. Veterans of classic Fallout know you can trade with your companions much more easily using the steal skill, But this would be difficult for most new players to discover. This replaces the dialogue option in the long press (which is redundant since it is the default action) with the hand, which is normally used to loot from containers and corpses.
This does introduce a slight inconsistency in the default action, not being present when you long press. how almost everyone will be single-clicking to talk to NPCs.
Also, "you plant..." and "you steal..." messages when trading with companions this way. Put this behind the same flag in case someone wants the original experience.
* Full context menu
* container -> target
* PR feedback
* rebase on main
* rename function
* Add original symbol beside all function offsets
e.g.
```
// 0x414E98 register_object_call
int animationRegisterCallback(
// 0x414E20 register_object_must_erase
int animationRegisterHideObjectForced(
```
This was programmatically generated so there could be errors. Spot checking looks pretty good though
* Mapper: fixed playmode, added some mapper features
* mapper: save map corrections + some stubs
* mapper: fix playmode and cleanup discrepancy
* mapper: edit_mapper inacuracies and tidying up some code
* mapper: corrected Delete Spatial, minor fixes
* mapper: implement debug.show_tile_num, Mark Exit Grid, toolbar name drawing fix and refactoring
* chore: auto-format with clang-format
* mapper: fix inaccuracies after AI review, round 1
* mapper: fix inaccuracies after AI review, round 2
* chore: auto-format with clang-format
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* [HRP] Enable HR dialog screen
(It's not really "hi resolution", just adds a border so it looks less funny.)
Also, picked up @NovaRain's suggestion of centering dialog on the play area if it is large enough, which matches Sfall.
Very simple party barter support. Builds upon the loot screen so is very little code:
Switch party members with left/right arrow keys
When leaving barter with items on the table (canceling), all items go to the PC's inventory
No special handling of money (yet)
The mod pins the player's money stack on top of the inventory list for all party members. That's nice, but also feels a little odd, but likely just because I'm used to the money stack being stuck at bottom. We can iterate on that.
Adding an interface will require art. I considered enabling mouse use triggered by clicking on the avatar which would be quite simple.
* Speed up Fallout1 .dat reader
It was reallocating a buffer on a loop, which caused large files to take minutes. Fixing this reduced it to a reasonable time, but still ~120s for the entire Fallout1 master.dat.
Also, bump the F2 gzip buffer to 4kB. It was only 400 bytes
In 8b2ead8a2b, soundLoad started honoring AudioFileInfo.channels, but the ACM decoder path historically only propagated sample rate. This changes playback in a way that caused the bug.
Verified by talking to good ol' Sulik
* Add support for new talking heads
Add [Heads] config section in ddraw.ini that maps critter PIDs to talking
head indices in art\heads\heads.lst. When a dialog script starts with
headId=-1, the engine now checks the critter proto's headFid first, then
falls back to the [Heads] mapping. This lets mods add talking heads
without patching dialog scripts.
Includes Cassidy mapping (PID 16777305 → head index 13) for use with
cassidy_head.dat mod.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Implement HOOK_INVENWIELD, HOOK_CANUSEWEAPON and fix HOOK_ADJUSTFID
Wire the sfall hooks that npc_armor.mod relies on so party-member sprites
actually change when armor is equipped:
- HOOK_INVENWIELD fires from inventoryEquipFunc/inventoryUnequipFunc with
(critter, item, slot, isWield). Script may veto by returning 0. Slot
values mirror interpreter_extra.cc: WORN=0, RIGHT_HAND=1, LEFT_HAND=2.
- HOOK_CANUSEWEAPON fires from _ai_search_inven_weap so the mod's
weapon-anim restriction can veto AI weapon picks.
- HOOK_ADJUSTFID arg list corrected to match sfall (single currFid arg,
critter resolved via dude_obj).
- ProgramValue::isEmpty no longer treats string values as empty — sfall
scripts like npc_armor's `while (sect.PID)` loop depend on a non-empty
string being truthy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* enum class
* chore: auto-format with clang-format
* bad merge
* PR feedback
* restore isEmpty() to vanilla while fixing bug
* fixes
* minor fixes
* extra
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: tectiv3 <tectiv3@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Sfall-like sound system
(I would like a better name for this system, but the opcodes themselves are called `play|stop_sfall_sound` and I can't think of a better name)
This is a sound management system very similar to Sfall's. With a few differences:
* No support for new sound formats yet. Support for at least ogg+wav will come next
* Does support reading from .dat files, hence playing any sound effect in the base game
* Support mode=3 for speech volume. This exists in Sfall but is ignored when called from the opcode.
Also, change GaplessMusic to use this system to play the "wind2" loading sound. This restores the "vanilla" feel map transitions, so I think it's reasonable to make GaplessMusic=1 the default. I can't imagine someone wanting to change it to 0 unless they are ultra purists
* Sfall saved arrays support
* Add "...all_arrays..." special case for a list of saved arrays
* Adjust error message on load fail
* Fix crash in GetArrayKey when index == size
* chore: auto-format with clang-format
* Update sfall compatibility md
* Add keyIndex for Assoc Arrays for O(1) key lookups
* Review feedback, more error logging
* Fix build, increase ARRAY_MAX_STRING to 1024 to match sfall, fix gl_test_arrays triggering dynamic string block merge failure, prevent potential string buffer corruption on very long strings
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
`-` can be used to take input from stdin (e.g. from `ce-dat-tool cat` or write to stdout).
`-` can be used to take input from stdin (e.g. from `ce-dat-tool cat`) or write to stdout. When reading from stdin, pass `--from-frm` or `--from-png`. Output defaults to PNG for FRM input and FRM for PNG input when output is omitted or `-`; use `--to-png` for PNG output to stdout from PNG input.
If `--palette` isn't specified, it will pick up `color.pal` in the .frm's directory or cwd.
Output file extensions are validated against the selected conversion. For example, PNG-to-FRM output must use `.frm`, and PNG output must use `.png`.
If `--palette` isn't specified, it will pick up `color.pal` in the input file's directory or cwd.
Notes:
- The tool expects a raw `color.pal` file. It does not read palettes directly from `master.dat`, so extract `color.pal` first if needed.
- A typical extraction flow is: `ce-dat-tool master.dat extract --lower . 'color.pal'`
- By default palette index `0` becomes transparent in the output PNG. Pass `--opaque` to keep it opaque.
-The current implementation writes RGBA PNGs. It does not preserve the original Fallout palette indices as a palette-indexed PNG.
-PNG output is always palette-indexed and preserves Fallout palette indices when possible.
- For `png -> frm`, transparent pixels (alpha below 128) map to palette index `0` by default. Pass `--opaque` to quantize every pixel instead.
- The current `png -> frm` implementation writes a single-frame FRM and points all six direction slots at the same frame payload.
Fallout 2 Community Engine is a fully working re-implementation of the Fallout 2 engine, optimized for a hassle-free experience on multiple platforms. It provides high resolution support, quality-of-life improvements, and dozens of bug fixes.
Fallout 2 Community Engine is a fully working re-implementation of the Fallout 2 engine, optimized for a hassle-free experience on multiple platforms, including Windows, Mac, iOS, Android, and Linux. It provides high resolution support, quality-of-life improvements, and dozens upon dozens of bug fixes.
This is a fork of the original Fallout2: CE project, which is no longer getting regular updates.
Popular Fallout 2 total conversion mods are partially supported. Original versions of Nevada and Sonora (that do not rely on extended features provided by Sfall) work. [Fallout 2 Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project) is supported (in Beta). [Fallout Et Tu](https://github.com/rotators/Fo1in2) and [Olympus 2207](https://olympus2207.com) are not yet supported. Other mods (particularly Resurrection and Yesterday) are not tested.
Popular Fallout 2 total conversion mods are partially supported. Nevada and Sonora work. [Fallout 2 Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project) is supported (in Beta). [Fallout Et Tu](https://github.com/rotators/Fo1in2) and [Olympus 2207](https://olympus2207.com) are not yet supported. Other mods (particularly Resurrection and Yesterday) are not tested.
Fallout2: CE has broad (though not total) compatibility with [Sfall](https://github.com/sfall-team/sfall) scripting extensions. Many traditional Fallout mods work out of the box.
Fallout2: CE has broad (though not total) compatibility with [Sfall](https://github.com/sfall-team/sfall) scripting extensions. Many traditional Fallout mods work out of the box, including NPC Armor, Party Orders, FO2Tweaks (we recommend v14.5+), Talking Heads, and many others.
There is also [Fallout 1 Community Edition](https://github.com/alexbatalov/fallout1-ce) (not affiliated with this fork).
## Installation — [Download Latest CE Release](https://github.com/fallout2-ce/fallout2-ce/releases)
## Installation
You *must* own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410).
You *must* own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410). Download latest [release](https://github.com/fallout2-ce/fallout2-ce/releases) or build from source.
Download CE from the link above, then extract the archive into your game folder. Launch `fallout2-ce.exe` on Windows (or the platform-specific executable) to play. CE has a lot of enhancements that require configuration. See [Configuration](#configuration) for examples.
For detailed instructions on how to play on Mac, Linux, iOS, or Android, see the [Platform-specific instructions](#platform-specific-installation).
## Quality of life benefits over vanilla Fallout
* High resolution support
* Party members can loot and barter in place of PC
* Directly equip party members instead of convincing them to use the right equipment.
* Expanded 2-column inventory, loot screens
* Expanded 4-row barter screen
* Expanded AP bar
* Ctrl-click to quickly move items when bartering, looting, or stealing, and auto-balance caps
* Music continues playing between maps
* Auto open doors
* Integrated "HELP" menu
* 44.1 kHz stereo sound/music supported, in .ogg and .wav format as well as legacy .acm
* Last used save slot is remembered
* Item/Corpse/Container/Critter highlighting (configure using [mods/sfall-mods.ini](https://github.com/sfall-team/sfall/blob/master/artifacts/config_files/sfall-mods.ini))
<img src="docs/images/party-member-loot.gif" alt="Party member loot" width="360"><br>
<sub>Party member loot</sub>
</td>
<td align="center">
<img src="docs/images/help-menu.gif" alt="Integrated HELP menu" width="360"><br>
<sub>Integrated HELP menu</sub>
</td>
</tr>
</table>
There are also dozens of small things that just work a little better than they did in the original. Better pathfinding, fewer graphics glitches, less finicky weapon stacking, and much more.
## Configuration
The main configuration file is `fallout2.cfg`. This contains original game config as well as new CE settings.
Additional settings for screen resolution, UI customization, and map options are now integrated into the main `fallout2.cfg` file (previously part of `f2_res.ini` from Mash's HRP).
Here are some important settings in `fallout2.cfg` under the `[screen]` and `[ui]` sections. See [the example config](https://github.com/fallout2-ce/fallout2-ce/tree/refs/heads/main/files/fallout2.cfg) for a full list of settings.
```ini
[screen]
resolution_x=1600 ; actual game window size (screen resolution), in pixels
resolution_y=1080
windowed=1 ; 0 = fullscreen
scale=2 ; 1 = original scale, 2 = 2x scale, etc. (e.g. at scale 2 and screen resolution 1920x1080, in-game resolution will be 960x540, thus every pixel is twice as wide and tall)
[ui]
; Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
inventory_columns=2
; Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires ce.dat)
expand_barter_window=1
[qol]
; Allow opening party member inventory from the long-press context menu.
party_trade_from_menu=1
; Allow switching to companions' inventories in loot screens (and barter, in the future)
party_loot_and_barter=1
```
**Recommendations:**
- **Desktops**: Use any size you see fit.
- **Tablets**: Set these values to logical resolution of your device, for example iPad Pro 11 is 1668x2388 (pixels), but its logical resolution is 834x1194 (points).
- **Mobile phones**: Set height to 480, calculate width according to your device screen (aspect) ratio, for example Samsung S21 is 20:9 device, so the width should be 480 * 20 / 9 = 1067.
In time this stuff will receive an in-game interface, right now you have to do it manually. To see all currently working fallout2.cfg settings, just run the game once and quit. It will be automatically updated with defaults for every supported setting.
*Note*: Use of the IFACE_BAR settings requires the `f2_res.dat` file, which contains graphical assets. Various versions are available, but one compatible with the above settings can be found here: [f2_res.dat](https://github.com/fallout2-ce/fallout2-ce/raw/refs/heads/main/files/f2_res.dat)
## Platform-specific installation
### Windows
@@ -103,53 +187,6 @@ docker run --rm -v $(pwd):/src emscripten/emsdk:3.1.74 sh -c 'git config --globa
```
- Demo available at https://github.com/ololoken/fallout2-ce-ems.git
## Configuration
The main configuration file is `fallout2-ce.cfg`. There are several important settings you might need to adjust for your installation. Depending on your Fallout distribution main game assets `master.dat`, `critter.dat`, `patch000.dat`, and `data` folder might be either all lowercased, or all uppercased. You can either update `master_dat`, `critter_dat`, `master_patches` and `critter_patches` settings to match your file names, or rename files to match entries in your `fallout2-ce.cfg`.
The `sound` folder (with `music` folder inside) might be located either in `data` folder, or be in the Fallout folder. Update `music_path1` setting to match your hierarchy, usually it's `data/sound/music/` or `sound/music/`. Make sure it matches your path exactly (so it might be `SOUND/MUSIC/` if you've installed Fallout from CD). Music files themselves (with `ACM` extension) should be all uppercased, regardless of `sound` and `music` folders.
Additional settings for screen resolution, UI customization, and map options are now integrated into the main `fallout2-ce.cfg` file (previously part of `f2_res.ini` from Mash's HRP). When Fallout 2 CE starts, if it detects an existing `f2_res.ini` file, it automatically migrates these settings into main config. After that, `fallout2-ce.cfg` becomes the single source of truth for this configuration.
Here are some important settings in `fallout2-ce.cfg` under the `[screen]` and `[ui]` sections. See [the example config](https://github.com/fallout2-ce/fallout2-ce/tree/refs/heads/main/files/ce.cfg) for a full list of settings.
```ini
[screen]
resolution_x=1600 ; actual game window size (screen resolution), in pixels
resolution_y=1080
windowed=1 ; 0 = fullscreen
scale=2 ; 1 = original scale, 2 = 2x scale, etc. (e.g. at scale 2 and screen resolution 1920x1080, in-game resolution will be 960x540, thus every pixel is twice as wide and tall)
[ui]
;Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires ce.dat)
expand_barter_window=1
;Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
- **Tablets**: Set these values to logical resolution of your device, for example iPad Pro 11 is 1668x2388 (pixels), but it's logical resolution is 834x1194 (points).
- **Mobile phones**: Set height to 480, calculate width according to your device screen (aspect) ratio, for example Samsung S21 is 20:9 device, so the width should be 480 * 20 / 9 = 1067.
In time this stuff will receive in-game interface, right now you have to do it manually. To see all currently working fallout2.cfg settings, just run the game once and quit. It will be automatically updated with defaults for every supported setting.
*Note*: Use of the IFACE_BAR settings requires the `f2_res.dat` file, which contains graphical assets. Various versions are available, but one compatible with the above settings can be found here: [f2_res.dat](https://github.com/fallout2-ce/fallout2-ce/raw/refs/heads/main/files/f2_res.dat)
## Quality of life benefits over vanilla Fallout
* High resolution support
* Expanded 2-column inventory
* Expanded 4-row barter screen
* Expanded AP bar
* Increased pathfinding nodes 5x for more accurate pathfinding
* Ctrl-click to quickly move items when bartering, looting, or stealing
* _a_ to select "all" when selecting item quantity
* _a_ to `Take All` when looting
* When bartering, caps default to the right amount to balance the trade (if possible)
* Music continues playing between maps
* Auto open doors
## Contributing
@@ -159,6 +196,14 @@ Integrating Sfall goodies is the top priority. Quality of life updates are OK to
For current sfall compatibility status and the remaining work needed to close gaps, see [SFALL_COMPATIBILITY.md](SFALL_COMPATIBILITY.md).
## For modders
* Robust (though not 100%) Sfall opcode and hook support
* .ogg/.wav support for map music
* .png support for static assets (must be 8bit indexed)
* .zip support for .dat archives
* Working BIS mapper
## License
The source code is this repository is available under the [Sustainable Use License](LICENSE.md).
@@ -4,13 +4,25 @@ This document tracks Fallout 2 CE compatibility with sfall. This is for modders
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 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`](files/ce.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-ce.cfg`](files/ce.cfg) instead:
The following settings were moved into [`fallout2.cfg`](files/fallout2.cfg) instead:
See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/) for documentation on specific functions.
@@ -41,9 +65,9 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
| Perks and traits | set_perk_image<br>set_perk_*<br>set_pyromaniac_mod<br>apply_heaveho_fix<br>set_swiftlearner_mod<br>has/set_fake_perk<br>has/set_fake_trait<br>set_selectable_perk<br>set_perkbox_title<br>show/hide_real_perks<br>perk_add_mode<br>clear_selectable_perks<br>add/remove_trait<br>seq_perk_freq | not implemented | - |
| Virtual file system | fs_create<br>fs_copy<br>fs_find<br>fs_read/write_*<br>fs_delete<br>fs_size<br>fs_pos<br>fs_seek<br>fs_resize | đźš« | Open an issue if you have a use case for these |
| Audio | eax_available<br>set_eax_environment<br>play_sfall_sound<br>stop_sfall_sound | not implemented | *eax* opcodes will not be implemented |
| Audio | play_sfall_sound<br>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<br>get/set_weapon_ammo_count | âś… | - |
| Sfall / Version | sfall_ver_major<br>sfall_ver_minor<br>sfall_ver_build | âś… | CE currently reports `4.3.4` |
| Utility / Math | log, exponent, round, sqrt, abs, sin, cos, tan, arctan, ceil, ^, floor2, div | âś… | - |
@@ -51,30 +75,32 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
| Global variables | set_sfall_global<br>get_sfall_global_int<br>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<br>get_sfall_arg<br>get_sfall_args<br>get_sfall_arg_at<br>set_sfall_return<br>set_sfall_arg<br>register_hook<br>register_hook_proc<br>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. |
| Interface / Main interface | intface_is_hidden<br>intface_redraw<br>intface_hide<br>intface_show<br>set_quest_failure_value | implemented: only intface_redraw | `intface_redraw` only supports the zero-argument form; the optional-argument path is explicitly unimplemented. |
| INI settings | get_ini_setting<br>get_ini_string<br>get_ini_section<br>get_ini_sections<br>get_ini_config<br>get_ini_config_db<br>set_ini_setting | âś… | `modified_ini` is intentionally omitted as deprecated. |
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>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<br>stop/resume_game<br>mark_movie_played<br>game_loaded<br>get_game_mode<br>get_uptime<br>signal_close_game | implemented: game_loaded, get_game_mode, get_uptime, signal_close_game | - |
| NPCs | inc_npc_level<br>get_npc_level<br>npc_engine_level_up | not implemented | - |
| Other | get_year<br>set_dm/df_model<br>active_hand<br>toggle_active_hand<br>get/set_viewport_x/y<br>hero_select_win<br>get_light_level<br>message_str_game<br>sneak_success<br>create_spatial<br>unwield_slot<br>add_g_timer_event<br>add_extra_msg_file<br>get_metarule_table<br>metarule_exist<br>remove_timer_event<br>spatial_radius | implemented: get_year, active_hand, toggle_active_hand, get_light_level, message_str_game, add_extra_msg_file, metarule_exist | `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. |
| Events | add_g_timer_event<br>remove_timer_event<br>create_spatial<br>spatial_radius | not implemented | - |
| Other | get_year<br>active_hand<br>toggle_active_hand<br>get/set_viewport_x/y<br>get_light_level<br>message_str_game<br>sneak_success<br>unwield_slot<br>add_extra_msg_file<br>get_metarule_table<br>metarule_exist<br> | âś… 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
@@ -90,19 +116,19 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
| 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. |
;Set this to a valid path to save a copy of the console contents
console_output_path=
mode=log
output_map_data_info=1
show_load_info=1
show_script_messages=1
show_tile_num=1
window_height=192
window_width=300
[mapper]
default_f8_as_game=1
fix_map_inventory=0
fix_map_objects=0
ignore_rebuild_errors=0
librarian=0
override_librarian=0
rebuild_protos=0
run_mapper_as_game=0
save_text_maps=0
show_pid_numbers=0
sort_script_list=0
use_art_not_protos=0
[preferences]
brightness=1.000000
combat_difficulty=1
combat_looks=1
combat_messages=1
combat_speed=50
combat_taunts=1
game_difficulty=1
item_highlight=1
language_filter=0
mouse_sensitivity=1.000000
player_speedup=0
running=1
running_burning_guy=1
subtitles=1
target_highlight=1
text_base_delay=6.000000
text_line_delay=2.000000
violence_level=3
[screen]
resolution_x=640
resolution_y=480
scale=1
windowed=1
[sound]
cache_size=448
debug=1
debug_sfxc=1
gapless_music=1
initialize=1
master_volume=22281
music=1
music_path1=data\sound\music\
music_path2=sound\music\
music_volume=22281
sndfx_volume=22281
sounds=1
speech=1
speech_volume=22281
[system]
art_cache_size=8
color_cycling=1
critter_dat=critter.dat
critter_patches=data
cycle_speed_factor=1
executable=game
free_space=20480
hashing=1
interrupt_walk=1
language=english
master_dat=master.dat
master_patches=data
screenshots_format=png
scroll_lock=0
splash=5
[ui]
;Speed up or slow down all UI animations such as screen fade, dialog window show/hide, AC numbers roll, etc.
anim_speed=2.000000
;To use more than one save slot for quick saving (F6 key) without picking a slot beforehand
;Quick save will cyclically overwrite saves from the first slot on the specified page to the last slot on the n-th page
;auto_quick_save sets how many pages you want to use for quick saving (valid range: 1..10)
;Set to 0 to disable
auto_quick_save=3
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
display_bonus_damage=1
;Set to 1 to get notification of karma changes in the notification window
display_karma_changes=0
;Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
enable_high_resolution_stencil=1
;Set to 1 to extend the action points bar to show up to 16 AP instead of 10 (requires iface_apbar_e.frm)
extend_ap_bar=0
;Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires barter_e.frm, trade_e.frm, and a screen height of at least 528 pixels)
expand_barter_window=0
iface_bar_mode=0
iface_bar_side_art=2
iface_bar_sides_ori=0
iface_bar_width=800
ignore_map_edges=0
;Set to 1 to display numbered dialogue options
numbers_in_dialogue=0
;Set to 1 to skip the 3 opening movies
;Set to 2 to also skip the splash screen
skip_opening_movies=0
splash_screen_size=1
;Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
;2-column Loot/steal window requires minimum screen width of 673px
inventory_columns=2
[qol]
; Automatically open doors that are unlocked and has no script attached.
auto_open_doors=0
; Overrides distance at which walk animation is used when using an object.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.