Solarus Wiki

A wiki for the Solarus engine community

User Tools

Site Tools


tutorial:the_first_map

This is an old revision of the document!


Chap. 1Chap. 3Table of Contents

Chapter 2 - Your First Map

The game starts and loads the quest well enough, but you are only on a title screen, because your quest is almost empty. In this tutorial, we will see how to create a map and launch the game on this map. We will use the quest editor a lot because its main purpose is the creation of maps.

Getting the Basic Resources

You will first need to get the basic resources you'll need to run the engine. You could create these resources completely on your own, but what you want here is to start a game quickly, so we'll provide you with resources to make a game similar to Zelda: A Link to the Past. Let's look at what these resources contain.

Tiles

First, let's explain what a tile is , in French a tile : they are elements of basic decors, which possess certain properties (is it a wall? Is it animated?). A map is composed of a multitude of tiles. In summary, each time you see a decorative element, it is a tile. And these tiles can be placed on several “levels” in the map (low, intermediate and high layer, in the software in English these are the low, intermediate and high layer). We will return to the diapers in a forthcoming chapter.

The quest editor allows the cutting of a tileset, a tileset being a set of several tiles forming part of the same skin, for example the skin of a particular house or dungeon. Creating a tileset is an easy but long and somewhat tedious exercise. Again, we will address this in a forthcoming chapter. For now, you can download the tileset we need here. Unzip this file and put its contents under data\tilesets.

Sprites

Tiles are not the only entities present on a map. There are also enemies, doors, chests, npcs, bushes, teleporters, etc. These entities can, for the most part, be represented on the map by sprites. A sprite is an animation constructed by a succession of still images. For example, when the hero walks, it is a succession of still images, the animation is not “real”. A bit like an animated gif, these are images that, put together end to end, give the illusion of animation. Note that not all sprites are necessarily animated, there are sprites composed of a single image (eg grass).

The Solarus engine needs two files to define a sprite: a .png file that contains all the images that make up the animation, and a .dat file that shows where each image in the .png file is located And what is the delay between each image. The same .png file can contain the images of several sprites, such as the shield that has its three possible evolutions in the same .png image. The inverse can also be true: for sprites with many different animations, the animations can be separated into several .png files.

Although the quest editor now allows the editing of sprites, this chapter is not devoted to sprites, and we advise you to download the minimum resources needed by the engine here. Unpack this file and match the subdirectories of the data folder . Replace all the requested files, it will not hurt your tilesets files (if they have disappeared, put them back).

Music and Sound

The archive contains Game Over music, imposed by the engine in version 1.0 because the game-over menu is hard-coded. (With version 1.1, the game-over menu is fully customized, but this tutorial is still only covering 1.0.) Music can be in SPC format (not recommended), IT format (recommended) or OGG format. The first two formats are very specific to the games, see the Wikipedia links for more information. The last format is very simple to use but does not allow advanced or complex loops: it will just loop on all the music (intro included if there is one). Converters to OGG are easy to find, while SPC and IT require specific software.

The engine also requires the presence of a number of sound files. They are also in the archive.

Building Your Map

Create the Tileset

In the quest editor, we will right click on the Tileset folder and make New tileset. We have downloaded tilesets from the world of light (light_world), but the engine and the editor do not yet know that they exist, because they must be indicated in the list of resources. The first dialog box asks you for the id of the tileset. As shown on the screen, set “light_world”. As you will have noticed, the id is the name of the files of tileset without extension. Therefore, the filenames and the id must match. The files being light_world.dat, light_world.entities.png and light_world.tiles.png , The common core of these three files is light_world. This is the ideal id.

The second dialog box prompts for a user-friendly name. This is an easier name to remember for an end user. This is the name that will appear in all your options for using this tileset in the editor, where the id is only the name of the file. All the resources in the tree to the left of the quest editor work on this principle: you will see just after that by doing a new map, it will ask for the id and the user-friendly name. Put what you want as a user-friendly name for this tileset, we will refer to it in future as the “outer world”.

If the editor says it can't open the .dat file, search for and manually edit the ground setting for water_bottom_right to wall_bottom_right_water. Do the same for the entries water_top_left, water_top_right, and water_bottom_left, but make sure the new entries match the directions of the old directions. In newer versions of the editor, these specific tile types were changed

If you double-click on the newly created tileset, you will see how the whole tileset is arranged: it is composed of a multitude of elements, sometimes tiny (the smallest is 8 * 8 pixels), sometimes enormous. By right-clicking on one of the elements, you will see its ground properties with their description.

Create Your First Map

*Sorry, we've not finished translating. Come back soon!*

Chap. 1 : Getting StartedChap. 3 : Houses and ForestsTable of Contents

tutorial/the_first_map.1500926429.txt.gz · Last modified: 2018/12/22 14:14 (external edit)