John Snail
Terrarian
A tool for modders to easily add dimensions (referred to as subworlds) to their mods, making all the necessary code injections, handling Multiplayer and managing every subworld.
HOW IT WORKS
LOADING
SAVING
MULTIPLAYER
HOW IT WORKS
Subworld Library does a LOT of code injection, as Terraria was not made with subworlds in mind.
Subworlds are highly customisable; from how big or small they are, to what ModSystems can update inside of them and even how they are lit.
Subworld Library removes Space, both Oceans and the Underworld from subworlds, allowing them to be extremely small without issues.
LOADING
Loading a subworld is straightforward. Loading screens can be as simple as text on a plain background, or something complex, like an item selection menu.
SAVING
Subworlds save to a directory named after the main world. A subworld and/or changes to players inside it can be temporary. Deleting a world deletes all of its subworlds as well.
MULTIPLAYER
Subworld Library works in Multiplayer with little to no extra work required from modders. A server is opened for every subworld being occupied.
Last edited:
Krispyhappy
Eye of Cthulhu
how does your mod exactly work. When I try to make the world with the on mod on it doesn't work it's soft locks the game.
John Snail
Terrarian
Just fixed that.how does your mod exactly work. When I try to make the world with the on mod on it doesn't work it's soft locks the game.
Krispyhappy
Eye of Cthulhu
Cool beans.Just fixed that.
Narret
Terrarian
I just registered to this forum to post this: if what you have made is what I think it is, and the modding community is as alive as I hope it is, you might have just opened a door to so many possibilities. Alternate dimensions mods and other gimmicks, this is amazing. Now I do have to ask a question, how would this interact with Large World Expander? As the only two ways I could imagine pulling this off is having off screen terrain, or separate hidden world files, either of those I could imagine might interact weirdly with super large worlds.
lazermaster351
Terrarian
where is the link for the mod
lazermaster351
Terrarian
where is the link that takes us to download the mod
John Snail
Terrarian
Added a couple download links, as well as a link to the wiki.where is the link that takes us to download the mod
EvanKrusher948
Skeletron Prime
where is the link for the mod
where is the link that takes us to download the mod
Really, double post. @lazermaster351
Also, request for option to change color of the sky when you enter the subworld. @John Snail
Other requests:
Being able to enable bool toggles while the player is in the subworld. (Also vice versa, for a bool to enable while the player isn't in the subworld)
Being able to create custom sun and moon sprites for your subworld (If you can, cloud sprites)
Being able to set the base blocks for your subworld (e.g. dirt is replaced with stone or Clorophyte is replaced by <Modtilenamehere>)
Enable / disable clouds
Enable mod day / night music. (If true, then the music must be defined)
Set which enemies spawn in your subworld (Also if you could, set whether vanilla enemies could spawn e.g. zombies won't spawn if false)
Set whether vanilla ores spawn in the subworld (If set to false, copper, tin, iron, etc. won't generate in the subworld)
Enable / disable cavern layer
This mod has a lot of potential, don't waste it.
Last edited:
John Snail
Terrarian
You can do literally all of these things, even without Subworld Library lolReally, double post. @lazermaster351
Also, request for option to change color of the sky when you enter the subworld. @John Snail
Other requests:
Being able to enable bool toggles while the player is in the subworld. (Also vice versa, for a bool to enable while the player isn't in the subworld)
Being able to create custom sun and moon sprites for your subworld (If you can, cloud sprites)
Being able to set the base blocks for your subworld (e.g. dirt is replaced with stone or Clorophyte is replaced by <Modtilenamehere>)
Enable / disable clouds
Enable mod day / night music. (If true, then the music must be defined)
Set which enemies spawn in your subworld (Also if you could, set whether vanilla enemies could spawn e.g. zombies won't spawn if false)
Set whether vanilla ores spawn in the subworld (If set to false, copper, tin, iron, etc. won't generate in the subworld)
Enable / disable cavern layer
This mod has a lot of potential, don't waste it.
EvanKrusher948
Skeletron Prime
How does one change the sprite of the sun and moon.
Or change dirt on generation, I don't know how to do so.
Or disable clouds.
Or change dirt on generation, I don't know how to do so.
Or disable clouds.
John Snail
Terrarian
Sorry for the super late reply! I checked out how Large World Enabler works, and it looks like it would work with subworlds too.I just registered to this forum to post this: if what you have made is what I think it is, and the modding community is as alive as I hope it is, you might have just opened a door to so many possibilities. Alternate dimensions mods and other gimmicks, this is amazing. Now I do have to ask a question, how would this interact with Large World Expander? As the only two ways I could imagine pulling this off is having off screen terrain, or separate hidden world files, either of those I could imagine might interact weirdly with super large worlds.
Narret
Terrarian
No worries, that's great to hear that it might work with it. This has started to pick up, I am interested in seeing where this will go.Sorry for the super late reply! I checked out how Large World Enabler works, and it looks like it would work with subworlds too.
IDGCaptainRussia
Skeletron
Oh, this has a forum page lol
This thing, is a
ing GODSEND for modders, it's simple and clean and gets the job done! The only thing I real ask for is some better documention and examples, like how to properly override and use a UserInterface class as I'm at a loss on that. Otherwise, love it!
I've been trying to avoid using more dependancies in SGAmod, but I can't pass up on this, not now that demensions in Terraria are so easily accessible to any coder and you don't have to be
Linx145 to do it
This thing, is a

I've been trying to avoid using more dependancies in SGAmod, but I can't pass up on this, not now that demensions in Terraria are so easily accessible to any coder and you don't have to be
Linx145 to do it
IDGCaptainRussia
Skeletron
Oh, this has a forum page lol
This thing, is a
ing GODSEND for modders, it's simple and clean and gets the job done! The only thing I real ask for is some better documention and examples, like how to properly override and use a UserInterface class as I'm at a loss on that. Otherwise, love it!
I've been trying to avoid using more dependancies in SGAmod, but I can't pass up on this, not now that demensions in Terraria are so easily accessible to any coder and you don't have to be
Linx145 to do it
Also PS to anyone who is going to change Main.spawnTileX and Main.spawnTileY, make SURE the block under this is solid, else your game may softlock during generation!
Learned this the hardway
getting rid of clouds requires you to make a CustomSky and have it activate in the Subworld
I havn't messed with Moon/Sun sprites but I think there's a main. field for it, I know other mods change it via skies
This thing, is a

I've been trying to avoid using more dependancies in SGAmod, but I can't pass up on this, not now that demensions in Terraria are so easily accessible to any coder and you don't have to be
Linx145 to do it
Well... not completely, the Underworld/heat distortion effect is still presentMisc.
Subworld Library gets rid of Space, the Underworld, and both Oceans inside subworlds, freeing up tons of world space, and allowing for very small subworlds.
If you need help with making a subworld, or encounter a bug, please go to the #sublib_help and #sublib_bugs channels in the GaMeterraria Discord respectively.
Also PS to anyone who is going to change Main.spawnTileX and Main.spawnTileY, make SURE the block under this is solid, else your game may softlock during generation!
Learned this the hardway
This thing lets you generate a clean-slate of a world, the world is completely blank and it's to you to fill it up with thingsHow does one change the sprite of the sun and moon.
Or change dirt on generation, I don't know how to do so.
Or disable clouds.
getting rid of clouds requires you to make a CustomSky and have it activate in the Subworld
I havn't messed with Moon/Sun sprites but I think there's a main. field for it, I know other mods change it via skies
IDGCaptainRussia
Skeletron
Ok so, I uncovered another problem
While instances of mod worlds still exist, it would seem for some reason ModWorlds are not loading any saved modded data
like if you go into a subworld, and check bosschecklist, no bosses are defeated because the downed fields are in their starting values
PS: Exiting a subworld fixes this, but still, I can't use any field values normally, I'm sure I could just reload the modworlds but shouldn't SLLib do that for you?
While instances of mod worlds still exist, it would seem for some reason ModWorlds are not loading any saved modded data
like if you go into a subworld, and check bosschecklist, no bosses are defeated because the downed fields are in their starting values
PS: Exiting a subworld fixes this, but still, I can't use any field values normally, I'm sure I could just reload the modworlds but shouldn't SLLib do that for you?
John Snail
Terrarian
Yeah, I'm working on better documentation and examples. Thanks!...The only thing I real ask for is some better documention and examples, like how to properly override and use a UserInterface class as I'm at a loss on that. Otherwise, love it!
Ah damn, I completely forgot about that. I'll fix that in 1.1, along with the lighting effect.Well... not completely, the Underworld/heat distortion effect is still present
That's odd, the game should just spawn you in the air. It may be something else freezing worldgen.Also PS to anyone who is going to change Main.spawnTileX and Main.spawnTileY, make SURE the block under this is solid, else your game may softlock during generation!
If I understand you correctly, this is intended behaviour. Subworlds are entirely new worlds; everything is reset to prevent weird things from occurring. Cache any information you need before calling EnterSubworld.Ok so, I uncovered another problem
While instances of mod worlds still exist, it would seem for some reason ModWorlds are not loading any saved modded data
like if you go into a subworld, and check bosschecklist, no bosses are defeated because the downed fields are in their starting values
PS: Exiting a subworld fixes this, but still, I can't use any field values normally, I'm sure I could just reload the modworlds but shouldn't SLLib do that for you?
Articuno
Terrarian
I really like the idea behind this mod, but I'm having trouble implementing it because of the lack of clear documentation. I agree with @IDGCaptainRussia that it would be really helpful - in my opinion, documentation is always pretty important for a "library" style of mod like this one.
A couple other thoughts:
A couple other thoughts:
- The Discord link appears to be invalid. Could you please update it?
- Is the source for this mod publicly available? This would go a long way towards helping people understand the correct usage for the mod, even without any more documentation. The Wiki link in the first post links to Github, but that repo contains just the compiled .DLL, not the source code.
- Do you know of any published and/or open-source mods that use this library? Again, a reference implementation would be great to allow us to see some examples of how it could be used.
IDGCaptainRussia
Skeletron
A: Join the GaMeTerraria Discord Server!I really like the idea behind this mod, but I'm having trouble implementing it because of the lack of clear documentation. I agree with @IDGCaptainRussia that it would be really helpful - in my opinion, documentation is always pretty important for a "library" style of mod like this one.
A couple other thoughts:
- The Discord link appears to be invalid. Could you please update it?
- Is the source for this mod publicly available? This would go a long way towards helping people understand the correct usage for the mod, even without any more documentation. The Wiki link in the first post links to Github, but that repo contains just the compiled .DLL, not the source code.
- Do you know of any published and/or open-source mods that use this library? Again, a reference implementation would be great to allow us to see some examples of how it could be used.
b: I don't think it is, you could snoop around freely with an editor or IlSpy or DnSpy, but it won't help alot as this library is comprised of alot, and I mean... ALOT of IL Editing (which in this decompiled perspective is very hard to read let alone understand).
c: No, pretty sure GaMeTerraria is closed source, and any other mod that is using it hasn't actually, uh used it (Mod of Redemption in this case, which is also closed source so rip you), my mine is open source but I haven't finished the update that adds in Subworlds yet, so you can take a look at that when the comes if you still need to. I also know there's a few other mods in the works using it but they are far from release.
Similar threads
Game Mechanics
Add a mechanic like Subworld Library.
- Replies
- 0
- Views
- 237
- Replies
- 2
- Views
- 5K
- Replies
- 4
- Views
- 971
Other Literature
Esther's Literature Library
- Replies
- 26
- Views
- 3K
-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.