-
Found a way to embed pck in the Raspberry Pi export template…
Posted on November 6th, 2020 No commentsRight after this post…
http://www.indiegamepod.com/?p=3590 I started to look for ways to embed the pck with the export template itself.
I found a way…it does show some errors when it tries to build the project… but…it works 🙂
Here is what to do…
1) Go to Project -> Export on Godot2) Tap on the Add option..it is right below the top bar on the Export dialog.
From the standard Godot export templates…select Linux/X11 (Runnable)
It should show up then in the Presets list
3) Tap on it…on the right side of the Export dialog…it should have some “Options”
Here is what worked for me…
a) S 3 Tc texture is checked to Onb) No Bptc Fallbacks is checked to On
c) Embed Pck is checked to On
d) For the custom template…download the Pi 4 export template … you could use the one I made…right here…
http://indiegamepod.com/godot-pi4-template.llvmThen be sure to select it for the Release and Debug options in the custom template.
e) Click on the “Export Project” button at the bottom
f) The Save a File dialog will come up. Uncheck the “Export With Debug” option …that is near the bottom of the dialog. Then tap the “Save” button
g) It will then export…you will get an “Error” dialog…that mentioned the project could not be exported… but you will notice that the file was made…it was saved as a .x86 file
h) You could then go to the directory where it was exported…from the terminal…and run it by typing in ./(name of file).x86
It’s cool that now one could have a standalone Godot executable that runs on the Pi 4. I’ve seen that things kind of load on Pi 3…but there were some issues. Maybe you could get it to work…I tried it on the Pi 3 with an older version of Raspbian
Enjoy.
-
Godot Export Template for Raspberry Pi 4…
Posted on November 6th, 2020 No commentsGodot 3.2.1 seems to run reasonably well on Raspberry Pi 4.
I noticed I had to build Godot on Raspberry Pi 4. Then…I could take any Godot project and have it run on Raspberry Pi 4 smoothly…provided I did the following…
1) exported the pck file in Godot
Project -> Export -> Add … Linux/X11 (Runnable) from current export template list…Export PCK/ZIP file2) Use the raspberry pi build version of godot made…from this post…
http://www.indiegamepod.com/?p=3517… and rename it to the same name as the pck file. So if I exported the pck file of the project to something called “truckdemo.pck”…the Raspberry Pi 4 export template would need to be named truckdemo.llvm
3) I would put both the pck file and llvm file in the same directory
4) run the llvm file … with
./truckdemo.llvmHere is a link to the llvm file you could use for the export template…
http://indiegamepod.com/godot-pi4-template.llvmIf you have better instructions…let me know. The ideal situation is that the pck is embedded in the template itself.
-
Godot 3.2.1 is now out…
Posted on May 3rd, 2020 No commentsGodot 3.2.1 is now out…
It seems nice.
Check it out here…
https://godotengine.org/download -
Godot on Raspberry Pi 4
Posted on September 1st, 2019 8 commentsThis tutorial will be about how to get Godot to work on a Raspberry Pi 4.
I recently got a Raspberry Pi 4, 2 GB version.
I read about other folks that tried to get Godot to work on previous versions of Raspberry Pi and did not expect things to go well. It seems like getting Godot to run on Raspberry Pi was not a priority. It seemed like if I could get Godot to run on Raspberry Pi, it would be very slow.
I decided to see what happens anyways. I was able to run Godot on Raspberry Pi 4…and it seemed to run all right. I’ll know more as I try to do more dev on it.
Here’s what I did to make it happen…
I downloaded the latest Godot source…3.2 dev… and compiled it on the Raspberry Pi 4. It took about an hour.To compile the source properly…I had to do a few things…
1) Keep this post for reference…
https://www.reddit.com/r/godot/comments/af1cji/compiling_godot_31_for_raspberry_pi/Keep this one for reference too…if you want to overclock…
https://bits.krzysztofjankowski.com/raspberry-pi-4-as-perfect-indie-console/2) I had to make sure I had all the necessary libraries needed for Godot to properly compile.
I used this page for reference…
https://docs.godotengine.org/en/3.1/development/compiling/compiling_for_x11.htmlSince I think Noobs is based off Ubuntu/Debian…I used the one liner provided to install the relevant libraries…
sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \
libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libudev-dev libxi-dev \
libxrandr-dev yasmInstall clang compiler…
sudo apt-get install clangIt was not enough and I had to install a few more libraries. I found out the exact libraries I needed when I tried to build the source with the following command…
scons -j 4 platform=x11 module_webm_enabled=no tools=yes use_llvm=yes CCFLAGS="-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mlittle-endian -munaligned-access"If it builds, cool…if not, SCons might mention the library/thing missing as you try to build. use apt-get to install the missing libraries.
Once you do that, you will be able to specify x11 as the platform.
One other note is that you will need to disable the webm module since it seems to cause errors when you build with it.
To do that, you add this flag to the build command…
module_webm_enabled=noSince Raspberry Pi 4…is a quad core…I used the -j 4 command…to help make the build go faster. I think it then uses all 4 cores for the build process.
Based on feedback from others and more time with development, I realize that some compiler flags need to be added…to make sure the performance of Godot is somewhat decent…
CCFLAGS="-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mlittle-endian -munaligned-access"I did try to build with 64 bits, but I do not think it went well…so I just went with the default…I think that is 32 bits.
The final build command looked like this…
scons -j 4 platform=x11 module_webm_enabled=no tools=yes use_llvm=yes CCFLAGS="-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mlittle-endian -munaligned-access"also, if you run out of virtual memory, just run the scons command again….it should pick up where it left off…so run this line again…
scons -j 4 platform=x11 module_webm_enabled=no tools=yes use_llvm=yes CCFLAGS="-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mlittle-endian -munaligned-access"3) Once it built, I went to the bin subdirectory and ran it. It seemed to run fine and I was able to develop on it. I made a simple cube and rotated it every frame. I ran it…and it went really well. There was no lag that I noticed.
I then wanted to see if I could make it so I could deploy the project to raspberry pi 4. To do this, I tried various things. The closest way I could get this to work was to build a version from source that was a release target but still had tools.
Then I exported the project as a zip file. I had to move the release version of godot to the directory with the zip file.
I then ran the godot release version and it loaded the project and ran the rotating cube directly.
It was nice. But still, I think there must be a better/faster way to do this.
The ideal situation would be that the executable would be built and then could be run…so I do not need to have the godot release build and the files in the same folder.
One other note…once you build Godot, the object files may take up a few gigabytes of space. If you need space on your sd card, you may want to remove the object files…go to the terminal, then go to your godot-master directory and type in the following…
scons –cleanThere are 2 dashes before the clean.
It will delete the object files and give you more space on your sd card. Of course, it also means that scons will have to generate the .o files again if you want to compile the source code again.
Post comments or questions below 🙂
-
Custom Servers in Godot…
Posted on August 17th, 2019 No commentsI’ve been playing around with Godot some more…and did some of the tutorials listed in the Godot documentation.
I tried to do the custom server tutorial mentioned in the Godot documentation, and noticed some missing gaps with the documentation…this post helps to address them.
Source for the module directory part of the tutorial could be downloaded here…
http://www.indiegamepod.com/podcasts/hilbert_hotel_custom_server.zipThe script to attach to spatial node in the second part of the tutorial could be found here…
http://www.indiegamepod.com/podcasts/Spatial.gdFirst, a little bit about custom servers in Godot.
Godot has modules and Godot has servers. The graphics and physics of the game engine are “servers”…conceptually, it seems like “servers” have their own thread/resources and run in parallel with other servers.
This is a bit different than modules that seem to work within the framework of an individual thread.
This tutorial starts from the Hilbert Hotel custom server tutorial mentioned in the Godot documentation
https://docs.godotengine.org/en/3.1/development/cpp/custom_godot_servers.html
To create a custom server, go to your godot source folder…
Go to the “modules” subfolder
Make a new folder called “hilbert_hotel” within the modules folder.
Now create hilbert_hotel.h in the new folder…
Type in the stuff mentioned for hilbert_hotel.h here…
https://docs.godotengine.org/en/3.1/development/cpp/custom_godot_servers.htmlI had to add a few other things to get this to compile…
Note…add these *after* the includes for the core .h files mentioned in the documentation#include “_hilbert_hotel.h”
#include “InfiniteBus.h”Let’s move onto hilbert_hotel.cpp
Type in the stuff mentioned for hilbert_hotel.cpp here…
https://docs.godotengine.org/en/3.1/development/cpp/custom_godot_servers.htmlReplace this line…
InfiniteBus *)bus = bus_owner.getornull(id);with this…
InfiniteBus *bus = bus_owner.getornull(id);Next, make a file called from prime_225.h and copy the code for prime_225.h mentioned here…
https://docs.godotengine.org/en/3.1/development/cpp/custom_godot_servers.htmlNext make a file called InfiniteBus.h and then copy the code for InfiniteBus.h mentioned here…
https://docs.godotengine.org/en/3.1/development/cpp/custom_godot_servers.htmlTo allow Godot to properly used the custom server, a dummy class needs to be made. It is not quite clear why this class needs to be made, but Godot needs it to make sure it references the right class instance when the server is called in the code.
The dummy class will be called…
_HilbertHotelThis is basically a class of the main custom server class with an underscore added at the beginning.
In _hilbert_hotel.h … copy it from the tutorial page then add this to the top of the file…
#include “hilbert_hotel.h”#include “core/list.h”
#include “core/object.h”
#include “core/os/thread.h”
#include “core/os/mutex.h”
#include “core/rid.h”
#include “core/set.h”
#include “core/variant.h”In _hlibert_hotel.cpp…copy it from the tutorial page and add this at the top of the file…
#include “_hilbert_hotel.h”In the directory…be sure to add the file…
config.py
it should have the following…
def can_build(env, platform):
return Truedef configure(env):
passin the directory…be sure to add the following file named…
SCSub# Put this code into the SCSub file…
Import(‘env’)module_env = env.Clone()
module_env.add_source_files(env.modules_sources,”*.cpp”)
module_env.Append(CXXFLAGS=[‘-O2’, ‘-std=c++11’])###############################
This helps SCons build your custom server.Once done, go to the main godot folder … then run SCons to rebuild everything.
Once it builds properly…go to the
/bin directory where the newly built app is placed…open it up and use the server…here is what I did…I made a new scene and added script to the Spatial node to test it out…I had to comment out HilbertHotel.finish() to get it to work properly… extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = “text”# Called when the node enters the scene tree for the first time.
func _ready():
print(“Start Debugging”)
var ridHilbertHotel.connect(“occupy_room”, self, “_print_occupy_room”)
OS.delay_msec(2000)
rid = HilbertHotel.create_bus()
OS.delay_msec(2000)
HilbertHotel.create_bus()
OS.delay_msec(2000)
HilbertHotel.create_bus()
OS.delay_msec(2000)
print(HilbertHotel.get_bus_info(rid))
HilbertHotel.delete_bus(rid)
print(“ready done”)
OS.delay_msec(5000)
# COMMENT OUT THIS LINE HilbertHotel.finish()pass # Replace with function body.
# Called every frame. ‘delta’ is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _print_occupy_room(room_number, r_id):
print(“Room Number : ” + str(room_number) + ” RID: ” + str(r_id))
print(HilbertHotel.get_bus_info(r_id))Source for the module directory could be downloaded here…
http://www.indiegamepod.com/podcasts/hilbert_hotel_custom_server.zipThe script to attach to spatial node can be found here…
http://www.indiegamepod.com/podcasts/Spatial.gd -
Should Indie Game Developers Switch to Godot…
Posted on July 17th, 2019 No commentsYou can download the podcast here…
http://www.indiegamepod.com/podcasts/godot-podcast.mp3Or listen to it here…