Aladdin3d

| January 25, 2023

Disney’s Aladdin is an 8-bit video game launched in 1994 for SEGA’s Game Gear and Master System consoles. Based on Disney’s motion picture “Aladdin” (1992), it consists of a side-scrolling platform game in which the player has to control Aladdin to dodge obstacles and not be captured by the guards.

In Disney’s Aladdin, the player must jump and avoid obstacles in a corridor-like map of Agrabah’s market while running in front of the Palace’s guard. The player has three lives and can recover if he gets an apple on the map.

Video demo

Game elements

World generation / model loading

The game scenario is a corridor with buildings on each side. It is generated by randomising the order of the buildings on each side, so every execution of the game and the obstacles look different. Each building has a fixed number of occurrences on each side. This way, the sequence length is guaranteed to be the same on each side.

The file format chosen for model loading is GLTF. There are three main reasons for this choice: first, it is directly supported by Blender, which is the main program used to create and texture the models of this project. Second, GLTF allows linking textures to the solids, which eases the task of loading textures. Third, GLTF stores much of the information in JSON format, which is very easy to read in any modern language.

Lights and shaders

The default shaders in this project implement a version of the Blinn-Phong lighting model to shade the objects in the scene. In addition, support for specular map textures has been implemented to create complex effects.

Therefore, all objects using the default shaders have diffuse and specular capabilities. The ground uses an all-black specular map to give it a fully diffuse aspect.

The building objects have been appropriately UV mapped, although some textures have yet to be included due to time constraints. Instead, white textures have been placed in the remaining objects to show the specular shading. However, building 1 has been textured in detail as a first step. Future work will be to texture all buildings.

Camera views

The game implements two different camera views: the classic camera view and the third-person camera view.

The classic camera view refers to the original camera setting in Disney’s Aladdin. The 1994 game was a fully 2D parallax game. Therefore, the first camera implemented is also 100% static. When this camera is set, the game becomes a parallax game, although with perspective and 3D objects.

The third-person view adds a camera for a 3D game, with the scene creating an attractive tunnel vision. By default, this camera shows the scene from behind the character, but it can also move freely around the whole scene using the ‘qwert’ and ‘asdfg’ keys. This is the camera set by default when launching the game.

Gameplay

Like the original Disney’s Aladdin, this game has straightforward mechanics. The player must jump the boxes that appear in the corridor to avoid hitting them. If they do, they will lose one life. The game has two possible endings: either the player reaches the end of the corridor, or they lose the three lives they had at the beginning of the game. There is no possibility of regaining lives yet, although this could be future work for the game.

Some additional features have been added to enhance the playing experience, like the colour change in the character to red when hitting an object. This minor feature makes it much simpler for the player to know if they have hit an object. It has been implemented through uniform passing and colour tweaking in the vertex shader.

Models

Agrabah draws inspiration from pre-Islamic Arabia, featuring a unique and captivating aesthetic that seamlessly blends various architectural styles, including Arabic, Moorish, and south-Asian influences.

The models were meticulously crafted using either Blender or Shapr3d, with careful attention to detail. To enhance their visual appeal, the objects underwent UV unwrapping through Blender’s specialized tools, and the finalized models were exported to GLTF for seamless integration into the game.

Among the elements, the building named as “building_1” and a strategically chosen box stand out as the sole fully textured objects in this project. Texturing, being an inherently time-consuming task, was selectively applied to prioritize these key components, ensuring a visually compelling result for the overall project.

Repository

Visit the GitHub repo to check out the project’s details and code.

See the project on Github