Giter VIP home page Giter VIP logo

sfall's Introduction

sfall

License Dev Build GitHub Pages

A set of engine modifications for the classic game Fallout 2 in the form of a DLL, which modifies executable in memory without changing anything in EXE file itself.

Engine modifications include:

  • Better support for modern operating systems
  • Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
  • Bug fixes
  • Many additional features for users, such as item highlight button, party member control, etc.
  • Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)

Original author: Timeslip

Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows Fallout to run correctly on modern operating systems, and adds additional features for modders.

Installation

  • Download sfall_*.7z from the release archive.

  • Extract ddraw.dll, ddraw.ini, sfall.dat, and the mods folder to Fallout's base directory (i.e. the one that contains fallout2.exe). Also, remove gl_highlighting.int and gl_partycontrol.int from Fallout's data\scripts\ directory if you are updating from an older version.

  • Important Note:
    If you are using a mod that already included sfall (e.g. killap's Unofficial Patch or Restoration Project), then that mod has probably included a custom modified ddraw.ini. In that case, overwriting it with sfall's vanilla ddraw.ini will be likely break your game. Instead, only overwrite ddraw.dll, and keep the mod's existing copy of ddraw.ini. (Or, if you know what you're doing, you can merge them together by hand.)

  • The folder translations contains translations of some of the strings that sfall displays in the game. To use a translation, copy this folder to Fallout's base directory too, and then in ddraw.ini change the TranslationsINI setting to .\translations\<your language>.ini.

Uninstallation

Delete ddraw.dll, ddraw.ini, and sfall.dat from your Fallout directory, and delete sfall-mods.ini from the mods folder.

Usage

This mod is configured via the ddraw.ini and sfall-mods.ini files, which can be opened with any text editor. Details of every configerable option are included in those files. Where a comment refers to a DX scancode, the complete list of codes can be found at the link below:
https://kippykip.com/b3ddocs/commands/scancodes.htm

In a default installation using an unmodified copy of ddraw.ini, the middle mouse button will be set to switch between weapons and the mouse wheel will be set to scroll through any menus that respond to the up/down arrow keys. Holding Ctrl and hitting numpad keys 0 to 6 (with Num Lock off) will adjust the game speed. Holding left Ctrl will let you move items between inventory lists by simply clicking on them. Pressing left Shift will highlight items on the ground, and holding the key will let you move an entire stack of items at once. The script extender and any engine fixes are also enabled. Most of the options that change gameplay in some way not originally intended by the developers are disabled.

For Wine users:
You need to set DLL overrides for ddraw.dll to "native, builtin" in winecfg or use WINEDLLOVERRIDES="ddraw=n,b" to run Fallout from the command line. If you want to play alternative sound files, you'll also need to install GStreamer Good 32-bit plugins.

Build Instructions

Prerequisites:

  • Visual Studio 2015 with Windows XP support for C++ component. If you're using Visual Studio 2017/2019/2022, make sure to install VS 2015 C++ build tools (v140).
  • DirectX SDK (June 2010). You will also need ddraw.lib from DXSDK February 2010 and dinput.lib from DXSDK August 2007. Both files can be found in the DirectX SDK Collection repo.
  • DirectX Runtime (June 2010). You can also install it from DirectX SDK installer.

Steps:

  1. Set up a postbuild.cmd using the template from the repo.
  2. Open the solution file and build with the ReleaseXP configuration (this is the one used for sfall releases).
  3. If everything is set up correctly, you should have a new sfall ddraw.dll in your Fallout 2 directory.

Additional info

sfall's People

Contributors

brussell1 avatar burner1024 avatar dependabot[bot] avatar fakelshub avatar ghost2238 avatar novarain avatar oppen avatar phobos2077 avatar vennor avatar vlad-saritasa avatar wipe2238 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sfall's Issues

Hook script at the end of every dialog

Add a hook script (or maybe we have it already?) at the end of every dialog.
This has a sole purpose of allowing for proper NPC Armor Appearence mod implementation (one global script, all settings in external INI file), but can have more applications.

New modular structure

  • Remove all hacks from main.cpp into module(s).
  • Each module (Inventory, Script Extender, Bug fixer, etc.) - separate class.
  • Use polymorphism for stuff like init, saving/loading state, destruct. Store all modules in one array of the Main module.

Universal opcode

Need to add one or several opcodes that will handle all future needs in terms of sfall-provided scripting functions.

  • Use string argument as a name of scripting function being called.
  • Make sure both statement and expression-type calls work.
  • Provide way to pass different amount of arguments to scripting function.
  • Maybe add some syntax sugar for compiler? (it's overloaded with new syntax already...)

Benefits:

  • No more updating sslc/int2ssl every time you need new scripting function.
  • No conflicts if 2 separate people add 2 different scripting functions at the same time (as long as names are different).

Hook Explosions

Would it be possible to hook explosions. I recently had the odd experience of having several bundles of dynamite in a bag, I set timers on two and after the explosions there sat the bag undamage with dynamite still in it. I want to write a script to trigger sympathetic detonations and destroy or scatter items in the hex the explosion was in.

A hotkey to center screen on dude

As it have been pointed out to me, Home key can do that. But unfortunately, I don't have it (I'm on macbook). I'm really missing it, though. Not sure if many people would need that, but an option to reassign this key would be nice.

Remove hardcoded carry weight limit

It seems that carry weight is hard limited to 999. Even when bonus is set to more, it still caps to 999 in game. If it's not complicated, I'd request to unhardcode it.

Controlling NPCs - making it useful

I love the idea behind controlling critters sfall gives (essentially Fallout Tactics in FO2 setting), but since NPCs acquire all your tags, perks and traits, it quickly turns them into copies of you, essentially way too powerful to make this option a valid way to play the game.

Could it be changed so that each time the NPCs (or critters you control in general) get a turn, they get their perks wiped out, their tags wiped out or changed to something unimportant (like gambling, sneak) and traits cleaned/changed to unimportant like sexappeal?

That would totally make it worth to re-play the game as a proper squad commander for extra flavor.

Docs on set_critter_burst_disable

Please add some docs on set_critter_burst_disable. I've tried to use it, but it doesn't seem to do anything in a companion script (or at least, nothing that one would expect judging by the name).

Automatically open/walk through unlocked doors

I think an option to have the doors open automatically for the dude when they're not locked would be a huge timesaver.

I'm not sure, maybe this is better done with scripting, if so, let me know and I'll try to look into that myself.

PipboyTimeAnimDelay working wonky with certain HRP settings

When PipboyTimeAnimDelay is set to 0:

  • On vanilla fallout, sleeping is instant.
  • With RP, too - if you use "basic" or "directdraw 7" graphics modes.
  • If swicthed to "DirectX 9", sleeping is faster but not instant anymore. That's on 640x480x8. If you start to increase resolution and/or color depth, sleeping slows down further. On 1280x800x32, no speedup is noticeable.

Code refactoring

Need to properly organize code. Goals:

  • Fix C++ code style, make it consistent
  • Replace C-style code with C++ code:
    • Use unique_ptr instead of raw pointers
    • Use STL containers instead of raw arrays
    • Don't use functions like memcpy for high-level code
    • Replace 0 and NULL with nullptr
    • Replace C-style type casts with C++ casts
  • Keep files small
  • Keep related things together
  • Clean code of unused functions, headers and macros (if any)
  • Use single style for scripting handler's ASM as much as possible (dangerous, need to test all functions thoroughly afterwards)

UI Scripting

Need to research possibility of extending UI scriptability.

Main focus:

  • Properly handle mouse clicks on buttons and panels (w/o tricks to prevent dude movement)
  • Draw text directly on screen
  • Draw on item icons (not sure if it's possible to make something like that scriptable..)
  • Use FRMs for graphics instead of PCX
  • Need to use the same graphics layer as the actual game (same functions, approach, etc.)

Hook conflicts

  • Address possible conflicts between engine hooks/writes (at the same address).

Need to replace HookCall() function with something that tracks writes at each address. There are 2 options how it should behave:

  1. Just detect repeated writes to the same addresses, and throw critical errors in such cases.
  2. Instead of requested hook, write hooks/jumps to some pre-defined function that will work with array of registered hooks for each address. For example, if two different hacks/features want to hook the same engine function, the first hook will work against original engine function, while the second hook will work against the previous hook, like layer after layer.

Add an option to auto reload

It would be a considerable time saver an option for the dude to auto reload both weapons at the end of combat with the same ammo, if possible. (Like party orders addon does to NPC).

A number of feature requests

I've a number of requests. I'm not sure which are doable easily, or at all, or maybe something is already possible with scripting. If you'd like to have a separate issue for each one for discussion, please let me know and I'll do that.

  1. A hotkey to highlight critters and transition areas (as an alternative to long option of entering combat mode, then exiting it). Could be the same or different key that is currently used to highlight items. Preferably different colors, though.
  2. (From Crafty's) an option to auto reload both weapons at the end of combat
  3. Runtime party control toggle. Probably a long shot, but I thought I'd ask. Reason is that controlling the party manually all the time is overly tedious, and not really worth it. But just once in a while, you really need the NPC to take cover, or shoot a specific enemy. And of course, it doesn't happen. A key allowing to toggle between these 2 modes would be perfect.
  4. Display occupied/total weight (and space, when space limit is enabled) in containers. Trunk specifically, but other containers also would be great.
  5. Automatically open/walk through unlocked doors.
  6. Instant weapon equip/switch - to disable the annoying animation delay when searching containers.
  7. In barter/steal/loot, use a key, like shift+right click to move items back and forth. (and something like ctrl-rclick could be used to move the whole stack)
  8. (From Crafty's) On weapon reload in inventory screen, automatically load full magazine - skipping number dialog.
  9. A hotkey to center screen on dude

Runtime party control toggle

Probably a long shot, and not many people would use it, but I thought I'd ask, just in case. Reason is that controlling the party manually all the time is overly tedious, and not really worth it. But just once in a while, you really need the NPC to take cover, or shoot a specific enemy. And of course, it's exactly what he doesn't do.
Therefore, a key allowing to toggle between these 2 modes would be perfect.

Disabling Horrigan encounter

@NovaRain
Hi. I am trying to upgrade Fallout 1.5: Resurrection's sfall using the stripped loader and it seems like the
DisableHorrigan=1 option does not work.
I've met a black screen encounter ater travelling some some time so I had to enable that option in the loader again (BTW I've re-enabled also Hi-Resolution Patch and the DAT extraction). Otherwise it seems working well so far.
Thanks again!

Allow highlighting more objects

I think it would be great to have a hotkey to highlight critters and transition areas (such as stairs, manholes, etc). It would be really helpful in dungeons. and other low-light areas.

Critters can be highlighted by entering combat mode, then exiting it, of course. But it takes considerable time, and doing it repeatedly is impractical..

Could be the same or different key that is currently used to highlight items. Preferably different colors, though.

Instant weapon equip/switch

Instant weapon equip/switch - to disable the annoying animation delay when searching containers and doing other stuff. This is nagging me since ever. And I'm quite sure it's not only me.

In fact, some time ago I tried to circumvent this by deleting the corresponding animation frames, but it didn't work out for some reason.

Integrate Crafty's small utility changes

In this issue, only include small enhancements, like multiple values in ExtraCRC

В рамках задачи, внедрить лишь небольшие улучшения.

Extend message_str_game function

Extend message_str_game function to support all pro_*.msg files as well.
Useful when you need to read names and descriptions of all items or critters.

Hotkey for switching current item mode

Lots of clicking goes into "single/aimed/burst/reload" mouse right click routine. If possible, a hotkey for it would be more efficient and thus greatly appreciated.

Ugly MS-DOS font on Fallout 2 worldmap

It appears like BIS/Interplay intended to use the Fallout screen font for FO2 worldmap, but didn't quite get it to work all the time and we see all location names in the MS-DOS font. Not very important, but easily reproduced, and may be possible to correct.

Reproduction:

  1. wander around the world map with a sensible outdoorsman skill
  2. when you are asked to enter an encounter, move the cursor to the edge of the screen to scroll the map
    (all of a sudden, location names are displayed in Fallout screen font!)
  3. don't enter the encounter (now the font changes back to the DOS font).

Burst Control

Could you make the burst behavior settings in ddraw.ini controllable from scripts?

Externalize explosives

Move explosives to INI properly (inactive => active PIDs for each and min/max damage)
(maybe flares along with them?)

Points of interest:

  • queue_do_explosion: replace min/max dmg code
  • obj_use_explosive_: replace cmp pids code, "active pid" code
  • check messages 590, 589

Sfall Global String Variable

Would you expose the methods for saving and recalling string variables to scripts directly? I know they already exist, Iv'e seen strings in sfallgv.sav when examining it to debug scripts, so it should be a trivial task.

books.ini variables manipulation

Please add access to the different variables for books.ini (min/max skill points without perk,min/max skill points with perk,and max skill skill level able to be upgraded with books)

Forced map update

Is there any way to force map_update (with calls to all scripts map_update_p_proc)?
If there is no way, need to add opcode for it.

Get item in player's inactive hand slot

When using critter_inven_obj(ObjectPtr who, int where) on dude_obj, this vanilla function always returns 0 for non-active hand.
Maybe it was an oversight, but we can't simple "fix it" as this is vanilla behavior and function is used extensively in F2 and TC's.

Need to find some easy workaround or add new opcode with desired behavior.

Display ammo type in the main interface window

Currently I'm running with 2 desert eagles, one with JHP ammo and another one with FMJ. I find myself struggling to know which one is which at the beginning of combat. So I thought it might be a good idea to display ammo type in the weapon windows. Probably in the lower right corner.

Enable debug mode in normal builds

Debug mode should be available in normal builds only by including Debugging section and enabling some "master switch".
Make sure to avoid performance impact when not using debugging mode on normal build (add fast checks, etc.).


Режим отладки должен быть доступен в обычных сборках (не TRACE), путем включения нужного флага в ddraw.ini.

Use numbers in dialogue option

When there are many options in dialogue, it becomes somewhat hard to navigate using number keys. Especially with HRP and higher resolutions.

I think displaying reply numbers instead of dots would improve user experience in that scenario. Would something like this be possible?

Hook Karma Changes

Would you please add a hook script for Karma changes? Since there is a ddraw.ini setting to display them it should be a fairly simple fis.

Really always run

Right now, when "always run" option is enabled, and destination is within 3 hexes or so, the dude still walks to it. Is it possible to force run always?

"Disable Pipboy alarm" option faulty

After upgrading to 3.7 (from 3.3), there's no option to rest in pipboy (the screen is just empty). Disabling "Disable pipboy alarm button" allows to sleep as per original.

Integrate Crafty's engine bug fixes

In this issue, only include engine bug fixes.

В рамках задачи, внедрить лишь правки багов движка.

Time passing on map loads differs

Can we fix this? The amount of time that passes when loading a map differs widely and as far as I know it's hard-coded.

In my opinion there should be no hard-coded time increase whatsoever; it should be based on worldmap speed of how far it is from the current map. Or if that's too difficult to automate, which is likely, just leave it up to the modder to put it in the script.

Fallout 1: For example loading a map can take days in-game, sometimes even weeks. This can be seen going to Irwin's Farm, and doing the caravans.

Not sure about Fallout 2 but I think it also exists in that engine. Just calling the load_map(Z) function seems to essentially do something like calling a "set_game_time(game_time + rand(X, Y))"

I was reminded of it by this bug report from Fixt:
"entering Irwin's farm takes 5-6 days, leaving it takes two weeks." <-- none of that is in the script, it's all being applied by the engine.

Combat AI hooks

Need to investigate the code, and think of some hook script ideas, that will allow to customize AI behavior.

Keep these possible goals in mind while searching for hook opportunities:

  • Flanking AI
  • Customize AI morale system without dirty hacks
  • Playable cover system
  • AI respecting new weapon types, like smoke grenades

Alternative to drag-and-drop in barter/steal/loot interface

Drag-and-dropping item in barter/steal/loot interfaces is tedious. I think it would be great to have a key combination that'd allow to do that faster.

For exampl use ctrl+right click to move items back and forth. (and something like shift-rclick could be used to move the whole stack, bypassing "quantity" window)

Update interface

Need to search for a way to force main interface redraw. If there is no such opcode, add new one.

Related: #16

Sfall version detection

Is it possible to detect sfall version in ddraw.dll? The reason I'm asking is that I've a mod that requires sfall 3.5+. I want to bundle the last version with the mod, and upgrade ddraw.dll if required. However, the only information I have about the version is a comment in ddraw.ini, which I'd rather not rely upon.

Or, am I overthinking this too much and it's always safe to upgrade ddraw.dll (leaving ddraw.ini intact, to preserve user settings)?

Customizable highlighting colors

In the currently test build, the item highlight colors are:

  • items on the ground - yellow
  • mouseover item on the ground - purple (was yellow in previous versions of sfall, changed by Crafty?)
  • containers - light gray

Would be nice if there are color settings for them in the INI.

Automatically load full magazine

When the user reloads a weapon from inventory screen, there's a dialog with quantity of magazines. There's 0 sense to it. I can't think of a time I didn't need to load the weapon fully. It would be great to bypass this dialog, as you pressed "all"

Naming scheme for engine-related stuff

Need to decide on following topics.

  1. How to name our Fallout Engine structs? In existing code there was no majority in naming, but most prominent is "sTile", "sMap", etc. I'm not sure it's a good scheme though.

  2. How to name our namespaces for engine variables, wrappers and structs. Need something consistent. Current version is not final.

PS: because we extracted real original names for all engine functions and many variables, we will use the same names for function wrappers and variable pointers.

Display occupied/total space

Display space usage in "occupied/total" format in containers. Trunk specifically, but other containers also would probably be great.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.