Portfolio/Multi-Topic Hardmode sky island content

@Freenight Tiles aren't created with this, they are modified. When the world is generated it creates instances of the Tile class for each coordinate, this class stores various information for that tile, such as wall block type, wall type, liquid type, and various other information tiles need.

The tile ID for air, I'm assuming, is -1, dirt is 0, so all we need to do is modify the Tile type from -1 to 0 to change it to dirt.

Here's a quick example snippet
for (int i = 0; i <= Main.maxTilesX; i++) {
for (int j = 200; j <= Main.maxTilesY; j++) {
if (Main.tile[i,j].type == -1) {
Main.tile[i,j].type = 0; //Set all air blocks above 200 Y to dirt
}
}
}
I don't know if this is accurate as Terraria is not my project, but from a quick look it seems spot on. Not sure how updating it would work. Also, not sure if Main.tile is currently loaded tiles or the entire map, which would obviously be an issue if it was currently loaded, but there is more than likely a way to load them if this is true.
 
Last edited:
There is absolutely no reason why new tiles could not be spawned via internal code. Not. A. Single. One. The primary problem - which, forgive me it I'm wrong, no one has addressed properly - is the removal of the tiles. I disagree with this particular method of spawning loot because it's unnecessarily complex. A significantly easier and much more robust method would be for there to be some sort of "Mega Wyvern Spawn Box of Doom", which gives the enraged Wyvern. Then, upon the Mega Wyvern's death, he drops a "Mega Wyvern Loot Box of Doom" which contains the loot, strangely enough.
[DOUBLEPOST=1419687184][/DOUBLEPOST]My apologies for the double post.
And even if the island gen were to stay, it would be much simpler to just have a new island be created and have it decay after it's chest is looted or whatnot.
 
Duhh, it's possible to generate structures even after world creation. You say meteors are an exception, since they're only generated by replacing any tiles in range with meteorite, but that doesn't prove anything: they've got an algorithm which generates them with their characteristic round shape.
The same could happen for floating islands or whatever, you just need to include more parts in the generation algorithm: make an island-shaped patch of dirt above x height, cover it with cloud blocks then cover any dirt block exposed to air with grass.
The only argument against generating structures after world gen is that it may cause griefing. That being said, there are conditions that can be added to the generation, so as to prevent your world from being destroyed, such as: if block id != id of air => don't replace anything.

However, I don't like the suggestion, so I'm not supporting it.
 
I just don't really see it happening. Some suggestions get shot down because of the way trees grow. TREES. SHOT DOWN BY @Cenx HERSELF BECUASE OF TREES. (I forget which one it was, but it had to do with the Staff of Regrowth.) If that's enough to kill a part of a suggestion, then this suggestion has been drop-kicked into a volcano with an atom bomb strapped to it- and the volcano is on a planet headed towards its sun, which is itself being sucked into a black hole.

Ya here that guys? Cenx shot down an idea about changing how trees grow so this one can never happen!

Also, the game CAN generate tiles after world gen. There's these things called WALL OF FLESH LOOT BOXES.
 
Ya here that guys? Cenx shot down an idea about changing how trees grow so this one can never happen!

Also, the game CAN generate tiles after world gen. There's these things called WALL OF FLESH LOOT BOXES.
Huh. Well, let's see... those are generated in a position relative to the Wall. These new islands are generated relative to... nothing. Different concept.
 
Huh. Well, let's see... those are generated in a position relative to the Wall. These new islands are generated relative to... nothing. Different concept.

Place some invisible entities that don't interact with the world in any way around the sky during world gen. Use them as a relative positional reference point for the new sky islands to spawn in.

There's almost always a work around to a problem in code. It just requires a little creative thinking.
 
Huh. Well, let's see... those are generated in a position relative to the Wall. These new islands are generated relative to... nothing. Different concept.
Don't be a fool. The tiles are generated relative to existing sky islands - all the game has to do is save the "center" of the island, then generate the new sky island over the old one. Or, even simpler, just pick a random point in the sky, check if all the areas around it are empty, then generate around that point. You clearly aren't a programmer. This problem is practically cakewalk.
 
Don't be a fool. The tiles are generated relative to existing sky islands - all the game has to do is save the "center" of the island, then generate the new sky island over the old one. Or, even simpler, just pick a random point in the sky, check if all the areas around it are empty, then generate around that point. You clearly aren't a programmer. This problem is practically cakewalk.
The thing is, the game doesn't "know" if something is a sky island, so how can it find its center? As for the "random point in sky" idea, that works better.
[DOUBLEPOST=1419836019][/DOUBLEPOST]
Place some invisible entities that don't interact with the world in any way around the sky during world gen. Use them as a relative positional reference point for the new sky islands to spawn in.

There's almost always a work around to a problem in code. It just requires a little creative thinking.
That works too.
 
The thing is, the game doesn't "know" if something is a sky island, so how can it find its center?
Yes it does. Have you ever read the text during world gen? "Generating Sky Islands" is one of the little text splashes. I don't know exactly how it does it, but all it has to do is save an arbitrary, but consistent point to use as reference.
 
Why not just have a locked chest that needs a key that comes from whatever you want spawn over the old one?
 
Why not just have a locked chest that needs a key that comes from whatever you want spawn over the old one?
I don't know about anyone else, but I'm just defending the feasability of how the idea was originally presented. However, this does come with its own set of problems - what if a player breaks all the chests from the world and puts them in storage? What if a player makes a bunch of sky chests w/ the Skyware Mill and places them at Floating Island level?
 
Replacing sky Islands should be similar to the meteorite process...
Why change the sky Islands for hardmode? Why not just have new enemies? A sky chest mimic could spawn after defeating a wyvern or whatever 5% of the time...
 
I don't know about anyone else, but I'm just defending the feasability of how the idea was originally presented. However, this does come with its own set of problems - what if a player breaks all the chests from the world and puts them in storage? What if a player makes a bunch of sky chests w/ the Skyware Mill and places them at Floating Island level?
Then have 2 chests spawn right next to each other, one that's locked, one that's not.
 
Back
Top Bottom