Jump to content

Shipwrecked mod for DST?


Recommended Posts

8 hours ago, Kzisor said:

@Chris1488, are these islands still too close for comfort?

F5EB76FB3993F08E795CCAD44AFC6F3C17B5BC2B

Wow, this is exactly how i want shipwrecked in DST. The main continent still here, and island to discover. All the great part of SW without the boring so small island that there is nothing great on each. This is wonderful.

Link to comment
Share on other sites

9 hours ago, Kzisor said:

@Chris1488, are these islands still too close for comfort?

F5EB76FB3993F08E795CCAD44AFC6F3C17B5BC2B

The island in the middle is a bit too big.

You should make them so there are lots of islands spread out. In my Opinion.

Also, how would this work in Wilderness mode?

Edited by mathem99
Link to comment
Share on other sites

22 minutes ago, TheTraditionalGentleman said:

This looks really good so far! I'm excited to see the finished product :D 

I know that you said you were focusing on the sailing and biomes right now. Were you also planning to add the seasons of SW as well, or would that be later down the line, if at all?

I do have a plan for seasons, but the details are not finalized. They aren't going to be a high priority until after everything else has been added.

19 minutes ago, mathem99 said:

The island in the middle is a bit too big.

You should make them so there are lots of islands spread out. In my Opinion.

Also, how would this work in Wilderness mode?

I appreciate you opinion. Please understand this isn't the final version of the code. A lot will change as I add the different biomes.

As far as Wilderness mode, I haven't given it a lot of thought, but I know I can specifically make characters only spawn on the main island. My goal is to ensure it works with survival and endless for alpha testing. I'll focus on making Wilderness compatible once we enter into beta testing.

Link to comment
Share on other sites

Will your new worldgeneration be compatible to all kind of other mods, especially set pieces mods like my teleportato mod?
http://steamcommunity.com/sharedfiles/filedetails/?id=756229217

Or will you release a guide how to make setpiece mods compatible to your version?
I think the second guess will be more accurate, since you are adding new biomes with new names, which are not included in setpieces mods..?!

Link to comment
Share on other sites

17 minutes ago, Serpens said:

Will your new worldgeneration be compatible to all kind of other mods, especially set pieces mods like my teleportato mod?
http://steamcommunity.com/sharedfiles/filedetails/?id=756229217

Or will you release a guide how to make setpiece mods compatible to your version?
I think the second guess will be more accurate, since you are adding new biomes with new names, which are not included in setpieces mods..?!

It is still too early in development to discuss any specifics. More information will be released once i have a concept for water biomes and water set pieces.

Link to comment
Share on other sites

Quick update:

Water rooms can now start being added to the game. They are added exactly the way other rooms/tasks are added to the game. In reference to this update, I've already successfully added the Coral Reef biome and will begin added the rest soon. The implementation may change as I add others, but I will give updates as to the changes.

B936FC929CFB86B58F6E5AF4BF119503AFFD1679

Land prefabs will not spawn on water tiles during World Generation. There are still a few minor tweaks needed for this, but it works the majority of the time. When it doesn't work is if there are prefabs spawning on a tile that is next to water, sometimes the prefab will appear in the water even though it's on land.

Land set pieces will not spawn on water tiles during World Generation. Like with land prefabs there are times where a set piece may appear on water, but ultimately they are on land tiles where water is the tile next to it.

Whats next?

I am currently working on finish adding the water biomes to the world generation. Once I've finished adding the water biomes I will begin work on adding the water set pieces. Water set pieces will be added to the game via an API call, so anyone who wishes to add water set pieces will be able to do so very conveniently.

Once water set pieces has been successfully added, I will begin working on water transportation and finally make the water not being able to be walked upon. Starting with boats, there will only be a single raft/boat for Alpha. It will have infinite durability will be insanely cheap to craft. It will be specifically for a proof of concept more than anything.

If you have any questions, please leave them below.

Link to comment
Share on other sites

1 hour ago, Kzisor said:

When it doesn't work is if there are prefabs spawning on a tile that is next to water, sometimes the prefab will appear in the water even though it's on land.

I'm curious. What are you using to determine if a point is water?

 

TheWorld.Map:GetTileAtPoint(x, y, z)

Is what the pitchfork uses, and it isn't accurate for the land/water border.

EntityScript:GetCurrentTileType()

Is accurate for the most part, but some edges appear as land, when they are really not.

 

In the simutil.lua of Shipwrecked, you have:

function GetVisualTileType(ptx,pty,ptz)

    if GetWorld().Map then

        if(ptx == nil or ptz == nil) then 
            print(debug.traceback())
        end
        assert(ptx ~= nil and ptz ~= nil, "trying to get tiletype for a nil position!")


        local tilecenter_x, tilecenter_y,tilecenter_z  = GetWorld().Map:GetTileCenterPoint(ptx,0,ptz)
        local tx, ty = GetWorld().Map:GetTileCoordsAtPoint(ptx, 0, ptz)
        local actual_tile = GetWorld().Map:GetTile(tx, ty)
        
        if actual_tile and tilecenter_x and tilecenter_z then
            local xpercent = (tilecenter_x - ptx)/TILE_SCALE + .5
            local ypercent = (tilecenter_z - ptz)/TILE_SCALE + .5
            
            local x_off = 0
            local y_off = 0
            
            local x_min = 0
            local x_max = 0
            local y_min = 0
            local y_max = 0
            
            if actual_tile == GROUND.IMPASSABLE or not GetWorld().Map:IsWater(actual_tile) then
                
                if xpercent < .25 then
                    x_max = 1
                    
                elseif xpercent > .75 then
                    x_min = -1
                end

                if ypercent < .25 then
                    y_max = 1
                    
                elseif ypercent > .75 then
                    y_min = -1
                end
                
                for x = x_min, x_max do
                    for y = y_min, y_max do
                        local tile = GetWorld().Map:GetTile(tx + x, ty + y)
                        if tile > actual_tile then
                            actual_tile = tile
                            x_off = x
                            y_off = y
                        end
                    end
                end
            end
            
            return actual_tile, GetTileInfo(actual_tile)    
        end     
    end
    return GROUND.IMPASSABLE, GetTileInfo(GROUND.IMPASSABLE) 
  
end

This one gave me the best results (basically using those xpercent and ypercent in a copypasted GetCurrentTileType).

Link to comment
Share on other sites

2 minutes ago, DarkXero said:

I'm curious. What are you using to determine if a point is water?

Is what the pitchfork uses, and it isn't accurate for the land/water border.

In the simutil.lua of Shipwrecked, you have:

This one gave me the best results (basically using those xpercent and ypercent in a copypasted GetCurrentTileType).

Don't Starve Together has a function in much like the Shipwrecked version that is C++ based; GetVisualTileAtPosition.

Link to comment
Share on other sites

6 minutes ago, DarkXero said:

Awesome. I can't believe I missed it.

The bad thing is that it seems that WorldSim is nil when you are playing. Or I'm missing something?

It's only available in World Generation, because at the point when you're playing the game it's mainly running in lua. There is no reason to run the simulation during gameplay as it would add additional overhead which isn't really required.

I might add the Shipwrecked version because as you say it's more accurate, however, it's a low priority task at the moment because I have access to the C++ version in World Generation. My main focus at the moment has been getting world generation working correctly then optimizing the game so that may be one point where I optimize it in the future.

Edited by Kzisor
Link to comment
Share on other sites

Just now, Kzisor said:

Technically you could replicate the same function by using the one from Shipwrecked, but because I'm in World Generation, I have access to the C++ version.

Yeah. I was just bringing the Shipwrecked one up in case it shed some light to solve the

1 hour ago, Kzisor said:

There are still a few minor tweaks needed

 

It will certainly prove useful for GetIsOnWater for boats.

Link to comment
Share on other sites

Just now, DarkXero said:

Yeah. I was just bringing the Shipwrecked one up in case it shed some light to solve the

 

It will certainly prove useful for GetIsOnWater for boats.

I completely agree, it will definitely help once I begin working on that. Now that I am thinking about it, rewriting a small section of the world generation could fix the minor issue with edge placement prefabs.

Link to comment
Share on other sites

This is the issue which needs minor tweaking:

d1285077367b4bfab43f6cad2bd527e7.png

It's technically on a tile, but because the water tiles overlap the land tiles it causes the issue where prefabs appear to spawn on top of water. I might try to add some additional math to the check in order to prevent it from spawning X and Y from water tiles.

Link to comment
Share on other sites

8 minutes ago, Kzisor said:

It's technically on a tile, but because the water tiles overlap the land tiles it causes the issue where prefabs appear to spawn on top of water.

Is putting all the oceans between impassable and road (in GROUND) out of the question?

The mod would break worlds that don't generate with the mod enabled.

But what happens anyways with worlds already created?

Link to comment
Share on other sites

3 minutes ago, DarkXero said:

Is putting all the oceans between impassable and road (in GROUND) out of the question?

Completely out of the question, water must be the highest id possible in order to visually display correctly.

6 minutes ago, DarkXero said:

The mod would break worlds that don't generate with the mod enabled.

But what happens anyways with worlds already created?

The mod doesn't break anything if enabled on a world previously generated. However, there is one caveat to enabling the mod and that is: If you want islands you are forced to lose your world, period. Island separation can only take place during world generation.

Link to comment
Share on other sites

1 minute ago, Kzisor said:

The mod doesn't break anything if enabled on a world previously generated. However, there is one caveat to enabling the mod and that is: If you want islands you are forced to lose your world, period. Island separation can only take place during world generation.

But the previous impassable water stays impassable, right?

Turning impassable into water takes place in world generation.

Link to comment
Share on other sites

1 hour ago, Kzisor said:

I might try to add some additional math to the check in order to prevent it from spawning X and Y from water tiles.

Well, I looked around, and found nothing. TheWorld doesn't exist during generation.

WorldSim:GetVisualTileAtPosition(x, y)
WorldSim:GetVisualTileAtPosition(x - 2.5, y)
WorldSim:GetVisualTileAtPosition(x + 2.5, y)
WorldSim:GetVisualTileAtPosition(x, y - 2.5)
WorldSim:GetVisualTileAtPosition(x, y + 2.5)

You have to look for the adjacent ones I guess.

 

The GetVisualTileAtPosition() of Shipwrecked is godlike though.

You can do a pass through Ents and check them with that, then remove them if they shouldn't be on water.

Link to comment
Share on other sites

7 hours ago, DarkXero said:

Well, I looked around, and found nothing. TheWorld doesn't exist during generation.


WorldSim:GetVisualTileAtPosition(x, y)
WorldSim:GetVisualTileAtPosition(x - 2.5, y)
WorldSim:GetVisualTileAtPosition(x + 2.5, y)
WorldSim:GetVisualTileAtPosition(x, y - 2.5)
WorldSim:GetVisualTileAtPosition(x, y + 2.5)

You have to look for the adjacent ones I guess.

 

The GetVisualTileAtPosition() of Shipwrecked is godlike though.

You can do a pass through Ents and check them with that, then remove them if they shouldn't be on water.

I've been doing this from the very beginning, this is why there needs to be minor tweaks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...