Author Topic: I added a new monster, any ideas or feedback? (post your new stuff too)  (Read 54677 times)

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
I like the way you think, I got fun effects by allowing each critter to modify the dungeon in different ways.  Putting two different critters in the same level got substantially different architecture than either alone.

I have wanted to write creatures that would modify the level, but haven't yet. What kind of approach did you choose and in what ways are they modifying levels?
Everyone you will ever meet knows something you don't.
 - Bill Nye

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Monsters that knock down walls have been part of the moria tradition (including angband) since the mid-eighties. Monsters that both reproduce and knock down walls (and explode on death, killing more walls) have been in tomenet for about ten years (so-called "Unmakers"). Tomenet also has monsters with breath weapons that destroy walls (disintegration and rockets, which probably actually come from old school tome or zangband, but idk). If you're looking for a smarter kind of level modification, I don't know any good examples.

Kimchi

  • Newcomer
  • Posts: 13
  • Karma: +0/-0
    • View Profile
    • Email
Also, keep in mind that creatures which replicate rarely can live forever. You could make it so that a fungus needs a certain amount of resources to sustain its growth level. Or hell, you could just set their growth level relative to a death rate, so the little buggers kill themselves off over time.

Wait a minute. What about genetic mutations? i.e. each time a fungus replicates, the offspring has "mutated stats," and then let the little buggers attack anything close by, including each other!!! You could produce a kind of natural selection this way, with the strongest fungi surviving. :D

Hi

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 154
  • Karma: +0/-0
    • View Profile
    • Email
I like the way you think, I got fun effects by allowing each critter to modify the dungeon in different ways.  Putting two different critters in the same level got substantially different architecture than either alone.

I have wanted to write creatures that would modify the level, but haven't yet. What kind of approach did you choose and in what ways are they modifying levels?
I started off with wall modifiers because walls vs floor is the most meaningful terrain distinction for the player.
The function "koolaidman" looks at a 3 by 3 square of tiles and determines if changing the center tile could change the connectivity of the map. (this is because the koolaidman bursts through walls)

Rockworm larva move only orthogonaly and can burrow into walls that do not change connectivity.  The creates a maze with walls a single tile thick.
Code: [Select]
###      ###
.X.  no  #X. yes
###      ###

Dwarf miners dig in straight lines turning 90 degrees whenever they find gold. When they collect enough gold they turn into dragons.
They occasionally create dwarf civilians.
Dwarf civilians remove exposed corners (unless it is next to a door)
Code: [Select]
###
.x#
..#
and place doors sometimes when they enter a room
Code: [Select]
#.#
#x#
..#
This combination creates a room and corridor layout.

Cave bison burst through walls that are only exposed on two opposite sides.
Code: [Select]
.#.
.X.
.##
this greatly increases connectivity and allows grass to spread so they can eat it.

Antelope clean up by removing walls that are exposed on three sides and do not change connectivity or wall connectivity.  The finishes the transition from corridors to grassland.

There are also ants that carve a tunnel if
Code: [Select]
#
##
   X
##
#

this creates a network of natural looking tunnels with plenty of short side tunnels.
« Last Edit: June 01, 2014, 03:45:34 AM by Hi »

Zireael

  • Rogueliker
  • ***
  • Posts: 604
  • Karma: +0/-0
    • View Profile
Wait a minute. What about genetic mutations? i.e. each time a fungus replicates, the offspring has "mutated stats," and then let the little buggers attack anything close by, including each other!!! You could produce a kind of natural selection this way, with the strongest fungi surviving. :D

I love the way you think, Kimchi!

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
That's pretty much what I was after Hi, thanks for explaining.

Also, keep in mind that creatures which replicate rarely can live forever. You could make it so that a fungus needs a certain amount of resources to sustain its growth level. Or hell, you could just set their growth level relative to a death rate, so the little buggers kill themselves off over time.

That's the plan (limiting their lifespan) eventually. In the meantime I'll try to add something new on the game, since it's sorely lacking content. Just couple of different monsters and items don't carry that far. I'm tempted to add more undead ones, like zombies or mummies. Perhaps have graves that you can try to loot for items, while risking on angering the skeleton there.

Everyone you will ever meet knows something you don't.
 - Bill Nye

AdamStrange

  • Newcomer
  • Posts: 35
  • Karma: +0/-0
    • View Profile
mmmm, I'm ready to start and been tweaking values and came up with this:

monster = MONSTER_SPORE
spore is not active until triggered by you being in room/near
each frame, health of spore is decreased
if you are exactly at a distance of 3, the spore will attempt to spawn a new spore next to itself. It will also decrease it's health more rapidly.
when health of spore is 0 then the spore dies.

with this, the spores replicate and are also killed, spores only replicate when you are near, so staying around is your own fault. The spores don't move.


tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
mmmm, I'm ready to start and been tweaking values and came up with this:

monster = MONSTER_SPORE
spore is not active until triggered by you being in room/near
each frame, health of spore is decreased
if you are exactly at a distance of 3, the spore will attempt to spawn a new spore next to itself. It will also decrease it's health more rapidly.
when health of spore is 0 then the spore dies.

with this, the spores replicate and are also killed, spores only replicate when you are near, so staying around is your own fault. The spores don't move.

If/when you code this, let us know how does it work. But wouldn't this eventually kill all the spores, if the player hangs close enough for their health to deplete, but not at a distance of 3? But I like how they are active only when player is close by. That saves from lot of hassle (like them taking over the level or eating up lots of CPU).

I added graves in the game this weekend. With correct tools, player can dig them up in search of items (currently mostly simply weapons, some martial ones with some luck), but risks disturbing possible monster there (mostly rats, sometimes skeletons). If there's a monster in the grave, it usually gets a free hit against the player, unless the monster is very slow or player is very fast.
Everyone you will ever meet knows something you don't.
 - Bill Nye

AdamStrange

  • Newcomer
  • Posts: 35
  • Karma: +0/-0
    • View Profile
ok here's what I've got
- when you are near, the spore is triggered

the replication code is in the AI section as it's a behaviour (spores can't move)
here's the spore AI:
- if random from 0 to 200 is < 2 continue
- get the distance from the spore to you
- if distance >= 2.5 or distance <= 4.5 Spawn new spore with double the decrease of spore health (new spores die faster)

in the rest of the game
- spore checks if you are near
- if near then pink spore attack (the spores are pink!)

I tweaked my setting till I got a replication auto death rate i liked. There was one time I got a > instead of a < and the spores kept replicating till they took over, which was cool, but not brilliant.
I also tried a variation when the spores would only replicate when you were further that 4 away from them - they took over, but not initially.

About the CPU, what is your monster provision?
I've got mine currently at a max of 200 on a 60x60 map without cpu issues (but i'm not checking monster against monster yet)

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
I removed all constraints for spawning extra fungi and let them flood the level as much as they could. The infighting limited it a bit in rooms, but corridors were mostly full. There were no problems with the CPU in this case, but I only had fungi on the level (so no pathfinding or any other complicated logic going on). Level size is 79x20, so some hundreds of monsters. Seems I was worried about CPU for nothing (at least in this case).
Everyone you will ever meet knows something you don't.
 - Bill Nye

AdamStrange

  • Newcomer
  • Posts: 35
  • Karma: +0/-0
    • View Profile
79x20 - interesting resolution.
I've not dealt with monster on monster interaction yet - but i've coded it so it should work with a little tweaking when I get there.
I thought the CPU would handle it (unless you were doing something really odd in the code) - yep, replication doesn't use path finding.

I've been looking at the new rooms, and rat AI entires on your blog (didn't realise you were using python to code with).

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
The resolution is holdover from earlier way of storing level data. I recently switched to system, where I don't have to worry about size of the levels while generating the levels. They can just freely grow to all directions as needed.

Yes, I'm coding in Python and slowly switching over to Hy (embedded Lisp running on top of Python). That gives me some performance penalty compared to using C/C++ for example, but as long as I don't do anything stupid it should be fine. And writing Python/Hy is much more faster for me than working with C/C++. Just have to figure out how to make easy to deploy packages for Linux and Windows without huge amount of effort. I know there are tools for that and I used to have Windows binaries at somepoint.

Here's a screenshot of an adventurer digging up those graves I mentioned earlier. All the items and monsters are spread around the grave as one digs them up. Here I was testing it with rats and skeletons, but I think it would be fun to create some more specialized monsters too. One idea I have been toying with is an undertaker that walks around the graveyard tending the graves. It mostly ignores the player, until he starts digging up the graves.

Everyone you will ever meet knows something you don't.
 - Bill Nye

AdamStrange

  • Newcomer
  • Posts: 35
  • Karma: +0/-0
    • View Profile
great idea for the keeper, maybe he could fill in graves when he finds them open?

Just been dealing with puffballs that get larger as you get nearer. when you are next to them, they pop and any puffballs next to them start a countdown and also pop. Thinking I should add self replication, so once one pops, they will all pop!
before:

They pops:


As an aside I've got some flat 2d graphics left over from my first version if you want some walls (gauntlet style) in grey - color to be added if you want - all versions (corners/etc) complete. Also some floor graphics?
« Last Edit: June 10, 2014, 10:52:16 AM by AdamStrange »

Zireael

  • Rogueliker
  • ***
  • Posts: 604
  • Karma: +0/-0
    • View Profile
Quote
The resolution is holdover from earlier way of storing level data. I recently switched to system, where I don't have to worry about size of the levels while generating the levels. They can just freely grow to all directions as needed.

That's a cool system, how do you do it?

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
great idea for the keeper, maybe he could fill in graves when he finds them open?
I was thinking that he might have a very limited vision range and if he finds an open grave, he would first fill it and then actively start searching for the player. He could even be blind, so as long as the player doesn't end right next to him, it would be safe to move around.

Just been dealing with puffballs that get larger as you get nearer. when you are next to them, they pop and any puffballs next to them start a countdown and also pop. Thinking I should add self replication, so once one pops, they will all pop!
Looks nifty. When they pop, they'll do damage to player? Are there any secondary effects.

As an aside I've got some flat 2d graphics left over from my first version if you want some walls (gauntlet style) in grey - color to be added if you want - all versions (corners/etc) complete. Also some floor graphics?
I'm always interested on new graphics and would use them if they fit stylewise to what I already have.

Quote
The resolution is holdover from earlier way of storing level data. I recently switched to system, where I don't have to worry about size of the levels while generating the levels. They can just freely grow to all directions as needed.

That's a cool system, how do you do it?
Instead of storing maps in two dimensional array (list of lists actually), I'm using a dictionary with coordinates as key and tile structure as value. Querying level at given coordinates will return the data the program is after or null if there is no tile at the given coordinates. Assigning a value to given location will create a tile if there is no one there already. Negative coordinates work equally well as positive. If I wanted, I could use three dimensional coordinates to create cliffs, chasms and such, but that is starting to get a bit more complicated that I want to deal with right now.

I wrote a bit more detailed explanation at: http://engineersjourney.wordpress.com/2014/05/29/new-level-structure/
« Last Edit: June 10, 2014, 06:24:56 PM by tuturto »
Everyone you will ever meet knows something you don't.
 - Bill Nye