• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Standalone Terranion: a companion/mini-wiki web application

YellowAfterlife

Official Terrarian
I am currently developing a web application that is a companion/guide/mini-wiki kind of thing.
It is intended to communicate essential information about the items in the most efficient way possible.
So there are small descriptions about the items and where to find them, their stats, and what you can craft with them.
Where possible, item information is taken directly from the game, thus is always up-to-date and error-proof.
Also I'm experimenting with the ways of storing item information, so you get item icons, tooltips, and other things.
Should be very convenient.

Terranion has now been released!
Updated information can be found in it's topic in "Released Mods" section.

Some imagery in chronological order:

The general looks of item page.


Tooltips for everything (note: older GIF, has "sells for" instead of "worth" label)



Search auto-completion. Tooltips included, lag isn't.

How does this look?
 
Last edited:

Froshin

Official Terrarian
Looks pretty as well as convinient. I've ran in to incorrect information more than once on the wiki, so I'm sure this will come in very handy. To people who would still prefer the wiki, it could server as a tool to verify some of the information they've seen on the wiki :)
 

YellowAfterlife

Official Terrarian
Wow! This looks really nice. Will this be a website or a program?

EDIT: Web application, oh.
Web applcation, yes. If it will be possible/efficient, I'll look into making an offline version available separately.


Meanwhile, here's how category pages currently look:
 

YellowAfterlife

Official Terrarian
Now figure out how to embed a web browser window in XNA-based games and make it a tAPI mod. lol
You probably can. I recall that Mono had some browser frame component, but I'm not sure about plain XNA. I guess the other question would be how practical such thing would be compared to alt-tabbing to app open in browser or opening a browser window in the Steam Overlay (yes, that's a thing) and shift-tabbing to it.



Meanwhile I've improved the text parser (for my own convenience) to permit writing page and item descriptions in something similar to markdown rather than plain HTML:
 

YellowAfterlife

Official Terrarian
Decided to poke this a little more (primarily since it's not too long till 1.3).
Categories now can have sortable comparison tables.
Also I've made the thing generate categories automagically where possible.
Example:
 

YellowAfterlife

Official Terrarian
And a bit more on features - the way information is stored allows me to display any kind of information about items anywhere, and it will automatically change if the item changes.
For example - quest fish category displays where the fishes can be caught, normal fish category displays what can be made from each fish:

 

YellowAfterlife

Official Terrarian
Added NPC pages. Currently work-in-progress, but I've already got graphics and information to display automatically (same as with items, data comes right from the game, which helps accuracy), so at least that's something.

Might add some sort of cross-linking so that NPC pages would also display related items (sold/dropped by them) if there are item pages linking to the NPC page.
 

darthmorf

Moderator
Staff member
Moderator
When you say it gets it from the game do you mean directly or you have decompiled it and inputted it?
 

YellowAfterlife

Official Terrarian
When you say it gets it from the game do you mean directly or you have decompiled it and inputted it?
Perhaps a little known fact, but Terraria can be used as a C# "library" -- you add Terraria.exe or TerrariaServer.exe as a "reference" to a C# project, and then you can create a game/server instance and do what you please with it from project code (in my case, creating items/NPCs on an empty server and reading their properties), without having to decompile/recompile anything. Of course, this way you don't get any documentation on variables/functions of the game (though I don't think that you'd get that via decompilation either), but their names are preserved, so it's possible to figure out how to do something through experimentation.

I guess another option would be to use tAPI and make a "mod" that would similarly output the information somewhere, but I haven't messed with that much so I don't know if that would be easier to do or not.

While decompilation probably has it's uses, Terraria has a record of having a lot of content (2800-ish items/400-ish NPCs as of 1.2.4.1) and adding hundreds of items per major update, so I think it's kind of suboptimal to get yourself in a type of situation where you would have to manually go over several hundred of items before your mod/tool would become compatible with the new version of the game.
 

YellowAfterlife

Official Terrarian

Filled out drop tables for everything today. That's 245 "rules" (each applies to one or more NPC dropping one or more item under the same condition/chance).
Curiously, after some compression and optimization all that comes down to just some 6KB of data - many times smaller than a PNG with those NPC' thumbnails is.
 

Shockah

Grandson of The Wizard
You could have saved some time on this one by actually working with tAPI, as we already did exactly this and turned stuff into "LootRules" which you can modify on the fly, lol. Current LootRule.cs code from the repo (contains some changes since the last released version): https://paste.kde.org/p9tn9lalk/f41vwy/raw (the paste should be up for 1 year btw.)

EDIT: The only rules that could be different from vanilla are the coin ones, as they were hard to "translate" into this code, but it should be pretty similar.
 
Last edited:

YellowAfterlife

Official Terrarian
You could have saved some time on this one by actually working with tAPI, as we already did exactly this and turned stuff into "LootRules" which you can modify on the fly, lol. Current LootRule.cs code from the repo (contains some changes since the last released version): https://paste.kde.org/p9tn9lalk/f41vwy/raw (the paste should be up for 1 year btw.)

EDIT: The only rules that could be different from vanilla are the coin ones, as they were hard to "translate" into this code, but it should be pretty similar.
Ooh. Well that would have been convenient.
Rule definition format that I have settled on is, let's put is so, rather compact,
but it took an afternoon to fill out regardless.

Is that being updated manually when new versions of the game come out then?
My other idea was to parse NPC' class structure and backtrack from Item.NewItem calls to resolve possible items and conditions, but I've decided to not do that as it could have taken far longer than doing the work manually.
 

Shockah

Grandson of The Wizard
Yeah, I spent 2-3 days while I was bored at work to go through the whole goddamn NPCLoot method and fill it out manually. Writing a parser to deal with this would be painful, I don't know anything about Mono.Cecil either, so it went down to this.
I was so goddamn satisfied afterwards though.

Anyway, I just wanted to tell you you could have just made a simple tAPI "mod" which would iterate over this stuff and generate your own format, whatever it may have been. Too late now though, I guess? :p

Anyway, good job.
 
Top Bottom