How can mods add support for gennotify?

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

How can mods add support for gennotify?

by burli » Thu May 26, 2016 17:19

If I want to write a mod for dungeons or caves, how can I add support for gennotify? And is it possible to add new structures like buildings? And is it possible to add more informations like the size of a dungeon room?
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: How can mods add support for gennotify?

by Sokomine » Fri Jul 15, 2016 01:02

burli wrote:If I want to write a mod for dungeons or caves, how can I add support for gennotify? And is it possible to add new structures like buildings? And is it possible to add more informations like the size of a dungeon room?

Mapgen already provides information about each dungeon room it creates. I also think I saw a mod that decorated dungeons quite recently.
A list of my mods can be found here.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: How can mods add support for gennotify?

by burli » Fri Jul 15, 2016 04:37

Only the center coordinate of each room. And this mod just places a chest at the center of a room
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: How can mods add support for gennotify?

by duane » Fri Jul 15, 2016 09:57

burli wrote:Only the center coordinate of each room. And this mod just places a chest at the center of a room


Room center is all you get. Anyway, it's fairly trivial to find the walls from there. The real trick is knowing if an open space is supposed to be part of the dungeon or not.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: How can mods add support for gennotify?

by burli » Fri Jul 15, 2016 10:30

That's what I mean. You have to "parse" the room yourself for an information the generator already had. Nobody get hurt if the generator adds this information to gennotify, but it makes life easier
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: How can mods add support for gennotify?

by duane » Fri Jul 15, 2016 15:40

burli wrote:That's what I mean. You have to "parse" the room yourself for an information the generator already had. Nobody get hurt if the generator adds this information to gennotify, but it makes life easier


Everything the mapgen does costs cpu time and memory. Paramat's gone to great lengths to make the mapgens run as fast as possible, which includes removing features that won't be important to most people, especially if they can be done nearly as efficiently in a mod.

If you're planning to decorate a dungeon using gennotify, you're going to use a voxelmanip. As I recall, gennotify only works in the on_generate function, so there's no point doing it otherwise. Once you have the map in lua, it takes only slightly more processor time than C would use to check the data array for room size, especially since you know the center of each.

Balance that against the small extra resource drain that every user would suffer, even if they have no interest in decorating dungeons, and consider that everyone who develops mods is likely to have a pet feature they'd like the mapgen to take over. You can see why people are likely to be conservative about putting in features like this.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: How can mods add support for gennotify?

by burli » Fri Jul 15, 2016 16:22

duane wrote:Everything the mapgen does costs cpu time and memory.

In this case the mapgen has all informations. He has just to put then into a table. This will cost nothing.

Trying to get the room size later in a mod is much more time expensive and can fail, if a cave destroyed a wall.

Mods would be much more efficient if they had the information they needed. For example more trees. The mod has to "guess" which biome there is, but most time it fails and that's why palm trees grow in a tundra or in snow biomes
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: How can mods add support for gennotify?

by duane » Sat Jul 16, 2016 00:10

burli wrote:In this case the mapgen has all informations. He has just to put then into a table. This will cost nothing.


Your first statement contradicts itself. You've just said that something has to be done. Doing anything in a computer costs resources. What you meant was that it's a trivial cost, but that's a judgment on your part and not everyone will agree.

Have you put in a feature request? Or, if you really want this added, have you started boning up on your C++ skills so you can put in a pull request with a finished modification? I doubt that any of the developers will consider it a high priority for the reasons I outlined above, but discussing it here isn't going to get much done.

When I added paramat's huge cave code to valleys mapgen, I asked for a new gennotify to indicate whether or not a huge cave existed in a map chunk. This would let me know if I needed to decorate any part of it with huge-cave-dwelling creatures. I was told that even sending a few extra bytes as a gennotify wasn't going to fly -- and I had already made a working patch to put the change in.

You're likely to be waiting a while if you expect someone else to do this.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: How can mods add support for gennotify?

by burli » Sat Jul 16, 2016 06:06

I don't have the skills to add this myself. But this thread is a little bit off topic. The initial thread asks for the ability to add informations to the gennotify from a mod.

for example, is it possible that a dungengen mod adds coordinates to gennotify? I guess, no
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 7 guests

cron