Places of interest

If I understand correctly, the building utility goes through a list of all specials in some set order, right ? Let’s say it goes like: beehive, cathedral, fema camp, mall. Now, when selecting a special, could we add a random roll and compare it to a building-specific threshold ? In that case it could go: If the RND > Building_threshold then place special; else next special.
Then, having different layouts would be just the question of adjusting thresholds so that mall1_thresh + mall2_thresh+… = x, with x detemrining the actual chance of encountering ANY type of mall. Would something like this work ?[/quote]

Not really. The way special placement in overmap generation works (I’m assuming this is what you mean by building utility, and not acidia’s utility) is it splits the map up into an N x N grid, then it picks a grid entry and selects a random point within that grid. After that, it makes a list of overmap specials it is allowed to place there based on the location that is selected. Next, it splits that list up into specials that it MUST place (specials that have not met their minimum amount set in the definition), and specials that it CAN place (specials that have met their minimum but not their maximum). If it has any in the must place, it picks one of those at random, otherwise it picks one at random from the can place list. After that it goes into the actual placement, where it applies rotation, road connections, etc. The correct way to do it would be to separate the definition of the special’s layout from the rest of the special. That way instead of how it is now where it is:
[tt]
{
type: special,
id: mall,
layout: { point:[0,0,0], mall_0_0_0, etc}
occurrences: [0,4],
etc…
}
[/tt]
it would be something more like:
[tt]
{
type: special,
id: mall,
layouts: [ mall_layout_1, mall_layout_2, etc ]
occurrences: [0,4],
etc…
}
{
type: special_layout,
id: mall_layout_1,
layout: { point:[0,0,0], mall_layout1_0_0_0, etc}
etc…
}
{
type: special_layout,
id: mall_layout_2,
layout: { point:[0,0,0], mall_layout2_0_0_0, etc}
etc…
}
[/tt]

This would also solve the problem quite well - the question is how the editing of individual tiles works (as in, is keeping all the walls lined properly on a, say 3x3 special, be difficult/arduous or is it just a case of "plot it in excel and off you go" ?).

It shouldn’t be too difficult as long as you can easily see what tiles it may be connecting to, but the more variations you have, the more opportunities you have for error.

[quote="vache, post:54, topic:7085"]Location handling in particular would require a rework of how it places specials entirely though.[/quote]

Here I must admit to a total lack of knowledge - are the map features not actually treated as entities at all ?

See above for how it handles locations. If you wanted to place something in a very specific area, like a small marina on a river bank, you would have to get very lucky and have the game randomly select a point on a river bank when it is picking places to plop a building down. Having control over things like that would require a new way of selecting where to place specials that could examine the list of specials and determine what locations to select, rather than selecting a location and picking a special that fits.

[quote=“vache, post:61, topic:7085”]Not really. The way special placement in overmap generation works (I’m assuming this is what you mean by building utility, and not acidia’s utility) is it splits the map up into an N x N grid, then it picks a grid entry and selects a random point within that grid. After that, it makes a list of overmap specials it is allowed to place there based on the location that is selected. Next, it splits that list up into specials that it MUST place (specials that have not met their minimum amount set in the definition), and specials that it CAN place (specials that have met their minimum but not their maximum). If it has any in the must place, it picks one of those at random, otherwise it picks one at random from the can place list. After that it goes into the actual placement, where it applies rotation, road connections, etc. The correct way to do it would be to separate the definition of the special’s layout from the rest of the special. That way instead of how it is now where it is:
[tt]
{
type: special,
id: mall,
layout: { point:[0,0,0], mall_0_0_0, etc}
occurrences: [0,4],
etc…
}
[/tt]
it would be something more like:
[tt]
{
type: special,
id: mall,
layouts: [ mall_layout_1, mall_layout_2, etc ]
occurrences: [0,4],
etc…
}
{
type: special_layout,
id: mall_layout_1,
layout: { point:[0,0,0], mall_layout1_0_0_0, etc}
etc…
}
{
type: special_layout,
id: mall_layout_2,
layout: { point:[0,0,0], mall_layout2_0_0_0, etc}
etc…
}
[/tt]
[/quote]

I see - and we can’t set a minimum for a group of specials (such as mall1, mall2…), because instead of having the #amount_placed incremented upon placing a special, the mapgen actually scans the map for a tile containing any given special and counts them all up (at least that’s the picture I’m getting based on my limited understanding of coding) ?

Will have to look into how acidia’s utility works then - might be easy enough for me to brave it through. :slight_smile:

Well, either that, or just incorporate rivers as sites for specials with dimensions that no land specials have - shabby solution, but wouldn’t it work ?

I’ve found the “LEAK_DAM” and “LEAK_RAD” flags - the first one sounds like what I want, but how to define what is leaked (found a few functions as well, but those seem to be tied to the rate of the leak only) ? Is it an automatic “what was in is getting out” situation that would result in the contents spilling on the ground like in case of petrol ?

PS: Updated the item list a bit more.

LEAK_DAM means that whatever was stored in the item will slowly fall out of the container in question.

Thanks for the info ! If it falls out, can I make it instantly vanish and create a cloud (say like a bloated zombie) ? The idea was to have gas cylinders leak on damage - say LPG - and form a small-but-extremely-flammable cloud.

Thanks for the info ! If it falls out, can I make it instantly vanish and create a cloud (say like a bloated zombie) ? The idea was to have gas cylinders leak on damage - say LPG - and form a small-but-extremely-flammable cloud.[/quote]

That would need new compiled-code, whether to support new JSON or to hardcode the effect you’re asking to a flag. A hypothetical “LEAK_FLD” might create fields when damaged (specify in the item JSON), but then the field would need coded in C++. I’m not certain how best to write up the field, but I’m sure one could be written that greatly facilitates fire, maybe even explodes when a flame is present.

That said, I’m all for it, as this would allow for actual rather than Bug thermobaric devices.

[quote=“KA101, post:65, topic:7085”]That would need new compiled-code, whether to support new JSON or to hardcode the effect you’re asking to a flag. A hypothetical “LEAK_FLD” might create fields when damaged (specify in the item JSON), but then the field would need coded in C++. I’m not certain how best to write up the field, but I’m sure one could be written that greatly facilitates fire, maybe even explodes when a flame is present.

That said, I’m all for it, as this would allow for actual rather than Bug thermobaric devices.[/quote]

This would be lovely to have - unfortunately I’m nowhere near the skill required to code something like this in. That said, I’ll prepare all the necessary items and maybe in the meantime someone will have a go at this… I’ve actually got some that could be flammable and some that would be explosive. With the level of chemical ability the PC can achieve, making a basic gas mixture would be almost trivial - one could actually make pretty high-payload bombs quite easily…

Sorry for double-posting, but I had to do an update even if there were no comments since last time. I’ve pretty much wrapped up the first batch of items in terms of conceptual work. The only thing that’s left is to code them in - would love some help in implementing all of the functionalities I had planned, but even if they are “to be added” for some time, I believe that adding the items will help flesh the world out a bit more.

I’ve went ahead and tried implementing a few basic items - stackable limestone bits / quicklime / sand and cement (well, bricks too, but I’m not happy with the description yet) along with a few recipes for them - could you please take a look at them (and voice your opinions - would like to hear your thoughts on constructing walls with cement and bricks, instead of only with wood/stone). Used one template on the four new items:

Cement: (modifies melee.json)

{ “type” : “AMMO”,
“id” : “material_cement”,
“category” : “spare_parts”,
“price” : 5000,
“name” : “cement”,
“name_plural” : “cement”,
“symbol” : “=”,
“color” : “dark_gray”,
“description” : “Portland is most likely long gone, but it’s memory persists in cement. This ubiquitous binder can be used for all kinds of advanced masonry. Just add water.”,
“material” : “ceramic”,
“volume” : 1,
“weight” : 20,
“bashing” : 1,
“cutting” : 0,
“to_hit” : 0,
“ammo_type” : “components”,
“casing” : “NULL”,
“damage” : 0,
“pierce” : 0,
“range” : 0,
“dispersion” : 0,
“recoil” : 0,
“count” : 50
},

Limestone bits:

{ “type” : “AMMO”,
“id” : “material_limestone”,
“category” : “spare_parts”,
“price” : 5000,
“name” : “limestone”,
“name_plural” : “limestone”,
“symbol” : “=”,
“color” : “dark_gray”,
“description” : “A handful of small chunks of limestone. Useful for experiments at science fairs, but pretty useless as ammo. Maybe something could be crafted from this stuff…”,
“material” : “ceramic”,
“volume” : 1,
“weight” : 14,
“bashing” : 1,
“cutting” : 0,
“to_hit” : 0,
“ammo_type” : “components”,
“casing” : “NULL”,
“damage” : 0,
“pierce” : 0,
“range” : 0,
“dispersion” : 0,
“recoil” : 0,
“count” : 50
},

Quicklime:

{ “type” : “AMMO”,
“id” : “material_quicklime”,
“category” : “spare_parts”,
“price” : 5000,
“name” : “quicklime”,
“name_plural” : “quicklime”,
“symbol” : “=”,
“color” : “dark_gray”,
“description” : “The product of burning limestone, this white powder is a crucial ingredient in making cement. That said, it is also extremely caustic and will cause severe burns to any tissue it comes in contact with. Could also be used to neutralise acid spills…”,
“material” : “ceramic”,
“volume” : 1,
“weight” : 15,
“bashing” : 1,
“cutting” : 0,
“to_hit” : 0,
“ammo_type” : “components”,
“casing” : “NULL”,
“damage” : 0,
“pierce” : 0,
“range” : 0,
“dispersion” : 0,
“recoil” : 0,
“count” : 50
},

Sand:

{ “type” : “AMMO”,
“id” : “material_sand”,
“category” : “spare_parts”,
“price” : 5000,
“name” : “sand”,
“name_plural” : “sand”,
“symbol” : “=”,
“color” : “dark_gray”,
“description” : “A handful of New England sand. If you had a stoked furnace, you could turn it into glass. Otherwise, it’s only good for making cement. And soaking up blood - something particularly useful nowadays.”,
“material” : “ceramic”,
“volume” : 1,
“weight” : 10,
“bashing” : 1,
“cutting” : 0,
“to_hit” : 0,
“ammo_type” : “components”,
“casing” : “NULL”,
“damage” : 0,
“pierce” : 0,
“range” : 0,
“dispersion” : 0,
“recoil” : 0,
“count” : 50
},

Quicklime recipe: (modifies recipe_ammo.json ?)

{
“type” : “recipe”,
“result”: “material_quicklime”,
“category”: “CC_OTHER”,
“subcategory”: “CSC_OTHER_MATERIALS”,
“skill_used”: “fabrication”,
“skills_required”: [ “cooking”, 2 ],
“difficulty”: 3,
“time”: 90000,
“reversible”: false,
“autolearn”: true,
“tools”: [
[
[“crucible”, -1]
],
[
[“forge”, 250], [“char_forge”, 50], [ “oxy_torch”, 50]
]
],
“components”: [
[
[ “material_limestone”, 50 ]
]
]
},

Cement recipe:

{
“type” : “recipe”,
“result”: “material_cement”,
“category”: “CC_OTHER”,
“subcategory”: “CSC_OTHER_MATERIALS”,
“skill_used”: “fabrication”,
“skills_required”: [ “cooking”, 3 ],
“difficulty”: 4,
“time”: 90000,
“reversible”: false,
“autolearn”: true,
“tools”: [
[
[“crucible”, -1]
],
[
[“forge”, 250], [“char_forge”, 50], [ “oxy_torch”, 50]
]
],
“components”: [
[
[ “material_quicklime”, 50 ],
[ “material_sand”, 50 ]
]
]
},

Limestone shard: (modifies melee.json ?)

{
“type”:“GENERIC”,
“id”: “material_shrd_limestone”,
“symbol”: “,”,
“color”: “light_gray”,
“name”: “limestone shard”,
“category”: “spare_parts”,
“description”: “A small shard of limestone. Pretty flimsy and not much of a weapon, but could be used to neutralise acid spills.”,
“price”: 1000,
“material”: “steel”,
“weight”: 700,
“volume”: 4,
“bashing”: 2,
“cutting”: 0,
“to_hit”: -2
},

Limestone shard deconstruction: (modifies recipe_deconstruction.json ?)

[spoiler]{
“type” : “recipe”,
“result”: " material_shrd_limestone ",
“id_suffix”: “uncraft”,
“category”: “CC_NONCRAFT”,
“subcategory”: “CSC_NONCRAFT”,
“time”: 10000,
“reversible”: true,
“autolearn”: false,
“qualities” : [
{“id”:“HAMMER”,“level”:1,“amount”:1}
], “tools”: [
[
[ “crucible”, -1 ]
]
],
“components”: [
[
[ “material_limestone”, 10 ]
]
]
},

Will this one give 10 units of limestone or ten stacks of limestone (each 50 units, as defined by their “count”) ?[/spoiler]

Making sand drop in the field, as rocks do, but slightly less often: (modifies item_groups.json ?)

{
“type” : “item_group”,
“id” : “field”,
“items”:[
[“rock”, 40],
[“material_sand”, 30]
]
},

Making limestone shards drop in mines:

{
“type” : “item_group”,
“id” : “mine_storage”,
“items”:[
[“shovel”, 10],
[“pickaxe”, 2],
[“rock”, 40],
[“toolbox”, 5],
[“coal”, 20],
[“material_shrd_limestone”, 20]
},

Question: If we dump water on fire, it goes out - can it be done (easily) for dumping quicklime on acid streaks and sand on blood splatters to remove them ?

10 units, methinks, and apart from putting all this into ammo, I love this!

Yeah, those items look nice.

Putting all those things in AMMO is probably not the way to go, generic stuff usually goes into melee.json AFAIK.
Some of your things should go in tools.json instead, I guess.

Still, well done Aenye! You said you already have a github account, right? Generall, it is probably a good idea to merge all that great stuff in baby steps. Otherwise you get annoying merge conflicts. Also, for a scope of all those additions, it is a really good idea to keep precise track of what is already in and what still has to go in. (As you already do.)

[quote=“Snaaty, post:69, topic:7085”]Yeah, those items look nice.

Putting all those things in AMMO is probably not the way to go, generic stuff usually goes into melee.json AFAIK.
Some of your things should go in tools.json instead, I guess.[/quote]

Thanks ! I wasn’t sure about stackables - originally I thought of having the game handle limestone bits (and some other resources as well) like it does lead/gold/silver, e.g. putting into a single stack, rather then generating huge numbers of “a bit of lead”-type items. Virtually all instances of such items are stored as “type” : “AMMO” and most of them are in the ammo.json, so I wanted to adopt the same approach. I’ve looked a bit more and found that paints and carpets are also stackable and while they are “type” : “AMMO”, they’re stored in melee.json, so I could pretty send my stuff down there as well.

That said, wouldn’t it be prudent to get all of the not-really-ammo-but-stackables into a different .json or even a different item type, such as type" : “resource” ? Would this be allowable and if so, would it be just a matter of adding a new file and moving all the items in question to it ?

Back to the topic: Which ones should go into tools.json ? Please excuse my newbie question (yet another), but most of the stuff there has some action on activate or has some kind of ‘ammo’ it drains - should I make the items into such ?

Yup, I’ve even managed to file a proper pull request (though that one took a lot of fidgetting on my part before I clicked the ‘confirm’ button). Thanks - I’ll be trying to go over all the stuff bit by bit and marking off what gets implemented.

Also, noticed that Rivet added the oxygen-acetylene torch (something that was looming in my mind as another application of the gas cylinders) - great job ! Wouldn’t want to change anything about it without Rivet’s permission. While I feel it could be made refillable from an acetylene/oxygen gas cylinder, that is merely a suggestion.

Nevertheless, this gave me another idea and some more questions - would making it refillable from a gas cylinder just need the same code as using a source of gasoline ? What about making it draw from two different containers at once, when reloading ?

How about dumping quicklime on acid streaks and sand on blood splatters to remove them ?

Looked at the code for mop/moppable stuff and found, what seems to be the piece used to remove spills from the map:

[spoiler] From map.cpp

void map::mop_spills(const int x, const int y) {
for (size_t i = 0; i < i_at(x, y).size(); i++) {
item *it = &(i_at(x, y)[i]);
if (it->made_of(LIQUID)) {
i_rem(x, y, i);
i–;
}
}
field &fld = field_at(x, y);
fld.removeField(fd_blood);
fld.removeField(fd_blood_veggy);
fld.removeField(fd_blood_insect);
fld.removeField(fd_blood_invertebrate);
fld.removeField(fd_bile);
fld.removeField(fd_slime);
fld.removeField(fd_sludge);
int vpart;
vehicle *veh = veh_at(x, y, vpart);
if(veh != 0) {
std::vector parts_here = veh->parts_at_relative(veh->parts[vpart].mount_dx, veh->parts[vpart].mount_dy);
for(size_t i = 0; i < parts_here.size(); i++) {
veh->parts[parts_here[i]].blood = 0;
}
}
}[/spoiler]

Utilising this code, I could make a map::neutr_acid_spills function, that would work on a field with acid spills (fd_acid, correct ?), right ? Then to exploit this piece of code (as in adapt a new instance of it) for checking whether a neutralisable field is present:

[spoiler] From map.cpp

bool map::moppable_items_at(const int x, const int y)
{
for (auto &i : i_at(x, y)) {
if (i.made_of(LIQUID)) {
return true;
}
}
field &fld = field_at(x, y);
if(fld.findField(fd_blood) != 0 || fld.findField(fd_blood_veggy) != 0 ||
fld.findField(fd_blood_insect) != 0 || fld.findField(fd_blood_invertebrate) != 0
|| fld.findField(fd_bile) != 0 || fld.findField(fd_slime) != 0 ||
fld.findField(fd_sludge) != 0) {
return true;
}
int vpart;
vehicle *veh = veh_at(x, y, vpart);
if(veh != 0) {
std::vector parts_here = veh->parts_at_relative(veh->parts[vpart].mount_dx, veh->parts[vpart].mount_dy);
for(auto &i : parts_here) {
if(veh->parts[i].blood > 0) {
return true;
}
}
}
return false;
}[/spoiler]

Would have to add a line to make a boolean of whether neutralisable items are present at a field, bysupplementing map.h, which has this:

bool moppable_items_at(const int x, const int y);

Then it’s onwards to iuse.cpp, which has:

int iuse::mop(player *p, item *it, bool)
{
int dirx, diry;
if (!choose_adjacent((“Mop where?”), dirx, diry)) {
return 0;
}
if (dirx == p->posx && diry == p->posy) {
p->add_msg_if_player(
(“You mop yourself up.”));
p->add_msg_if_player((“The universe implodes and reforms around you.”));
return 0;
}
if (g->m.moppable_items_at(dirx, diry)) {
g->m.mop_spills(dirx, diry);
add_msg(
(“You mop up the spill.”));
p->moves -= 15;
} else {
p->add_msg_if_player(m_info, _(“There’s nothing to mop there.”));
return 0;
}
return it->type->charges_to_use();
}

By adding an iuse::quicklime, which checks with a “has neutralisable items at” flag, from the previous step, this would let me bestow a “neutralise acid” action to items, right ?

Also, iuse.h has this piece:

int mop (player *, item *, bool);

This checks whether using the item consumes a charge. My quicklime is stackable (with a “count” of 50) - would it work with the code (some of it being used up) or would it need to have some “charges” that would be drained ? If possible, please advise me on this one in more detail.

Apart from giving items the proper “action on use”, this seems to be everything I need to do. Please verify my reasoning and help me get all of my newbie misconceptions straightened out.

Update:
Added the first bit necessary for the facilities- a single tile warehouse building: HERE. It would be lovely if anyone could provide me with some tips/hints on making this building actually be generated during mapgen.

Oops, somehow this got on the second page. Let’s fix that.

Anyway, the cement, warehouse, and road-roller are all in. Huzzah! Aenye’s tests with the roller hit on a pretty important vehicle change, but that’s probably better discussed in a separate thread.

Lookin’ kickass, Aenye. Keep 'em coming, please.

Thanks ! I wouldn’t have stood a chance were it not for your, vache’s and Mschock’s help and encouragment.

Went crazy today and posted two more bits I was working on lately - a few chemicals for the chem system overhaul (sorry, I forgot who was postulating that one) and the water-spewing fire engine. Both seem to work, though the water cannon damage remains an issue (on it ATM).

Does the code in the post above make sense ? Wouldn’t want to break anything more…

One of those times when I haven’t really had the chance to look, sorry. :frowning:

Two questions.
One: Would you be interested in some assistance making some of the building/map tiles?
Two: If so, is there a list of buildings similar to the list of items posted a few pages back?

I should be doing more to help with the game myself, and feel most comfortable working with building layouts. Not that I couldn’t work with code, too, but I feel I’m a bit better at design than code.

Hi guys !

First of all, sorry for my long absence - hell of a story there, but let’s not go too much off-topic. In short, the airlines managed to ship me and my luggage (personal laptop included) to two different places. Got it back this friday and posting now to let you know, that I’m good and ready to get back to work (well, have to prepare X-mas for my family first).

[quote=“alRashid, post:75, topic:7085”]Two questions.
One: Would you be interested in some assistance making some of the building/map tiles?
Two: If so, is there a list of buildings similar to the list of items posted a few pages back?[/quote]

If your offer is still standing, I’d love some assistance, especially that my “Cata-scrapbook” has swollen to the size of four notebooks filled with a lot of content for the facilities (concept work virtually done).

The list of buildings for the game ? Most are in data\json\mapgen, while a few are hardcoded (not sure where exactly :frowning: ). If You want the list of buildings I’ve got planned, I can send You some of my work notes, that I’ve managed to get digital (pretty much most of the tiles I’ve wanted to get in there are listed, but only short comments on what can be inside them).

I’d also appreciate it, if you could send me the stuff you want to do, so perhaps I can help implementing it.

Add me to the list of willing assistants. I can json buildings and items fairly well (although I need to be better about triple checking my work), and I’m ok at coding. I wouldn’t want to tackle anything memory intensive or too much OOP as I’m still shaky on C++'s way of handling it, but I think I could work on the quests.

I gotta say, that is damn fine design work. You’ve put a lot into these, and your hard work and enthusiasm has gotten myself and a lot of other people excited to work on it.

Edit to not double post: I’ve started a topic for beginning work on a machine shop. Could you send me your design notes on that (or all of them, either way)? I figure that’s a good place to start doing some work on NPCs.

Most gladly - is there anything specific You would like to work on ?

[quote=“jokermatt999, post:78, topic:7085”]Add me to the list of willing assistants. I can json buildings and items fairly well (although I need to be better about triple checking my work), and I’m ok at coding. I wouldn’t want to tackle anything memory intensive or too much OOP as I’m still shaky on C++'s way of handling it, but I think I could work on the quests.

I gotta say, that is damn fine design work. You’ve put a lot into these, and your hard work and enthusiasm has gotten myself and a lot of other people excited to work on it.

Edit to not double post: I’ve started a topic for beginning work on a machine shop. Could you send me your design notes on that (or all of them, either way)? I figure that’s a good place to start doing some work on NPCs.[/quote]

Thanks ! I’ve been trying to code a lot of this stuff in, but I’m mostly good for items / maps - the advanced stuff is taking me large amounts of time to understand. Machine shop ? I’ve done some work on a repairman’s shack for one of the specials - will digitalise the notes ASAP and send them / link them in tomorrow.

One of the things, we could try making, would be the component maps for the facilities - there’s 65+ uniques to draw up and I got a bit sidetracked by the chems and steel / aluminium rework. If You’d like, I’ll also post an Excel spreadsheet, I made to help me with drawing up the building maps (nothing special, but gets the row/column strings done without errors).

Hm, what precisely do you mean with “component maps”?

Also, I am willing to work on a couple of things, but I am severely lacking in the creative department, so I’ll have a look at anything you thought of.