Jp

Joined: Sep 17, 02

Email

Current Project

Keywords

My demos

 

 

GIAD 2009 entry

Here's my entry for the Game In A Day contest, 2009: Gears of War.

It's a turn-based tactics game - you have a bunch of robots, your foe (Either an AI or another human player) has a bunch of robots, and you would both rather like it if the other's robots all vanished.

I'm actually reasonably happy with the quality of the result, given the timeframe. The graphics are utterly awful, as you might expect from me, and the UI is a little clunky - but the gameplay is, I think, actually pretty good, and the AI manages to be semi-competent, in that it's actually trying to hurt you and not doing random stuff (Actually, my first cut at AI for it just had the AI moving 'bots randomly and then firing at any enemies in range...)

I might actually continue the game in the future - probably with some rewriting of code and better graphics, but the same game, at least.

Posted by Jp on Sunday, September 13, 2009 05:29PM - 4 comments / Members say: yea +2, nay -0

(set! age (+ age 1))

Well, I'm 20, officially, as of about 1 hour and 8 minutes ago. I am no longer a teenager. I've nearly finished my degree. I have no more excuses.

Time to actually write a goddamned game.

Posted by Jp on Wednesday, July 01, 2009 08:39AM - 8 comments / Members say: yea +2, nay -2

Not Getting Stuff Done: Yet to be named roguelike

When I entered IainPeregrine's Get Something Done challenge, I did in the full knowledge that I likely wouldn't have enough time to get something done. Turns out that the last year of an engineering degree has a lot of assignments - whoever would have thought it?

Anyway, due to university/work commitments, I was far, far too busy to actually get something done this May. When I hit uni holidays, I'll see about it then.

But for now, what my project was intended to be: A successor to Ruin.

Ruin is really the first thing I've released on BYOND that I could really consider a completed game, and it's got a number of serious flaws. For example:

  • Maps follow a tree structure, causing a lot of backtracking and metagaming of the map

  • Very simplistic magic

  • Does not use the isometric perspective for anything useful

  • Ugly programmer art

  • Missing a number of useful features - such as a town level, a dungeon map, etc.

  • Reasonably ugly code.

  • Terrible interface.



It also has a smidgeon of good:

  • I quite like the way magic item generation works, in terms of generating interesting magical items.

  • The way dungeons are saved and cached is reasonable

  • Definitely a number of design decisions I'd like to keep on hand. (Particularly spells/scrolls/potions, the way character statistics are calculated, and monster AI).



I'd like to see if I can do better. I haven't come up with a name for the project as of yet (Ruin 2 will suffice for now, I suppose, but I might come up with something a little catchier in the future). Planned features:

  • Much snazzier dungeon generation using my most recent dungeon generation library. This means maps will be graphs, and rooms will be furnished.

  • In addition to the better underlying generation algorithm, I intend to place 'features' throughout the dungeon. When you roll up your character, the game will decide, for instance, that there is an orc barracks on dungeon level 4, an underground lake on level 7, a temple dedicated to an evil god on level 13, and a dragon's lair on level 21, say. These would all influence the generation of that level, and would, of course, be randomly generated.

  • Magic item generation revolving around randomly selected properties, each with a point value. Think the way D&D magic items work - each property is worth some point value, and the item is, in total, worth the sum of the point values of all its properties.

  • Standard roguelike functionality that was missing from Ruin, including a town level with shops and the like (gasp), and dungeon maps (double gasp).

  • Icons from someone who can actually draw (Likely an artistically-inclined friend of mine I'm roping in)

  • Still the isometric perspective, but actually used for something. With the more advanced dungeon generation, and actually functional art, this should be less of an issue. This won't be actual Z-levels in a single dungeon level (So elevation won't be an issue), this will simply be 3D pretties. It will be optional, like Ruin, so you can run the game in 2D top-down mode if you'd like.

  • Interesting sense functionality to handle things such as blinded characters, magic items that enhance your sense of smell, hallucination, and sound in fun ways. This will also apply to monsters and monster AI.

  • More documented and ordered development process.



It's a lot planned, but I think I can pull some of it off on the first release and the rest of 'em over time.

A few more words on the last point: I intend to try developing this project more publicly than other stuff I've done. It's not that I try to be secretive when working on stuff, it's just I don't think anyone would be interested.

I still think you're not going to be interested, but regular status updates provide motivation for me to keep working. So the plan will be that once development kicks in in full swing, I'll be making semi-regular posts detailing progress to date and intended next items for completion. I also intend to produce design documentation, and a series of near term, medium term, and long term goals to keep me on track.

Finally, I intend to store the source code in a publically readable SVN repository. Development won't be open source, in the sense that I won't be soliciting patches from the public (Although if you have the urge, suggest away), it will be both readable and usable. Likely released under a BSD license or the like, once I've got a firmer idea of what my legal responsibilities under such an arrangement are. Might end up just being public domain.

tl;dr: Sorry, IainPeregrine, I didn't find the time to do anything for your brilliant challenge (And I really mean that, it was a damned fine idea), but I intend to develop a much-improved version of Ruin some point in the future (Likely beginning mid-July, after exams).

Posted by Jp on Monday, June 01, 2009 05:50AM - 0 comments / Members say: yea +0, nay -1
(Edited on Monday, June 01, 2009 05:58AM)

DM is somewhat unique - lexing/parsing issues with block structure

I've been continuing on with my attempts to write a parser for DM code, and there's this one block I keep hitting again and again - determining block structure.

I can handle this case:

a
    b
    c
        d
    e
        f
            g
    h


That is, if it's entirely indented with tabs/spaces/whatever.

I can handle this case:

a
    b
    c/d
    e/f/g
    h


That is, indentation with mixed tabs and slashes, with nothing under the slash'd lines. But this?

a
    b
    c
        d
    e/f
        g
    h


Can't figure out how to do it. Everything I've tried so far can't parse 'g' correctly (Parses it as under 'e', rather than under 'f') or can't parse 'h' properly (Parses it as under 'e', not under 'a').

That construct is legal in DM, I'm certain, but I can't for the life of me figure it out. And because DM is the only language I know of (And I've done some searches about it) that uses indentation to indicate block structure but allows that use of slashes, I don't have any examples to crib off of.

I'm using flex and bison - I'm getting the lexer to figure out the block structure (So technically it's not a parsing issue, but whatever) and then passing definitions up to bison with the block level set in a global variable. Any ideas on how to handle it? This is the most correct I've got at the moment:

%{
        int depth = 0;
%}

%%

[\t ]                           depth++;
\n                              depth = 0;
\/                              depth++;


EDIT: Wait, no, I came up with a solution:
%{
        #include 

struct depth_t {
        int depth;
        int tabdepth;
} typedef depth_t;

        int depth = 0;
        int tabdepth = 0;
        depth_t tempdepth;
        std::vector<depth_t> stack;
%}

%%

[\t ]*                          {
                                        depth+=yyleng; tabdepth+=yyleng;
                                        tempdepth = stack.back();
                                        if(tempdepth.tabdepth < tabdepth) {
                                                depth = tempdepth.depth + tabdepth - tempdepth.tabdepth;
                                        }
                                        else {
                                                stack.pop_back();
                                        }
                                }

\n                              {
                                        tempdepth.tabdepth = tabdepth;
                                        tempdepth.depth = depth;
                                        stack.push_back(tempdepth);
                                        tabdepth = depth = 0;
                                }

\/                              depth++;


That appears to work, although I can't help but feel that I'm overcomplicating issues... And of course, it won't work with braces. That's easy, though.

EDITEDIT: That's a vector of depth_ts, of course. For some reason the <depth_t> got cut out, even though I've got <pre> tags around it. Is that a bug?

EDITEDITEDIT: More issues! You wouldn't believe it, but it took me this long to realise that / is also used for the division operator. That means block depth is going to have to be determined at the parser level. Crap. I think it'll mostly convert, but I'm not sure how I'll have the grammar distinguish between, for example:
a/b //Defines /a and /a/b

world/New()
    var
        a
        b
    a/b //Does nothing


without making the parsing much more complicated than I had originally invisioned. Ah well, such is life. I suppose I can just ignore everything with a tab-depth greater than a function... and I can tell its a function because it has () at the end of it.

Posted by Jp on Friday, February 13, 2009 02:33AM - 2 comments / Members say: yea +0, nay -1
(Edited on Friday, February 13, 2009 03:43AM)

Jp's Thoughts on JRPG Design, Part 3 - Defence!

Last time I discussed how I think difficulty in a JRPG-style game should revolve around making the player think - forcing them to strategise. I also think that's where the fun lies - a game where you can just press X to win is boring.

One area where I think JRPG-like games can add strategy - thereby increasing fun - is defensive actions. Most JRPGs have a pretty woeful selection of ways to defend yourself:

- The ever-present 'defend' command. It's completely useless. You give up a chance to attack or heal for a slightly lessened amount of damage next round. Does anyone ever use this? Why does it even exist?

- 'protect' and 'shell'-style spells - basically, you cast the spell in question on a character, they take less damage from physical/magical attacks for the duration of the spell. They're better than 'defend' - because in many cases they're worth spending an action - but they're still not great. In general they're either entirely not worth using, because you don't need to bother defending, or they're mandatory, because you take too much damage otherwise. Also, the only tradeoff you're making is between one action of doing something else and a number of actions of reduced damage, there's not much strategy involved - it's always either a good idea or a bad idea, no thinking involved. Well, okay, in some games 'shell' reduces the amount of HP healed by magic, but the effect is generally negligable because healing is so damn easy in most games (More on that in another post).

- 'cover' or 'sentinel'-like abilities. Continuing on with Final Fantasy abilities, 'cover' is generally a passive ability on some characters that means they occasionally take single-target attacks for another member of the party, occasionally only when the target is heavily damaged, and 'sentinel' is generally the defend action, except that you also cover for teammates. 'cover' has absolutely no merit in terms of improving strategy, because it's a passive ability and you're making absolutely nothing in the way of tradeoff. It also generally activates so rarely that it may as well not exist. 'sentinel', on the other hand, I've actually found several uses for. It goes in the 'good idea, need more of them' basket. For example, consider the following example: The player is fighting a boss. This boss retaliates every time the player targets him with an action, and kills every member of the player's party in one hit. You could go all battle-of-attrition and just keep bringing people back to life, but that's wasteful - you could, alternatively, have your toughest party member use a 'sentinel'-style ability, and then have your other two party members attack - your tough character takes the hit and survives (because they're defending), and then you just have to heal them, not bring them back to life.

- 'reflect' - cast a spell on a character, and magic cast on that character is then reflected back to the user for the duration of the spell. This I find fascinating. It's an incredibly powerful defensive ability - that character is completely immune to magic - but it's also a massive tradeoff, because you lose the ability to cast beneficial magic on that character. In particular, that makes it hard to heal them in many games. Finally, it has useful offensive properties, if you consider that reflected spells generally go through reflect - also, some versions just reflect the magic to the 'other side' of the battle, so if one of your characters casts an offensive spell on one of your other characters with reflect, then it hits one of the enemies, not the caster - that means you can get multiple hits of one spell on a single enemy by casting reflect on your entire party before casting a multiple-target spell on them. Unfortunately, 'reflect' is generally crippled, because it generally only affects a very limited selection of abilities - so most monsters can ignore it completely. Also, it's generally easy for monsters to remove, so anything with a shred of AI can just cast a 'dispel' equivalent before blasting you with magic. But it's definitely an example of how defensive stuff should work.

Those are the sorts of things available in the vast majority of JRPG-type games. There are some interesting corner-cases - Golden Sun, for example, has abilities that cause your entire party to take absolutely minor damage for one turn, and Baiten Kaitos' battle system puts defence on essentially the same level as offence - that's an awesome game, by the way. If you can live with the terrible voice acting and reasonably boring storyline, the brilliant battle system is worth it.

Anyway, in general the defensive abilities I've noted as interesting above have a few things in common - they make a tradeoff more interesting then "I could defend, or I could attack". 'reflect' trades the ability to buff the character for immunity to magic. 'sentinel' trades knowing who the enemy is going to attack for exposing one character to potentially a lot of damage (Until his/her/its next action, that character is going to get hit with every single-target attack thrown at the party). I think that's the absolute key of defensive abilities - first, they need to do something that's worth it, and secondly they need to make an interesting tradeoff.

But there is, I think, a problem with this approach - any ability that takes an action to use is always going to be second-rate compared to attacking the enemy. No player is going to waste their time faffing about with defensive options against mooks when they can just kill them before they attack. At best, they'd just get used against a few bosses and mooks - they'd be a niche. Monster that uses only magic attacks? Reflect it is. But that's the only time it would ever be used. That doesn't really add much to strategy.

So I think defensive options shouldn't cost an action to use. They need to be passive. Normally, that would be a problem - players would just use the most powerful defensive ability and they'd never have to think about it, because it's passive. But if every ability makes a major tradeoff, it suddenly becomes more interesting - particularly if that character can change his/her/its defensive ability during battles. Consider the following system:

Every character has a number of defensive abilities. They are learned over time like any other skill. Characters are always using one defensive ability out of their set of known abilities. Players can change that skill on the menu, or during the characters turn in battle. Changing the ability the character is using does not cost a turn - so you can change their ability and attack in the same round. All the abilities have a powerful effect, but they all have penalties, so the 'best' ability changes situationally. Here are some examples of potential defensive abilities:

- Damage from melee attacks is significantly reduced, but magical and ranged attacks do more damage (Probably for a sword-and-shield sort of character)

- Character is unaffected by all magic, but cannot cast any spells (Probably on a magic user, but they'd have to have something useful to do if they couldn't cast magic. Items, perhaps?)

- Character counterattacks all physical attacks directed towards them before they are attacked, but take more damage from attacks (Maybe for an archer character - they shoot monsters before they get attacked, but are more vulnerable because of it)

- Character intercepts all single-target attacks directed at the party, and takes significantly less damage from all physical attacks, but deals signicantly less damage with physical attacks (A sort of paladin-y ability).

- Character takes significantly less damage from magical attacks, but is more vulnerable to physical damage (say, a mage actively countering enemy magics, but the concentration required leaves them vulnerable).

I'm sure you could come up with others in the same vein. I'm still split on whether or not there should be a 'neutral' option with no benefits or penalties - on the one hand, characters sort of need somewhere to start, and it allows players to opt out of all this mess if they find its too complicated, or if they don't have an appropriate ability for the monster they're fighting. On the other hand, the lack of a neutral position forces players to consider defensive options, so they're required to strategise in this way.

I still don't think those abilities are enough, though - there's one last element I'd like to see. To foster interesting strategy, there should be some defensive abilities with an effect greater than a single character - like the 'sentinel'-style ability in the list above, they should be team-players. What if an upgraded version of the 'shell'-equivalent above caused all enemy magical attacks to do significantly less damage, no matter who they targeted? You'd probably want to bump up the penalty a bit, too - maybe it costs MP every round the character has it active.

Anyway, that's how I think it should be done. Does anyone have any thoughts? Ideas for cool abilities? Know of any games that do something similar (Like the lightsabre forms in KOTOR 2)?

Posted by Jp on Monday, February 09, 2009 06:25PM - 7 comments / Members say: yea +2, nay -1