Jump to content

Creating extended night versions of original maps from original art


maurvir

Recommended Posts

This is related to my ongoing quest to get fog in the original parts of the game, but I figure it might be worth a shot.

Is it possible to convert the existing artwork into the "new" artwork required for extended night in the EE's? That is, could I take the current landscape art, convert it to the new day format, then have NI show the "night time" variant and convert that to the new night format. This would, in theory, allow existing forest areas to use the extended night flag, allowing proper fog display.

Such a mini-mod would make it trivially easy to enable fog, but I'm not sure how to do the conversions, nor do I see anywhere in NI to set the day/night tile sets.

For a more advanced version of this, how would you go about altering the lighting? (say for mushrooms or windows on cabins, etc.)

Thanks!

Edited by maurvir
Link to comment

Just creating a 'night' copy is fairly trivial, iirc. Copy the tileset and add an 'N' suffix; copy the light map and change 'LM' to 'LN', and set the extended night flag. There might be one or two more steps (I haven't done it for a while) but that's basically all you need.

To get different lighting effects, you need to alter the lightmap, the bitmap that determines lighting. To actually get beams of visible light from the windows, and the like, you need to alter the artwork. 

Link to comment
26 minutes ago, DavidW said:

Just creating a 'night' copy is fairly trivial, iirc. Copy the tileset and add an 'N' suffix; copy the light map and change 'LM' to 'LN', and set the extended night flag. There might be one or two more steps (I haven't done it for a while) but that's basically all you need.

To get different lighting effects, you need to alter the lightmap, the bitmap that determines lighting. To actually get beams of visible light from the windows, and the like, you need to alter the artwork. 

The idea here is that I am generally happy with the "night" the game creates by altering the lighting, so I was going to just take the night version from NI and convert it to a night tile set at first, just to get past the initial "bug". Then, as needed, alter the art in Photoshop to create lighting effects. I'm just trying to get the workflow established before moving on.

This is my first real attempt at modding, and I'm having to learn as I go. Next step is to figure out how to go between PNG and TIS...

Link to comment

Unfortunately, simply adding a TIS file with the N at the end and setting the flag did not work. It still causes a CTD. I tried both versions in NI - legacy and PVRZ-based.

Apparently I need to create a "night WED", but I'm not sure how to do that in Near Infinity. The tutorial I found uses DLTCEP, but that is for new areas. I'm trying to retrofit existing areas.

Link to comment

How does this EEEEEEEEEEEextended night work, anyway? I know it's not any longer than usual. I wanted to make - well, I did make - a night-only area once, and that was without any special parameters and ending letters. I just recolored the tiletset and converted the PNG to the TIS. But that doesn't count, does it? You want the change from day to night. All I can say is that the Day/Night flag needs to be on for the area, otherwise it'll be stuck in perpetual daytime. Also you don't need "Extended night" for fog. But these are just scraps in my mind.

Link to comment

No, it's fine. You need some entries in FOG.2DA, and then voila. Activate it from the action or the spell. Did I have a screenshot with fog somewhere... Deleted it. From Nashkel. I'm pretty sure it has no special flags set.

Link to comment

Ok, this is getting closer, but still not quite there. The doors are missing, and more distressingly, once a door comes into view (or rather the black block where it should be), I get a CTD. However, the fog is the right color!

Which means I can probably now do forest areas that don't have movable doors, but not towns for now.

I do appreciate the help, and if I can get this squared away, I will definitely try to create an "enhanced forests" mod when I'm done.

Edited by maurvir
Link to comment

As an aside, when I converted the PNG using legacy, I got a mess of horizontal lines everywhere. I converted using the PVRZ-based, which cleaned up the lines, but left a whole bunch of extra files. I wasn't sure if they were required or not, so I dumped them into the override folder along with the new TIS file.

Also, nope - I tried the wilderness lake, BG4200, and it CTDs a few seconds after entering the map as well. Interestingly, it did NOT do this the first time I went there, but when I had failed to update the TIS file. (I had accidentally forgotten to update the night WED file). When I went back and updated it with the correct TIS file, I started crashing.

After a bit of debugging, it seems that it is the TIS files themselves. I converted the day file and now I get a CTD if I go to the area day or night.

Edited by maurvir
Link to comment

All of the files from conversion are required. Ship them along with the mod. Those infamous horizontal lines appear, if I'm not mistaken, when you convert a PNG that is not 256 colors. At least I converted a 256-color PNG to a "legacy" TIS just now, and it looks normal.

Link to comment

The original PNG from NI is a 24-bit color image, though it's clear the original art isn't 24-bit. I downsampled to 256 colors using an adaptive scheme, but I still got a CTD on the resultant TIS file.

It did, at least, fix the horizontal lines, though. Progress!

Edited by maurvir
Link to comment

FWIW, here is code that just enables the extended night for an area:

DEFINE_ACTION_FUNCTION are_extended_night
	STR_VAR are=""
BEGIN
	// get the WED file; add the extended_night flag
	COPY_EXISTING "%are%.are" override
		READ_ASCII 0x8 wed // get wed file
		WRITE_LONG 0x48 (THIS BOR BIT6) // set extended night
	// already done? If so don't worry
	ACTION_IF !FILE_EXISTS_IN_GAME "%wed%n.wed" BEGIN
		// clone the wed file
		COPY_EXISTING "%wed%.wed" "override/%wed%n.wed"
			READ_ASCII 0x24 tis
			WRITE_ASCIIE 0x24 "%tis%N"
		BUT_ONLY
		// clone the tis file
		COPY_EXISTING "%tis%.tis" "override/%tis%n.tis"
		// clone the PVRZ files
		OUTER_PATCH_SAVE pvrz_base "%tis%" BEGIN
			DELETE_BYTES 0x1 1 // get the (dumb) BD convention for PVRZ file names
		END
		ACTION_CLEAR_ARRAY pvrz_copy
		OUTER_FOR (digit1=0;digit1<10;++digit1) BEGIN
			OUTER_FOR (digit2=0;digit2<10;++digit2) BEGIN
				ACTION_IF FILE_EXISTS_IN_GAME "%pvrz_base%%digit1%%digit2%.pvrz" BEGIN
					COPY_EXISTING "%pvrz_base%%digit1%%digit2%.pvrz" "override/%pvrz_base%N%digit1%%digit2%.pvrz"
				END
			END
		END
		// clone the light map
		COPY_EXISTING "%tis%lm.bmp" "override/%tis%ln.bmp"
	END
END

If you include this function and just do

LAF are_extended_night STR_VAR are=ar3300 END

then extended night should work without CTDs.

That said, this won't give you all that you want, because the new 'night' TIS is just a daytime TIS, so it won't get dark. You still need to recolor the TIS. But it might be helpful to use this as a starting point, so that at least you know the game isn't going to crash on you.

Link to comment

That's the thing. If I create the second WED file and alter the ARE file using NI, but used the original TIS for both, I don't get a CTD. As you said, it just doesn't look like it's night. The CTDs start when I try to use a modified image that has been converted to a TIS. That was why I was briefly excited - was able to walk around "at night" with fog, but with the day map art. As soon as I switched it to the new TIS, the game crashed.

It seems it doesn't like something about my converted TIS files, but I don't know what.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...