I recently completed my first ever 3D game! I wanted to share my process as well as some of the tools I used. I do see people occassionally ask if Defold can do 3D, so hopefully this post will be a good resource for people.
For context, I’ve been playing around with the 3D stuff for some time and have been working on a much larger 3D project (I’ll share more details when I have a demo for it). However, with this project, I wanted to practice making a 3D game end-to-end to see any unexpected issues I might encounter.
The Time Limit:
Early on in my game-dev journey I really enjoyed doing game jams, short quick sprints where I had something cool at the end to share with others. It has been nearly a year since I last did that.
I wanted to do something quick to not distract me from my current project but couldn’t find anything super well suited for it so I ended up doing a self-imposed challenge.
I gave myself 250 minutes to make a 3D game.
The Idea:
I decided to make a game about setting off fireworks. It seemed easy enough, I could reuse a lot of assets plus it lets me play around with a number of different things (Particles, models, lighting, etc).
The gameplay consists of running up to a firework, doing a quick skill check minigame then either successfully lighting the firework or failing and blowing it up.
Afterwords the game will give a quick replay of the show as a reward for completing the level.
The Assets:
I started by forking an existing 3D project I’ve been working on. Within this project I’ve been utilizing a number of projects from the defold asset portal including:
- Druid - Druid - Component GUI Framework - The Defoldmine - Defold game engine forum
- Used this for all menus, utilized a wrapper I wrote to also integrate controller support with it
- Scene 3D - Scene3D - collection of assets for 3D gamedev - The Defoldmine - Defold game engine forum
- Studied and used a very similar first-person camera set up and mouse capture logic
- Lights and Shadows - Light and Shadows example - The Defoldmine - Defold game engine forum
- Used for the lighting effects
Special shoutout to everyone who has contributed to the above projects, this would not have been possible without you!
Development:
I started off by creating a number of art assets for the game, my goal was to keep things simple and moving quickly.
Some highlights include: a grass texture, a lighter, and some firework colors to use as a particle FX:
After that, I moved onto modeling in blender. I created a rocket model as well as a hill scene for the game to take place on:
I am still working on my 3D art skills, so I decided to keep a low poly aesthetic. This also helped with my time constraint for the project.
After that I started the process of designing the play area within Defold.
I encountered two big issues while doing this. Firstly, I struggled to tell what was and was not in the world, the flat lighting in the editor made it hard to line up the fence at times. I ended up switching to the build-in model since it had some directional lighting already applied before going back to the lights and shadows model.
Additionally, the fence I made was only 2 units wide, so it was difficult to place. Using the in-engine move tool almost always moved it to far (1 unit at a time) so I had to enter fractions until it looked correct.
After this I began working on the first-person controller and allowing the player to move around the world:
It felt too bright out, so I added in a skybox as well as adjusted the light levels some to make it feel more like dusk.
The fireworks itself are a combination of a number of Particle FX to sell the illusion of the firework blasting off and popping. I am really happy with how the effect turned out.
To get the interaction system working I had a separate collision object in the rocket then another attached to the player’s camera to see where the player was looking.
- I ended up running a calculation every frame to see what the closest object was to interact with.
- I discovered that I needed to use physics.wakeup to make sure objects continued to interact and that the collision didn’t stop working after a few seconds.
The final piece was getting in a minigame to actually light the fireworks. I went with a skill-check minigame where you have to click at the right time to launch the firework. I had some major issues getting it work since I was trying to check based on the gui node position if it was overlapping with other nodes. Things were clearly overlapping when they shouldn’t have been. That’s when I learned about gui.screen_to_local which enabled the system to work correctly.
The hardest part of the entire project was getting the mouse to be consistently locked on HTML5. I have a pause menu on the project I forked, coming in or out of it sometimes did not result in the mouse being locked properly. I had to add a screen asking the player to re-click in order to look around.
In the end I spent around 12 hours working on the project. While I severely missed by 250 minute goal, I did make a fun little game that I was proud of.
Outstanding issues I still need help with:
The main issue I was not able to solve is how to handle screen stretching. msg.post(“@render:”, “use_fixed_fit_projection”) seems not to work (I confirmed it is in the render script still). When stretching the screen, the view of the camera just expands outwards. This leads to some things I did not intend to be in-frame at times being visible, such as the corners of the map on the main menu or later menus in the tutorial visible off screen.
How I expect them to render:
How they actually render when stretched:
If you know how to fix this (or have any suggestions, please let me know!
What I learned:
The biggest thing I learned is that 3D game development is far slower than I initially expected. I have made a number of 2d games over the past 9 years so I feel very confident in that. However, 3D game development has a different dimension to it (pun intended) that will take some getting used to.
I am excited to see what additional features Defold adds to continue making 3D game development easier.
Here is a link to the game if you’d like to try it out. I have not been able to test it only anything other than my PC, so please let me know if you encounter any issues with framerate.














