F2LC problem

Andy-Spacetrain said:
Does anybody know how to prevent the 13 year limit? Cause I haven't found it out yet.

I don't know the details (sounds like Jargo does though?), but there are some offsets for this listed here:

http://koti.mbnet.fi/platonjr/offsets.txt

13 Year Limit (Not working totally...)
Version: Hex Offset:
Fallout2 (US v1.0)
Fallout2 (US v1.02d) 000938D8
Fallout2 (UK v1.01) 00093688
Fallout2 (UK v1.02e) 00093A88
Fallout2 (GR v1.0)
Fallout2 (GR v1.02d) 00093BA8
Fallout2 (FR v1.0)
Fallout2 (FR v1.02d) 00093BA8
( Fallout2 (315371520) 0003CC12 )
Change to FFFFFFFF (?)

AND change also (so that combat doesn't end the game)

Version: Hex Offset:
Fallout2 (US v1.02d) 0009392D
Fallout2 (UK v1.02e) 00093ADD
Fallout2 (GR v1.02d) 00093BFD
Fallout2 (FR v1.02d) 00093BFD
( Fallout2 (315371520) 0003CC12 )
Change to FFFFFFFF (?)

Even if its a hack that isn't perfect, I think it's still worthwhile to have as an option in FO2LC.

I seem to recall the problem being an integer reaching its max value, so they forced end of game before reaching that limit. I found this in command.h today:

#define MAXINT 4294967295 //Max int
#define INV(x) (MAXINT - x) //An inverse function

Although those are defined in the header, I checked and neither of these are used in scripts, but perhaps these headers were also used as includes for the engine build.

This number 4294967295 is the maximum value that can be stored in 4 bytes. I assume that Jargo found a way to just reset that value back to the beginning when it reaches max value. From a programming perspective, the obvious question is how could this integer be made into a double (not sure if that's doable without the source code).

EDIT: I just had a wild idea about this 13 year limit problem. If one had the source code, the natural thing to do would be to use a double type number rather than integer. The max number would then jump to 18446744073709551615. The problem is we don't have the source, and trying to change it into a double may not be feasable.

However, if I understand this correctly, this is a "game tick" accumulator, and we can see how game ticks translate to time in the define.h header.

/* Time Information (in Ticks) */
#define ONE_GAME_SECOND (10)
#define ONE_GAME_MINUTE (60*ONE_GAME_SECOND)
#define ONE_GAME_HOUR (60*ONE_GAME_MINUTE)
#define ONE_GAME_DAY (24*ONE_GAME_HOUR)
#define ONE_GAME_WEEK (7*ONE_GAME_DAY)
#define ONE_GAME_MONTH (30*ONE_GAME_DAY)

So let's assume that for whatever reason we can't make the tick accumulator wider (to double precision). How about doing the opposite: making one day half the amount of ticks? So one second becomes 5 ticks, one minute 300 ticks. In theory that would at least double the 13 year limit, but the implications of such a change may be too large (ie does it affect combat or other things that might rely on time events). Just a thought.
 
dude_obj said:
If you create a loader with 0.1 FO2LC and put that in \Fallout2 does it not work on Win98?

Yes- there is two problems
first: have Win98
second: have other version of fallout (fo2lc.flc is the same as fallout2.exe uk1.02 so must change on this)

if someone got the same configuration- solution will help
loader work now properly for me
 
Lich said:
Yes- there is two problems
first: have Win98
second: have other version of fallout (fo2lc.flc is the same as fallout2.exe uk1.02 so must change on this)

First, as a reference, it seems that loaders created by 0.1 FO2LC work properly on Win98 with a US 102D executable. This was tried today by corpse. And both versions of FO2LC work for me on Win2k with US 102D.

Now regarding FO2LC.FLC ... I thought Andy said (in another thread) that the whole idea of this file was to force compatibility, in other words make the loader use the US 102D executable. Are you sure that FO2LC.FLC is the same as UK 102 (I thought it wasn't). Try doing a file compare of the FO2LC.FLC in Andy's zip file with your UK exe:

FC FO2LC.FLC Fallout2.EXE

Are they the same? I thought they shouldn't be. When Andy released the 0.2 version he said this:

Okay, I've made a new version now. Download it at the same place www.spacetrain.com/FO2LC.zip

This version comes with a file called FO2LC.FLC, which is basically the US 1.02 version of the EXE file ...
http://www.nma-fallout.com/forum/viewtopic.php?p=159271&highlight=#159271

So I'm pretty sure the FO2LC.FLC is NOT the same as your UK exe.


My other thought is this ... is there any reason why you can't or shouldn't use the US executable with your game? The inclusion of FO2LC.FLC with the loader was intended to force this (I think, do I have that right Andy?).

The earlier 0.1 version of FO2LC did a check on file size of the EXE and applied patch at different offsets for the UK version. I think the 0.2 version, since it includes a US executable, patches to offsets only for US executable. Or maybe if it finds the file FO2LC.FLC it patches for US offsets, otherwise if the file size matches UK exe patch for those offsets (speculation).
 
uh i think got the UK version and fo2lc.flc is like US F2.exe
anyway- use this file to made compatibile with loader

(i test method and found sometime game crash when i run loader so is not perfect solution)
 
It shouldn't matter whether or not FO2LC.FLC is UK 1.02, or US 1.02. It works like this: Checks for FO2LC.FLC, if it exists, use it, if not use fallout2.exe, then it checks file size for version number, and applies appropriate patch.

The US exe runs fine on the UK version for me (may need the children frm's though), but I'm not sure about other versions (as I don't have them). The only thing I was worried about would be the language files (they're in an "english" folder for me, is that built into the exe? OR CFG file?)

Also dude_obj, I was testing out the debug patch but it just makes the game crash. Loads of debug windows appear as the game starts up, but in strange colours, then when I try to tstart the game it crashes....I',mm still going to add the patch into v0.3 even if I don't get it working on mine. Expect 0.3 to come out later today.
 
I use the debug patch every day Andy, it works fine for me. In fact I don't ever not use it, I'm always logging debug messages. Not sure what is wrong with yours but it definitely works for me. Did you try running noid's f2patch.exe. I did that on fallout2.exe and then used the noid patched exe with FO2LC, all works fine. These lines have to be added to the fallout2.cfg for messages to show up in the log:

[debug]
mode=environment
output_map_data_info=1
show_load_info=1
show_script_messages=1
show_tile_num=1

[sound]
debug=1
debug_sfxc=1


Some example debug output:

Fade time is 30
Fade steps are 1400
Chi squared is 25.341000, P = 36.420000 at 0.05
Sequence is random, 95yonfidence.
>partyMember_init Initializing sound system...soundInit: Setting primary buffer to: 16 bit, 2 channels, 22050 rate
soundInit: Primary buffer settings set to: 16 bit, 2 channels, 22050 rate
success.
Reading SNDLIST.LST Sound FX Count: 1935
Sounds are on.
Music is on.
Speech is on.
>gsound_init >initMovie >gmovie_init >moviefx_init >art_init >tile_init >obj_init >cycle_init >intface_init >iso_init >gmouse_init >proto_init >anim_init >scr_init >game_load_info >scr_game_init >wmWorldMap_init >CharEditInit >pip_init >InitLoadSave >gdialog_init >combat_init >automap_init >message_init >message_load >scr_disable >init_options_menu
>endgameDeathEndingInit

Playing movie: iplogo.mve
Direct Playing at (0, 0) not scaled
Movie aborted
Frames 11, dropped 0

Playing movie: intro.mve
Direct Playing at (0, 0) not scaled
Movie aborted
Frames 12, dropped 0

Playing movie: credits.mve
Opening subtitle file text\english\cuts\credits.SVE
subtitle: couldn't parse
Read 35 subtitles
Direct Playing at (0, 0) not scaled
Movie aborted
Frames 39, dropped 0
Loading background sound file 07desert.ACM... finding background sound playing succeeded.
Loading sound file nmselec0.ACM...succeeded.
Loading sound file nmselec1.ACM...succeeded.

Game Exit
 
Even if its a hack that isn't perfect, I think it's still worthwhile to have as an option in FO2LC.

I seem to recall the problem being an integer reaching its max value, so they forced end of game before reaching that limit. I found this in command.h today:

Yes there is a integer
Code:
DGROUP:0055F710 _fallout_game_time dd 49D40h            (55F710 mapper2.exe)
This patch removes this forced endgame call so yo can play but the game time is wrong(reset to start)
When limit is reached then this variable is set to 0.

I found my old notes on my work on this issue:
(all mapper2.exe)
I replaced the endgame call with new call
address:BD9D3(4BE5D3)
Code:
000BD9D3 8B15 10F7 5500 81EA 0027 5CF4 8915 10F7 ....U....'\.....
000BD9E3 5500 EB0B F590 9090 9090 9090 9031      U............

this new call is to empty code block at: 12CF88 - 52DB88

I put there a small procedure:
Code:
0012CF88 5150 A1FA 6156 0089 C158 8D34 0859 E9B5 QP..aV...X.4.Y..
0012CF98 08F9 FF00                               ....
This proc clears _fallout_game_time var and add 12 (years) to a new created year variable in data block.

Code:
file: 164FFA   ASM: 5661FA
DGROUP:005661FA                 db    0 ;

Thats all i got in my files but i remember there should be one more change:
Code:
AUTO:004BE44A                 lea     esi, [eax+8C1h]
Should changed to call to this new date var.

Now how this work:

Current data = Start year constant + _fallout_game_time

I changed Start year constant to var and when _fallout_game_time is full (12 years)then it is reset to 0 and year variable is increased by 12. After this wee got empty _fallout_game_time and good date :).
 
jargo said:
Yes there is a integer

Annoying that they didn't use a double. They probably thought there was enough room in an integer. Then when they reached the max, to change format to double would have probably caused problems with other code that uses the game ticker. Reminds me of how IBM thought nobody would ever need more than 640k RAM in a PC in the beginning.
 
Still no luck with the debug patch, basically this is my problem: I apply the patch, update the cfg file etc. Then I try and run from explorer and nothing happens (game works, but no debug windows), so I go to CMD prompt and run fallout2.exe, and it works (debug windows are visible) up until the opening custcene, when the game crashes.

*EDIT*

My log file says this at the end:

Error during execution: Couldn't open scripts\ farmers fending off some scorpions.int for read

No current script




I am setting the enviroment variables before running from the CMD prompt, so I presum the failure running via explorer is that these variables aren't set? If so, I'm not sure what I can do for getting the debug patch to work with FO2LC
 
Andy-Spacetrain said:
Still no luck with the debug patch

Weird, I've been using debug for a long time, in FO1, FO2, and the mapper (the mapper doesn't require a patch).

You're not running f2patch.exe on a UK executable are you? Noid lists a UK version but its a dead link. I looked on the TeamX site and they too only have the US version f2patch.exe.

Try using this executable, that one is working for me (this is US102D patched with Noids f2patch). I have another version of the same thing also patched with jdoe's 800x600 resolution change. Both of these are working with FO2LC.

Perhaps the debug patch is one that requires the US master.dat?

I am setting the enviroment variables before running from the CMD prompt, so I presum the failure running via explorer is that these variables aren't set?

I do this in a batch file:

@ECHO OFF
@SET DEBUGACTIVE=LOG
@FO2XP.EXE

Where FO2XP.EXE is a loader created by FO2LC
 
dude_obj, I've tried everything, and I still have the problem. The debug output only works via batch file/command prompt with the environment variable DEBUGACTIVE set. I think my problem is a path problem or something, though I haven't found a solution yet. The game does almost work with it, I've made a loader file that applies the patch here: http://www.spacetrain.com/FO2Loader.exe (This was created using the new FO2LC)

Can you test that for me, and see if it works for you?
 
Wild_qwerty said:
What did you want the icon to look like :)


*EDIT*
Okay, I have made a couple of icons so far.
Whats you email address so I can send them to you

*EDIT 2*



I have a white abckgruond and a transparent background for this icon.

Thanks :)
 
Andy-Spacetrain said:
The debug output only works via batch file/command prompt with the environment variable DEBUGACTIVE set.

Yes, this is expected behavior! Enabling debugging requires the environment variable to be set. In my mod you always click on a batch file to start the game. The batch file sets the DEBUGACTIVE variable, copies in either a VGA or SVGA patched exe, and runs the FO2LC. It works perfectly. And if I want to turn debugging off, I can do so by setting the debug options to zero in the cfg file.

I don't use the GUI debugging, that's just annoying, I log to file. Like I said I just leave this on all the time. I'm going to write a script that saves the debug.log when the program is launched, because it's replaced every time you start the engine. This is so when people experience crashes they can email me their debug log. That log file is very useful! For example, it helped me figure out how to load an FO1 map with the FO2 engine, by telling me where it was crashing (first on a party member init, second on a proto init). I also use the debug_msg command in my own scripts for debugging.

http://www.spacetrain.com/FO2Loader.exe (This was created using the new FO2LC)

Can you test that for me, and see if it works for you?

No it is not working. I tried copying the Fallout2.exe right off the CD to be sure I had an untouched exe. I tried running the above two ways: With the exe called Fallout2.exe and with it renamed to FO2LC.FLC. Both give me this error:

The exception unknown software exception (0x0eedfade) occurred in the application at location 0x7c59bbf3
Exception EInOutError in module FO2Loader.exe at 00008A38. Invalid filename.

And now I'm seeing something like what was happening on Win98 for others, but on Win2K. If the executable is named FO2LC.FLC, after I run the loader, it is renamed to FO2LC.FLC.exe

Something weird is happening with your renaming, and its having trouble finding the executable.
 
Andy-Spacetrain said:
Sorry, my fault. Redownload it, it should work now

Yes its working now. An unpatched Fallout2.exe is writing debug messages to debug.log when loaded with your FO2Loader.exe.
 
Andy-Spacetrain said:
Okay, great. Now just the 13 year patch to go

Andy I forgot to mention, there is a small bug in your file open. If I create a loader that uses a different cfg file name, then open that loader in FO2LC, the new cfg file name is not shown, it always appears as fallout2.cfg. The other selections are correct, and I know the loader actually uses the custom config file, so I assume FO2LC is not reading the cfg file properly from the loader. It doesn't bother me because I don't really need that file open capability anyways.
 
dude_obj said:
Andy-Spacetrain said:
Okay, great. Now just the 13 year patch to go

Andy I forgot to mention, there is a small bug in your file open. If I create a loader that uses a different cfg file name, then open that loader in FO2LC, the new cfg file name is not shown, it always appears as fallout2.cfg. The other selections are correct, and I know the loader actually uses the custom config file, so I assume FO2LC is not reading the cfg file properly from the loader. It doesn't bother me because I don't really need that file open capability anyways.

Okay, I'll sort that out.
 
Andy-Spacetrain said:
Okay, 13 year patch is done for the loader. I'd be very grateful if someone could test it

I'll write a script that does game_time_advance to jump ahead 13 years and see what happens. But I need a loader with movies disabled. I have tried this before, and without movies disabled, it will try to play all of those hanukin dreams and the engine isn't happy when I try to advance. Could you either upload a loader with the movies disabled, or upload the new FO2LC and I'll make a loader.
 
Back
Top