Set of assets, libraries and plugins for quick starts

I have that idea that I struggle to work alone or in a small group here in the office. So I need some common Defold user wisdom and experience for it.

I think, we should have more templates than just this:

May be 2D mobile game template? Or HTML5 game template? Something else?
Each template would have the camera and the manifest setup for easier deployment, would feature some key assets/libraries as dependencies, would feature some key plugins.

  • Does this quick-start project templates idea make sense to you?
  • What assets, libraries and plugins shall be included in the empty project then?
  • Anything else that a Defold newbie would expect out of the box, that we don’t provide currently?
6 Likes

I agree that many templates which lean toward certain kinds of game designs and platforms for distribution would be useful. As the general resources continue to build up, it will be easy and fast to put a few together as new templates.

https://github.com/subsoap/defsp is this kind of thing but DefSP specifically has a lot of loose parts in it that are not really done, and will be redone in near future with using the various public library modules to form a much neater package. DefSP when it’s ready will specifically be a template focused on 2D portrait mobile games with various screens pre-setup and most of the non-game logic setup so that you can download it and put your game on the game screen and have a playable game faster.

2 Likes

Considering that I can’t tell if there should be a difference between 2D mobile game templates and HTML5 game templates, I can say that I would need them.

Defold is missing out of the box and has to be added through assets (I’m taking inspiration from some editors):

A. Camera to solve the issue of mobile phones having different sizes/aspect ratios: fit height, fit width, fit both, or none.

B. Gui system with premades:

  • Button with transitions (normal, pressed, hover, disabled) and types (sprite, color tint, scaling animation or none)
  • Scrollbar with direction (vertical, horizontal), autohide if not scrolling (bool), auto hide time
  • Scrollview (horizontal, vertical), inertia (bool), brake, elastic (bool), bounce duration, horizontal/vertical
  • Progress bar and slider
  • Editbox
  • Toggle and toggle group with transition and events

C. Mobile gestures detection: tap, swipe, drag, double tap, long tap.

D. Scene management

E. Detecting clicks on game objects: raycasts, collisions, math coupled to camera?

Lack of event system for objects makes it hard. Usually buttons have an OnClick field where it’s passed what to call when clicked.

5 Likes

I agree that camera and GUI are the two big things that Defold doesn’t provide out of the box. I like to think that Rendercam solves the camera stuff. (It has fixed width, fixed, height, fixed area, and expand/contract options, and the usual screen-to-world helpers for detecting clicks on objects, etc. )The GUI stuff is more complicated, but DirtyLarry and Gooey seem pretty good.

I keep a branch of my empty template with extra stuff in it that I clone whenever I start a new project, but it’s just a random collection of things that I personally always use, not an actual game template, and I’ve been using Defold for almost a year (!), so not necessarily the stuff that beginners want.

8 Likes

That’s cool!
I guess you’re keeping these as dependencies so it all autoupdates?
Or do you prefer it to be more static?

2 Likes

Yeah, mostly dependencies.

@ross.grams do you think you could share your setup on Community Pages the same way you did it with Empty Project Template?

So we can see how actual Defold users do/use these stuffed project templates, and also get feedback from more users. This way we have a better idea of how to make more built-in ones. @Axel and @britzl have this in the backlog.

Great stuff! As Oleg mentioned, me, @britzl and @sicher have been doing some stuff behind the scenes, on this one—mainly preparing template projects, both regarding templates that has to do with game mechanics, and ‘actual’ templates.

The templates as they are now, can be found in BjĂśrns github repo, and my idea of how they could be accessed from Defold can be seen in the image below*.

*Note that this is just early design stuff from me, and not a promise that stuff will look exactly like this anytime soon.

8 Likes

Super awesome!

4 Likes

That looks awesome! Would be super handy!

3 Likes

After the global game jam I feel like resurrecting this thread.

I noticed that people often struggle to brute-force their way through Defold because of their previous experience. And it just falls apart making people frustrated with their experience. I noticed that when I point people to specific docs or sample projects, they still tend to use Defold based on experience/gut feeling. I guess it makes sense, but does not help to boot up with Defold faster :wink:

From where I am, the hardest thing to start with Defold is to convince oneself to start from a demo project and utilise features built by the devs/community.

Need a camera? Sure, there’s Rendercam by @ross.grams. Need pathfinding? The A* is there already implemented by @Mathias_Westerdahl, see the example and use in the project. Timer? Sure, @britzl has you covered. Etc. etc.

After a few weeks with Defold it changes to the opposite: I see people get really surprised if their particular case is not on the Asset Portal (or popular githubs). Some take such cases as a challenge and ship their solutions to the Asset Portal. But initially this probably looks…unnatural that the engine is so lean, I guess?

Fellow jammers @naktinis @dmitrijus.babicius @jmalijonis (and everyone else really) may have an input here =] Would your first weeks with Defold have been better if we had offered more demo projects, sample templates or small tutorial videos?

2 Likes

I’ve only picked up Defold about a week ago, but we’ve managed to build a working proof-of-concept game in the global game jam – with @dmitrijus.babicius and @Oleg_The_Evangelist . For me it was really helpful when @Oleg_The_Evangelist could immediatelly point to the relevant library/example.

I think the Community Assets should be promoted more (maybe mentioned more in tutorials, introductions etc., or maybe they were, but I missed it). Maybe some of your devs could also contribute to it more (as an example, add A* as a proper package, because now I had to copy/paste .lua files manually).

I think there are still some rough edges in Defold (most are known bugs) and downsides of using external packages. It really struck me how hard it was to detect if a game object was clicked. It took me at least an hour to hack my way through just to have something so basic and I’m not really happy about how it turned out.

It’s good that you have strong consistent design/architecture principles in Defold, but they shouldn’t come at the expense of essential usability.

6 Likes

Really easy if you use rendercam. Use rendercam.screen_to_world_2d with a simple rect.

function M.point_within_rectangle_centroid(point_x, point_y, rectangle_x, rectangle_y, rectangle_width, rectangle_height)
	local width_half = rectangle_width / 2
	local height_half = rectangle_height / 2
	if point_x >= (rectangle_x - width_half) and point_x <= (rectangle_x + width_half) then
		if point_y >= (rectangle_y - height_half) and point_y <= (rectangle_y + height_half) then
			return true
		end
	end
	return false
end

Clicking on object example (maybe show go and gui in same example) could be added to the examples list here if there is not already one https://www.defold.com/examples/basics/simple_move/

2 Likes

In the end I did use the rendercam’s function (I wouldn’t even know that rendercam exists if not for @Oleg_The_Evangelist help) , but if we’re talking about an object being clicked in a game, I would never call such a solution “really easy”. Maybe if message_id == hash("mouse_clicked") ... or a native built-in go.mouse_coordinates_within(mouse_x, mouse_y), but not an external library combined with a 10 line snippet.

5 Likes

Yeah, you’re right. It’s because the render script is so flexible that a built in universal solution is not so easy to deliver. I’d still say it’s easy once you are aware of the tools available, and I guarantee you would have been given a good answer on the forum about it! Rendercam is an absolute must in every project I make now.

3 Likes