Skip to main content

Level Editor

You might ask why a game with random levels needs a level editor...

Well, roguelikes are not completely random.

Most roguelikes use predefined rooms in their level generation algorithm. Usually these are rectangles, but they might also be another shape, such as an oval or a rectangular donut or a cross.

I'm going to be doing the same, so that I don't have only rectangular or square rooms. But as well as simple primitives (square, rectangle, torus) I'm going to include quite a lot of themed rooms and even themed areas. These might include mazes or an array of dungeon cells or an underground fortress, or a subterranean village or whatever.

For that I need a quick and easy way of creating these prefabricated areas and saving them to disk ready to be called up by the game.

Introducing the prefab editor V0.4:


You can place rooms, corridors, stairs up and down, secret doors and encounter areas (the numbers on the map above).
The encounter areas are my favorite bit so far. They will be added to the level's dictionary of encounter areas and random monsters or treasure or furniture items will be placed there according to a theme when the level is created. There's a good chance that an encounter area won't spawn an encounter but if it does, the encounter parts should be constrained to the tiles specified in the level editor.

The level hook is a tile marked for connection to the other parts of the dungeon. There can be multiple level hooks, or just one. If the prefab contains stairs it will be stored in the "stairs" dictionary along with an entry detailing the length of it's longest edge, so it can be rotated or flipped and fitted in to the BSP generator I talked about earlier.

There will be a lot of prefabs built, so the chance of encountering any 2 identical areas is pretty low. In any case they may have a different tileset, different encounters, furniture or other features so they won't be instantly recognizable.

Comments

Popular posts from this blog

Advice needed on tilesets...

I need some advice on which is the best way to handle building the dungeon. Right now I'm using prefabs for my dungeon, they have a north south east and west section for each "room": The basic tileset. This has several advantages, and also several disadvantages. Firstly I can have curved rooms, I can have tunnels and other interesting shapes. The tilesets can look quite nice with a little work. On the other hand I can't easily get the navigation data before building the map and once the map has been built I can't make changes to the layout, like having active pit traps or believable secret doors. Although the rooms are interesting, they are quite repetitive, and it takes a lot of effort to make even a few different variations. Also rooms are constrained to one size. A newer version of the tileset with a lot of variant parts for making more interesting rooms. To create a tile set is a real headache too. Planning how to lay out the UVs, trying to cra

Upstairs / Downstairs.

I've decided to make my prefabs multilevel. Later this should allow me to add pit traps and other great stuff. It also makes it easier to line up stairs so that you can exit them on the same co-ordinates where you entered them. The prefab editor is pretty much finished, it just needs some code for loading up prefabs from a saved dictionary, so that they can be checked or edited. The entries will need to be forwards compatible, so I'll be loading each tile and then translating the indexes to a new array, that way if I add extra indexes or extra info (like traps or puzzles) I'll be able to update existing prefabs to work with the new standard. Click for a video.

Video Diary 8

Things are moving along well, there's been a lot of progress on the action manager side of things. Actions have finally moved to the UI, so you can initiate actions by clicking the appropriate button. I've set up some dummy actions to show what happens visually when actions are taken, but the actual dice rolls and such are yet to be integrated. The UI objects are also being added, though some are non functional or empty at the moment. Click on the image to see this week's development video. Every time I add something big I also add about a dozen small things. Like the selection box visualization. Previously this was using render.drawline, and old fashioned Blender function which can be impossible to see at certain resolutions, or at certain frequencies. I replaced it with a function that adds planes of the right size and scale in the right location. I also made all characters a little bigger. I still need to do some work with vectors and final target locations t