Starbound

Starbound

Anom's Outpost Overhaul
 This topic has been pinned, so it's probably important
AnomNom  [developer] 26 Apr, 2021 @ 11:04am
Technical (Modding Information)
There's a lot to cover here, so if you're interested, stick around and take a read. I'll explain virtually everything I did and link to resources, since I'd argue this is my biggest mod yet.

First and foremost: Tiled. This whole mod would not have been possible without tiled. I specifically used v1.4.3. Tiled is a very versatile tool, which allows you to make both custom dungeons and custom tilesets. As well, you can use it to modify existing dungeons, like I've done here. Most files I worked with are saved as TMXs, which I still have with the exported .json files, something I didn't do with my Anom's Outpost Overhual. I also included all the tilesets, along with the tiles themselves, to make things easier to comb through should you so chose. Just don't reupload my mods please.

For tiled, I reccomend these resources:
Tiled Dungeon Guide by HerrJunky: https://community.playstarbound.com/threads/starbound-and-tiled-getting-started-tiles.131443/
Tiled Tilesets Guide by HerrJunky: https://community.playstarbound.com/threads/starbound-and-tiled-tilesets.138547/
Tiled Layer Guide by SpazDiesFirst360.0: https://community.playstarbound.com/threads/using-tiled-new.135911/

And now, onto the dungeons themselves! Each of the two dungeons has the base .json file, which is the main dungeon itself; the entire thing. After that, segments of dungeons that change are created. These are placed overtop the main dungeon when the universe flag specified in "universeflags.config" are applied. Within this file, the dungeon is applied through a specific universe flag, and given a position accurate to in-game space.

What does this mean for us? Simple, we need to either replace existing dungeons, as I did with ones such as The Beakeasy or the 2-Stop Teleshop, or create entirely new ones, such as the Security office. For replacements, we only need to patch "universeflags.config" to replace the position values, and this is only if we moved where it needs to be positioned in the first place, or changed its size. As for entirely new dungeons, we need to apply a patch to add the dungeon to an existing (or new, if you know what you're doing) universe flag. For example, In the case of the Security Office, the patch looks like this:

{ "op": "add", "path": "/outpost_mission2/actions/-", "value": { "type": "placeDungeon", "dungeonId": "outpost_securityoffice", "targetInstance": "outpost", "targetPosition": [397, 606] } },

In the patch above, we include some specific values: the "type" of action it's doing ("placeDungeon"), the "dungeonID", the "targetInstance" (which instance world is it targeting? In this case, "outpost"), and the "targetPosition" (the X and Y values of the instance world it should spawn at). The path indicates that we're patching "outpost_mission2", which is the Floran Hunting Grounds Mission.

I also had to do two important patches to "dungeon_worlds.config" and "instance_worlds.config" to add the "Monolith", which is the new Ark Ruins!

"dungeon_worlds.config"
[ { "op": "add", "path": "/monolith", "value": { "primaryDungeon": "monolith", "threatLevel": 1, "gravity": 80, "worldSize": [2000, 1000], "dungeonBaseHeight": 750, "ambientLightLevel": [128, 128, 128], "ambientNoises": "/sfx/environmental/space_loop4.ogg", "musicTrack": "/music/temple-of-kluex.ogg" } } ]

"instance_worlds.config"
[ { "op": "add", "path": "/monolith", "value": { "type": "FloatingDungeon", "dungeonWorld": "monolith", "seed": 1234, "spawningEnabled": false, "beamUpRule": "Anywhere", "disableDeathDrops": true, "worldProperties": {"nonCombat": true}, "skyParameters": { "spaceLevel": 3000, "ambientLightLevel": [24, 28, 24], "skyType": "barren", "horizonImages": [], "dayLength": 1153.36, "surfaceLevel": 1200, "seed": -5288806180628667000 } } } ]

In "dungeon_worlds.config", we identify the dungeon, give it a threat level (default is 1 for basically none), set the gravity (generic is usually 80), then specify the world's size (make sure this is bigger than the dungeon you're making it for. After that, we specify the dungeon's base height (Not fully sure what this means, but I think it means how far from the bottom of the worldspace the dungeon is placed). Next, we specify the ambient light levels, the ambient noise, and the music track for the dungeon.

For "instance_worlds.config", we specify a good deal more. First, we have to identify what kind of world it is; in this case, a Floating Dungeon world. Next we give the dungeon world we identified in "dungeon_worlds.config", followed by the seed of 1234 because that's a good seed. Next, we disable monster spawning, and add the beam up rule that identifies where we can beam up at. We then disable death drops (for normal mode), then we set the properties to be a non-combat zone (for those who play multiplayer with PVP on). Finally, we configure the sky, which is a small process, being the level, lighting, the type of sky, the length of the day, what level is the surface, and the seed.

The last few patches were generic dialgoue patches and such. Aside from those, there's one more important thing to mention about dungeons: the .dungeon file. For example, lets take a look at a vanilla .dungeon file, the "outpost.dungeon" specifically.

{ "metadata" : { "name" : "outpost", "species" : "generic", "rules" : [ ], "anchor" : [ "outpost" ], "gravity" : 80, "maxRadius" : 1000000, "maxParts" : 100, "protected" : true }, "parts" : [ { "name" : "outpost", "rules" : [ [ "maxSpawnCount", [1] ] ], "def" : [ "tmx", "outpost.json" ] } ] }

This might look suprisingly simple, and that's because it absolutely is. Dungeons that are entirely one part are quite simple to make. Running through this, we start out by giving it a "name" (aka the ID), identifying the "species", adding the "rules" array (it's usually empty), and identifying the anchor (which is one of the options in the "parts" section you want the whole dungeon to anchor from, and since there's only going to be one option, that's the anchor). Next, we identify the "gravity", then give it the "maxRadius" (I'm not fully sure what it does but it does something). Next, we identify the "maxParts" (which really only matters if we have more than one part). After that, we set a boolean that identifies if the dungeon is "protected." In the final section, we identify the parts, which in this case is just the dungeon itself, so we "name" it, give it the default "rules" (which is what's there), and set the "def" (which is a small section that identifies the actual dungeon).

Want some more information on Patching? Here's a useful guide on it: https://starbounder.org/Modding:Advanced_Modding

I think that about covers everything. Got questions? Feel free to leave a comment, or better yet, join one of the two discords linked at the bottom of the description! Both are great places (though Knightfall is way more active than mine lmao).

Addendum:
Included in outpost.json and universeflags.config is a small parameter ("anomsOutpostOverhaul") which can be tested for. If your mod uses a patch method to NPCs or single objects to outpost.json, this can be used to create a variation of the patch that places the items in the proper place on the new outpost. The patch for universeflags.config can equally be used to create varied coordinates for your mods, so they'll place at one set of coordinates in vanilla, and another set in this mod.
Last edited by AnomNom; 21 Jan, 2024 @ 1:49pm
< >
Showing 1-7 of 7 comments
Bromo Sapien 27 Nov, 2023 @ 5:34am 
Question: I can't seem to understand the x,y, of a "patched" dungeon adding to the outpost.
Such as with a shop's closed state is replaced with an open state.

If I open your outpost, the x,y, in tiled is not the same as the x,y, in any of the patches.
I think there is a count variance in tiled. it counts from right down I think.
Any input on how to find the right x,y to add a new shop to your outpost?

I moved something and then it broke your load and the old gate spawned and made a mess of everything.

I got everything else correct just cannot understand how to determine the correct x, and y for the spawn location.
AnomNom  [developer] 27 Nov, 2023 @ 8:39pm 
Originally posted by Bromo Sapien:
Question: I can't seem to understand the x,y, of a "patched" dungeon adding to the outpost.
Such as with a shop's closed state is replaced with an open state.

If I open your outpost, the x,y, in tiled is not the same as the x,y, in any of the patches.
I think there is a count variance in tiled. it counts from right down I think.
Any input on how to find the right x,y to add a new shop to your outpost?

I moved something and then it broke your load and the old gate spawned and made a mess of everything.

I got everything else correct just cannot understand how to determine the correct x, and y for the spawn location.

Coordinates in universeflags.config don't actually refer to the coordinates in tiled, but the coordinates in the actual instance world. If I recall correctly, you should be able to see what the coordinates are of the tile that your cursor is hovering over if you use /debug. A dungeon is placed by their anchor, so you'll want to find the coordinates that correspond with where that anchor would need to be placed - I often find that using a ruler mod of some kind is incredibly useful for this.
Bromo Sapien 27 Nov, 2023 @ 9:18pm 
Excellent! I'm working on a series of mods that link various mods into the outpost via quests npc's and shops/upgrades to it.

Thanks for the reply.
[GerPMW]R|ambo 21 Jan, 2024 @ 1:14pm 
Is there anything specific inside of the universeflags config that I can test for to clearly identify if this mod is installed or not?
Having my own mod that adds something to the outpost based on world flags that needs to be moved elsewhere in this version of the outpost.
AnomNom  [developer] 21 Jan, 2024 @ 1:41pm 
Originally posted by GerPMWR|ambo:
Is there anything specific inside of the universeflags config that I can test for to clearly identify if this mod is installed or not?
Having my own mod that adds something to the outpost based on world flags that needs to be moved elsewhere in this version of the outpost.
"anomsOutpostOverhaul" is an empty value I patched into universeflags.config that you can test for
[GerPMW]R|ambo 21 Jan, 2024 @ 1:58pm 
Originally posted by AnomNom:
"anomsOutpostOverhaul" is an empty value I patched into universeflags.config that you can test for

Thank you. You just updated the post and I remember something somewhere stating that it has a typo you cannot fix because other mods already use it. Is it actually written "anomsOutpostOverhaul" or still "anomsOutpostOverhual"?
AnomNom  [developer] 21 Jan, 2024 @ 2:02pm 
Originally posted by GerPMWR|ambo:
Originally posted by AnomNom:
"anomsOutpostOverhaul" is an empty value I patched into universeflags.config that you can test for

Thank you. You just updated the post and I remember something somewhere stating that it has a typo you cannot fix because other mods already use it. Is it actually written "anomsOutpostOverhaul" or still "anomsOutpostOverhual"?
I did actually end up fixing that a little while back - I think I simply forgot to update this post with that development - so it's "anomsOutpostOverhaul"
< >
Showing 1-7 of 7 comments
Per page: 1530 50