From an idea to a release on Steam: everything about making your game using Castle Game Engine
michaliskambi
563 views
52 slides
Oct 11, 2024
Slide 1 of 52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
About This Presentation
Slides from my presentation at Cologne at FPC / Lazarus meeting (October 2024). Showing all important Castle Game Engine features, starting from using the editor to design games, using Pascal code to implement game logic, using ready assets from Sketchfab, Quaternius, OpenGameArt etc., adding Steam ...
Slides from my presentation at Cologne at FPC / Lazarus meeting (October 2024). Showing all important Castle Game Engine features, starting from using the editor to design games, using Pascal code to implement game logic, using ready assets from Sketchfab, Quaternius, OpenGameArt etc., adding Steam integration and more.
Size: 4.7 MB
Language: en
Added: Oct 11, 2024
Slides: 52 pages
Slide Content
From an idea to a release on Steam:
everything about making your game
using Castle Game Engine
Michalis Kamburelis
I'm Michalis Kamburelis
●Castle Game Engine - https://castle-engine.io/
●PasDoc - https://pasdoc.github.io/
●Modern Object Pascal Introduction -
https://castle-engine.io/modern_pascal
●Involved in 3D standards
○X3D (Web3D member)
○glTF (Khronos liaison)
○Others (WIP IFC implementation for https://www.sorpetaler.de/ )
Castle Game Engine intro:
Editor, Components and Building
Applications
Castle Game Engine
Features
●3D and 2D
○any game type
●Comfortable Editor
○with game simulation possible, and custom components
●Pascal API (all that you can do in editor + much more)
○For your games and for engine
○FPC (all platforms) and Delphi (Windows, Linux)
●Open-source
○Want to fork to add a project-specific feature? OK.
●Multi-platform
○Windows, Linux (Raspberry Pi too), FreeBSD, macOS
○Android, iOS
○Nintendo Switch
3D FPS game template
●Views
●Play view
○Viewport, navigate in 3D
○Left side: hierarchy with components
■UI
■viewport is also UI
■3D: transform scenes, cameras, lights
■drag-and-drop 3D models, images
■transform, delete, duplicate
■behaviors attach to transforms, like billboard
○Right side: properties
○Bottom: files
■preview
■special data directory
■double click to run view3dscene on scenes
2D game template
Run!
From CGE editor, or Lazarus, or Delphi, or VS Code.
Run on mobile
Just switch "Run -> Platform (...)" to "Android".
Assuming you have Android SDK and FPC cross-compilers, see https://castle-engine.io/android .
Coding
Any editor you like - VS Code, Lazarus IDE,
Delphi, Emacs…
Our VS Code extension ( https://castle-engine.io/vscode ) provides everything:
●Pascal highlighting and code completion (LSP), knowing also CGE layout
●Integration with CGE projects (build, run, debug)
Views, handle key press
●Organize project into views
●Views can handle events, like
○Start
○Update
○Press
○Natural place to handle events, like OnClick of buttons, too
Handle button click, change Translation
●Assign TCastleButton.OnClick event to handle classic button clicks
●Change TCastleTransform.Translation whenever
●TVector3, our vector type, is used throughout the engine
Play a sound
●Non-spatial?Just setup TCastleSound and call SoundEngine.Play(MySound)
●Spatial? Use TCastleSoundSource and TCastleSound.
●See https://castle-engine.io/sound
Physics
Setup and test Physics in editor -
colliders and rigid bodies
Use forces from code
Level design in editor (bigger
projects)
Reuse designs, factory of designs
Design (compose) components and reuse
●Design a composition of CGE components in editor
●Instantiate them, once or multiple times using TCastleComponentFactory
●This is a bit like LCL / VCL / FMX TFrame, but more for our purposes
○It can be 3D or 2D thing
○Factory allows to create lots of it - spawn monsters, falling down debris, rockets
etc.
Demo
Behaviors
Behaviors
●Descend from TCastleBehavior
●Override TCastleBehavior.Update to do what you want
●Attach to multiple things
●Example: patrolling enemy in "3D FPS Game"
In progress (not yet in master) TCastleLiving,
TCastleMoveAttack behaviors
●Add TCastleLiving where you want the player to be (camera, avatar)
●Add TCastleLiving and TCastleMoveAttack to each creature
●Configure stuff, like Enemy
●Ready FPS game mechanics!
●Short-range attack, approach the player when sees player. Underneath also
fire missile and navmesh (in progress to make them exposed nicely).
●It works when you run the game, or in simulation.
TCastleMoveAttack and TCastleLiving demo
Show creatures_behaviors demo.
●Where are behaviors
●Run game
●Run simulation
●Show tweaks - change Enemy.
Notes:
●Behaviors can be added by code, or by editor.
●You can query for all TCastleMoveAttack occurences in Viewport.Items etc.
●Custom components, like behaviors, want to see them at design-time?
https://castle-engine.io/custom_components
Demo - TCastleMoveAttack also at simulation
Demo "poor guy" - one skeleton is enemy
Use ready assets
(aka: why I love open 3D
standards and glTF in particular)
We integrate with Sketchfab, you can search
and download models from Sketchfab
●Demo:
○Get level (dungeon) (tweak PreciseCollisions)
○Get props (barrel)
○Setup walk/fly navigation (tweak MouseLook, MoveSpeed)
○Ready game - run!
●The assets are in data/sketchfab, with licenses and authors to attribute
●This is thanks to using glTF standard , https://castle-engine.io/gltf
Demo from Sketchfab models
More open-source and free assets
●Quaternius https://quaternius.com/
●OpenGameArt https://opengameart.org/
●Pro tip: Seek for "modular" assets to have "lego pieces" to build levels, either in CGE
editor or Blender
●Demo:
○Drag-and-drop glTF files on plane
○Add lights, shadows
●Again, glTF rules
Demo from Quaternius models
Integrations - Steam, Google Play
Create a game on Steam, use our integration
for achievements and more
●https://castle-engine.io/steam
●Soon: engine also on Steam
We also integrate with Google Play Games and
Apple Game Center
●Android and iOS applications:
○Compiled using FPC to library
○We add support code in Java / Objective-C to interact with system
○We add optional "services" code to interact with specific 3rd-party native libraries,
like Google Play Games
○The resulting project is build to APK (Android) or IPA / Xcode project (iOS)
TCastleControl
Also on LCL / VCL / FMX form, alongside other
LCL / VCL / FMX
●Useful if you only want to CGE rendering to existing LCL / VCL / FMX applications
●Everything described here still works, you just start a bit different, by TCastleControl
●See https://castle-engine.io/control_on_form
Conclusion
Homework proposal: try to combine all the
things you learned:)
You know now how to:
●Design stuff in editor
●Write Pascal code to make logic you want
●Use ready-made assets from the Internet
○learning Blender is beyond this talk :), but if you do -- export from Blender to glTF and
the world is your oyster.
●Download https://castle-engine.io/ and make a game!
●Let me know how it goes:
○[email protected]
○https://forum.castle-engine.io/
○https://castle-engine.io/talk.php
Plans
●We are at 7.0-alpha.3, I think we'll make 7.0-alpha.4 in October
○New features already: https://castle-engine.io/steam
○TCastleMoveAttack almost finished
○Other features (distance field fonts, export design to X3D/STL),
shadows optimization
●Working on 7.0 release, hopefully in 2024
○For 7.0: material components, new navigation components
○See https://castle-engine.io/roadmap
●Then, for 7.2: Web target using FPC WebAssembly
How to make this sustainable?
●We are looking for your support:
https://www.patreon.com/castleengine
●We are open to cooperation with companies (consulting, dedicated
features, platforms…). Talk to me!
Thank you!
https://castle-engine.io
These slides:
https://castle-engine.io/cologne2024