Jump to content

Set Piece Code Generation and Related Issues


Recommended Posts

I am currently modifying my old save file by adding more Set Pieces to increase its potential. Unfortunately, I’m not very familiar with coding, so I’ve been using ChatGPT to interpret and modify the code. Therefore, I’d like to seek advice from the experts on the forum: how can I fix the generation of a specific maze Set Piece, such as the ones listed below:

Spoiler

In the maze_layouts file, the Set Pieces I'm trying to generate are currently randomized. I'm using d_spawnlayout("SINGLE_NORTH"), but I know this is incorrect. I'm not sure how to modify it properly.

`NLS7IAA5~_NWP)4(3~XA6Y.png

IXGFDDG5JX$Y]M%9%MX8E}N.png

 

Spoiler

Additionally, I haven't been able to locate all the Set Pieces. For example, I haven't found the one listed below—does anyone know about it? Also, am I missing any other Set Pieces?

Here's the link: https://forums.kleientertainment.com/forums/topic/149874-more-set-pieces/

image.png

 

 

If you're also interested in modifying an old save file by adding some new Set Pieces, you can check out the files below. These contain all the Set Pieces and related textures that I've found so far. You can follow the instructions in the files to add and modify Set Pieces in your old save file (I recommend backing up your save first, and then planning and making changes).

Spoiler

布景 - 饥荒维基 - 灰机wiki - 北京嘉闻杰诺网络科技有限公司 (huijiwiki.com)

Here is the translation of the relevant definitions:

Set Piece, also known as Static Layout, is part of the world generation in Don't Starve Together.

Set Pieces can be categorized into the following types:

  • Failed Survivors, also known as Boons, colloquially referred to as "Predecessors," usually consist of a skeleton and some relics. These relics may include scattered items, structures, or even a small base. Players can acquire extra resources at no cost (except for potential psychological burden).

  • Traps, which typically activate special effects when triggered by the player. Sometimes, the cost of these Set Pieces can far outweigh the benefits they provide. The "Traps" may awaken dangerous creatures, cause environmental changes, alter the state of certain objects, etc.

  • Points of Interest, usually consisting of a skeleton and some relics, but the relics often have clear professional implications, allowing players to infer the occupation of the skeleton when it was alive.

  • Protected Resources, which usually come with a large concentration of resources, but are also guarded by numerous creatures. Players must defeat these creatures to safely gather resources, although sometimes the creatures themselves may be more valuable than the resources.

  • Fixed Set Pieces, which are guaranteed to appear in the world, typically representing important and critical resources, structures, NPCs, etc.

  • Maze Set Pieces, which are generated as part of labyrinthine terrains such as the Atrium or the Ancient Archives.

  • Revamped Set Pieces

 

A Collection of Set Pieces.docx

You might be better off asking in the modding board than in this one since it sounds like you're trying to make a mod. 

Also, don't expect generative AI to output anything coherent or accurate - it's only as good as the data it's fed on and that data's inevitably going to have flaws with how much it needs to function, and what it does is try to replicate patterns in that data set that it "thinks" fit your prompts. This is the same technology that, not too long ago, would tell you on Google that you need to eat two rocks per day because an Onion article it scraped said so.

I something use AI when I am struggling with my trial and error approach to modding so I send my draft (that e.g. created a dedicated server error or a lua error) to the llm for it to look for typos and syntax error, or to "reinterprete" what I have tried to come up with, or suggest me an alternative approach to what I planned to do or to ask it if an alternative version could be impletend instead. So the LLM is actually a great tool when you have a /specific/ idea in mind and already have been searching other workshop mods that have a similar function. The LLM when fead with DST data can help quite well "reading" and modifying the code snippet you give it.

But apart from those uses I noticed the thing being quite outdated or often making up functions that don't exist OR trying to suggest code that would work in the single player game for DST, so I would never trust an LLMs output word by word but instead I keep using the approach to make something by looking at other mods, and then try to focus on one specific change, and if my approach kills the game, ask the LLM what "they" would suggest to change just for this one specific detail. If it works, great, moving on to the next detail.

So maybe you could try the approach to just focus your plans on ONE setpiece, if possible one that is included in an already existing, not too outdated, workshop mod, and try to "copy" the approach as much as possible, asking the LLM in case you get stuck, just detail by detail. And if this works, you could try expanding it bit by bit.

Sadly this means having to make a lot of discarding of ideas and compromising but it could maybe get you a tiny bit closer to the result you want to archive.

I think your might have misunderstood me. I didn’t mean to create a mod, but rather to use the in-game debug console to spawn some of the existing terrain structures. However, the terrain related to the maze_layouts.lua file in the game is randomly generated when I use the debug console to spawn it. I would like to know how to accurately generate each specific terrain structure mentioned in this file. I hope to get help from experts.

8 hours ago, adminaaassh said:

I think your might have misunderstood me. I didn’t mean to create a mod, but rather to use the in-game debug console to spawn some of the existing terrain structures. However, the terrain related to the maze_layouts.lua file in the game is randomly generated when I use the debug console to spawn it. I would like to know how to accurately generate each specific terrain structure mentioned in this file. I hope to get help from experts.

what you are asking is not possible via the method you are attempting it. console commands allow you to manually ask the game to execute an existing code, it does NOT allow you to make new code or alter said existing code. in this case when you ask for a rng-dependant set piece to be generated the game looks through its lil' rolodex of codes, finds the set piece type and picks one at random from the set. it does not have a feature disallow the randomization part and console commands does not let you modify the code to force disallow the randomization.

 

also, you probably should not be using chatgtp. not only does it have a habit of making things up if it does not have the answer but it uses existing material that has been fed to it to come up with the answers it does have; you are 100% using someone else's coding when you use chatgtp but you aren't getting context for why it is working or a guarantee it wont wreck your business up when it doesnt work

2 hours ago, gaymime said:

what you are asking is not possible via the method you are attempting it. console commands allow you to manually ask the game to execute an existing code, it does NOT allow you to make new code or alter said existing code. in this case when you ask for a rng-dependant set piece to be generated the game looks through its lil' rolodex of codes, finds the set piece type and picks one at random from the set. it does not have a feature disallow the randomization part and console commands does not let you modify the code to force disallow the randomization.

 

also, you probably should not be using chatgtp. not only does it have a habit of making things up if it does not have the answer but it uses existing material that has been fed to it to come up with the answers it does have; you are 100% using someone else's coding when you use chatgtp but you aren't getting context for why it is working or a guarantee it wont wreck your business up when it doesnt work

I understand now, thank you for your guidance. I have learned from this.

2 hours ago, Cassielu said:

My personal experience is you can register these Maze Set Piece as a normal Set Piece in scripts\map\layout.lua and then generate it with d_spawnlayout command.

 

Thank you for providing the method; I will give it a try.

谢谢

9 minutes ago, adminaaassh said:

I understand now, thank you for your guidance. I have learned from this.

Thank you for providing the method; I will give it a try.

谢谢

not a problem, i mod solo ds so i have had to just go in and manually change stuff when i couldn't get the results i needed. lucky for us modding is way easier with lua and if you really bork it up you can always do a reinstall ^^

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...