December 27, 2011

RomTerraria Update (Now With Lava Cleanup)

Update for RomTerraria:

- Stronger warning if you try to enable lava rain.
- Option to remove all lava in the top quarter of your map.

December 23, 2011

Twisted Christmas Carols

I like writing off-kilter song parodies.  It's a fun hobby.  Here's one that I wrote yesterday and posted to Shacknews which I find rather seasonal...


Time To Bury Christmas - to the tune of "A Holly Jolly Christmas"

Now it's time to bury Christmas,
It's the best time of the year,
Stash his toe beneath the snow
And get me another beer

Now it's time to bury Christmas
Dragging Saint Nick by the feet
Broke my axe off in his ass
Now he's just dead meat

Oh ho
The sled does glow
Burning so brightly;
Reindeer will fly no more;
Deer jerky for me!
Now it's time to bury Christmas
And in case you didn't hear,
Tell the coppers
And we're gonna
Bury your ass next year!

December 21, 2011

Replace Me

Since I'm leaving MPI, I need a replacement.  Well, two actually, but they're focusing on the development side at the moment.  If you're interested in applying and live in the Dallas/Fort Worth area, go to Taleo and apply.

[Updated 12/22 9:33am with a link.]

December 17, 2011

Yes, I'm Aware...

RomTerraria currently launches 1.1 instead of 1.1.1. It's a mistake on my part, but I cannot fix it until tomorrow night because I am 2,000 miles from my PC. I will have the issue fixed tomorrow when I get back.

[Update: I forgot to post that this particular issue had been fixed.  Those responsible have been sacked.]

December 16, 2011

No Updates Until Monday

Real life is intruding. Will post an update to RomTerraria as soon as I am able. In the meantime, do not use the "shrink textures" option, as it is broken in 1.1.1.

December 12, 2011

RomTerraria and Eyefinity

I found the root cause of the ultra-wide-screen Eyefinity issues with Terraria and RomTerraria.

If your horizontal resolution is greater than 1920 pixels, a piece of math in Terraria.Main.InitTargets() will cause the render target creation process to fail.

I'll work on a solution tonight.

December 11, 2011

Last RomTerraria Update of the Weekend

In this build:

- Stack traces will now include all inner exceptions to assist in debugging Eyefinity and other issues.

I won't be able to look at any stack traces until late Monday, but please post them here.

Another RomTerraria Update

In this build:

- Additional code was put in place to remove invalid resolutions from the in-game menu.

Minor RomTerraria Update

In this update:

- Added a "Stack Traces" folder inside your My Documents\My Games\Terraria folder.  If the game crashes, a stack trace will be dropped in that folder, and you can copy the file into a response on a blog post.

December 10, 2011

RomTerraria Update #2 for 1.1

In this build:

- Additional checkbox in place to allow you to downscale the size of the backgrounds by 75% at the expense of some visual issues for now.  The new backgrounds look great, but some of them take up to 16MB of VRAM each.  I'll work on the visual issues once I find a way to replace two behaviors.

- Additional work to try to get Eyefinity working again.  If your Radeon card is properly set up for Eyefinity, please leave the resolution settings set to "Let Terraria handle my game's resolution" and see if your resolution appears in the list.

- CTRL Tooltips updated to work on new "workbench" tiles.  Still incomplete for all other tile types.

Still working on map and performance enhancements.

December 9, 2011

Amazon.Rom

Yes, the title of this post is a bad pun.

I've accepted a position with Amazon.com in their Digital Products division starting January 9, 2012.

I won't know what projects I can't continue working on until that date, but I'll be hard at work until then trying to keep my projects as up-to-date as possible.

As you may have noticed, I've blogged very little about my current place of employment over the last five years.  I'll probably blog even less about Amazon, but I'm looking forward to the challenge.

Also, if you consider yourself a senior level C#/ASP.NET developer who is looking for some hands-on management experience and you already live in the Dallas/Fort Worth area, go here and apply.

Update 12/10 10:12am: I'm going to be moving to Seattle as well.  My last full day here in Dallas is January 6, 2012, and my wife will be following a couple of weeks later.  I also clarified the type of development experience that I'm looking for in whoever replaces me.  That should answer the questions that have been hitting my mailbox the most.

Update 12/22 9:40am: Updated application URL.

December 1, 2011

RomTerraria Update #1 for Terraria 1.1

I've made a simple update so that RomTerraria wouldn't crash outright with today's 1.1 release, but I haven't yet had a chance to test it because I'm at work for another four hours.

If you get a chance to try it, reply to this post or over on ShackNews.

If you already have it, should update automatically.  Otherwise, usual install point.

September 26, 2011

RomTerraria Development on Hold

I'm temporarily shelving RomTerraria.  I'll still handle bugfixes and integration of select community features, but my own projects need to take priority in the short term.

I'll resume development once Terraria 1.1 is released.

September 24, 2011

RomTerraria 2.0 Source Released

You can get the source code for RomTerraria 2.0 here

Creative Commons License
RomTerraria is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Please post and comments or fixes for the code in the comments to this post.

Please don't hotlink to the source file.  Link to this post.

September 22, 2011

Sitefinity 4 Control Templates Still Coming

I've almost got my generic Sitefinity 4 Control template complete.

It will support most of the RadControl suite, and I'm ditching convention-over-configuration and shifting over to an attribute-based layout system.  For example, if you've got a string that requires HTML, you'd decorate it with:

[FieldType(FieldType.Html)]

My goal is to have a revised alpha out next week and to have the component complete before Dallas GiveCamp.

RomTerraria Source Release This Weekend

I'll be releasing the source code to RomTerraria 2.0 sometime this weekend.

With the source release, you'll see the convoluted way that I had to bind to Terraria to make it so I could run outside that folder.

Obviously there will be parts of the code that aren't ideal, but hey, that's why the release.

September 5, 2011

RomTerraria 2.0 RC6 Available

Sorry about the delay getting this out.

In this build...

- Fixes an issue that was preventing some people from updating related to the profanity filter. (Thanks, Brandon.)
- Readded on-demand tooltips for blocks, but moved the hotkey to the CTRL key to make it not conflict with 1.0.6.1.  Tooltips are not up-to-date, but should be before the final release.

Usual place.

September 1, 2011

Hover Help In Sitefinity 4 UI


I now have the Description attribute popping up as hover help. Layout is fubar, but I'm getting closer.

August 31, 2011

Dallas TechFest Slide Deck Available

I forgot to post this earlier, but a slightly-edited version of the slide deck for my talk at Dallas TechFest on Sitefinity is available for download now.

Making Sitefinity 4 Control Templates Easier


One of the great things about Sitefinity 3 was that you could add a couple of attributes to your controls and have a great design experience with little to no additional effort. The steps you have to go through to get the same thing in Sitefinity 4 are, well, insane. Take a look at this...six files for what you used to be able to do in one. There had to be a better way.

What I'm sharing today is pre-alpha, but is a large step towards bringing back attribute-based design experiences.

First, download the ZIP file with the code. It contains four files: DesignerScript.ashx, DesignerScript.ashx.cs, EmptyLayout.ascx, and GenericDesigner.cs. Drop all four files in the root of your Sitefinity 4.2 or higher project and ensure they're included in the project.

Second, add the following attribute to your UserControl's class:
[ControlDesigner(typeof(GenericDesigner))]

If you get a red squiggly on that class, add "using Telerik.Sitefinity.Web.UI.ControlDesign;" to your using clauses.

That's it. The new system respects the Browsable and DisplayName attributes, gives you checkboxes for booleans, basic validation for integer types, and if your property is a string type with "Html" in the property name, it will spit out a text area for you instead.

Lots of work still to do as you can see from the comments in the code, but this is a step in the right direction for the product.

August 25, 2011

Infections Suck...

Sorry about the slow progress on RomTerraria lately.

I'm recovering from a (fortunately mild) kidney infection.

Hopefully I'll be able to do some more work this weekend.

August 20, 2011

RomTerraria 2.0 RC5 Available

In this build...

- Infinite Goblin Invasion returns.
- Spawn Eye A Day returns.
- Infinite Blood Moon returns.
- Profanity Filter returns.
- Version number for publish and title bar fixed.

Tooltips and texture pack fixes will be in the next build.

Usual install location applies.

August 11, 2011

RomTerraria 2.0 RC4 Available

In this build...

- Readded real-time clock, but moved it to the lower-right corner.
- Properly wired up 1.0.6 critical attack font to texture pack and internal fonts.
- Made NPC room labels appear in the room and appear slightly translucent.
- Made folder in Terraria save game area for plugins (coming soon).

Check it out.

August 9, 2011

August 6, 2011

RomTerraria Update After 1.0.6

I plan on doing a new version of the RomTerraria launcher shortly after 1.0.6 launches.

I'm expecting major changes, and don't want to waste my time going down a dead-end path in the meantime.

RomTerraria Update After 1.0.6

I plan on doing a new version of the RomTerraria launcher shortly after 1.0.6 launches.

I'm expecting major changes, and don't want to waste my time going down a dead-end path in the meantime.

July 13, 2011

RomTerraria 2.0 RC Build

In this build...

- Health and mana regeneration fixed.
- You can now flood Hell again.
- Minimaps act nicer near the edges of maps.

Give it a whirl.

After installing, it appears in your Start Menu under Michael Russell > RomTerraria.

July 8, 2011

Test Version of RomTerraria 2.0

Because it's such a pain in the rear to keep people on the same version of RomTerraria, I've got a ClickOnce version up for testing.

Everything should work in it except the profanity filter, which I'm rewriting.

Click here to give it a shot.

New features:
- New UI.
- Texture and font pack support.
- Counteract water evaporation in Hell.

After installing, it appears in your Start Menu under Michael Russell > RomTerraria.

July 2, 2011

Use ZIP Files To Hold Your XNA Content

Quick entry for now, more in-depth one coming soon. Requires SharpZipLib.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using ICSharpCode.SharpZipLib.Zip;
using System.IO;

namespace RomTerraria
{
public class ZipContentManager : ContentManager
{
private ZipFile zipFile = null;

public ZipContentManager(IServiceProvider services, string zipFile) : base(services, "")
{
this.zipFile = new ZipFile(zipFile);
}

protected override System.IO.Stream OpenStream(string assetName)
{
var entry = zipFile.GetEntry(assetName.Replace('\\','/') + ".xnb");
if (entry != null)
{
return zipFile.GetInputStream(entry);
}
return null;
}
}
}

June 23, 2011

RomTerraria Updated For 1.0.5

New build available.

Key Events in XNA 4.0

One of the top requested features for XNA since release was the ability to intercept key press events instead of just the key up/down events so that people could do text input easily.

Still can't do it in XNA 4.0, but here's a way of working around it by adding a message filter. Please be aware that they may break this in the future if they don't use Windows Forms for their form in XNA 5.

First, the keyboard filter class...


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace RomSteady.Xna.GameEngine.Input
{
public class KeyboardMessageFilter : IMessageFilter
{
[DllImport("user32.dll")]
static extern bool TranslateMessage(ref Message lpMsg);

const int WM_CHAR = 0x0102;
const int WM_KEYDOWN = 0x0100;

public bool PreFilterMessage(ref Message m)
{
if (m.Msg == WM_KEYDOWN)
{
TranslateMessage(ref m);
}
else if (m.Msg == WM_CHAR)
{
if (KeyPressed != null)
KeyPressed.Invoke(this,
new KeyboardMessageEventArgs()
{
Character = Convert.ToChar((int)m.WParam)
});
}
return false;
}

public event EventHandler KeyPressed;
}

public class KeyboardMessageEventArgs : EventArgs
{
public char Character;
}
}


...and now to wire it up so you can get those KeyPressed events. In your Initialize() function...


...
var keyboardFilter = new KeyboardMessageFilter();
keyboardFilter.KeyPressed +=
new EventHandler(keyboardFilter_KeyPressed);
System.Windows.Forms.Application.AddMessageFilter(keyboardFilter);
...


This code isn't flawless, but is working well enough for my purposes.

June 17, 2011

One Month of RomTerraria

So a month ago, I started working on RomTerraria, a launcher for the indie hit Terraria.

Originally, I just wanted to put in a minimap because I was getting lost regularly, but it wasn't ready yet. A regular on Shacknews made a command-line launcher to allow people to allow people to override the initial 800x600 maximum resolution, and I brought that idea in to a graphical launcher along with a rapid health recharge trainer, and over the last twenty plus updates I've added the minimap, weather effects and so much more.

The only things I won't do are expose god mode and inventory editing. I've been focused on allowing people to tweak gameplay to their level...not letting people skip playing the game.

The biggest downside of this whole thing has been that the warez monkeys out there have been bundling the early versions of my launcher with the pirated version of the game. I keep hoping that Redigit will make a change that breaks my launcher, like turn Terraria.Main.screenWidth into an auto-property. I hate the feeling that my work is being used by some people to cheat these guys out of money they rightfully deserve, especially given my history. Yes, the irony isn't lost on me.

The biggest upside is that the bad taste for game development that my departure from Ritual left in my mouth is finally gone. Now my free time is being filled with little bouncing baby prototypes. I can't wait until one is ready to share...

May 28, 2011

RomTerraria FAQ

This is a list of frequently asked questions about RomTerraria, along with hopefully some answers.

[Update 11/9 1:25p] Most of this FAQ is out of date due to Terraria being upgraded to v1.2.  Preview releases of RomTerraria 3.0 are located here.
What is RomTerraria?

RomTerraria is a launcher for Terraria, a new indie game being distributed via Steam.

How does RomTerraria work?

RomTerraria takes advantage of a feature of the .NET Framework where every .NET executable is also a class. When RomTerraria is launched, it instantiates a copy of the game class inside Terraria.exe, modifies some internal variables inside the class using either direct access or reflection, and then fires the appropriate methods once you hit the launch button. It also uses the GameComponent architecture inside of XNA games to hook into the Update events, but because of where base.Draw(GameTime) is called inside Terraria, an alternate solution had to be used for where I'm doing rendering.

Why does RomTerraria have to be in the same folder as Terraria.exe?

The way I'm currently binding to Terraria.exe demands it. For awhile, I was working on separating the two, but given recent interactions with the community, I'm binding it tighter to the original game executable and to Steam.

Why did you release the source code?

I wanted to show that you could modify the game without cracking the executable, decompiling it, modifying the disassembled code, then illegally distributing their code. (Note: The source is occasionally one or two minor bug-fix updates behind.)

Why do fewer enemies spawn during gameplay when I'm using widescreen resolutions?

Terraria uses the screen dimensions to determine where to spawn enemies. For stock spawn rates, launch a local multiplayer server, then connect to that server.

When will the new HUD be complete?

No current estimate. The air conditioning in my apartment went out, and even with a 20" box fan blasting my box, it still gets too hot if I use it for long periods of time. Replacement parts have been ordered, but are backordered. My A/C should be fixed by June 4.

What does "Enable Pony" do?

I've been asked this from nineteen separate countries. First, read this thread over at Shacknews. Second, realize that had been a horrible day. Third, epic troll is epic.

I'm using a pirated version of Terraria, and your launcher won't work.

Boo hoo. Buy the game. Even if I was to grant the asinine assertion that piracy for evaluation purposes was acceptable (which I'm not), the moment you start looking for enhancements, evaluation time is over.

The launcher is crashing. What should I do?

First, make sure that you have the latest version of the launcher. Second, make sure all the files are in the same folder as Terraria.exe. Third, make sure Steam is running. If all of those conditions are met, the launcher should pop up a stack trace on the screen. Hit Control-C, reply to this post, and then hit Control-V to paste the stack trace into the comment.

I turned on Infinite Goblin Invasion. After turning it off, they're still coming. What should I do?

The Infinite Goblin Invasion option keeps firing the trigger to bring on new invasions. Each invasion contains at least 100 goblins. Unfortunately, that means you'll have to kill to the end of the current invasion. Good luck.

I'm using your launcher and I'm getting an error about fontCombatText.

Upgrade to the 2.0 launcher series.

May 21, 2011

Weekend

It's been far too long since I've done some code for me. I've missed it.

My personal project I was working on back in December got back-burnered to the point where it's hard to get back into it, so I'm taking some time to get into other code so when I do get back to my project, I'll be ready for it.

May 18, 2011

Terraria Trainer/Resolution Launcher

Update: 6/30/2015:

Preview version of RomTerraria 4.0 (for Terraria 1.3.x) is now available at this post.

---


Well, staring at JavaScript for a week drove me cross-eyed, so I spent an hour weekend or so and built a simple trainer/resolution launcher for Terraria. Requires Steam and Terraria 1.0.6. Not a source hack...wraps and calls into Terraria.

Install Launcher | Download Source | FAQs

Welcome to Shacknews, SomethingAwful, ArsTechnica, Quarter To Three, Reddit, PC Gamer, and GameFront. I can't believe over 13,000 people are using this launcher...

Screenshots: Normal Mini-map | Full World Mini-map

Note for those of you on Windows Vista/Windows 7: If you are being told that you may have an illegal copy when you don't AND you've installed Steam into Program Files AND Steam is running, right-click on the executable and run as administrator. The reason why this is happening is that when you just copy it over, it doesn't go into that folder. It goes into VirtualStore. Sorry for the extra security...blame TPB.

March 1, 2011

Sitefinity 4.0: Bring Back The Breadcrumbs

You may have noticed that the breadcrumb bar is missing from Sitefinity 4.0. Here's how to use the stock one from ASP.NET 4.0 until it comes back.

Go to Administration > Settings.

Click "Advanced."

Drill down to Toolboxes > Toolboxes > PageControls > Sections.

Create a new section if wanted. I named mine AspNetToolboxSection.

Inside where you want it created, drill down to Tools.

Click "Create New."

Under Control Type, enter:
System.Web.UI.WebControls.SiteMapPath

Under Name, enter:
System.Web.UI.WebControls.SiteMapPath

Under Title, enter:
SiteMapPath

Save changes.

January 20, 2011

What's Not Complete In Sitefinity 4.0

I had an ulterior motive for participating in this past weekend's GiveCamp. We use Sitefinity 3.7 SP4 as our primary CMS at work, and we've been planning on moving to Sitefinity 4.0 in March even after the licensing brouhaha. Participating would not only allow me to give something back to the community, but also use the new version in a production environment and get some initial learnings.

What we found was an alpha product with a 4.0 version number. Advertised features like localization and custom fields weren't working. Multiple teams got bit by template issues that caused their entire sites to vanish. Performance was abysmal.

We also found many features "in process of implementation," i.e. not done. Here's a short incomplete list.

Definitions on Blogs, Events, Generic Content, Documents, Images, Videos and News.
Paging on Generic Content.
Updating your profile through the backend.
Advanced filters on Blogs, Generic Content.
Image gallery: Thumbnail sizes, large image sizes.
Image library, video library: Thumbnail sizes and resizing.
Libraries: Caching.
Parts of the Download List Selector Designer.
The "Create New Library" portion of the Media Content Uploader view.
Batch editing in the Upload dialog.
Navigating to the parent, owner, page properties, reordering pages or publishing pages from certain toolbars.
In the page view, showing scheduled pages, pages pending approval, custom fields.
In some areas, creating child pages or sibling pages isn't implemented, even though it's set up right in other areas.
Comments: Blocking IP addresses, e-mail addresses, or marking comments as favorites.
Tags and category filters.
Resolving resource URL's against libraries.
Searching through users.
Advanced filtering of Events.
Replacing images in the Image library.

I really hope that we get SP1 by the end of February.

January 15, 2011

Re-add Redirects to Sitefinity 4.0

If you are trying to use Sitefinity 4.0 and are missing the ability to add external URL's like you could in Sitefinity 3.7, here is a partial solution.

RedirectToUrl.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RedirectToUrl.ascx.cs" Inherits="SitefinityWebApp.UserControls.RedirectToUrl" EnableViewState="false" %>


RedirectToUrl.ascx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Sitefinity.Web.UI;

namespace SitefinityWebApp.UserControls
{
public partial class RedirectToUrl : System.Web.UI.UserControl
{
public string DestinationUrl { get; set; }

public bool PermanentRedirect { get; set; }

protected void Page_Load(object sender, EventArgs e)
{
bool inDesignMode = this.IsDesignMode();
if (!String.IsNullOrWhiteSpace(DestinationUrl))
{
if (inDesignMode)
{
Output.Text = Server.HtmlEncode("Redirect to " + DestinationUrl);
}
else
{
if (PermanentRedirect)
{
Response.RedirectPermanent(DestinationUrl, false);
}
else
{
Response.Redirect(DestinationUrl, false);
}
}
}
else
{
if (inDesignMode)
{
Output.Text = "Warning: No redirect URL found";
}
else
{
Output.Text = "";
}
}
}
}
}