November 16, 2016

1.3.4 Support Coming

Sounds like Terraria v1.3.4.x broke RomTerraria again.

If I had to make a guess, I'd say that the new render pathway for water changed the number of RenderTarget2D's in the code.  If that is the case, it's probably a 20-30 minute fix.

That said, I haven't had a chance to look at it because I've been working, and I won't be getting home from work until late tonight.

I'll take a look at it after dinner tonight.

Update 11/16/2016, 8:23pm: I've got the resolution patch working, but the new water effects are causing the following crash that I need to fix first...

...removed for space...

Update 11/22/2016, 11:10am: Patch appears to be working, but I have to finish my test pass before I release it.  Hopefully tonight after dinner.

Update 11/22/2016, 6:41pm: I found a crash bug with Working on patching it now.

Update 11/22/2016, 8:24pm: Okay, I've got a choice.  I can either release a version that will only work with all the visual bells and whistles turned off, or I can hold back and release it once I figure out what is causing the wave mask to get corrupted and crash approximately ten frames into rendering.  Right now, I'm planning on holding back until I get this tracked down.

I know that isn't what people want to hear, but I'd like you to remember two things.  First, the reason that RomTerraria works as well as it does across multiple versions of the game is that I don't do source decompiling/recompiling.  I do MSIL-level opcode patching.  This requires a lot more time to do right because if I do it wrong, I create invalid code and that breaks everything else.

Second, the reason that you never see anything about this mod over on anything official is because back when Terraria launched, some asshats were using my mod as a crack for Terraria and they bundled my mod with the cracked version.  Because of this, Re-Logic appears to see this mod as something bad.  As someone who spent a decade in the games industry fighting pirates, I can't blame them.  I'm absolutely certain that they see me as someone who has enabled bad behavior and they don't want to enable me to succeed in this venture.

I've been maintaining this mod as a spare-time project for over five years now, and it wears on me.  I don't make any money off of it, partly because I don't want to further enrage Re-Logic, and partly because it doesn't seem right to me to make money off of mods.  However, that means that this mod is secondary to other projects at both work and home.  Even tonight, I've had to spend time helping out a lady friend.

I spend the time that I can afford to on this, both from a financial point of view, but also a mental point of view.  Working on this mod isn't as simple as hitting F5 in Visual Studio and seeing what happens.  It requires a lot of time to trace through each failure.  It requires a lot of effort to inject diagnostics code into the assemblies.  It requires a lot of patience to track down crashes, support comments, etc.  I have a finite amount of willpower to get through each day and this mod gets the last few minutes of the day usually.

I'll keep working until I head to bed tonight, but I won't be able to work on it again until Thursday night or Friday morning at the earliest due to the holiday and social obligations.  I'm off Friday, however, so hopefully I can refocus my energies for a bit and get this fixed.

Update 11/22/2016, 8:50pm: Around 40 frames in, something is corrupting Terraria.GameContent.Liquid.LiquidRenderer._waveMask and changing it from an array of 40000 XNA Color structs to an array of 39936 XNA Color structs.  This is going to take a lot longer to figure out since Terraria uses unsafe code to work with that array.

Update 11/22/2016, 9:05pm: Well, the good news is that I figured out the root cause.  There's a bad bug in LiquidRenderer.InternalPrepareDraw when it's dealing with a fixed pointer to _waveMask.  This code has a lot of issues.  It's not cache coherent (looping over Y inside of a loop over X), and the root cause is a chunk of code that starts writing before the variable if you are on a screen with certain conditions set:

*(vISCOSITYMASK - 200 * sizeof(Color)) = *vISCOSITYMASK;

They're trying to set the pixel above a point to the value of that point.  That line should scare you.  Scares the hell out of me.  Until I can trace through what the hell led to this, or Re-Logic writes a cache coherent version of this method that doesn't write to memory before vISCOSITYMASK pointer, there will not be an update to RomTerraria.

Update 11/26/2016, 12:57am: A test version that seems to work with is available over at the update post.


Rafael said...

Plz, we need you, help us! I literally can't play in my monitor without this mod =(

Unknown said...

Same here.

VV3 said...

Re-digit is just filled with bunch of "we do what we want" dev and staff members.
We have bloody 2016 and they simply cannot rearrange the resolution by simply adjusting the parameters on their own source code. A work of few minutes, not even at all ...
I am waiting for either your modification, or simply for the latest Terraria (I guess, .4.2 isn't the last one) and will decompile it once again.

I hate their attitude not fixing some minor technical bugs like this on their own.

Unknown said...

is it ready yet? What can I do to help?

Unknown said...

Just chiming in with a thank you for doing this.
Plying on an ultra widescreen while windowed makes for a sad experience.

Unknown said...

Agreed. I am very thankful that you do this.

David said...

It never stopped working for me, I just patch again.

However, I lost the map after the first 1.3.4 version and I can't open it anymore. Every subsequent .x update I would repatch but never had the map. I don't even have the map before patching a new Terraria.exe.

Russell said...


Unknown said...

I am not meaning to be pushy, I would just like an ETA. because I can't play without this mod. I can't go back.

Russell said...

So your old 1.3.3.X .exe fix still works to launch the game, but the map and water features don't function when in-game. I have no map and the water is just like normal...but the game isn't causing a crash as you're suggesting. And the resolution works fine. Any way to release with the new water particles disabled/unchanged and fixing the map and any other issues you've come across that are able to be patched currently?

Unknown said...

so you're telling me I will never get to enjoy Terraria in 2560x1080 ever again?

Unknown said...

if you are not going to update the mod then tell me how to uninstall the mod because my game is broken now. I can't open my map