Jump to content

Does anyone know anything about worldgen 3.0?


Recommended Posts

I've been struggling to get anything working at all when it comes to custom worldgen. I have a set of rooms, tasks, and levels that I used in the singleplayer Don't Starve that I am trying to get into DST.

I know there is a great tutorial here in the forums that talk about worldgen 2.0, and I've already applied all those changes, but the current version is now 3.0. 

 I know about addtaskpreinit, and addlevelpreinit, but I'm not sure if I'm not doing it right or if it just doesn't work the way it used to. It's able to run without crashing in the worldgenmain, but it doesn't actually change anything.

I've been searching and digging through the workshop to try and find mods that modify worldgen to study how they do it, but I've come to realize that none of them actually work anymore. The "cave on ground" mod that allowed cave rooms and such to appear above ground doesn't actually work. And a lot of the older worldgen related mods stopped working after the 3.0 switch, and now require the mod "turfed" to function.

Is there any information at all about the new 3.0 format and how its different? Or any functioning 3.0 worldgen mods at all?

Link to comment
Share on other sites

Isn't the "Multi Worlds" mod working?
http://steamcommunity.com/sharedfiles/filedetails/?id=726432903

And there is this mod (this requires "turfed"):
http://steamcommunity.com/sharedfiles/filedetails/?id=608722692

And some stuff is done in my mods, but only about setpieces and number of things:
http://steamcommunity.com/sharedfiles/filedetails/?id=758921911

http://steamcommunity.com/sharedfiles/filedetails/?id=756229217

 

 

Edited by Serpens
Link to comment
Share on other sites

4 hours ago, Serpens said:

Isn't the "Multi Worlds" mod working?
http://steamcommunity.com/sharedfiles/filedetails/?id=726432903

 

 

Ahh, yes that one is working! Perfect! It must not have shown up in the search results for me earlier.

I've been going through it and playing around with the code for a few hours and I've managed to get most of the basics fixed. It turns out there were a few key differences that I missed between DS and DST but those are cleared up now.

Strangely enough, I noticed everything in that mod is also labeled as version 2, though it still seemed to work fine (as far as I know) 

I still haven't been able to get an island world going yet, but I think I just need more time to play around with it.

Link to comment
Share on other sites

11 minutes ago, pickleplayer said:

 

Ahh, yes that one is working! Perfect! It must not have shown up in the search results for me earlier.

I've been going through it and playing around with the code for a few hours and I've managed to get most of the basics fixed. It turns out there were a few key differences that I missed between DS and DST but those are cleared up now.

Strangely enough, I noticed everything in that mod is also labeled as version 2, though it still seemed to work fine (as far as I know) 

I still haven't been able to get an island world going yet, but I think I just need more time to play around with it.

uhm, an island world is impossible without rewriting big parts of game code.
At least this was the case when I tried to make island generation working for the "adventure mod"
http://forums.kleientertainment.com/files/file/1684-dst-adventure-mod-unfinished/

And for the project "shipwrecked" startet by Kzisor, which is a brilliant modder, the code was rewritten completely, see this linked post:

Kzisor wrote in PM to me:

On 29.11.2016 at 1:32 AM, Kzisor said:

In order for you to do that you will need to rewrite the entire world generation script from scratch like I am doing with the mod I am creating. It's not an easy task and not something you can simply put in an API.

World generation either generates islands or it doesn't. Wormholes being linked to specific islands is a different set of code that will need to be written. Right now, wormholes spawn where ever and so do cave entrances; this is why I am choosing to do it the way I am doing it. I will need to write less code to make it work correctly.

I've spent 2+ weeks writing the world generation code which makes it do what I have it doing. It would take another 2 weeks to do your idea, it would take months to make a proper API which would allow people to set and choose their layouts. In fact I might add that option via overrides, we will have to see what the future holds.

But maybe a statement from a dev is helping you to solve it easier:
http://forums.kleientertainment.com/topic/70370-mod-beta-compatibility/?page=0#comment-826216

 

Edited by Serpens
Link to comment
Share on other sites

 

1 hour ago, Serpens said:

uhm, an island world is impossible without rewriting big parts of game code.
At least this was the case when I tried to make island generation working for the "adventure mod"
http://forums.kleientertainment.com/files/file/1684-dst-adventure-mod-unfinished/

 

 

Ohhhhh... That complicates things.

Hmm. I'm not sure if I know enough about world generation to figure this out anytime soon, but I'm wondering if the limited tools available are enough to get me anything close to what I need, because I really don't need a lot.
Really, it's just... A map that's completely empty save for a tiny square of land in the middle.
 
I recall that I was able to do that by making the island world only two islands made of water, one of which just spawned a setpeice.
heh, maybe I can just mess with the biomes to make them all spawn only water.
I'll have to look into that tomorrow. 
Edited by pickleplayer
Link to comment
Share on other sites

On 3/24/2017 at 10:39 AM, Serpens said:

you could check how it is done in this mod:
http://steamcommunity.com/sharedfiles/filedetails/?id=523209309

I guess they did it like the dev advised in my last link in the post above. So the islands are not spawned during worldgen, but after it.

 

Yea, after getting nowhere with worldgen yesterday I decided to try out a post-worldgen method instead. Deleting all land within a 200 units of spawn and changing the tiles to grass in a small rectangle around spawn. I guess it worked.

I have messed around with tile world tiles before in the past, and I knew that the cliff sides and collision walls didn't actually change properly when used, but I didn't know that all of those problems were as easy to fix as simply reloading the world!

Thanks for all your help on the subject!

Link to comment
Share on other sites

14 hours ago, pickleplayer said:

 

Yea, after getting nowhere with worldgen yesterday I decided to try out a post-worldgen method instead. Deleting all land within a 200 units of spawn and changing the tiles to grass in a small rectangle around spawn. I guess it worked.

I have messed around with tile world tiles before in the past, and I knew that the cliff sides and collision walls didn't actually change properly when used, but I didn't know that all of those problems were as easy to fix as simply reloading the world!

Thanks for all your help on the subject!

:)
please link your mod when it is finished. In case me or someone else will start working on the "adventure" mod again, maybe your mod could be helpful to realize the world with islands.

Link to comment
Share on other sites

On 3/26/2017 at 10:36 AM, Serpens said:

:)
please link your mod when it is finished. In case me or someone else will start working on the "adventure" mod again, maybe your mod could be helpful to realize the world with islands.

 

You'd probably be better off looking into the Personal Islands mod itself, mine is probably less useful and more unnecessary.

But if anything, maybe it gives a more simple idea of how tile swapping works. This just replaces all tiles in a 200x100 grid with water tiles.

		local xcap = 100 --just to easily adjust grid size 
		local zcap = 200
		
		local gridx = -xcap
		local gridz = -zcap
		
		while gridz <= zcap do --runs through a grid of 100x200 tiles
		
			gridx = gridx + 2
			
			if gridx == xcap then
				gridx = -xcap
				gridz = gridz + 2
				print("BULDOZING OLD GROUND")
			end
		
			local ground = TheWorld
			if ground then
				local pt = anchor:GetPosition() --anchor is a object I had spawned at the center of the stage
				local x, y = ground.Map:GetTileCoordsAtPoint(pt.x+gridx, pt.y, pt.z+gridz)
					
				local newx = x
				local newy = y + 1
					
                	--these two actually create the new ground
				ground.Map:RebuildLayer( GROUND.IMPASSABLE, newx, newy, 5 ) --honestly, I forget what the 5 was for
				ground.Map:SetTile( newx, newy, GROUND.IMPASSABLE )
					
			end
		end

This is called from the modmain with AddSimPostInit. I have another, basically identical, one that then replaces a smaller grid with grass tiles. Then the server needs to restart for the tile changes to finish applying. 

 

Link to comment
Share on other sites

9 hours ago, pickleplayer said:

This is called from the modmain with AddSimPostInit. I have another, basically identical, one that then replaces a smaller grid with grass tiles. Then the server needs to restart for the tile changes to finish applying.

Just be careful with replacing large amounts of terrain like this in one go.

When I was messing with an entire world before setting the entire world to a tile the RAM completely filled and exploded the process from out of memory.

 

I've been poking around worldgen and I must say it's quite the spaghetti ball.

Edited by CarlZalph
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...