Sample Scenes¶
The package ships five demo scenes in Assets/CreativeSpore/RpgMapEditor/Samples/Scenes. This page says what each one shows and which parts of the tool to look at in it. All five use the same demo tileset, AutoTileset, with 32 pixel tiles.
Opening the demos¶
Open any scene from the Samples/Scenes folder and press Play. Open Demo Scene in the welcome window (Tools > RpgMapEditor > Welcome) opens the first one for you.
Every demo has a SceneSelector object. In play mode it draws a scene list at the top of the Game view. Pick a scene in the list to switch to it. The R key reloads the current scene.
In the editor the scene list and the door teleporters work without any setup. A player build needs the scenes in Build Settings. Click Add Demos to Build Settings in the welcome window to add all five in one go. It appends them to the list and leaves the scenes already there alone. If a scene is missing, the scene list logs a warning in the Console that names the folder to add.
Note
The in-game map editor is on in every demo, so a palette covers the left side of the Game view when you press Play. Click < at its top to hide it and > to bring it back. See In-Game Map Editor.
Controls in the demos¶
| Input | What it does |
|---|---|
Arrow keys or W A S D |
Walk. With the old Input Manager these are the Horizontal and Vertical axes, so they follow your Input settings. |
H J K U |
Shoot left, down, right or up. |
Return |
Get on or off the boat or the balloon when you stand next to it. Go through a door teleporter when you stand on it. |
R |
Reload the current scene. |
The in-game map editor adds its own controls, listed in Keyboard and Mouse.
demo1 - Big Map¶
A 200 by 200 map to walk around. It shows what a full-size map looks like with the three default layers, Ground, Ground Overlay and Overlay.
- The
Playerwalks with the arrow keys and shoots withHJKU. ThePlayerCamerafollows it. - The
Boatcrosses water and theBalloonflies over everything. Both useVehicleCharController. See Characters and Vehicles. - An
EnemyGenobject spawns a zombie plant every five seconds, up to five at a time. They chase the player using the map pathfinder. See AI. - A
Teleporterleads intodemo3 - Player House. See Teleporters.
demo2 - Farm House¶
A farm on a 200 by 200 map, populated with characters that move on their own. This is the scene to open for the gameplay framework.
- Villagers (
NpcFarmer,NpcOldMan,NpcChildBoy,NpcChildGirl) and the sheep walk around withNPCBasicAI. - The cat, the dog and the chickens use
CompanionAI. - The characters are animated with
DirectionalAnimation, and the scene's animations come from theCharacterAnimationsasset. See Directional Animation. IsoSpriteControllersets each character's depth from its height on the map, between the ground layers and the first overlay layer. A character further down the screen draws in front of one further up.- The boat, the balloon and a door
Teleporterinto the player house are here too.
demo3 - Player House¶
A small 50 by 50 interior. It shows that a map does not have to be large, and it is the other end of the teleporters in demo1 and demo2. Its own teleporter takes you back out to demo2 - Farm House.
The map data for this scene is MapData_PlayerHouse. The other demos use AutoTileMapData1 to AutoTileMapData4.
demo4 - FogOfWar¶
The big map with a fourth layer, FogOfWar, of layer type Fog Of War. The whole map starts covered.
- The player uncovers the tiles around it as it walks.
PlayerControllerreveals five tiles around the player by default (Fog Sight Length). - The balloon sees further the higher it flies, up to ten tiles at full altitude.
- Zombie plants spawn here as in demo1.
What is uncovered while playing is not kept when you stop, unless the map has Save Changes After Playing on. See Fog of War and Saving and Loading.
demo5 - PathFinding¶
The big map with an object called DemoPathFinding that follows the player along a path found with A*. The in-game map editor starts turned off in this scene.
- The heuristic list at the top of the Game view switches the pathfinding heuristic. The time the last path took is shown below it, in milliseconds.
- Turn on Gizmos in the Game view to see the path it found.
- The mouse wheel zooms the camera.
Enable Edit Mapturns the in-game map editor on, so you can paint walls and water in the way and watch the path change.Enable Debug PathFindingturns it off again.
The script is DemoPathFindingBehavior, in Samples/Scripts. It extends MapPathFindingBehaviour. See Pathfinding.