Possession (formerly Possession 2) - Release Date: July 18th!

Show off your games, demos and other (playable) creations.
User avatar
markgo
Party member
Posts: 189
Joined: Sat Jan 05, 2013 12:21 am
Location: USA

Re: Possession 2 - A Roguelike made in LÖVE

Post by markgo »

This is really cool. I'm making a roguelike, and your dungeon generation code really helped me understand a lot on the subject matter!
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Possession 2 - A Roguelike made in LÖVE

Post by Rickton »

Thanks. Good to know my code is legible to others. :)
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Possession 2 - A Roguelike made in LÖVE

Post by Rickton »

Today's post is about speed! Not only is it the first R-rated movie I ever watched (and haven't seen since), trying to account for it is also a pretty big issue in roguelikes and other turn-based games.
Image

It's much easier to just have everyone move once per turn. Anything else just gets complicated, both from a programming and a gameplay standpoint. But given that the differences between bodies are such a big deal in Possession, I really want there to be some creatures that are weak but fast, and some that are strong and slow. Not to mention the possibilities of spells or obstacles that speed/up slow down creatures, and let the player (or their enemies!) run away or escape more quickly.

At first I tried a simple system where certain creatures either got an extra turn or lost a turn every X number of turns, but implementing it got kind of ugly and annoying. I decided to look into what other people had already done. I found this post, detailing a wide variety of time systems used in roguelikes, and decided to go with an energy-based system, which is apparently what Angband uses, which is somewhat appropriate I guess because even though I don't really like it much now, it was the first roguelike I ever played.

Anyway, the basic way it works is, every creature has a "speed" rating that is added to their "energy" stat every turn. If their energy stat is above 100, they can move, and 100 is subtracted from it. If it's above 200 they can move twice, above 300 three times, etc. Most creatures just have speed 100, meaning they move once a turn.

For example:

Code: Select all

Creature		Speed		Energy, Turn 1
Bat				150			150 (moves once, reduces to 50)
Zombie	 		50			50 (doesn't move)
Caretaker	 	100			100 (moves once, reduces to 0)

Creature		Speed		Energy, Turn 2
Bat				150			200 (moves twice, reduces to 0)
Zombie	 		50			100 (moves once, reduces to 0)
Caretaker	 	100			100 (moves once, reduces to 0)

Creature		Speed		Energy, Turn 3
Bat				150			150 (moves once, reduces to 50)
Zombie	 		50			50 (doesn't move)
Caretaker	 	100			100 (moves once, reduces to 0)
Same goes for the player, of course. If they have above 100 energy, they can move, if not, a turn happens without them. If they have above 200 energy, their move is an "extra" move. They still move, as does any creature with more than 100 energy, but nobody's energy increases that turn.
Image
The ghost moves faster than most creatures, so the player has a chance to run away.
Click to enlarge.

This system worked pretty well as-is, but it does run into a weird problem. I had bats and ghosts both faster than normal, but the ghost was slightly faster than the bat. It got an extra turn every two turns, and the bat got an extra turn every three. This resulted in, one turn, the ghost would move twice and the bat wouldn't move, the next turn the bat would move twice and the ghost wouldn't move. It didn't make much sense.
Image
Player takes extra turns, then bat takes extra turns.
Click to enlarge.


So, to get around that, I made it so that if the player is faster than a creature, the creature saves up enough energy to take an extra turn, it doesn't actually take its extra turn until the player takes their extra turn. That seems to work pretty well so far. Might take some more tweaking as things continue, but we'll see.

Image
Bat now takes extra move when player takes extra move.
Click to enlarge.


The other problem with this system is that all actions take the same amount of time. It's not currently possible to have, for example, a creature who moves slowly but attacks at the same speed. Or a creature that can move 5 spaces per turn but only attack once. I'll have to see if that's something I want to invest the time into making possible.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
User avatar
Hexenhammer
Party member
Posts: 175
Joined: Sun Feb 17, 2013 8:19 am

Re: Possession 2 - A Roguelike made in LÖVE

Post by Hexenhammer »

I would. You should separate movement and attack/special ability speed. If you do not, speed becomes a super-powerful uberstat. The fast creature which can move 4 spaces while another can only move one can also attack 4 times while the other can only attack once - that is insanely imbalanced unless you make the attacks of fast creatures super weak but this is an ugly "solution" and usually game worlds feature creatures which move fast but have normal attack strength. Also consider attacks which inflict status effects i.e. poison. You would have to scale those too. Otherwise a "25% chance to poison" ability on a fast creature becomes a 100% one against a slow creature. Consider that these special abilities can also be on weapons, again major balance issue if you have things like a "25% chance to stun" weapon which can easily become a 100% chance to stun weapon with your system.

Action points (AP) are the most common solution in RPG games and they work for roguelikes too. E.g.

Normal movement, normal attack:
AP: 1
AP cost for moving one space: 1
AP cost of attack: 1

Very fast movement, normal attack:
AP: 4
AP cost for moving one space: 1
AP cost of attack: 4

Fast movement, fast attack:
AP: 2
AP cost for moving one space: 1
AP cost of attack: 1
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Possession 2 - A Roguelike made in LÖVE

Post by Rickton »

The AP system is pretty similar to the energy system I'm using, it just approaches it in another way.

Your points are all true. If I actually had any creatures that moved 3 times in a turn, I'd definitely want to separate those out (right now the most anyone will move is twice per "regular" move, and that only ever even happens every few turns). The question I suppose is, is the ability to put those kinds of creatures in the game worth all the extra work it would take to change the system like that?
Because the problem that Possession has that other games don't have, is that the player can control almost any creature. It'd be easy enough to set things up for NPCs to have different attack speeds and keep the player kind of standard, but that's not really an option here, and I'm not sure how to present this to the player interface-wise.

If I have, for example, a fast creature that can move 5 times a turn, but only attack once, what do I do when the player moves three times and then tries to attack? The way I see it I have a few options:
1) The attack doesn't happen. Sort of like trying to move when stunned. Maybe there's an error message, maybe the turn advances until the player's AP/energy regenerates, then the game asks for their input again, but that would mean the game basically just ignored their input.
2)I could have it run turns until the player has enough AP/energy to attack, then attack. That'd be OK I guess, but what if the creature moves before then? And even if they don't, it'll run the extra turns to let the player regen AP/energy, then attack, then run turns until the player can move again...that's a lot of stuff happening for just one keypress, and might be confusing to players.
3) When it's asking for player input, the player can attack no matter what their AP/energy is. If the attack cost is more than their AP/energy it'll just go into negatives. This means that after the attack, more turns will run before the player can move again, which could also be confusing.

None of those solutions really seem that great to me. But if you have any other suggestions to how to fix the problem I'm all ears.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
User avatar
Hexenhammer
Party member
Posts: 175
Joined: Sun Feb 17, 2013 8:19 am

Re: Possession 2 - A Roguelike made in LÖVE

Post by Hexenhammer »

Rickton wrote: If I have, for example, a fast creature that can move 5 times a turn, but only attack once, what do I do when the player moves three times and then tries to attack?
Good point, I did not consider how to handle such cases using a typical roguelike interface. In a RPG you simply press "end turn" if you do not have enough AP left but in a roguelike this is problematic indeed..
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Possession 2 - A Roguelike made in LÖVE

Post by Rickton »

I'm working two jobs right now, and the past few weeks have been pretty busy for me. I have managed to continue working on Possession 2, just not as much as I'd like. Today's post isn't really focusing on any one aspect in particular, just highlighting some of the things I've been working on.

I've made some more AI improvements. Smarter creatures now try to avoid dangerous terrain, such as lava and fires, while dumber creatures will just walk straight through.
Image
Dumb Skeleton walks straight through the fire. Click to enlarge.

Image
Smarter caretakers paths around the fire. Click to enlarge.


I've also made spellcasting AI improvements, so that creatures running away can use defensive spells like teleportation, and creatures can also use positive spells (like healing) on their allies.

Content-wise, I've also continued work. Here are shots from a few new special levels. First of all, the ruins of an underground city full of Lovecraftian monsters. It's mostly finished, just needs a little more work on some of the creature powers.
Image
Click to enlarge.


There's also a few areas that are still very much in progress, a nature preserve (full of flammable grass and trees!) and the ruins of a demon city.
Image
Click to enlarge.

Image
Click to enlarge.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Possession 2 - A Roguelike made in LÖVE

Post by Rickton »

Crossposted from my blog
So I apologize for not really having posted anything recently. There's been some work going on, but a lot of it has been kind of behind the scenes (probably worth a post, might be of interest to other game dev people), and honestly, there hasn't been THAT much work done, either. Right now my job situation just makes it hard to put as much time in as I'd like, especially considering I'm still running and working on Pleasantville by Night.

I do still have the energy to do some conceptual work, so once I do get the time to work I have plenty of creatures already planned out. I've also managed to make myself do the sprites for quite a few. Here's a look at some of them:

Image
Click to Enlarge


That's fifteen new creatures. Possession 1 had a total of 31 creatures, not counting the ghost. Only 24 of them were possessable. The creatures in that one image alone is more than half of what the first game had!

Here's some more info on how much bigger Possession 2 will be than Possession 1. Possession 1 was five levels long, and each level had the same group of creatures available each time. Possession 2 will be ten levels long, and eight of those levels will randomly be one of three possible levels and creature groups. If each of the levels has an average of five creatures, that's around 130. That's already a hundred more than the first game had, not counting bosses or summonables. And, of course, there's going to be a wider variety of level designs and level features, not to mention all the new creature abilities.

In about two weeks, my job hours are going to drop to sane levels, so you should be seeing more from me after that point. My priority will be to get a playable version out. It won't be complete (or probably even winnable), but you'll finally get a chance to play around with some of the new stuff.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Possession 2 - A Roguelike made in LÖVE

Post by davisdude »

Looks cool! Keep up the good work! I like your art-style too! :)
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Possession 2 - A Roguelike made in LÖVE

Post by Rickton »

Thanks! I'm pretty bad at art, so I'm glad I was able to find a style that I can do fairly easily that (in my opinion anyway) looks pretty good.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests