Fallout 1 using Fallout 2 engine - help requested

Sduibek

Creator of Fallout Fixt
Moderator
Modder
Hi all,

So I've been working on this from time to time for a while (using the original work by Jordan), and most of the things that I haven't worked out are at least things I know how to fix, just haven't actually done the footwork yet.

However, there's a few things that I could really use help on; that I think someone here might know how to do but not sure who it would be.


-- Water chip quest in Pipboy (countdown post-it note) [Possibly fixable using Sfall GUI commands, see post from Lexx - seems this is definitely doable but needs a way to make sure the graphic always stays on top]

-- Dotted line while moving on world map [Maybe doable with Sfall, I would guess. No idea though.]

-- Tell-Me-About button does not exist. [can use workaround of having entries in an equivalent in-dialog selection, i.e. in dialog will always have "Tell me about..." as clickable option, from there will have options of what to ask about. Otherwise, will need functional GUI elements added and rebuilding the Tell Me About code, which basically reads specific entries and if those entries are found, displays specific other entries and plays the related sound file, for Talking Head characters]

-- Is there a way to script or automate the building of the random encounter tables? I have all the pertinent data from the Fallout 1 scripts, but I'm a bit overwhelmed by the thought of typing up all 840 sections completely from scratch.

-- Perks and Traits need to be reviewed and changed to be identical to Fallout 1's. How hard is this? What exact files need to be modified? Can all of it be done with Sfall?

-- How the game calculates derived stats, skill percentages from stats, and other such equations needs to be the same as Fallout 1. Can this be done via Sfall?
 
Sduibek said:
-- Triggering "Do you wish to keep playing?" prompt from Fallout 2 so we don't have to use Corpse's Endgame Mod hack. [is this just a Global Variable or what?]

Like I said earlier, it's a part of endgame_slideshow (so definitely no global variable); but if you already knew that, then what's the problem? Do you want to have it separate from the slideshow or something; and if so why (can't really remember how it was in Fallout 1, but I thought the slideshow was after the confrontation with the overseer)? Sorry if I'm missing something obvious.
 
JimTheDinosaur said:
Sduibek said:
-- Triggering "Do you wish to keep playing?" prompt from Fallout 2 so we don't have to use Corpse's Endgame Mod hack. [is this just a Global Variable or what?]

Like I said earlier, it's a part of endgame_slideshow (so definitely no global variable); but if you already knew that, then what's the problem? Do you want to have it separate from the slideshow or something; and if so why (can't really remember how it was in Fallout 1, but I thought the slideshow was after the confrontation with the overseer)? Sorry if I'm missing something obvious.
Oops, I must have forgot :oops:

So endgame_slideshow command is run, and the prompt automatically pops when that's done? Cool.
 
Ah, no problem! Yup, if you test it you'll see a blank screen (no information for the slides yet I guess) and then the prompt.

-- Is there a way to script or automate the building of the random encounter tables? I have all the pertinent data from the Fallout 1 scripts, but I'm a bit overwhelmed by the thought of typing up all 840 sections completely from scratch.

That sounds insane; I remember looking at the Fallout 2 worldmap.txt after you sent me the PM, but it didn't look that huge to me. How does FO1 handle random encounters then? Also in a text file?
 
JimTheDinosaur said:
Ah, no problem! Yup, if you test it you'll see a blank screen (no information for the slides yet I guess) and then the prompt.

-- Is there a way to script or automate the building of the random encounter tables? I have all the pertinent data from the Fallout 1 scripts, but I'm a bit overwhelmed by the thought of typing up all 840 sections completely from scratch.

That sounds insane; I remember looking at the Fallout 2 worldmap.txt after you sent me the PM, but it didn't look that huge to me. How does FO1 handle random encounters then? Also in a text file?
Yeah, if you go to the end of worldmap.txt you've got Tile 0 through Tile 19, and each one has 42 entries (0_0 through 6_5) -- 42 * 20 = 840.

And those are just referencing the Encounter Tables themselves, which you also have to build :\

If I have to do it by hand that's fine, I'm not gonna bitch about it, but I figure it's better to check if someone found a shortcut before committing to doing it manually :D
 
Sduibek said:
Yeah, if you go to the end of worldmap.txt you've got Tile 0 through Tile 19, and each one has 42 entries (0_0 through 6_5) -- 42 * 20 = 840.

And those are just referencing the Encounter Tables themselves, which you also have to build :\

If I have to do it by hand that's fine, I'm not gonna bitch about it, but I figure it's better to check if someone found a shortcut before committing to doing it manually :D

Could you send me the worldmap.txt so I can see if I can think of something? I have Fallout 1 installed, but apparently dat explorer only works on FO 2 files or something.
 
Sure thing, here you go. There's a blank one and a full one, the full one should be what came from FO2 master.dat.

https://www.dropbox.com/sh/nsc9me5rblndv6q/Mxi_H6Oor1

Ultimately what will need to happen is pull the data from the Fallout 1 script files (RNDDESRT, RNDMTN, RNDCOAST, RNDCITY) and translate those into worldmap.txt - which isn't too bad, just copying over some numbers basically. Script#, PRO#, how many encounter, sceneryID#s, etc.

The tough part will be figuring out the percentages. They will have to be extrapolated from the rolls in those scripts, and if needed, simply made up. I think part of it is probably hard-coded (picking what chance things will be found). This is especially true of special encounters and the like.
 
Sduibek said:
Sure thing, here you go. There's a blank one and a full one, the full one should be what came from FO2 master.dat.

https://www.dropbox.com/sh/nsc9me5rblndv6q/Mxi_H6Oor1

Ultimately what will need to happen is pull the data from the Fallout 1 script files (RNDDESRT, RNDMTN, RNDCOAST, RNDCITY) and translate those into worldmap.txt - which isn't too bad, just copying over some numbers basically. Script#, PRO#, how many encounter, sceneryID#s, etc.

The tough part will be figuring out the percentages. They will have to be extrapolated from the rolls in those scripts, and if needed, simply made up. I think part of it is probably hard-coded (picking what chance things will be found). This is especially true of special encounters and the like.

Oh, sorry, misunderstanding then; I thought FO1 had a worldmap.txt version of its own (only differently formatted or something). I'll see if I can check out those scripts then. One thing I was thinking if copying easily becomes a problem, skipping the worldmap.txt and making a global script instead might be an easier route, though I'm not sure. Depends also on how far you're willing to stray from the FO1 encounter template. I always thought they were very boring compared to the FO2 ones, so I wouldn't mind a more unorthodox way of dealing with them, but it's up to you.
 
Well I think at the beginning (so that we have a playable version people can start testing to provide feedback), I may do a hack job that I thought of while looking at some files Cubik2k sent me:

1) Encounter tables in worldmap.txt point to a "blank" map (such as DESERT1.MAP)

2) These "blank" maps have MAP_SCRIPT set to the appropriate file from Fallout1 files -- RNDMTN, RNDCITY, RNDDESRT, RNDCOAST -- and those of course generate everything like they already are doing.

That's what Fallout 1 is doing anyway, it's just doing it behind the scenes in the exe before running the RND* scripts, instead of being in a text file.

That way for the time being I'd just have to build a basic skeleton worldmap.txt and the encounters would be identical to Fallout 1. Until I get the motivation to build the entire worldmap.txt properly :P
 
About the "Tell me about" function, I believe it'll be better if the text is integrated into dialogue rather than trying to rebuild the whole thing.

Not only is that function completely superfluous, figuring out the proper keywords is a pain.
 
Sduibek said:
-- Dotted line while moving on world map [Maybe doable with Sfall, I would guess. No idea though.]
No I don't think it's possible with sfall at the moment. There's also no terrain info in Fallout 2 (when you move the mouse over the green triangle).
But there may be an even bigger problem, namely travel speed. Fallout 2 makes no difference in travel speed depending on terrain, it's the same speed all the time. At least i think so, though vanilla it goes too fast to tell (sfall is slowing it down, but I don't think it changes anything else). Don't know if travel speed needs to be synched because of the time limit in Fallout 1, or if it's even possible.

Sduibek said:
1) Encounter tables in worldmap.txt point to a "blank" map (such as DESERT1.MAP)

2) These "blank" maps have MAP_SCRIPT set to the appropriate file from Fallout1 files -- RNDMTN, RNDCITY, RNDDESRT, RNDCOAST -- and those of course generate everything like they already are doing.

That's what Fallout 1 is doing anyway, it's just doing it behind the scenes in the exe before running the RND* scripts, instead of being in a text file.

That way for the time being I'd just have to build a basic skeleton worldmap.txt and the encounters would be identical to Fallout 1. Until I get the motivation to build the entire worldmap.txt properly :P

1. Yes you could do that but it wouldn't be enough.

2. The map scripts for desert encounters chooses what encounter table to use depending on worldmap location. There are 15 different ones (and there's also 3 different mountain tables). It gets the info it needs from global variable 65, it's hard coded and is updated automatically by the F1 engine. F2 to my knowledge has no such thing.

3. If you want to take your shortcut or the one JimTheDinosaur (which would be better in my mind), you would have to build a table of all the worldmap tiles and compare it to your current worldmap position (well, it wouldn't have to be every tile, many of them can be grouped into zones), and then set g_var 65 accordingly.

Because of point 3 it may just be better to do it properly instead.

Also, is it known what the encounter chance is in F1, and if it's affected by any skills or perks?

Oh yeah, I made a map of all the random encounter tables.

[spoiler:dac0e27fde]
f1encmap.jpg
[/spoiler:dac0e27fde]
Code:
Random encounters:

The letter is for terrain. D for desert, M for mountain, C for coast and Ci for city.
The number is 65:G_var World_Terrain, it decides what encounter table is used.

Random City: don't check g_var 65, only 1 table

Random Coast: don't check g_var 65, only 1 table

Random mountain:  G_var65 set to   2 = North_table, 3 = South_table, else = Vault table

Random Desert:   G_var65 set to    0 = North_table, 1 = South_table, 2-4 = random North_table or South_table, 5 = Shady_table, 6 = Raider_table,
                                   7= Junk_table, 8 = Hub_table, 9 = Necrop_table, 10 = Steel_table, 11 = Vats_table, 12 = Glow_table,
                                   13 = Bone_table, 14 = Death_table
 
Oh wow thanks so much for the map. Did you just walk to each square and hold the mouse over the green triangle?

Also, is it known what the encounter chance is in F1, and if it's affected by any skills or perks?
Not sure on changes to it, and the best information I have is from Cubik2k's "encounter tweaker" utility:

http://www.nma-fallout.com/forum/viewtopic.php?t=59426

According to it, encounter initiator is checked every 65 ticks (6.5 seconds) and the chance of a normal encounter is 33%. That's all I've got.

I guess maybe best would be to ask him directly, maybe he's got more info on that somewhere :shrug:


EDIT: I think i'll just build the encounter tables the proper way. I'm gonna be doing it that way anyway eventually, might as well do it right the first time.

Plus I've been thinking, considering the small number of encounters in Fallout 1 compared to Fallout 2, a lot of it can just be pasted over and over, so even though it's 840 lines I think it may not be as bad as it sounds.
 
Sduibek said:
Oh wow thanks so much for the map. Did you just walk to each square and hold the mouse over the green triangle?
Nope, had to save on every tile to check what global variable 65 was.
Only way to know what encounter table is used for each tile.
Took a few hours, but sometimes there just are no shortcuts. :shrug:

Sduibek said:
I think i'll just build the encounter tables the proper way. I'm gonna be doing it that way anyway eventually, might as well do it right the first time.

Plus I've been thinking, considering the small number of encounters in Fallout 1 compared to Fallout 2, a lot of it can just be pasted over and over, so even though it's 840 lines I think it may not be as bad as it sounds.
Yep. I think the hard part is gonna be tweaking the numbers and make it all feel like Fallout 1.
 
Dammit! So close.
I made the encounters by filling in all the tile data in worldmap.txt,
and then link them to the encounter tables. I left each tables first encounter empty so the original scripts can do the job of setting it up instead, and only filled in the special encounters.

Then I built a table of worldmap positions that set g_var 65 to the correct value (so the old scripts would set up the correct encounters) and put it in the random map scripts.

It all works perfectly except for one small detail, encounter details in the message window ("You encounter:", and then what you encounter). In Fallout 2 the text is automatically pulled from worldmap.msg and you can't take it away. If I delete the whole entry it displays error, and if I only remove the text, I get 2 green dots.

Anyone have a clue how to deal with this?
I know filling out worldmap.txt proper is one way, but one I tried to avoid.
Sduibek, I've done your 840 lines, and I think that was the easy bit.
 
Here's an example:

A filled out a Master tile in worldmap.txt:
Code:
[Tile 6]
art_idx=345
encounter_difficulty=-300
0_0=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
0_1=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
0_2=City,No_Fill,Uncommon,Uncommon,Uncommon,City_table
0_3=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
0_4=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
0_5=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
1_0=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
1_1=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
1_2=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
1_3=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
1_4=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
1_5=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
2_0=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
2_1=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
2_2=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
2_3=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,Vault_table
2_4=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
2_5=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
3_0=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
3_1=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
3_2=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
3_3=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
3_4=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
3_5=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
4_0=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
4_1=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
4_2=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
4_3=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
4_4=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
4_5=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
5_0=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
5_1=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
5_2=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
5_3=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
5_4=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
5_5=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table
6_0=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
6_1=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
6_2=Mountain,No_Fill,Uncommon,Uncommon,Uncommon,North_mountain
6_3=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
6_4=Desert,No_Fill,Uncommon,Uncommon,Uncommon,North_table
6_5=Desert,No_Fill,Uncommon,Uncommon,Uncommon,Junk_table

That tells the game what terrain and encounter table to use on each tile in master tile 6.
So lets say we get an encounter on a tile with the Junk_table, we go and have a look at the Junk_table.

Code:
[Encounter Table 6]
lookup_name=Junk_table
maps=Desert Encounter 1, Desert Encounter 2, Desert Encounter 3
enc_00=Chance:82%
enc_01=Chance:3%,Counter:1,Special,Map:COLATRUK,Enc:Special1, If(Global(605) < 1)
enc_02=Chance:3%,Counter:1,Special,Map:TALKCOW,Enc:Special1, If(Global(606) < 1)
enc_03=Chance:3%,Counter:1,Special,Map:FOOT,Enc:Special1, If(Global(607) < 1)
enc_04=Chance:3%,Counter:1,Special,Map:USEDCAR,Enc:Special1, If(Global(608) < 1)
enc_05=Chance:3%,Counter:1,Special,Map:TARDIS,Enc:Special1, If(Global(609) < 1)
enc_06=Chance:3%,Counter:1,Special,Map:FSAUSER,Enc:Special1, If(Global(610) < 1)

(the percentages and globals probably needs tweaking so don't mind them)

As you can see I left enc_00 blank except for chance %, so the original maps script can do the same as it's always done.
For fallout 2 style it should really be enc_00=Junk1, enc_01=Junk2 etc.
I added code in the map script to set global var 65 like this:

Code:
							if ((metarule(44, 0) > 700) and (metarule(44, 0) <= 1050) and (metarule(45, 0) > 300) and (metarule(45, 0) <= 600)) then begin
								if (((metarule(44, 0) > 800) and (metarule(44, 0) <= 1000) and (metarule(45, 0) > 450)) or ((metarule(44, 0) > 1000) and (metarule(45, 0) > 550))) then begin
									set_global_var(65, 7);
								end
								else begin
									if (((metarule(44, 0) <= 800) and (metarule(45, 0) > 300)) or ((metarule(44, 0) <= 850) and (metarule(45, 0) > 350) and (metarule(45, 0) <= 450)) or ((metarule(44, 0) > 1000) and (metarule(45, 0) <= 450))) then begin
										set_global_var(65, 2);
									end
									else begin
										set_global_var(65, 0);
									end
								end
							end

Anyway, pretend we get the junk1 encounter, the map script will give you this encounter description "Radscorpions, incoming!".
A line under that the F2 engine will add "{2998}{}{You encounter:}" and then a second line with {3300}{}{A war party.}
The text is from worldmap.msg, it has sections of text for each encounter table. Every table can have 50 lines, so I guess that's the encounter limit for each table.

My encounter method works but looks like shit because of this problem.
 
Al Right! Cubik is feeling generous with his worldmap editor.

Big thumbs up!

I thought you'll never release it))
 
@ Cubik2k

Cool, looks nice :ok:

While excellent for editing, I'm not sure it's really easier when recreating the whole worldmap.txt from scratch.
Maybe for tweaking things afterward.
 
Back
Top