Just starting out with Defold, but 10yr game dev

Hi All,

New to defold, but been making games professionally since 2010.

Excited to learn Defold.

Not sure if this is the correct place to ask, but I have some fundamental/general questions:

  1. Does Defold have a CLI? To allow DevOps with automated builds to various platforms?
  2. Best way to make a game responsive, game and UI (As in responsive to different screen sizes, especially HTML5, when loading as iFrame), to scale (not stretch) to any screen size.
  3. Export to XCode instead of IPA?
  4. Dynamic loading of assets at runtime, for example, images, videos, audio files.

Thanks for your time!

5 Likes

Welcome!

  1. Yes, you can build projects with bob on the command line. Fully automated builds scripts are possible. Here’s a sample we use for Steam builds
#!/bin/bash
title=$(less game.project | grep "^title = " | cut -d "=" -f2 | sed -e 's/^[[:space:]]*//')
title_no_space=$(echo -e "${title}" | tr -d '[[:space:]]')
contentroot=C:/steamworks/sdk/tools/ContentBuilder/content/

echo "Project: ${title}"

if [ ! -f bob.jar ]
	then
		echo "Unable to find bob.jar. Download it from d.defold.com."
		exit 1
fi

bob() {
	java -jar bob.jar $@
}

build() {
	platform=$1
	shift 1
	rm -rf build
	bob --archive clean resolve build --build-report-html "build-report-${platform}.html" --texture-compression true --variant "release"  --platform "${platform}" -e a@a.com -u fake_token
}


bundle() {
	platform=$1
	echo "${platform}"
	shift 1
	bob --platform ${platform} --bundle-output build/${platform} $@ bundle
}

move_to_steam() {
	platform=$1
	if [ "${platform}" == "x86_64-darwin" ]
		then
			echo "${title_no_space}_${platform}"
			echo "Removing old ${contentroot}${title_no_space}_${platform}"
			rm -rf "${contentroot}${title_no_space}_${platform}"
			if ! cd build/${platform} ; then read -p "Build folder ${platform} not found! - Press Enter"; exit 1; fi
			mkdir -p "${contentroot}${title_no_space}_${platform}"
			cp -r * "${contentroot}${title_no_space}_${platform}"
			cd ../..	
	else
		echo "${title_no_space}_${platform}"
		echo "Removing old ${contentroot}${title_no_space}_${platform}"
		rm -rf "${contentroot}${title_no_space}_${platform}"
		if ! cd "build/${platform}/${title}" ; then read -p "Build folder ${platform} not found! - Press Enter"; exit 1; fi
		mkdir -p "${contentroot}${title_no_space}_${platform}"
		cp -r * "${contentroot}${title_no_space}_${platform}"
		cd ../../..
	fi
}

do_platform() {
	platform=$1
	shift 1
	echo -e "\n[Building ${platform}]"
	build ${platform}
	echo -e "\n[Bundling ${platform}]"
	bundle ${platform}
	echo -e "\n[Moving to Steam ${platform}]"
	move_to_steam ${platform}
	echo -e "\n[${platform} Done]"
}

# build / bundle / archive platforms

do_platform x86_64-win32
do_platform x86_64-linux
do_platform x86_64-darwin

# play some music to let us known it's done

ffplay fanfare.mp3 -autoexit -nodisp

echo -e "\n[All Done!! - You can now run upload_steam]"

read -p "Press enter to close"

  1. Use something like RenderCam and then code UI either to be responsive or support multiple orientations. It is possible to do all in GUI too. Blossom Blast Saga was done almost entirely in GUI afaik.
  2. No, but running in simulator is possible. And the source is available so if you need to customize the binary you can. There is native extension support so you can code anything custom you need.
  3. Yes, it’s possible. Either by using Live Update or just downloading and using them.
5 Likes

Thanks @Pkeod

  1. Perfect, and thanks for sharing the bash script
  2. Will use RenderCam moving forward. Seems like most projects use it, why is RenderCam not the default (Defold :smiley: )?
  3. No big deal, can always customise the build process to use IPA instead. Thanks.
  4. Ok cool, so no asset authoring required on the assets before it can be used? Eg: TextureFormats, compression, etc…
2 Likes

I agree that something like RenderCam+Orthographic should be included as a builtin and used in the blank projects. Maybe it will happen eventually.

  1. It depends on how you want to use the media, you may need to process it first, and you may need to use a native extension to make use of it. But with Live Update it’s done for you for the most part, it’s the easiest option.
6 Likes

Hi! Welcome to the forum.

This is definitely the right place!

1 Like