Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Commit

Permalink
Ports tg's cavegen, bitfields, area_flags, improved random mineral ro…
Browse files Browse the repository at this point in the history
…cks (#4800)

* Refactor bitfields global, improve turret_flags debugging (#53239)

* Refactors area stuff (#52751)

-bitfielded a bunch of bools on /area, I left some untouched cus they get called a lot
-Unused vars
-Fixed a var pretending to be a fake bool
-Probably more

* Random mineral spawns change less turfs. (#49205)

As-is, random mineral spawning changes the turf to the subtype with that mineral, which results in a lot of turf changes I guess. Now it just changes the mineralType of the turf. Unless it's gibtonite or a cave spawner, because the alternatives are worse and those aren't all that common anyway.

🆑
tweak: Random mineral turfs no longer cause large amounts of turf changes on initialization.
/🆑

* Refactor the procedural generation of lavaland and turf/closed/mineral (#54915)

This replaces lavaland's old diagonal tunnel gen which was really
horrendously jammed into asteroid floor code (?????) with Cellular
Automata which runs in rust (PR for that here:
tgstation/rust-g#57 ). The new code is a bit
cleaner, but also looks better.

VID: https://streamable.com/a45ke2

Things to do:
- Make an icemoon version
- Fix the roundstart atmos adjacency issues

I asked AnturK if this was an acceptable PR for this month; he said it
was okay as long as I didn't add new areas, which I don't plan to do.
But if anyone thinks this PR breaks the spirit of the month I'll open
it again in december.

* fix (#55462)

* Fix lavaland map

* Fix bad merge

Co-authored-by: Urumasi <[email protected]>

Co-authored-by: Jared-Fogle <[email protected]>
Co-authored-by: TiviPlus <[email protected]>
Co-authored-by: Buggy123 <[email protected]>
Co-authored-by: Qustinnus <[email protected]>
Co-authored-by: Urumasi <[email protected]>
  • Loading branch information
6 people authored and Terra1 committed Aug 7, 2021
1 parent bd49779 commit 0dc9ac5
Show file tree
Hide file tree
Showing 49 changed files with 55,122 additions and 55,076 deletions.
6,886 changes: 3,443 additions & 3,443 deletions _maps/RandomRuins/SpaceRuins/crashedship.dmm

Large diffs are not rendered by default.

394 changes: 197 additions & 197 deletions _maps/RandomRuins/SpaceRuins/derelict4.dmm

Large diffs are not rendered by default.

886 changes: 443 additions & 443 deletions _maps/RandomRuins/SpaceRuins/derelict5.dmm

Large diffs are not rendered by default.

704 changes: 352 additions & 352 deletions _maps/RandomRuins/SpaceRuins/mrow_thats_right.dmm

Large diffs are not rendered by default.

100,103 changes: 50,050 additions & 50,053 deletions _maps/map_files/Mining/Lavaland.dmm

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "code\__DEFINES\atmospherics.dm"
#include "code\__DEFINES\atom_hud.dm"
#include "code\__DEFINES\balloon_alert.dm"
#include "code\__DEFINES\bitfields.dm"
#include "code\__DEFINES\callbacks.dm"
#include "code\__DEFINES\cargo.dm"
#include "code\__DEFINES\chat.dm"
Expand Down Expand Up @@ -573,6 +574,8 @@
#include "code\datums\mapgen\_MapGenerator.dm"
#include "code\datums\mapgen\JungleGenerator.dm"
#include "code\datums\mapgen\biomes\_biome.dm"
#include "code\datums\mapgen\CaveGenerator.dm"
#include "code\datums\mapgen\Cavegens\LavalandGenerator.dm"
#include "code\datums\martial\_martial.dm"
#include "code\datums\martial\boxing.dm"
#include "code\datums\martial\cqc.dm"
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/bitfields.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define DEFINE_BITFIELD(_variable, _flags) /datum/bitfield/##_variable { \
flags = ##_flags; \
variable = #_variable; \
}
22 changes: 22 additions & 0 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define NO_LAVA_GEN_1 (1<<6) //! Blocks lava rivers being generated on the turf
#define NO_RUINS_1 (1<<10) //! Blocks ruins spawning on the turf

////////////////Area flags\\\\\\\\\\\\\\
/// If it's a valid territory for cult summoning or the CRAB-17 phone to spawn
#define VALID_TERRITORY (1<<0)
/// If blobs can spawn there and if it counts towards their score.
#define BLOBS_ALLOWED (1<<1)
/// If mining tunnel generation is allowed in this area
#define CAVES_ALLOWED (1<<2)
/// If flora are allowed to spawn in this area randomly through tunnel generation
#define FLORA_ALLOWED (1<<3)
/// If mobs can be spawned by natural random generation
#define MOB_SPAWN_ALLOWED (1<<4)
/// If megafauna can be spawned by natural random generation
#define MEGAFAUNA_SPAWN_ALLOWED (1<<5)
/// Hides area from player Teleport function.
#define HIDDEN_AREA (1<<6)
/// If false, loading multiple maps with this area type will create multiple instances.
#define UNIQUE_AREA (1<<7)
/// If people are allowed to suicide in it. Mostly for OOC stuff like minigames
#define BLOCK_SUICIDE (1<<8)
/// Can the Xenobio management console transverse this area by default?
#define XENOBIOLOGY_COMPATIBLE (1<<9)

/*
These defines are used specifically with the atom/pass_flags bitmask
the atom/checkpass() proc uses them (tables will call movable atom checkpass(PASSTABLE) for example)
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,6 @@

//Saves a proc call, life is suffering. If who has no targets_from var, we assume it's just who
#define GET_TARGETS_FROM(who) (who.targets_from ? who.get_targets_from() : who)

///Define for spawning megafauna instead of a mob for cave gen
#define SPAWN_MEGAFAUNA "bluh bluh huge boss"
2 changes: 1 addition & 1 deletion code/__HELPERS/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(/area/engine/eng
var/area/place = get_area(turfs[i])
if(blacklisted_areas[place.type])
continue
if(!place.requires_power || place.teleport_restriction || place.hidden)
if(!place.requires_power || place.teleport_restriction || place.area_flags & HIDDEN_AREA)
continue // No expanding powerless rooms etc
areas[place.name] = place
var/area_choice = input(creator, "Choose an area to expand or make a new area.", "Area Expansion") as null|anything in areas
Expand Down
3 changes: 2 additions & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,8 @@ eg2: `center_image(I, 96,96)`
while (L.len && !target)
var/I = rand(1, L.len)
var/turf/T = L[I]
if(!T.density)
var/area/X = get_area(T)
if(!T.density && (X.area_flags & VALID_TERRITORY))
var/clear = TRUE
for(var/obj/O in T)
if(O.density)
Expand Down
Loading

0 comments on commit 0dc9ac5

Please sign in to comment.