BoxRob

#1: INTRO

BoxRob is a puzzle platform game. In this game, your goal is to load cargo onto a truck using a flexible forklift. To complete the level, you need to collect all the boxes and put them in the appropriate slot. Some levels are easy and you just drive around collecting boxes, but as you go through the game the levels get more difficult. Perform special moves or follow sequences to solve the puzzle and complete the level.

The game consists of 3 parts, 20 base levels, and 1 bonus level. A total of 63 levels.

I created this game for 7Spot Games.
I did code and level design; idea, art, music, and all the rest come from 7Spot Games.

17 Likes

#2: GAMES

2.1) Boxrob play

6 Likes

2.2) Boxrob 2 play

4 Likes

2.3) Boxrob 3 play

4 Likes

#3: TIMELINE

It took 5.5 month to make 3 parts.

  • 03.05.2021 - Initial commit
  • 17.07.2021 - Prototype is done. Levels can be completed.
  • 22.09.2021 - Boxrob-1 is ready for soft launch.
  • 19.10.2021 - Boxrob-2 and Boxrob-3 are done.

Polishing for release and creation of levels for parts 2 and 3 went in parallel.

5 Likes

#4: BUILD SIZE

Game target is web; that’s why the build size was crucial.
Web build size (Boxrob 1): 5.8 MB / 3.8 MB (gzipped)

2.91 MB assets:
• 1.33 MB music + sounds
• 1.20 MB textures
• 216.20 KB scripts
• 63.21 KB fonts
• 46.65 KB levels (json)

7 Likes

#5: DEVELOPMENT

5.1) Defold already has a built-in version of box2d but the functionality is limited. Luckily you can take the built-in box2d out of the engine and use a native extension to add full-fledged physics, in which everything is available.

For physics I used a fork of lerg box2d native extension (https://github.com/Lerg/extension-box2d).

Later this fork will be used as a base for full box2d native extension. (https://github.com/d954mas/defold-box2d)

6 Likes

5.2)Level Editor (Tiled)

Tiled is a cross-platform open-source tile map editor for games.

It is possible to make levels in the defold editor, but I find Tiled more convenient and flexible. From Tiled levels are exported to .lua. Export is pretty redundant, so I converted .lua files to .json using my script.

The script gets rid of the unused data, makes some fixes (for example, changes the coordinate system from y-down to y-up) and performs validation (checks that player spawn exists, that elevators use an existing trajectory, and that there are no objects with the same name, etc.)

5 Likes

5.3)Ecs

I have a thing for the data-oriented approach in development and ecs. I won’t go deep into what is ecs (entity component system). In brief, this is a pattern for decomposition.

The idea that each game object (entity) consists of a set of components. For example, position component, acceleration component and so on.

All logic is written in the system. For example, the movement system takes all entities that have position and acceleration component, and performs the necessary operations with them. You can read more here

In the end, the game has 44 systems, and even more components.

This approach results in a flexible game architecture that is easy and pleasant to work with, easy to extend, and optimize.

6 Likes

5.3.1)Scripts
All logic is written in lua modules. So i have only 1 .script file in scene: controller.script
This script update ecs and capture input from player.

7 Likes

#6: PROTOTYPE

6.1) The creation of the game started with a prototype. In the prototype, we make sure that there are no problems with physics, and that the game is fun to play.

First, we tested Tiled level editor, because we needed a level where the robot would ride.

Then physics was added, and the creation of the robot began. When working with physics, the box2d documentation helped a lot, as well as Google, and various tutorials for box2d.

5 Likes

6.2) Changing physical properties is painful. If the properties were changed in one place, it might require changing properties in another place, because physically the robot would start behaving differently. For example, I increased the density of the arm, the arm became heavier, and the passability decreased. Now I have to add more strength to the wheels. By adding more strength to the wheels, I could affect something else, and so on.

As a result, the way the robot behaves in the release version is a set of physical bodies and their properties, which was selected due to a large number of iterations :slight_smile:

4 Likes

6.3) Next, I will show some stages of work on the prototype. Between each of these stages, there were a large number of iterations to select the necessary properties of physical bodies and to solve other problems.

4 Likes

6.4.1)Stage 1(11.05.21)
Wheelbase

3 Likes

6.4.2)Stage 2(18.05.21)

Art added. The robot can jump. Hand added. Hand is a physical rectangle that is always at a certain angle to the wheelbase. When turning the base, it keeps the right angle.

4 Likes

6.4.3)Stage 3(24.05.21)

The hand is a set of physical bodies. Now it’s moving. When making contact with the box, it connects to the hand.

4 Likes

6.4.4)Stage 4(7.06.21)

Passability increased. The hand can take the box and ride with it. When changing the direction of movement, the hand turns.

4 Likes

6.4.5) Stage 5(09.06.21)

The first version of throwing a box. Hand swings and throws. Player has the ability to aim.

4 Likes

6.4.6)Stage 6(10.06.21)

The second version of throwing a box. Box shooting. This option, without the ability to aim, is used in the game.

4 Likes

6.4.7)Stage 7(17.07.21)

Prototype is done. All mechanics work. You can complete the level from the start until the victory screen appears.

4 Likes