June 30, 2015

Productive Evening

By the time this post goes live, I'll have had over 500 downloads of RomTerraria 4 in just under three hours.  Not too bad.

That said, I've got a full day at the office tomorrow and need at least eight hours of sleep.  Have to keep at the full-time job because making mods doesn't pay bills.  I'll try to answer questions every evening (Pacific time) for the next bit, and if I have to release a patch, will do so as quickly as possible.

RomTerraria 4 Released

(6/11/2017 6:51pm: While the high resolution core of RomTerraria is now embedded into Terraria proper, they added in a forced minimum zoom level for higher resolutions.  New project created to take care of that.)

Note: This was tested on 1.3.3.  This does not work with 1.3.4 yet due to a change in visibility of a RenderTarget2D and some bugs in the new water code that I have to work around at higher resolutions.  A test build that supports v1.3.4.3 is available for download on this post, but has not yet been fully tested.

(9/11/2016 11:36am) Download RomTerraria 4 v1.2 here.  Updated for 1.3.3, and the instructions below have changed.

The v1.2 release fixes the "Retro" lighting issue introduced with v1.1. 

(6/28/2016 10:12am) Forgot to update this post with a link to the code on GitHub.

This release allows you to do the following:
  • Increase the maximum resolution of the Terraria client beyond 1920x1200.
  • Enable cooperative fullscreen mode.
  • Swap the left and right mouse buttons for our left-handed friends out there.  (new for v0.9)
  • If RomTerraria can't find your Steam folder, will now pop up a folder browser to let you tell it where your Steam or GOG version of Terraria is.  (new for v0.8)
  • Allow you to have the effects of the Gravity Globe without having the item equipped in an accessory slot.  Thanks to GamingWithRyan for the idea.  (new for v0.8)
  • Disable achievements (if you want).  (new for v0.2)

Terraria 1.3.0.2 at 2560x1440

To use:
  1. Unzip to somewhere other than where Terraria is installed.
  2. Right-click on Terraria in Steam, go to Properties, go to Local Files, and then Verify Integrity of Game Cache.  Every crash I've looked at so far has been caused either by the game itself or a bad file somewhere.  This also resets your Terraria installation to the latest version of the game.
  3. Run Terraria once.  If you don't do this, you can run into situations where RomTerraria can't find or patch your version of Terraria.
  4. Run RomTerraria 4.0 (filename is RTRewriter.exe).
  5. Only select "Enable Cooperative Fullscreen" if you are running a multimonitor solution or know what this is.
  6. Click "Open Terraria Save Game Folder."
  7. Click "Update Terraria." A Terraria.exe file and an RTHooks.dll file will appear in your save game folder.
  8. Open your Terraria folder on Steam.
  9. Rename Terraria.exe to Terraria.Original.exe.
  10. Copy Terraria.exe, Terraria.exe.config, and RTHooks.dll from your Terraria save game folder to your Terraria folder.
  11. Launch the game from Steam.  The game may crash once.  If it does, run one more time.
  12. Starting with v1.3.3, Terraria won't let me default to the maximum resolution of your default monitor, so you will have to go into Settings > Video > Resolution to change your resolution.
If you select a higher resolution and it won't go above 1920x1200, go into windowed mode, change the resolution, then pick "Go Fullscreen" from the options menu.

Please note that if the game is updated, you'll have to repeat the above steps.

One note: the best thing that could ever happen to this mod would be for its main reason for existing (resolutions greater than 1920x1200) to cease to exist.  If Re-Logic would like the code to enable high resolutions, just let me know.  It's yours for free, and would take very little time to implement.

If you like it, and want to tip in Dogecoin, here's someplace you can send them:
DMVNZDrDxqygKg92v7KjbgJPrDz6cseWF3

FAQ:

I'm not able to go above 1920x1200.
I'm looking into each of these reports.  If you can't go higher than 1920x1200, enable cooperative fullscreen.  When cooperative fullscreen is enabled, I set the screen size to the size of the default display adapter (monitor 1), set full screen to false, and set the window style to "none," meaning it hides the border and widgets.

The game is crashing with RomTerraria installed.  (Note that this usually happens at resolutions higher than 4096 in any one direction.)
Try running v0.7.  You should now get a stack trace.  Post that stack trace in the comments.  If you can't post it to the comments, you can email it to romterraria -at- romsteady.net.  If you don't get a stack trace, it's okay.  I'm working on setting up a 3-monitor setup at home so I can troubleshoot it.

After installing RomTerraria, I can't open the map.
Go into Settings > General, and make sure "Map Enabled" is set.  It's been randomly disabling for some users.

After installing RomTerraria, I seem to be capped at 60fps.
If you are in cooperative full-screen mode, you'll be capped to your desktop refresh rate.
If you are in regular full-screen mode, I'm investigating that.

I can't get the game to run after this, I'm running Windows Vista/7/8/8.1, and my copy of Terraria is installed under C:\Program Files.
Please install the game to a different Steam install location (like C:\Steam) or run Windows Explorer as an administrator.  Windows Vista and above created a great security mechanism called VirtualStore which can make it look like you are mucking around inside C:\Program Files, but are actually working against a folder in your User folder.  The way Steam works, it won't like having the replacement Terraria.exe or RTHooks.dll in the VirtualStore folder.

How does this find my copy of Terraria?
I use .NET's Process.GetProcesses() function to get a list of all processes on your machine that have "steam" in the name.
If I find one named "steam.exe," I look for Terraria in [that file's folder]/SteamApps/Common/Terraria.
If I don't find it there, I assume that it's in a different Steam install folder, so I open your config/config.vdf file and look for the path in InstallConfigStore/Software/Valve/Steam/apps/105600/installdir.
If I don't find it there, or if I don't find Steam.exe, I look for the GOG version by checking the registry key HKEY_LOCAL_MACHINE\SOFTWARE\re-logic\terraria\install_path.
If it still can't find it after that, it pops up a browse dialog.

Old versions of RomTerraria patched out the need for Steam.  Will you do that in RT4?
No.  It works fine under Steam now due to how they handled Steamworks this time.

There are one or two new files in my save game folder: RomTerrariaDebug.txt and/or CrashInInitTargets.txt.  What gives?
RomTerrariaDebug.txt is a general purpose place where I can log out debug text.  Right now, I'm putting texture load debug info there if you've hooked the texture loader.
CrashInInitTargets.txt gives me all the info I need to troubleshoot hardware acceleration issues.

How do I uninstall this mod?
Right-click on Terraria in Steam, go to Properties, go to Local Files, and then Verify Integrity of Game Cache.  This will "unpatch" Terraria.

When I use this on the GOG version, I'm told to run this through Steam.  What gives?
This isn't happening for everyone, but I'm investigating the cause.

When can I expect a response to my questions?
I'll respond as quickly as I can, but the most likely time periods are between 7-8am Pacific and 7-10pm Pacific daily.

I'm technically advanced and think I can help out.
Code's on GitHub.  Have fun.

Older Version Archive:

v0.8 Download (works for 1.3.0.8)
v0.7 Download (works for 1.3.0.4, 1.3.0.5, 1.3.0.6, 1.3.0.7)  
v0.6 Download (works for 1.3.0.4, 1.3.0.5) 
v0.5 Download (works for 1.3.0.3)
v0.4 Download (works for 1.3.0.3)
v0.3 Download (works for 1.3.0.2)
v0.2 Download (works for 1.3.0.2)
v0.1 Download (works for 1.3.0.2)

June 28, 2015

RomTerraria 4 Release Date

I'm targeting a July 1 release date for RomTerraria 4.

This version will be updated to work with Terraria 1.3, which will be released at approximately 10am Pacific on June 30.

This release will ONLY include support for modifying resolutions and enabling cooperative full-screen. The patch notes make it look like 1920x1200 will still be the largest supported resolution, so RomTerraria will still be needed.

Why release the next day?  Well, I have to be at work between 8:30a and 9a on June 30.  I won't be home until almost 6p that day.  I have to eat dinner, investigate the code, and figure out how to do the following:
  • Disable achievements if it's the Steam version.  Steam achievements have been added to this game, and since I don't want anyone to get a Steam ban for using RomTerraria, this has to be done.
  • Add the resolution to the UI.  Each version has had its own weird way that this has had to be done.
  • Redirect file loads so that the patched executable doesn't have to be in your Terraria folder.  This was one RomTerraria 3 feature that people liked, so I'm going to try to keep it.
  • Build the whole thing into a single patcher.
Once all that is done, I'll have to test it.  I've got a nice 2560x1440 monitor right in front of me so I can test the living daylights out of the release.

Finally, I have to upload it and update all the download links everywhere, but I'm probably going to create a RomTerraria 4 download page and just point everything there.

See you later this week.

Update 6/30, 10:15am: Terraria 1.3 released.  Looks like the code will be easier to port than I thought.  I'll need to change from searching for Main to InternalMain, ensure that SocialMode is changed from Steam to None, and then test my code.  May even be able to get rid of some of my code completely.  I like simplification.

Can't do any of this until I get home tonight, but shouldn't be too much of a problem.

Update 6/30, 5:30pm: Still not home, but I'm already getting crash reports from people running the old mod.  Don't run the old stuff.

Update 6/30, 6:10pm: Home now, but it looks like they did another update since this morning.  Give me a few minutes to eat dinner, please, then I'll start on updating the mod.

Update 6/30, 6:33pm: In menu in Steam at 2560x1440. Needs additional testing before I can release it.

Update 6/30, 6:42pm: In game in Steam at 2560x1440 in 1.3.0.2.  However, I'm getting this weird strobe effect in dark areas.  Won't release until I get that solved.

Update 6/30, 6:54pm: Visual glitch fixed.  A new RenderTarget2D was added in 1.3 that I wasn't accounting for.  Let me package this up.

Update 6:30, 7:08pm:  Released.

June 21, 2015

Recovering from Injuries

I'm not doing a lot of coding right now.  Instead, I'm pulling a Peter Griffin, grasping my knee, and going "ow" a lot.

Yesterday, I decided to go to Raging Waters in San Jose.  It was a warm day, and the air conditioning in my leased home doesn't work very well, so rather than risk heat damage to my PC (a very real possible side effect of the computer vision coding I've been doing for the last couple of weeks), I decided to spend a day going down waterslides.

It was my first time going, so after spending 45 minutes in line to get my photo ID season pass, I started meandering around the park.  There were several slides that I could not go on because of my shoulder, but I finally found a set of slides I could enjoy called "The Serpentine Slides."

I went down the yellow slide first, and had a good time until I got to the bottom.  My tube was underinflated, so when it hit the water at the bottom, it stopped and I skipped off that tube right under the water.  Still, had fun.

Then, went up to the pink slide.  This time, my tube had a reasonable inflation level.  After turn three, there's a dip.  When I hit that dip, I caught air, hit my head hard on the slide, got turned upside down, and was going down the slide face down.  I caught air twice more with the tube on top of me, but was able to shield my head from getting hit any more with my arm.  When I got to the bottom of the slide, I essentially pile-drived my knees into the concrete on the bottom of the ride.

When I got up, I was woozy and bloody.  Kudos to the first-aid team there for a prompt, polite response.

Today, I've got a massive goose-egg where my head hit the slide and my right knee hurts like crazy and is still leaking fluids into bandages, but I'm mostly okay,

Expect progress on posts to resume soon.

June 4, 2015

Back from Vegas

14 poker tournaments.  6 final tables.  Only one cash.

I've done a lot better, but I've also done a lot worse.

I need a couple of days to catch up and recover.  Please forgive any delay in responding to questions/comments/bitches/complaints/gripes.