Day 4, and I've got basically a fully functional game! Sure, a few pieces are missing, but they're not essential to having a working roguelike. (Though it would be nice to have some sort of victory message when you defeat the final boss... not that I've actually found him yet! Probably some sort of healing potions would be nice, too, so you can survive long enough to find him...)
So, combat. Formation definitely matters now. Place the heroes you want to do the damage dealing (and the damage receiving) near the enemy; place the others (or the ones with the longer ranged attacks) in the back. You can attack someone who's out of range, by the way - you just take a rather large accuracy penalty: you have a 1 in 3 chance to miss for each subtile out of range that the target is! But the same penalties apply to monsters, too... except that for some reason the monsters sometimes like to target heroes in the back instead of in the front! Not sure what's causing this, but it seems to be related to the way you're facing, or maybe they way they're facing...
Since now you have hitpoints to keep track of, I also added a stats box, which shows the stats of each hero in your party. Later I plan to let you look at enemy formations to see their stats, too.
Here's a screenshot of the game - not much has changed, but if you're actually playing it (which you totally can, in case you forgot - just check out the code at https://bitbucket.org/ekolis/triquest) you'd notice lots more messages in the log pertaining to combat!
Oh, and one bug that I think I'll leave in as an interesting game mechanic - monsters will literally kill each other to get to you! If you're fighting one group of monsters, and another group of monsters that's farther away sees you, they will begin fighting the monsters you're fighting, from the rear!
+9 to save vs. demons and software glitches! Who says Christians aren't allowed to be nerds?
Tuesday, March 12, 2013
Monday, March 11, 2013
7DRL 2013 day 3: Monsters! Raar!
Now TriQuest has monsters! Unfortunately, they just appear as ASCII symbols, and since there's no combat besides moving onto the monsters to kill them (or being moved onto yourself and dying), you can't really tell what is what. They do have names and stats, I swear!
I also added the formation change mechanic I'd alluded to yesterday. You can press F to change formation; then you're prompted to place each of the characters in turn using the numpad. Doing so consumes a turn (don't do it on rough terrain or it will cost more time), but if you change your mind you can press F again to cancel without wasting a turn.
Here's a screenshot of the game with some monsters:
The blank area up top is the message log. I couldn't capture any messages because it seems that pressing a key (such as to take a screenshot) clears the log, even if the key is not an actual game command. Oh well.
Tomorrow, combat! I've got some interesting ideas for how I'll do that - I've already got some stats set up for the heroes and monsters, and basically fighting will involve rolling dice based on a pair of stats, one for the attack type (physical or magical), and one for the role one is playing in combat (attacker or defender). Attackers will use the attack type that is likely to inflict more damage, so (for instance) the mage will only attempt a physical attack if the target has a high magic stat. And then there's range - attacks will be degraded based on the range to the target (in subtiles), so that's where the formations come in! Just like in Final Fantasy, your characters will be able to rush to the front lines to inflict more damage, or retreat to the back to lessen the damage they take - except that enemies will come from all four sides, so the lines of battle constantly shift!
I also added the formation change mechanic I'd alluded to yesterday. You can press F to change formation; then you're prompted to place each of the characters in turn using the numpad. Doing so consumes a turn (don't do it on rough terrain or it will cost more time), but if you change your mind you can press F again to cancel without wasting a turn.
Here's a screenshot of the game with some monsters:
The blank area up top is the message log. I couldn't capture any messages because it seems that pressing a key (such as to take a screenshot) clears the log, even if the key is not an actual game command. Oh well.
Tomorrow, combat! I've got some interesting ideas for how I'll do that - I've already got some stats set up for the heroes and monsters, and basically fighting will involve rolling dice based on a pair of stats, one for the attack type (physical or magical), and one for the role one is playing in combat (attacker or defender). Attackers will use the attack type that is likely to inflict more damage, so (for instance) the mage will only attempt a physical attack if the target has a high magic stat. And then there's range - attacks will be degraded based on the range to the target (in subtiles), so that's where the formations come in! Just like in Final Fantasy, your characters will be able to rush to the front lines to inflict more damage, or retreat to the back to lessen the damage they take - except that enemies will come from all four sides, so the lines of battle constantly shift!
Sunday, March 10, 2013
7DRL 2013 day 2: Heroes on the move
Well, now I've got some heroes in the game, and you can move them around on the map. Since this is a tactical game, and it would be a pain to have to adjust your formation every time you want to fight monsters coming from a different direction, the game has two movement modes: normal and strafe. In normal mode (just pressing the arrows), the formation will automatically rotate to face the direction you pressed if you are not already facing that direction; if you are facing that direction it will just move there. (Note that rotation costs a turn - don't get flanked!) In strafe mode (shift-arrows), on the other hand, your formation does not try to rotate when it moves.
Here's what the game looks like thus far:
I also wanted to add the ability to rearrange your formation today, but I'm getting a bit sick of programming for now. Maybe I'll do that later this afternoon. I ran into a lot of issues with slow rendering; it turned out that just rendering a 100x100 map with each tile being a 3x3 grid of characters is actually pretty slow! So for now I'm just rendering stuff in line of sight. Eventually I'll have to add a proper fog of war, and find some other way to clip stuff that you've seen before but that's currently offscreen. Or I could just show the fogged-but-previously-seen tiles on the minimap, and not on the tactical map...
Here's what the game looks like thus far:
I also wanted to add the ability to rearrange your formation today, but I'm getting a bit sick of programming for now. Maybe I'll do that later this afternoon. I ran into a lot of issues with slow rendering; it turned out that just rendering a 100x100 map with each tile being a 3x3 grid of characters is actually pretty slow! So for now I'm just rendering stuff in line of sight. Eventually I'll have to add a proper fog of war, and find some other way to clip stuff that you've seen before but that's currently offscreen. Or I could just show the fogged-but-previously-seen tiles on the minimap, and not on the tactical map...
Saturday, March 9, 2013
7DRL 2013 day 1: I'm the map, I'm the map, I'm the MAP!
Well, I got map generation working today! It wasn't all that hard, since I'm doing a natural overworld style map instead of a dungeon, so if things aren't lined up perfectly - hey, it's nature!
Here's a screenshot of what I've accomplished so far. It looks better than I'd anticipated!
Tomorrorow I'll implement heroes, so that will require subtiles, since the heroes will be traveling together. I'm not sure if I'll do the subtiles today or tomorrow - just have to see if I feel like working on this some more later on today! Should be pretty simple, since I'm not planning on doing anything like allowing different subtiles within the same tile to have different terrain. Just a 3x3 array or something!
Friday, March 8, 2013
7DRL 2031 day 0 redux: Bitbucket!
I've created a Bitbucket repository for TriQeust:
https://bitbucket.org/ekolis/triquest
Check back tomorrow and onward to follow my progress!
https://bitbucket.org/ekolis/triquest
Check back tomorrow and onward to follow my progress!
Thursday, March 7, 2013
7DRL 2013 day 0: Intro to TriQuest!
So I'm going to be participating in the 7DRL challenge again. If you don't know what 7DRL is, it's 7 Day Roguelike, where "roguelike" is a genre of single player adventure/roleplaying game with minimal graphics and intricate gameplay mechanics. The goal of the 7DRL challenge is to write a roguelike in 7 days. No prizes or anything (apart from some neat logos you can put on your blog or whatever), but it's fun to build a game and play the games that other folks build. I've participated four times before, and succeeded twice; you can see my completed games on my website:
http://edkolis.exofire.net/decimation.php - Decimation, my 2009 entry, a very simple game where you're the number zero and you use math to eliminate the other numbers.
http://edkolis.exofire.net/smasharena.php - Smash Arena, my 2010 entry, an arena battle game where you try to knock enemies out of the arena; the more you damage them, the further they fly when you hit them, sort of like in Super Smash Bros.
I also participated in 2008 (tried to make a game called Rogue Battalion that had driveable vehicles, but got in over my head since it was my first time) and 2011 (tried to make a game called Into the Darkness that was a metaphor for spreading the Gospel, but was too busy with work). I didn't participate in 2012 because I didn't have any good ideas for games that year.
But this year I've got an idea! A bit ambitious, but if I plan it out, I think I can accomplish it. My idea is called TriQuest, and basically it's a hybrid roguelike and turn based tactics game. Instead of controlling one character, you control three - a Warrior, a Mage, and a Priest. Now there have been other roguelikes where you control multiple characters, but these have always either had you controlling one character directly, with an AI controlling the others, or required you to move each character in turn. My idea simplifies the mechanics a bit, while adding a new level of tactics to the genre.
You know how in roguelikes, it's one character or monster per tile? Well, in TriQuest, this rule no longer holds. Each tile will be split up into nine subtiles arranged in a 3x3 grid (hmm, like the numpad? how convenient!), and you can arrange your three heroes in a formation in any way you like (using the numpad of course). Monsters, too, will appear in formation. You might run up against a squad of up to nine goblins!
I haven't got all the mechanics worked out quite yet, but I do have a few ideas on how they will work. For instance, I think that weapons will have a "length" or "range" attribute. This range will be measured in subtiles, and attacking a monster outside of your weapon's range (say, from the back of the formation) will reduce your accuracy and/or damage. Of course, hanging out at the back of the formation will protect you from monsters' attacks in the same way (assuming they don't have long-range weapons), so it's sort of like Final Fantasy with the front and back rows. Except that monsters can attack you from all four sides, so you'll have to adjust your formation on the fly to deal with threats from every direction! I'm thinking there might also be an additional penalty (or maybe even inability to attack, but also inability to be attacked except by area of effect spells) for hiding directly behind another character.
Also, I was thinking of having not the traditional "dungeon levels", but instead a sprawling Zelda-style overworld with a gradient noise mapped "threat level", with the final boss lurking at the maximal point on the noise map. You might be fleeing from some level 3 monsters, and unwittingly stumble into a level 4 zone... eek!
So, what's the plan? Well, here it is:
http://edkolis.exofire.net/decimation.php - Decimation, my 2009 entry, a very simple game where you're the number zero and you use math to eliminate the other numbers.
http://edkolis.exofire.net/smasharena.php - Smash Arena, my 2010 entry, an arena battle game where you try to knock enemies out of the arena; the more you damage them, the further they fly when you hit them, sort of like in Super Smash Bros.
I also participated in 2008 (tried to make a game called Rogue Battalion that had driveable vehicles, but got in over my head since it was my first time) and 2011 (tried to make a game called Into the Darkness that was a metaphor for spreading the Gospel, but was too busy with work). I didn't participate in 2012 because I didn't have any good ideas for games that year.
But this year I've got an idea! A bit ambitious, but if I plan it out, I think I can accomplish it. My idea is called TriQuest, and basically it's a hybrid roguelike and turn based tactics game. Instead of controlling one character, you control three - a Warrior, a Mage, and a Priest. Now there have been other roguelikes where you control multiple characters, but these have always either had you controlling one character directly, with an AI controlling the others, or required you to move each character in turn. My idea simplifies the mechanics a bit, while adding a new level of tactics to the genre.
You know how in roguelikes, it's one character or monster per tile? Well, in TriQuest, this rule no longer holds. Each tile will be split up into nine subtiles arranged in a 3x3 grid (hmm, like the numpad? how convenient!), and you can arrange your three heroes in a formation in any way you like (using the numpad of course). Monsters, too, will appear in formation. You might run up against a squad of up to nine goblins!
I haven't got all the mechanics worked out quite yet, but I do have a few ideas on how they will work. For instance, I think that weapons will have a "length" or "range" attribute. This range will be measured in subtiles, and attacking a monster outside of your weapon's range (say, from the back of the formation) will reduce your accuracy and/or damage. Of course, hanging out at the back of the formation will protect you from monsters' attacks in the same way (assuming they don't have long-range weapons), so it's sort of like Final Fantasy with the front and back rows. Except that monsters can attack you from all four sides, so you'll have to adjust your formation on the fly to deal with threats from every direction! I'm thinking there might also be an additional penalty (or maybe even inability to attack, but also inability to be attacked except by area of effect spells) for hiding directly behind another character.
Also, I was thinking of having not the traditional "dungeon levels", but instead a sprawling Zelda-style overworld with a gradient noise mapped "threat level", with the final boss lurking at the maximal point on the noise map. You might be fleeing from some level 3 monsters, and unwittingly stumble into a level 4 zone... eek!
So, what's the plan? Well, here it is:
- Saturday: Map generation
- Sunday: Heroes and movement
- Monday: Monsters
- Tuesday: Combat
- Wednesday: Magic and skills
- Thursday: Items and weapons
- Friday: Polish, testing, and bugfixes
Oh, and technically I guess this post should be titled "day -1", since today's Thursday, but whatever... :)
Monday, February 11, 2013
On Error Don't Explode
Everyone in the programming world mocks VB's old On Error Resume Next feature, saying it led to "cowboy coding". But you know what? The old horse had its merits!
The next time you're frustrated by Java's checked exceptions, think what fun it would be if you could write some code and not have to catch every single eventuality that whoever designed your API could think of... seriously, do I really need to catch a MalformedUriException when I'm just passing the constant string "www.wikipedia.org" to the Uri class constructor?
.NET, while it doesn't have checked exceptions like Java, has problems of its own. It's like a crotchety old uncle who is hard of hearing, so if you don't say what you want exactly right, it spews a stream of profanity in your face. It's almost worse than Java, since (although it's easier to code), you live in constant fear of runtime exceptions crashing your production code, so you are forced to spend all your time writing unit tests (not that those are unnecessary in Java, but they're more needed, in my opinion, in .NET).
And then there are the dynamic languages. These are the most flexible of all, so naturally they need tons of unit tests. You can't even assume that a variable you reference actually exists in some of these languages! However they are quite a bit more flexible when it comes to data structures. While Java and .NET will scream at you if you try to add a key to a map/dictionary and the key is already present, or conversely if you try to change the value of one that's not actually there, Perl (for instance) will happily overwrite the existing key when you add, and is glad to insert the one that's not there for you. (This is primarily because there is no distinction between "add" and "change value" for Perl hashes, since both are simply assignments, but that's beside the point.)
So where can we find a happy medium? On Error Resume Next is too lenient, but Java's anal-retentiveness is too strict. .NET and Perl take various stances in the middle, but I don't think either is optimal. What we need, I'd have to say, is actually a rethinking of the whole exception handling mechanic.
Instead of specifying in our code every time we want to handle an exception, why not assume that exceptions are meant to be handled? It's the best practice, so why shouldn't our programming languages adapt to it? The only thing left is to specify how the exceptions are to be handled.
There are several ways to handle an exception:
The next time you're frustrated by Java's checked exceptions, think what fun it would be if you could write some code and not have to catch every single eventuality that whoever designed your API could think of... seriously, do I really need to catch a MalformedUriException when I'm just passing the constant string "www.wikipedia.org" to the Uri class constructor?
.NET, while it doesn't have checked exceptions like Java, has problems of its own. It's like a crotchety old uncle who is hard of hearing, so if you don't say what you want exactly right, it spews a stream of profanity in your face. It's almost worse than Java, since (although it's easier to code), you live in constant fear of runtime exceptions crashing your production code, so you are forced to spend all your time writing unit tests (not that those are unnecessary in Java, but they're more needed, in my opinion, in .NET).
And then there are the dynamic languages. These are the most flexible of all, so naturally they need tons of unit tests. You can't even assume that a variable you reference actually exists in some of these languages! However they are quite a bit more flexible when it comes to data structures. While Java and .NET will scream at you if you try to add a key to a map/dictionary and the key is already present, or conversely if you try to change the value of one that's not actually there, Perl (for instance) will happily overwrite the existing key when you add, and is glad to insert the one that's not there for you. (This is primarily because there is no distinction between "add" and "change value" for Perl hashes, since both are simply assignments, but that's beside the point.)
So where can we find a happy medium? On Error Resume Next is too lenient, but Java's anal-retentiveness is too strict. .NET and Perl take various stances in the middle, but I don't think either is optimal. What we need, I'd have to say, is actually a rethinking of the whole exception handling mechanic.
Instead of specifying in our code every time we want to handle an exception, why not assume that exceptions are meant to be handled? It's the best practice, so why shouldn't our programming languages adapt to it? The only thing left is to specify how the exceptions are to be handled.
There are several ways to handle an exception:
- ignore it
- log it and continue
- log it and terminate
There are of course more than these, but these are the main ones that are "sane" - sure you could terminate without logging it, but that's not very helpful!
So, the idea is, in each source code file you would specify a default exception handling behavior, which could then be overridden in individual block scopes. For instance (in pseudo-C#):
// This class is very important to the global economy! If it produces incorrect results the world is doomed! We must stop it at once if it errs even slightly!
@Catch(typeof(Exception), CatchMode.LogAndTerminate)
class ImportantBusinessLogic
{
public static void Main()
{
DoImportantBusinessStuff();
// OK, we can be a little more lenient here; sometimes the web service we are using returns nulls instead of actual data; in that case we just use the cache.
@Catch(typeof(NullReferenceException), CatchMode.LogAndContinue)
{
ComputeSomeInterestRates();
}
SaveTheGlobalEconomyFromRuin();
}
}
Good idea? Bad idea? Anyone care?
Subscribe to:
Posts (Atom)



