devlog - godot dump
It’s been a few months since I’ve started playing with Godot engine and it has been an enjoyable experience.
Here I’m dumping a list of “aha moments” that I’ve pilled up while learning how to use it, hoping come handy to some other newcomer.
- signals are Godot’s events; they are locally scoped to the component defining/using them; defining them in an auto-loaded singleton is a pattern I found useful using them as a cross-project event system
Vector2 has methods for most of the stuff you think you need to write a function for (need a distance between two points? no need for writing it from scratch – use distance_to), always check the latest docs - KinematicBody is easier to use to implement fine tuned player movement; compared to Rigidbody physics that will require you to understand forces and may be a pain to optimize into a smooth and simple game-play experience – always evaluate your approaches
multi-line comment shortcut: ctrl + k - if you have problems with imported asset types always check the “import” tab and hit “Reimport” with appropriate asset type selected
you can reduce your build size by compiling Godot from source and omitting unused features
Godot’s filesystem dock only shows built-in resources. JSON files are not built-in resources (https://godotengine.org/qa/30357/json-file-not-showing-in-editor) - when debugging collision shapes enable: Debug -> Visible Collision Shapes
- when debugging mobile touch input enable: Project -> Project settings -> Input Devices -> Emulate touch from mouse
- mouse_entered() and mouse_exited() also trigger with touch events
- when exporting _.json, _.csv, *.txt, etc… data files, you need to specify file types in Export -> Resources -> Filters to export non-resource files/folders
- need to setup for Android? This video tutorial is spot on: https://www.youtube.com/watch?v=6646oo2YSBY
- but there can be a trick with older Android device running on Adreno based GPUs – they don’t support GLES3. Go to Project settings -> Rendering/Quality -> Render Name and set it to GLES2; Project settings -> Rendering/Vram Compression and enable Import Etc
- you can have custom-shaped clickable buttons using BMP click masks and TextureButton (white clickable; black non-clickable; BMP must be 24-bit)
- when you save the BMP into Godot folder it imports it as Texture – reimport it with correct format
mobile size of 1920×1080 works quite well; also try to play with stretch/size in Project settings
portrait mode can also be forced in Project settings - while we are at Project settings – don’t forget they have a “search” input
RichTextLabel support BB code formatting – brings back bulletin board memories, but is also a quite handy and useful text formatting method (at least I liked it) - there is also VisualScript inside Godot for “non-coders” – I don’t use it, but interesting
- last bullet for this dump – but probably the most important: if you want to get anything done with Godot stop worrying about your code and architecture and just make your idea work smoothly, make it playable, polish the details for the user, not for developer, get it done, ship it out or you will never release anything if you just keep polishing the code. The engine is built for mess and node/component isolation allows you to keep even messy code manageable. If you are coming into Godot with years of development experience from other areas, over-optimizing/organizing your code can be a trap of getting frustrated with it – enjoy it – it’s GAME development – should be playful.
Hope this knowledge dump comes handy for some lonely indie game dev newbie soul. And let’s hope there is a part II in a few months.