Posted: . At: 8:21 AM. This was 3 years ago. Post ID: 15161
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Cyberpunk 2077 source code has some interesting stuff in it.


This code in the Cyberpunk 2077 source leak has information about censorship options. This is to do with censoring Homosexuality, Nudity, Drugs, and Gore.

dev/src/common/gameTelemetry/src/telemetryAggregator_InitialChoices.cpp
215
216
217
218
219
220
221
222
223
224
225
226
227
228
	void InitialChoicesAggregator::GetCenshorship( telemetry::parameters::Censorship& censorship ) const
	{
		RED_SCOPE_FLAG_GUARD( m_accessFlag, Inclusive );
 
		censorship.region = red::GCensorshipSystem.GetCensorRegion().AsChar();
 
		censorship.isNudityCensored = red::GCensorshipSystem.IsNudityCensored();
		censorship.isSexualisedCensored = red::GCensorshipSystem.IsSexualisedCensored();
		censorship.isSuggestiveCensored = red::GCensorshipSystem.IsSuggestiveCensored();
		censorship.isHomosexualityCensored = red::GCensorshipSystem.IsHomosexualityCensored();
		censorship.isGoreCensored = red::GCensorshipSystem.IsGoreCensored();
		censorship.isDrugsCensored = red::GCensorshipSystem.IsDrugsCensored();
		censorship.isReligionCensored = red::GCensorshipSystem.IsReligionCensored();
	}

Apparently, the engine is using FFmpeg. This is to process screenshots and other things.

┌──[jason@192.168.1.2][~/Downloads/cp_no_password/cp/root/R6.Root/Mainline]
└──╼  ╼ $ grep -R "ffmpeg" *
dev/internal/Audio/SoundContentProcessing/SoundContentProcessing/LipsyncProcessing/LipsyncProcessingDataProvider.cs:        // ex. Z:\r6.assets\audio\cyberpunk_vo\ffmpeg\ffmpeg-4.0-win64-static\binaries\ffmpeg.exe
dev/internal/Audio/SoundContentProcessing/SoundContentProcessing/LipsyncProcessing/App.config:    <add key="ff_mpeg_path" value="audio\cyberpunk_vo\ffmpeg\ffmpeg-4.0-win64-static\binaries\ffmpeg.exe"/>
dev/internal/Audio/SoundContentProcessing/SoundContentProcessing/VoiceoverProcessing/App.config:    <add key="ff_mpeg_path" value="r6.assets\audio\cyberpunk_vo\ffmpeg\ffmpeg-4.0-win64-static\binaries\ffmpeg.exe"/>
dev/src/common/engine/src/screenshotGrabber.cpp:	#include "../../../../external/ffmpeg-3.4.2-win64-dev/include/libavcodec/avcodec.h"
dev/src/common/engine/src/screenshotGrabber.cpp:	#include "../../../../external/ffmpeg-3.4.2-win64-dev/include/libavutil/opt.h"
dev/src/common/engine/src/screenshotGrabber.cpp:	#include "../../../../external/ffmpeg-3.4.2-win64-dev/include/libavutil/imgutils.h"
dev/src/common/engine/premake5.lua:		"ffmpeg",
Binary file dev/src/games/cpLauncher/PGO/x64/cpLauncher.pgd matches

This is very interesting. They are using it for cinematic screenshot capture.

Here are more of the censorship flags. They named the China option Winnie the Pooh.

dev/src/common/redReflection/include/censorshipSystem.h
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "bitFieldBuilder.h"
 
 //------------------------------------------------------------------------------
 // Censorship flags
 
enum CensorshipFlags : Uint32
{
	Censor_Nudity		= RED_FLAG(0), // Nudity (showing genitals)
	Censor_OverSexualised	= RED_FLAG(1), // Sexually explicit content
	Censor_Suggestive	= RED_FLAG(2), // Sexually suggestive content
	Censor_Homosexuality	= RED_FLAG(3), // Homosexual content
	Censor_Gore		= RED_FLAG(4), // Gore during dismemberment
	Censor_Drugs		= RED_FLAG(5), // Drug use or explicit references
	Censor_Religion		= RED_FLAG(6), // Reference to religion or other gods or religions
	Censor_WinnieThePooh	= RED_FLAG(7), // China
};
 
RTTI_DECLARE_BITFIELD( CensorshipFlags );

This is very funny, they make fun of China by calling it WinnieThePooh. Hilarious. I am sure China will not see it that way. But it is very interesting to look at the source code for a game engine and see how it works under the hood. The Red Engine also uses Curl for HTTP functions, this makes sense. There are quite a few references to Linux in this code. Does that mean it could run on Linux? That would be very interesting to see. I mean you can play it with Proton, but not natively. That should be a thing, but all game companies focus on Windows instead.


2 thoughts on “Cyberpunk 2077 source code has some interesting stuff in it.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.