Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4fcd1ad
Update SDK to experimental build for Godot 4.5
limbonaut May 13, 2025
8bebfe9
Add errors & automation
limbonaut May 13, 2025
99caeb2
Add pre-compiled Godot builds that should be used with the demo
limbonaut May 13, 2025
5755268
Add Godot ignore file
limbonaut May 13, 2025
46ce1c5
Update and fix demo stuff
limbonaut May 13, 2025
ab10e4c
Tidy up: descriptions, whitespace, messages
limbonaut May 13, 2025
46ad3fc
Update goal.gd
limbonaut May 13, 2025
72ad50f
Update game.gd
limbonaut May 13, 2025
6ce4111
Tags and variables
limbonaut May 14, 2025
40d4010
Update project version
limbonaut May 14, 2025
7bd35d9
Change DSN to sentry-sdks/sentry-demos-godot
limbonaut May 15, 2025
9c52ca1
Add GameLogic GDExtension with a method that introduces a crash
limbonaut May 15, 2025
daa0d3b
Add compiled libgamelogic binaries for macOS
limbonaut May 15, 2025
e46b93f
Add precompiled GameLogic for windows
limbonaut May 15, 2025
3912ab5
Remove duplicate breadcrumb
limbonaut May 15, 2025
ea91cdc
Update project.godot: dotnet assembly name
limbonaut May 15, 2025
5d08488
Update sentrysdk build
limbonaut May 20, 2025
54b226c
Add godot export template build script
limbonaut May 28, 2025
f53d0b8
Update godot build script
limbonaut May 28, 2025
18024d8
Add script to build SwiftShader & update godot build script
limbonaut May 29, 2025
47cc26c
Update SentrySDK build
limbonaut May 30, 2025
fb458c1
Update godot build script
limbonaut Jun 2, 2025
aa0e94a
Accept --dsn=ABCD1234 command-line argument
limbonaut Jun 2, 2025
427f031
Create build-gamelogic-windows.ps1
limbonaut Jun 2, 2025
a454146
Add gamelogic debug info files
limbonaut Jun 2, 2025
b2977dd
Fix gamelogic build script
limbonaut Jun 2, 2025
e7e23d3
Switch to dylib for GameLogic on macOS
limbonaut Jun 2, 2025
beefcc6
Create build-gamelogic-mac.sh
limbonaut Jun 2, 2025
84f956f
Update Gamelogic builds for macOS including symbols and source bundles
limbonaut Jun 2, 2025
6a74b68
Remove export_presets.cfg
limbonaut Jun 2, 2025
ce27044
minor demo updates
cstavitsky Aug 14, 2025
d4c49d3
Update README.md
cstavitsky Aug 15, 2025
125d4f4
Update README.md
cstavitsky Aug 15, 2025
08a2bb3
update readme per code review
cstavitsky Aug 15, 2025
efc92a1
Merge branch 'demo_refresh_updates' of https://github.com/sentry-demo…
cstavitsky Aug 15, 2025
ec14df1
fix header
cstavitsky Aug 15, 2025
490e463
Update README.md
cstavitsky Sep 15, 2025
995da0d
Update README.md
cstavitsky Sep 15, 2025
bc23367
Update README.md
cstavitsky Sep 15, 2025
b35a8d2
Merge pull request #2 from sentry-demos/demo_refresh_updates
cstavitsky Sep 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 189 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Commented out parameters are those with the same value as base LLVM style.
# We can uncomment them if we want to change their value, or enforce the
# chosen value in case the base style changes (last sync: Clang 13.0).
---
### General config, applies to all languages ###
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
# AlignArrayOfStructures: None
# AlignConsecutiveMacros: None
# AlignConsecutiveAssignments: None
# AlignConsecutiveBitFields: None
# AlignConsecutiveDeclarations: None
# AlignEscapedNewlines: Right
AlignOperands: DontAlign
AlignTrailingComments: false
# AllowAllArgumentsOnNextLine: true
# AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
# AllowShortEnumsOnASingleLine: true
# AllowShortBlocksOnASingleLine: Never
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: All
# AllowShortLambdasOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Never
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
# AlwaysBreakTemplateDeclarations: MultiLine
# AttributeMacros:
# - __capability
# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
# AfterCaseLabel: false
# AfterClass: false
# AfterControlStatement: Never
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# BeforeLambdaBody: false
# BeforeWhile: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
# BreakBeforeConceptDeclarations: true
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
# BreakBeforeTernaryOperators: true
# BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
# BreakStringLiterals: true
ColumnLimit: 0
# CommentPragmas: '^ IWYU pragma:'
# CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
# DeriveLineEnding: true
# DerivePointerAlignment: false
# DisableFormat: false
# EmptyLineAfterAccessModifier: Never
# EmptyLineBeforeAccessModifier: LogicalBlock
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IfMacros:
# - KJ_IF_MAYBE
# IncludeBlocks: Preserve
IncludeCategories:
- Regex: '".*"'
Priority: 1
- Regex: '^<.*\.h>'
Priority: 2
- Regex: '^<.*'
Priority: 3
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentAccessModifiers: false
IndentCaseLabels: true
# IndentCaseBlocks: false
# IndentGotoLabels: true
# IndentPPDirectives: None
# IndentExternBlock: AfterExternBlock
# IndentRequires: false
IndentWidth: 4
# IndentWrappedFunctionNames: false
# InsertTrailingCommas: None
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# LambdaBodyIndentation: Signature
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PenaltyIndentedWhitespace: 0
# PointerAlignment: Right
# PPIndentWidth: -1
# ReferenceAlignment: Pointer
# ReflowComments: true
# ShortNamespaceLines: 1
# SortIncludes: CaseSensitive
# SortJavaStaticImport: Before
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: false
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: Never
# SpacesInContainerLiterals: true
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
## our comment capitalization at the same time.
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# BitFieldColonSpacing: Both
# StatementAttributeLikeMacros:
# - Q_EMIT
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
TabWidth: 4
# UseCRLF: false
UseTab: Always
# WhitespaceSensitiveMacros:
# - STRINGIZE
# - PP_STRINGIZE
# - BOOST_PP_STRINGIZE
# - NS_SWIFT_NAME
# - CF_SWIFT_NAME
---
### C++ specific config ###
Language: Cpp
Standard: c++14
---
### ObjC specific config ###
Language: ObjC
# ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
# ObjCBreakBeforeNestedBlockParam: true
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
---
### Java specific config ###
Language: Java
# BreakAfterJavaFieldAnnotations: false
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax']
...
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@

# Godot-specific ignores
.import/
export_presets.cfg

# GDExtensions
.cache
.sconsign*.dblite
compile_commands.json

# Tools
tools/godot.macos.editor.arm64
tools/godot.windows.editor.x86_64.exe
tools/godot.windows.editor.x86_64.console.exe
tools/godot.windows.editor.x86_64.src.zip
tools/godot.windows.editor.x86_64.console.src.zip
tools/godot.windows.editor.x86_64.debug_files.zip
tools/godot.windows.template_release.x86_64.exe
tools/godot.windows.template_release.x86_64.console.exe
tools/godot.windows.template_release.x86_64.src.zip
tools/godot.windows.template_release.x86_64.console.src.zip
tools/godot.windows.template_release.x86_64.debug_files.zip
tools/godot/
tools/*.dSYM/
tools/*.pdb

# Imported translations (automatically generated from CSV files)
*.translation
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "addons/gamelogic/src/godot-cpp"]
path = addons/gamelogic/src/godot-cpp
url = https://github.com/godotengine/godot-cpp
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,96 @@ A sample Godot game called "Sentry Jump". The updated demo project lives in the

![Screenshot](.github/screenshot.png)

## Getting Started (No Godot Experience Required)

If you're new to Godot, follow these simple steps to run the demo:

### Prerequisites

- Download and install [Godot 4.5-dev4](https://godotengine.org/article/dev-snapshot-godot-4-5-dev-4/#downloads) or newer for your operating system
- Extract the Godot executable (Godot.app) to a location on your computer
- Clone this demo repo locally (`git clone [email protected]:sentry-demos/godot.git`)
- `cd` into the cloned repo and check out the `godot-4.5` branch. (⚠️ for now, that branch holds the current version of the demo. remember to do this!)

### Step 1: Open Godot

1. Launch Godot from your downloaded location

### Step 2: Import the Project

1. In the Project Manager, click the **"Scan"** button (highlighted in the left panel)
2. In the file browser dialog that appears, navigate to the folder containing this project
3. Select/double-click the folder that contains `project.godot`, `README.md`, and the `src` folder
4. Click **"Select Current Folder"** to import the project

![Godot Project Manager](screenshots/godot_open_project.png)

![File Selection Dialog](screenshots/select_godot_folder.png)

### Step 3: Open the Project

1. Once imported, you'll see "Sentry Jump" appear in your project list
2. Select the "Sentry Jump" project (it will be highlighted)
3. Click **"Edit"** to open the project in the Godot editor

![Project List with Sentry Jump Selected](screenshots/select_sentry_jump.png)

### Step 4: Run the Game

1. In the Godot editor, you'll see various panels and a 3D viewport
2. Look for the **Play button** (▶️) in the top-right corner of the editor
3. Click the **Play button** to start the game

![Godot Editor with Play Button Highlighted](screenshots/start_sentry_jump_game.png)

### Step 5: Play the Demo And Trigger a Runtime Error

**Game Controls:**

- **Arrow keys**: Move the character left/right
- **Spacebar**: Jump
- **F key**: Toggle fullscreen mode
- **R key**: Reset the scene

**Objective:** Jump to the red flag on the right. When you reach it, the demo will intentionally cause a runtime error (not crash) to showcase Sentry's error reporting capabilities!

**Note:** Most errors developers deal with in Godot are runtime non-crash errors. This is because the game logic is usually implemented in a scripting language, and 99% of the time errors don’t cause a crash.

![Trigger Runtime Error](screenshots/gameplay_instructions_to_trigger_runtime_error.png)

### (Optional) Step 6: Jump Into the Crash Zone to trigger a crash

When the player jumps into the "Crash Zone," the game triggers a crash in the `C++` gamelogic library. This is meant to illustrate a crash connected to some native code.

![Trigger crash](screenshots/gameplay_instructions_to_trigger_crash.png)

### (Extremely Optional) Step 7: Fall off the platform to trigger another runtime error

If the player goes off the platform and falls down, they reach the limits of the level, resulting in another runtime error.

**Note:** (I'd skip this during a live demo. It's redundant since you already jumped to the flag to generate a runtime error, but you can do it if you want an additional runtime error for any reason)

![Trigger crash](screenshots/fall_off_platform.png)

### Troubleshooting

- If you get import errors, ensure you're using Godot 4.5-dev4 or newer
- Make sure you're selecting the folder that contains `project.godot`, not a subfolder
- The game window may appear behind the editor - check your taskbar/dock

## Advanced Usage

### Automate the game without opening Godot Engine

You can also run the game (and make the character jump to the flag) from the command line. This is used to generate bulk demo data, I recommend against running this in a live demo context.

```bash
# On macOS
$ /Users/yourname/Downloads/Godot.app/Contents/MacOS/Godot --path /path/to/sentry-demos/godot/directory/you/cloned --automate
```

![automate flag](screenshots/automate.png)

## Talk slides

https://docs.google.com/presentation/d/1mU0HEeOpR0whLYLtfTzlbiIXN4wYUssLNChutvJAeJQ
4 changes: 4 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python

# This file is for building as a Godot GDExtension.
SConscript("addons/gamelogic/SConstruct")
21 changes: 21 additions & 0 deletions addons/gamelogic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# GDExtension generated files
*.gen.*
.sconsign*.dblite
compile_commands.json
src/gen/

# Compiled files
*.bc
*.creator
*.creator.user
*.dblite
*.exp
*.files
*.idb
*.includes
*.lib
*.o
*.os
*.pyc
*.so
*.obj
42 changes: 42 additions & 0 deletions addons/gamelogic/SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python

# This file is for building as a Godot GDExtension.

env = SConscript("src/godot-cpp/SConstruct")

# Add source files.
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")

env.Append(CPPDEFINES=["GDEXTENSION"])

bin_path = "bin/"
extension_name = "gamelogic"
debug_or_release = "release" if env["target"] == "template_release" else "debug"

if not "arch_suffix" in env:
env["arch_suffix"] = env["arch"]

if env["target"] in ["editor", "template_debug"]:
# GDExtension has editor classes available in debug templates, which allows editor code to compile.
# If you don't want to compile editor stuff in templates, move these 2 lines to a separate "if" block.
env.Append(CPPPATH=["src/editor/"])
sources += Glob("src/editor/*.cpp")
# Add documentation XML files as a generated cpp file. Only works in Godot 4.3+.
doc_data = env.GodotCPPDocData("src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
sources.append(doc_data)

library = env.SharedLibrary(
"{}/{}{}.{}.{}.{}{}".format(
bin_path,
env.subst('$SHLIBPREFIX'),
extension_name,
env["platform"],
debug_or_release,
env["arch_suffix"],
env["SHLIBSUFFIX"],
),
source=sources,
)

Default(library)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading