PC Stats gathering, How many traps in small, medium and large Lizard Temple?

mshunter

Terrarian
Hi guys,

With all the Mech work done here I though it might be a good idea to tally up how many of x traps you can find in each world size.

Lets start with large worlds:

large world:

spear traps:..........Super Dart traps:..........Flame traps:

30......................22............................3
36......................20............................4


Please post your findings and I will add a running tally.
Would be great to get as many subs as possible as it makes the stats more reliable. Please make sure you collected all the traps in the lizard temple.
if you missed some it will harm the end result.

Once completed we can use this to say X build uses the traps of y Large worlds ect.
 
Last edited:
Yep' you should use a table :
Code:
[table]
Data 1 | data 2
Data 3 | data 4
[/table]

You will have :

Data 1 | data 2
Data 3 | data 4

I was hoping to do the same thing with more blocks. The longest will be to generate enough worlds :p
I once found a script on TCF to do so... I'll try to find this for you.
 
I was hoping to do the same thing with more blocks. The longest will be to generate enough worlds :p
I once found a script on TCF to do so... I'll try to find this for you.

I recently demonstrated a 1-liner way to do this that doesn't require any special tools -- Reddit link.

What I don't have is an easy way to generate a histogram of the tiles in the world (I have some ideas how to accomplish this but have yet to make it happen).
 
Wow. I never guessed it was possible to generate worlds with TerrariaServer.exe. Thanks a lot for your "script" ! :D
Very simple, but that's enough.

Do you know, by any chance, how world/blocks informations are encoded into .wld files ? Or maybe do you have some documentation about it ?
 
Do you know, by any chance, how world/blocks informations are encoded into .wld files ? Or maybe do you have some documentation about it ?

I have a general idea from digging through the code. Each tile is stored as a structure that has information about block type, block UV, wall type, paint colors, slopes, actuation, wiring, liquid, and so forth. This data is stored gzip compressed in the world file and gets loaded into a huge array. You can read a bit more about the internals of the .wld format here -- though I think the information isn't quite up to the current version (says the current version is 69 which is 1.2.0.2, but 1.2.4.1 is version 102).

I think looking at this again has given me enough motivation to take another shot at making this work. I have a pretty good idea of how to do the calculations (requires iterating over the world and reverse mapping tiles and UV data to items), but I'm not particularly fond of C# as a language. I swear I'm trying to warm up to it though.
 
Thanks for the link.
I'm afraid I'm still a noobie in gzip and C#, so I can't really explore .wld files properly. It's a huge mess when I try Notepad++. I'll try again in a few years. x)
 
Once completed we can use this to say X build uses the traps of y Large worlds ect.
Great stuff guys, would be very useful in this way. I like to make as my builds as 1 world compatible as possible, etc.
spear traps:..........Super Dart traps:..........Flame traps:
36......................20............................4
Didn't realise this was a mock-up to start with (that's a lot of spears)! Anyway, don't forget your spikey balls in the real thing! ;)

I think it would be most reliable (best chance of avoiding selection bias, and such) for a single person to collate an entire set of data. But no harm for people to post their own anecdotal findings. Be great to have a standard deviation figure for each too. :happy: Will try to add the results to the trap characteristics sheet, if that's ok also. (Talking of tables, be great if someone were to re-post the existing data in properly forum coded tables. ;))
 
Thanks for the link.
I'm afraid I'm still a noobie in gzip and C#, so I can't really explore .wld files properly. It's a huge mess when I try Notepad++. I'll try again in a few years. x)

Gzip is more of a data specification than a particular file type. Even when uncompressed, the map data is all binary soup that just won't make any sense with a text program like Notepad++. You pretty much need special programs like Terraria (or TEdit or TerraMap or whatever else) to turn the binary data into something human readable. Don't feel bad if it looks like a huge mess when you open it in a text editor. It does to everyone else too! :D
 
I think it would be most reliable (best chance of avoiding selection bias, and such) for a single person to collate an entire set of data. But no harm for people to post their own anecdotal findings. Be great to have a standard deviation figure for each too. :happy: Will try to add the results to the trap characteristics sheet, if that's ok also. (Talking of tables, be great if someone were to re-post the existing data in properly forum coded tables. ;))

If I can get the tool I mentioned above working, there probably wouldn't be major issues with selection bias, as long as whoever runs a test can easily create a hundred blind worlds and compile numbers on that. Like any statistical analysis, there will probably always be extremes that either need to be tossed out or become insignificant with enough data.

I suppose a plan B option would be to just mod the WorldGen code and have it tabulate the traps or whatever to a file as the world is generated. That might be slightly easier, but my program is mainly intended to do some other cool tricks. :cool:

Argh. Once again I go from wandering around bored to having way too much I want to get done.
 
I suppose a plan B option would be to just mod the WorldGen code and have it tabulate the traps or whatever to a file as the world is generated. That might be slightly easier, but my program is mainly intended to do some other cool tricks. :cool:

Any idea how world generation sets the traps in the temple to begin with? Do you think at worldgen there are set ranges for the number of total traps that can spawn, or set ranges for each type of trap? It seems the latter is more likely since there seems to be a major bias for spiky ball traps over all other temple traps.
 
Any idea how world generation sets the traps in the temple to begin with? Do you think at worldgen there are set ranges for the number of total traps that can spawn, or set ranges for each type of trap? It seems the latter is more likely since there seems to be a major bias for spiky ball traps over all other temple traps.

I'm not sure it's quite A or B. Some casual skimming seems to suggest it builds the temple in two phases, phase 1 building the general structure and phase 2 going back through and placing things like traps, spikes, and furniture. It's a bit of a meandering process, but it definitely seems to favor spiky ball traps then spear traps then super dart traps then flame traps. It's RNG upon RNG with no clear upper or lower bounds. The number of traps could roughly be a function of how complex phase 1 made the temple, along with the initial size of the temple. I think the only way to arrive at numbers would be to isolate the code, add some diagnostic traces, then put it through a few thousand iterations of various world sizes to see what the aggregate results are (apart from manually creating a zillion worlds and inspecting each one).
 
Actually, if you pay attention to open space distances between a (Horizontal/Vertical) trap and a wall/floor, you can guess which one it is. If the gap between the trap and it's opposite surface is small, it's usually a Spear/Flame trap (restricted range). Bigger distances switch to Super Dart/Spiky Ball traps ("unlimited" range). It's not set in stone, as far as I can tell, but that's the general trend I've noticed in all the temples I raided. I've been raiding temples for traps since I found them back in original 1.2. I have no clue about the exact cut-off distance for the switch in traps, though. Someone else can analyze that ^_^ I just know it's (seemingly significantly) under the range limit of the respective short-range traps.

Also, the map viewer TerraMap has a Highlight Searched Item function that also returns the number of said items it finds. It is a bit quirky since it returns the total number of blocks occupied, not the actual number of items. (e.g. Search for a chest or statue; you have to divide the value it returns by 4 or 6, respectively, to find the true number of said item in the world.) Still, quirk aside, it would make doing a per-world trap count fairly trivial, if a bit time-consuming for one person. A Windows Batch script for TerrariaServer.exe to generate worlds (hopefully in a controlled manner) and TerraMap to do the block count searches. Beats having to do the search manually...

...Unless you want to harvest the traps anyway. At which point I recommend bringing along a Snowman Cannon and plenty of Rocket IVs for harvesting and fighting ^_~. (Any other rocket-based weapon would technically work as well, but you risk blowing yourself up too often...) Bonus points for dislodging the annoying wooden spikes as well. Makes navigation easier.
 
Back
Top Bottom