From 5c7553b75fd1803da7a9b3db4190f435df90d6bb Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Tue, 1 Sep 2020 00:12:02 -0700 Subject: [PATCH] Give some code readmes better filenames (#53325) --- code/__DEFINES/README.md | 13 +++++ code/__DEFINES/_readme.dm | 14 ----- .../mob/living/silicon/ai/freelook/README.txt | 49 ++++++++++++++++++ .../mob/living/silicon/ai/freelook/read_me.dm | 51 ------------------- .../{mapGeneratorReadme.dm => README.txt} | 7 --- tgstation.dme | 2 - 6 files changed, 62 insertions(+), 74 deletions(-) create mode 100644 code/__DEFINES/README.md delete mode 100644 code/__DEFINES/_readme.dm create mode 100644 code/modules/mob/living/silicon/ai/freelook/README.txt delete mode 100644 code/modules/mob/living/silicon/ai/freelook/read_me.dm rename code/modules/procedural_mapping/{mapGeneratorReadme.dm => README.txt} (99%) diff --git a/code/__DEFINES/README.md b/code/__DEFINES/README.md new file mode 100644 index 00000000000..71ddfc1a973 --- /dev/null +++ b/code/__DEFINES/README.md @@ -0,0 +1,13 @@ +This folder is full of #define statements. They are similar to constants, +but must come before any code that references them, and they do not take up +memory the way constants do. + +The values in this folder are NOT options. They are not for hosts to play with. +Some of the values are arbitrary and only need to be different from similar constants; +for example, the genetic mutation numbers in genetics.dm mean nothing, but MUST be distinct. + +It is wise not to touch them unless you understand what they do, where they're used, +and most importantly, +how to undo your changes if you screw it up. + +- Sayu diff --git a/code/__DEFINES/_readme.dm b/code/__DEFINES/_readme.dm deleted file mode 100644 index 8bf6ada6477..00000000000 --- a/code/__DEFINES/_readme.dm +++ /dev/null @@ -1,14 +0,0 @@ -/* - This folder is full of #define statements. They are similar to constants, - but must come before any code that references them, and they do not take up - memory the way constants do. - - The values in this folder are NOT options. They are not for hosts to play with. - Some of the values are arbitrary and only need to be different from similar constants; - for example, the genetic mutation numbers in genetics.dm mean nothing, but MUST be distinct. - - It is wise not to touch them unless you understand what they do, where they're used, - and most importantly, - how to undo your changes if you screw it up. - - Sayu -*/ diff --git a/code/modules/mob/living/silicon/ai/freelook/README.txt b/code/modules/mob/living/silicon/ai/freelook/README.txt new file mode 100644 index 00000000000..78dc3b52f5c --- /dev/null +++ b/code/modules/mob/living/silicon/ai/freelook/README.txt @@ -0,0 +1,49 @@ +CREDITS + +Initial code credit for this goes to Uristqwerty. +Debugging, functionality, all comments and porting by Giacom. + +Everything about freelook (or what we can put in here) will be stored here. + + +WHAT IS THIS? + +This is a replacement for the current camera movement system, of the AI. Before this, the AI had to move between cameras and could +only see what the cameras could see. Not only this but the cameras could see through walls, which created problems. +With this, the AI controls an "AI Eye" mob, which moves just like a ghost; such as moving through walls and being invisible to players. +The AI's eye is set to this mob and then we use a system (explained below) to determine what the cameras around the AI Eye can and +cannot see. If the camera cannot see a turf, it will black it out, otherwise it won't and the AI will be able to see it. +This creates several features, such as.. no more see-through-wall cameras, easier to control camera movement, easier tracking, +the AI only being able to track mobs which are visible to a camera, only trackable mobs appearing on the mob list and many more. + + +HOW IT WORKS + +It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be +explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Del(). + +Next the camera network has chunks. These chunks are a 16x16 tile block of turfs and cameras contained inside the chunk. +These turfs are then sorted out based on what the cameras can and cannot see. If none of the cameras can see the turf, inside +the 16x16 block, it is listed as an "obscured" turf. Meaning the AI won't be able to see it. + + +HOW IT UPDATES + +The camera network uses a streaming method in order to effeciently update chunks. Since the server will have doors opening, doors closing, +turf being destroyed and other lag inducing stuff, we want to update it under certain conditions and not every tick. + +The chunks are not created straight away, only when an AI eye moves into it's area is when it gets created. +One a chunk is created, when a non glass door opens/closes or an opacity turf is destroyed, we check to see if an AI Eye is looking in the area. +We do this with the "seenby" list, which updates everytime an AI is near a chunk. If there is an AI eye inside the area, we update the chunk +that the changed atom is inside and all surrounding chunks, since a camera's vision could leak onto another chunk. If there is no AI Eye, we instead +flag the chunk to update whenever it is loaded by an AI Eye. This is basically how the chunks update and keep it in sync. We then add some lag reducing +measures, such as an UPDATE_BUFFER which stops a chunk from updating too many times in a certain time-frame, only updating if the changed atom was blocking +sight; for example, we don't update glass airlocks or floors. + + +WHERE IS EVERYTHING? + +cameranet.dm = Everything about the cameranet datum. +chunk.dm = Everything about the chunk datum. +eye.dm = Everything about the AI and the AIEye. +updating.dm = Everything about triggers that will update chunks. diff --git a/code/modules/mob/living/silicon/ai/freelook/read_me.dm b/code/modules/mob/living/silicon/ai/freelook/read_me.dm deleted file mode 100644 index 7004cd752af..00000000000 --- a/code/modules/mob/living/silicon/ai/freelook/read_me.dm +++ /dev/null @@ -1,51 +0,0 @@ -// CREDITS -/* - Initial code credit for this goes to Uristqwerty. - Debugging, functionality, all comments and porting by Giacom. - - Everything about freelook (or what we can put in here) will be stored here. - - - WHAT IS THIS? - - This is a replacement for the current camera movement system, of the AI. Before this, the AI had to move between cameras and could - only see what the cameras could see. Not only this but the cameras could see through walls, which created problems. - With this, the AI controls an "AI Eye" mob, which moves just like a ghost; such as moving through walls and being invisible to players. - The AI's eye is set to this mob and then we use a system (explained below) to determine what the cameras around the AI Eye can and - cannot see. If the camera cannot see a turf, it will black it out, otherwise it won't and the AI will be able to see it. - This creates several features, such as.. no more see-through-wall cameras, easier to control camera movement, easier tracking, - the AI only being able to track mobs which are visible to a camera, only trackable mobs appearing on the mob list and many more. - - - HOW IT WORKS - - It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be - explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Del(). - - Next the camera network has chunks. These chunks are a 16x16 tile block of turfs and cameras contained inside the chunk. - These turfs are then sorted out based on what the cameras can and cannot see. If none of the cameras can see the turf, inside - the 16x16 block, it is listed as an "obscured" turf. Meaning the AI won't be able to see it. - - - HOW IT UPDATES - - The camera network uses a streaming method in order to effeciently update chunks. Since the server will have doors opening, doors closing, - turf being destroyed and other lag inducing stuff, we want to update it under certain conditions and not every tick. - - The chunks are not created straight away, only when an AI eye moves into it's area is when it gets created. - One a chunk is created, when a non glass door opens/closes or an opacity turf is destroyed, we check to see if an AI Eye is looking in the area. - We do this with the "seenby" list, which updates everytime an AI is near a chunk. If there is an AI eye inside the area, we update the chunk - that the changed atom is inside and all surrounding chunks, since a camera's vision could leak onto another chunk. If there is no AI Eye, we instead - flag the chunk to update whenever it is loaded by an AI Eye. This is basically how the chunks update and keep it in sync. We then add some lag reducing - measures, such as an UPDATE_BUFFER which stops a chunk from updating too many times in a certain time-frame, only updating if the changed atom was blocking - sight; for example, we don't update glass airlocks or floors. - - - WHERE IS EVERYTHING? - - cameranet.dm = Everything about the cameranet datum. - chunk.dm = Everything about the chunk datum. - eye.dm = Everything about the AI and the AIEye. - updating.dm = Everything about triggers that will update chunks. - -*/ diff --git a/code/modules/procedural_mapping/mapGeneratorReadme.dm b/code/modules/procedural_mapping/README.txt similarity index 99% rename from code/modules/procedural_mapping/mapGeneratorReadme.dm rename to code/modules/procedural_mapping/README.txt index bb6c70f167a..7ce0a63e739 100644 --- a/code/modules/procedural_mapping/mapGeneratorReadme.dm +++ b/code/modules/procedural_mapping/README.txt @@ -1,5 +1,3 @@ - -/* by RemieRichards ////////////////////////////// @@ -72,7 +70,6 @@ mapGeneratorModule Existing Calls: place() - //////////////////////////// // MAPPER FRIENDLY README // //////////////////////////// @@ -140,7 +137,3 @@ Variable Breakdown (For Mappers): CLUSTER_CHECK_ALL_ATOMS 20 //Don't let ANY atoms cluster same and different types CLUSTER_CHECK_ALL 30 //Don't let anything cluster, like, at all - - - -*/ diff --git a/tgstation.dme b/tgstation.dme index c61b73f5e39..e9685d310ac 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -2357,7 +2357,6 @@ #include "code\modules\mob\living\silicon\ai\freelook\cameranet.dm" #include "code\modules\mob\living\silicon\ai\freelook\chunk.dm" #include "code\modules\mob\living\silicon\ai\freelook\eye.dm" -#include "code\modules\mob\living\silicon\ai\freelook\read_me.dm" #include "code\modules\mob\living\silicon\pai\death.dm" #include "code\modules\mob\living\silicon\pai\pai.dm" #include "code\modules\mob\living\silicon\pai\pai_defense.dm" @@ -2676,7 +2675,6 @@ #include "code\modules\procedural_mapping\mapGenerator.dm" #include "code\modules\procedural_mapping\mapGeneratorModule.dm" #include "code\modules\procedural_mapping\mapGeneratorObj.dm" -#include "code\modules\procedural_mapping\mapGeneratorReadme.dm" #include "code\modules\procedural_mapping\mapGeneratorModules\helpers.dm" #include "code\modules\procedural_mapping\mapGeneratorModules\nature.dm" #include "code\modules\procedural_mapping\mapGenerators\asteroid.dm"