Seriously, go play Phoenix Wright already.

The other day I posted a list of things I’d need to do to the distraction engine to have it cope with my new miniRPG, and I casually mentioned “Finish the battle engine” as something silly that still needed to be finished in the next few days. I guess I wasn’t thinking straight. I’ve haven’t mucked around with the code in this thing for about six months now, so I had no idea how much work was going to be involved. It seems there are some major gaps in my assessment of the situation…

So I had a look through the code, and worked out where I stand, and exactly what I need. Here’s what I have at the moment:

– When the “battlemode” flag is enabled, I start an ATB system, where the turns of players are queued up.
– Each action has a name. On a player’s turn, the action associated with the hero’s name is automatically called. (e.g. on Squall’s turn, the action “Squall” is called automatically.)

Each action has a type, with a couple of variables – “size”, “cost”, and a generic array called “link”. The current implemented types are:

LIST
Default for selections. Specifify “size” as the number of elements, link[0], link[1] etc are the actions to call (by name).

HERO_LIST
As list, except the hero’s name is shoved in front of it, so that when player1 selects “Attack” and player2 selects “Attack”, they do different things, because the engine acts like you’ve selected “Player1_Attack”.

SKILL_LIST
As list, except you also specify a “cost” for each link, and this is displayed beside the action, along with the SP.

ACT
So far, this doesn’t really do anything. It calls a routine which processes a basic script that’s coded into the links of the action. This scripting language supports the following commands, so far:
end” – destorys all textboxes, and continues with the ATB.
damage” – so far, it adds “floating” damage to the caster, displaying the floating text with it.
wait” – waits a given number of frames
link” – runs the next action in the queue.

To clarify, here’s how that structure currently looks with the variables hardcoded into the engine:


void init_stats(characterclass *heros, characterclass *enemies, actions *action){
  //This is a temporary routine - eventually, everything will be inputted
  //externally.
  
  heros[0].name = "Remy";
  heros[0].strength = 14;  heros[0].defence = 10;
  heros[0].intelligence = 27;  heros[0].speed = 15;
  heros[0].limit = 0;  heros[0].time = 0;
  heros[0].hp = 9999; heros[0].maxhp=9999;
  heros[0].sp = 30; heros[0].maxsp=30;
  heros[0].action = heros[0].name+"_default";
  
  //Every inital action will have to be a list - unless the character is
  //beserked or fighting with the enemy or something.
  numactions=7;
  action[0].name="Remy_default";
  action[0].type=HERO_LIST;
  action[0].size=3;
  action[0].link[0]="Attack";
  action[0].link[1]="Skills";
  action[0].link[2]="Item";
  
  action[3].name="Remy_Attack";
  action[3].type=ACT;
  action[3].size=3;
  action[3].link[0]="damage";
  action[3].link[1]="120";
  action[3].link[2]="end";
  
  action[4].name="Remy_Skills";
  action[4].type=SKILL_LIST;
  action[4].size=10;
  action[4].link[0]="Skills"; 
  action[4].link[1]="Smash"; action[4].cost[1] = 30;
  action[4].link[2]="Hyper"; action[4].cost[2] = 25;
  action[4].link[3]="Trip"; action[4].cost[3] = 20;
  action[4].link[4]="Bomb"; action[4].cost[4] = 15;
  action[4].link[5]="Double"; action[4].cost[5] = 10;
  action[4].link[6]="Refresh"; action[4].cost[6] = 15;
  action[4].link[7]="Protect"; action[4].cost[7] = 20;
  action[4].link[8]="Meditate"; action[4].cost[8] = 20;
  action[4].link[9]="Focus"; action[4].cost[9] = 10;
}      
   

So… I guess this is where I need to go from here:

– Add more actions and list types (e.g. Inventory support, Limit breaks).
– Expand the ACT action to do something more useful, i.e.
* draw battle animations, (need to think about this one)
* deal actual damage
* turn status effects on and off
* trigger sound effects
– After that, I need to add enemies to the mix
– Then, mortality. What happens when everyone dies? What happens if you kill all the enemies?
– Leveling up, I guess, is next. Should probably be handled in a generic way, i.e. all enemies carry a certain about of stuff, including XP points.
– When I get that far, the next step is to have the heros walk about, get into a fight, finish the fight, and walk on. when I’ve done that, the basics of the battle engine will be complete.

I’ve also been reading up on A* Pathfinding. I’m pretty sure I understand how it works, but it’s going to take me a few days on top of the battle engine to implement… I think it’s a good idea to implement it, as it’ll make a lot of things down the line much simpler – but I couldn’t help nagging myself while reading about it. I should really be making a game, not coding an engine.

0 Comments

Evidently I have better things to do with my November

Well, for what it’s worth, I decided to work on that third game.

The whole “make a game in a month” thing didn’t work out. There’s no point to going into my excuses as to why, even though I’ve got some good ones.

Here’s where I stand: I’m still working on this shorter game, and I’m using what I’ve done of the distraction RPG engine to put it together, but it doesn’t have all the features I need yet. Therefore, over the next few weeks, I need to add the following new features to the engine:

  • Finish the battle engine: So far the battle engine has some basic features, and menu support is finished, but it still lacks a number of crucial features – proper battle scripting, event animation, and ability to modify status (e.g. reduce health, trigger a “poison” effect, and so on). Once I’ve got all the things I need, I guess the next step would be to put together some working battles that can be fought from start to finish. At the moment, you just hit F1 and that brings up the battle menu.

  • Pathfinding: This is something that I was planning to add anyway, but since the new game is mostly a strategy game, it’s more of a priority. I had been looking into A* pathfinding for a while now anyway.

  • Catapillar Parties: This simply means that the other party members follow the main character around (rather than in most old RPGs, where the main character represented the whole party). It’s sorta required because of the way I intend to implement combat. This is actually relatively tricky to do properly in a pixel by pixel sense – the simplest way to do it would be to keep a history of the main character’s movements, and have the other party members copy those movements until they collided with the main character… though that leads to some problems with collision of other NPCs. A better solution is to use pathfinding, and have the other party members work out their own paths to the hero. Of course, that may also lead to problems if the other party members get stuck… So I’m not sure what to do. I’m open to suggestions for solutions here.

  • Cutscene Engine: I’ll need to implement a proper cutscene engine to handle events in the new game. This shouldn’t be that big a deal, since the scripting engine is already pretty versatile.

  • That’s it. After that, I’ll need to start adding a few features that are unique to the new game, so I can just start a fork on the old source code and start adding new features from there:

  • Space Exploration: I’ll need to add a completely new field mode for traveling between planets. This shouldn’t be a big deal, since the engine is designed to easily switch between states. My basic idea is to set up a simple starfield and have the player fly about in it.

  • …huh. I think that’s actually all I’ll need to do. If I get it that far, I should have an engine that’s fit to run my game. All that’s left to do is, you know, make it.

    7 Comments

    Looks like Kya ha ha ha and Gya ha ha ha are up to something again.

    A quick primer for those who haven’t heard of NaNoWriMo : it’s an annual endeavour that thousands of people from around the world undertake – to write a 50,000 word novel from start to finish, in November of each year. There are chapters worldwide, in particular, there’s one in Dublin that meets every week. I’m not taking part, exactly – I’m using this month to make a game. Though to be fair, the NaNoWriMo rules are pretty clear on this restriction : If you believe you’re writing a novel, we believe you’re writing a novel too.

    I suppose there’s no reason why I need the writing competition to inspire me – but I’m so tired of the same old stuff I’ve been working on. I want to do something new, something a little quirky and pointless. Something that doesn’t take itself so damn seriously. And this seems like as good a time as any to do it.

    The thing is, I still haven’t decided on exactly what kind of game I want to make yet – I have narrowed it down to three, though.

    Game 1:
    This one’s a little silly, but I can’t bring myself to let go of the idea.

    Basically, it’s a character based puzzle game. You’ve got 5 characters stuck in some sort of difficult situation, and they can all do different things, like one guy can knock down walls, and another can jump over large holes, and so on. They have to work together to progress with the game. Pretty simple, really. I envision something along the lines of a multiplayer Lufia II, where you switch between the five turn by turn.

    Here’s the weird bit – they’re all chess pieces. The rook is the one knocking over walls, the knight is jumping over holes, the queen is doing pretty much everything, with the objective of each level being to get the feeble old king to safety. And it lends itself pretty well to some decent characters – the queen could be some kinda terrifying golddigger, bossing all the other pieces around, the king some bubbling old fool who hides behind the rook at the first sign of trouble…

    There’s something to be said in defense of this idea, and I’m not altogether certain what it is. I mean, it could be absolutely atrocious – it’s kind of a silly idea to begin with, and it would need to be put together with a lot of care in order to have any merit. Or it could just end up being really boring. I don’t know.

    There’s a lot I like about it though. It’s simple. It’s very easy to put together and design levels for, it’s the sorta thing I can realistically work on with a piece of paper during my morning commute. And of all the game ideas I’m considering, it would probably be the most fun.

    Technically, there are a few challenges to overcome here. Putting together some good enemy AI, for example, is bound to be pretty tricky. But I still think there’s a good chance that I’d have this one done in a month.

    Game 2:
    This is probably the most serious of my ideas, and unlike the others, I don’t really know what to compare it too. So no screenshot then. Bah.

    A couple of weeks ago, I was chatting with a friend about Alan Turing (as you do). During the course of the conversation, he reminded me of a fairly obscure historical character, Marian Rejewski. Before World War II had even started, Rejewski had cracked the famous German cipher Enigma. He spent the rest of the war being evacuated from country to country as they fell to Germany, first to Romania, then to France, then to Vincy France, and finally to Britain, were he worked on comparatively trivial ciphers until the end of the war. Apparently, the Mathematicians in Bletchley Park didn’t even know about him.

    I don’t know what most people think when they hear this story, but here’s what I think : that would make a great computer game.

    Here’s the basic idea – you’re a regular person in a minor European country at the beginning of WWII, say Poland or Austria or Ireland or Greece or something. Before the game starts, a sequence of events is predetermined for the coming six years – say instead of invading Poland, Hitler decides to sucker punch France before it can prepare and takes over west Europe instead of east. Only now, the Soviets have had plenty of time to prepare and just stroll right into Berlin. Or instead of getting greedy and invading the USSR, Hitler just takes a few central countries and then consolidates his power, so that the war doesn’t even really begin and all counterattacks fail. Whatever way things turn out, the idea is that you, as a citizen of somewhere in the middle, won’t have a clue what to expect.

    And what do you actually do in the game? That’s up to you. You can partake in the war effort, if you want, join a resistance movement and fight against the invading forces. Or you can flee – sneak your way out to safety and live out the war making bullet casings in a London factory…

    Oh, ok, I haven’t a clue yet. But I think there’s a cool game here, if I could only visualise it properly… I’ve got no idea how long this would take, really – I suppose it depends on the scale I go with.

    Game 3:
    I think this is the most likely course of action – unfortunately, it’s the most traditional game of the three. It’s an game I’ve been thinking about for a couple of months now – an adventure game set in space.

    You start on a dying little planet that has just discovered faster-than-light travel, and sends a crew out to explore the universe. It’s a pretty open-ended RPG will no real objective, just to explore and discover new things, meet new civilisations, that sorta thing. I guess you could compare it to Sid Meier’s “Pirates”. Only in space. Space Pirates, if you will.


    Isn’t google images wonderful?

    Over the past few months, I’ve had a lot of specific ideas about how the game mechanics would play out – how battles would work, how communication with aliens would work, how the game would look and play – and that’s sorta why I’m leaning towards this one. I know exactly how the game would play, but I’ve got no idea what it’s about. And seeing as I’m supposed to be doing all this as a writing exercise, I can think of no better approach than to make it all up as I go along.

    Don’t get me wrong, I want the game to be plot driven – I just think it might be fun to write something that isn’t character driven. I really like the idea that I could just have a basic game in place, and then start adding unrelated random planets and quests as they come to me.

    That’s it, I guess. Right now I’m leaning towards game three, but yesterday I was sure I was going to go with that second one, and I’d been thinking about how the first one would work all last week!

    I suppose for now it doesn’t matter. All three games are basically RPGs, and I’ve got a little bit of generic engine work to do before I make a decision.

    And now for something completely different – a great article I came across a few days ago. Well worth checking out.

    Top 50 worst Video Game names of all time.

    8 Comments

    I’m a general, not some opera floozy!

    Behold the new website! It’s just like the old one, except there’s a lot less clutter. I’m sorry that it’s been so quiet around here recently.

    My new day job requires me to produce risk reports for stock traders, and it means a lot of spreadsheet work. I’ve gotten very familar with Microsoft Excel over the last few months, so naturally, I got curious as to if it was possible to make a game in Excel.

    Turns out it is!

    Utterly Pointless

    I’ve called it “Utterly Pointless”, because that’s what it is. If you’ve played any of my old games, it might be familiar to you. Pointless, but it was kinda fun putting it together. It’s not an elaborate project – actually, it’s the result of about a month of three-minute-improvements at a time. (It’s not easy to code a game at work…)

    You’ll need Excel to run it, and you’ll have to enable macros to get it to do anything (this may or may not require you to go to “Tools”, “Options”, “Security” and change the macro secruity settings to Medium or Low. The menu may not be available unless you’ve got a worksheet of some kind open, a new blank one will do.)

    The only reason I mention this at all is because it’s all I have to talk about, really. I haven’t done any other coding in the past couple of months. Still, there have been a few minor additions with my RPG engine, and I started keeping a build diary too. They’re hardly worth mentioning, but that’s never stopped me before – so here they are!

    Build 1-14: (Early builds. No concrete information kept.)
    ———–

    Build 15: (consists of minor additions I made with the spare minutes in the run up to my finals)
    ———–

    * (13th March) Z-ordering. NPCs are now sorted first by whether they appear on the given screen segment, and then by y position on the map.
    * (24th March) Made a start at Battle Menu Scripting. At the moment, it works but it’s internal to the engine.
    * (27th March) Fixed a bug that caused characters of the same speed to fall out of sync.
    * (27th March) New Battle Menu type – SKILL_LIST. Like a normal list, only it displays a header and remaining skill points too.
    * (23rd April) Fixed a bug that caused textboxes to be incorrectly destroyed when using the SKILL_LIST type.
    * (23rd April) Added simple differentiation of selected menu item and intended action. An extra list type allows optional appending of hero name to differentiate between actions, and a second list of the menu options is kept to simplify action names (and solve the problem of spacing).
    * (23rd April) Expanded funcionality of actions – each link now has an associated “cost”.

    Build 16: (Same as build 15, after the name change.)
    ———–

    * (28th April) Name reverted to “Project Distraction”.
    * (28th April) Changed control system to the more modern A S Z X system.
    * (28th April) You can now specify a width for textboxes. Skill lists are automatically long enough for skills with long names.

    Two Columned Menu

    * (28th April) Textboxes can now optionally have an extra column, to display associated information (like MP usage, number of items left, etc)
    * (29th April) I’ve made a start on battle scripting itself. Currently, it supports killing the script, and linking to another script.
    * (1st May) Fixed minor bug with targetting, turned off camera movement during battle.

    Build 17: (It’s been so long since I’ve programmed, that I’m starting the new build to differentiate it from the old one.)
    ———–

    * (15th October) I’m sick to death of my old placeholders, so I’m now using FFIV tiles as test tiles.

    Full Battle Screen

    I’m still getting my bearings. It’s been months since I did any serious coding, and I don’t remember how the engine works or anything like that. I’m not even really sure that I want to carry on with my old projects.

    But I do have something in mind. NaNoWriMo. I’ll update with more info tomorrow.

    [first person to identify the quote in the title wins a kudos!]

    3 Comments