Skip to main content

Concept: Monster Spawns.

Today I had some ideas on what to do about monster and room management spawns.

I want to add random objects, monsters and props such as tables to the map, but I want them to be placed in a way that makes sense and has some kind of internal narrative.

I don't want you to enter a room and see:
  • an empty book case
  • a skeleton
  • an elf
  • a potion of speed
  • a rug
  • a telescope
  • a green slime
  • some writing on the wall
  • a puddle of rats blood 
What I want is that you enter a room and see:
"Some guards standing around a table, on the table is a lunch buffet of green cheese and mushroom sandwiches. In the corner two guards are sleeping on bedrolls. A guard captain is sitting at a card table playing cards."
The above situation would be the result of three themed spawns:
  1. A table with appropriate contents and some appropriate monsters standing around it.
  2. Sleeping monsters on bedrolls (perhaps with optional equipment spawns nearby)
  3. A card table with one or more themed monsters. 
The spawns would be packed in to the room, if there wasn't enough room another spawn would be substituted.

I'd use a dictionary a little like this:
Yes, that's right arrays can contain function calls.

There are other indexes in the dictionary as well as the object spawn arrays, the level index would restrict spawns to different levels, the x_size and y_size are not really needed as you could just measure the array lengths to get that info, but you could include a theme key here such as "insects" or "horror".

The random monster function calls a random monster from the meta list of monsters using a guideline of max xp cost and starting state, allowing sleeping, frozen, stone or polymorphed (etc...) monsters to be placed.

With this kind of method you could have spiders (a monster) and cocooned prey (a prop), or a book case and scattered books (all props) or a barracks with beds, chests and sleeping guards and lookouts. Further refining the random monster function, you could use a wild card such as False or None instead ofXP amount to use XP from a general spawn pool (calculated in relation to the player's strengths and weaknesses). Or you could add an extra argument to the function such as monster type, which only adds monsters with that type to the random generation pool. A typical type would be "furry" which would generate giant rats, wererats, werewolves, cave bears and such, or "insect" which could generate all kinds of bugs, or "human" or whatever. The more tags you have, the more you can control the spawns and create more narrative for your game, but the more chance of getting an empty list.

For instance you spawn a monster formation on level one which includes a random monster call for a "demon". The xp pool is just 100 xp, but the lowest level "demon" monster is 5000xp. That's going to result in no monsters being spawned unless you have a fall back, like:

else:
       monster_instance = monster("giant_rat", "crazed")

In which case the player is going to be so busy dealing with a berserk Giant Rat they may not notice the "pentagram" and "sacrificial_altar" props in the room.

The above concept may need tweaking a little, the final game is going to include props that can block your movement but also others that don't (such as a puddle). In that case it would be fine for a spawn location to include a prop as well as a monster or object. Objects could also be placed inside or on props (such as food on a table).
Imagine entering a room and seeing a zombie feasting on a fresh corpse, or an egg that splits open to release a juvenile giant spider.

Anyway, today I'm going to be experimenting with saving and loading and maybe try moving a player object around the map.

As a closing video I'm going to post this, which is exactly what I don't want my game to be like:


 

I hate the way you can upgrade the rusty helm (which doesn't look nearly crappy enough to be a rusty helm by the way) while still fighting and running around. How? Does he have an army of crafting gnomes stuffed into his loin cloth?
And you can speed up the upgrade by paying for it. Again, how does that work?
Although the worst thing was the massive in game tutorial pop-up which completely covered the bossfight (and the bosses spawn was ruined by happening mainly off screen).

No wait, the worst part was:
tap=slash
tap=slash
tap=slash
tap=slash
tap=slash
etc...

He had several special abilities, but there seemed little point in using them as every enemy fell to a few quick slashes of his mighty rusted sword.

I don't have full details of the combat system I'm going to use yet, but rest assured it will feature more than just tap=slash, and special abilities will be useful.

Comments

Popular posts from this blog

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.

Automating Level imports from Blender to Godot

  Recently I've been making some levels in Blender an importing them into Godot. There are only about 7 or 8 shaders for each level, not counting dynamic objects which will be added later. But to improve rendering performance, it can be a good idea to split the meshes up into sections. At that point you might be faced with a list like this: Or it might be even more chaotic, if you didn't use simple names for the objects in your level. So it can take a long time to sort out all the meshes, make them unique and add textures and so on. Blender imports with simple Blender textures, or with placeholder materials. This is sometimes OK, but if your Godot shaders are very different to those used by Blender, it means applying new materials to every mesh object in the level when you import the scene. I found that during the design process, I was importing and readying a level several times before I was happy with the final layout. So at first I was wasting a lot of time. In Blender, I us

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