Combat

March 10, 2008 on 12:26 pm | In Combat, Game System | No Comments

I’ve tried this, and it works reasonably OK.  Basically combat works on a combat queue & ‘tick’ system.  A player stacks up the actions they wish to take in their combat queue.  The queue has a number of available ’slots’ in it.

Each action takes a pre-defined length of time in ticks and some have a ‘reuse time’ before they can be reused (again in ticks).  The player clicks on any action they have available and it gets added to the combat queue.  Once there it can’t be removed (tough).

Now there are a couple of different flavours of this system.  The first and easiest to code, is that you only have a few slots of queue available, but a slot can take *any* action, and time.  So you could have 3 slots and have one action that takes 3 ticks, one that takes 2 and one that takes 4, so a total of 9 ticks worth of combat.  The other flavour and slightly more difficult to do, is that the combat queue is larger, but each slot is a single tick.  So if you had 8 slots, the sequence of events above wouldn’t fit in until 1 tick had passed.  The second method is actually easier to understand, although we could remedy that by adding the information about times to the first method (could be that the bar fills up left to right based on the total time).  Thinking about it, I think that the first option is probably the better.  Its less demanding on the client’s computer for a start, but also having the slot fill up will actually be more visually informative than lots of slots.

An action has a number of elements: onset time, total time and reuse time.  The onset time represents the amount of time before an action happens (think charging up a fireball).  The total time is the number of ticks that this skill requires (think charging up a fireball, shooting it and then waiting a bit until your vision clears).  Finally the reuse time, is the amount of time you have to wait until you can use that skill again.  Overall it sounds really complex, but in reality its pretty straight forward.  Additionally by seeing information in hard numbers the human brain can comprehend them more easily.

Now each tick is roughly 2 seconds.  More if there is lag, as the system waits until it receives a response from the server before counting down those 2 seconds (there is a timeout option as well to prevent people trying to hack).  Now 2 seconds is actually quite a long time, so weapon attacks and actions may make multiple ’strikes’ within each attack.  Take a sword for example.  I would say that you can swing an averge blade once every second, more if its lighter.  So a regular attack from a sword would have a time per action (1), damage per strike (3-4) and a strikes per action (2), so you ought to have 6~8 damage from that one attack (obviously each has a chance to miss/crit etc).  Now a ‘gigantic’ attack might go time per action(2), damage per strike (+400%), strikes per action (1).  So this ought to cause the same damage as 2 regular attacks, but as its a special attack will likely have an increased chance to cause a special effect (like a stun).  Its going to be one of those things that will need lots of testing, but probably the best way of tackling it.

As with all of W2, all actions are passed to the server to complete, the fancy javascript UI is purely client side and every action is validated by the server.  Amusingly what this means is that somebody could technically unlock a skill before its reuse time, and thus add it to the queue before they should be able to.  In reality this actually just delay’s the next action in the queue :)

Well thats the basics of the combat system in a very small nutshell.  Hopefully keeping everything simple and the interface straightforward will ensure that the game runs smoothly.  Although 2 seconds is a long time, especially when waiting for an ability that takes a while to use, it is quite fast when you’re using 1 tick actions.  I may also put in a control that compensates to a lesser extent on if you get big lag spikes.  Its not uncommon to see lag of 250ms when on the internet (time it takes to send and receive a reponse from the server), which makes a tick 2.25 seconds.  If I were to time this, then I could make the tick delay 1.75 seconds to compensate for the 250ms lag.  If I were able to get the server to decide on the amount of time to pause, this would make life easier, as its going to be fairly difficult to intercept for hackers.

Classes and Stuff

March 10, 2008 on 11:09 am | In Classes, Game System | No Comments

Currently I want to implement a pretty unique class based levelling system for W2.  I want to maintain a Feral feel to the whole game, so don’t want to use a regular warrior/mage/rogue type of class system.  That said, I do want magic (Magik) to exist in some form or other within the game.  I personally dislike regular levelling systems where you grind so much XP to gain a level and a skill point and/or stat points.  Having said that, creatures will require some kind of level in order to know what they should be fighting and how far they’ve progressed.

Anyway, levelling is for another post.  When it comes to classes, I am currently veering down the following thought line.  Each creture falls broadly into one of four categories.  Either a Fighter, Caster or Hyrbid (i.e. fighter with casting skills and the other way around).  As a creature battles they will fight in a particular manner, which will result in them going down a specific specialisation class (i.e. a sub-class, but not in a minor way).  This means that if a player wishes to end up with, say a Beserker, then they must play in that style from day one.  I’m currently tempted to make all starting creatures the same in terms of class, so they might all be able to fight with a sword and cast a small fireball initially, but once they gain their first level, they loose unused skills.  Hybrids would be difficult to begin with as you’d need to keep the Magik and Melee damage within sight of each other.

This would work relativly simply, by watching the amount of damage caused by a creature via their starting skills.  This could actually be quite straight forward, if all creatures start at level 0, then they could have a quest to kill 10 rats (i.e. the obligatory rat killing quest).  When the quest gets handed in, they get told ‘you are following the way of the <whatever>’ and then all their starting skills get replaced.  So a Hybrid would get a spell to imbue their sword to do magikal damage, Fighter would get a low powered melee attack and Caster would get a new magic missle.

Currently I’m thinking along the lines of the following Specialist classes:

  • Blademaster/Gladiator – Weapon specialist, low armour, but high avoidance
  • Beserker – Very high ‘in your face’ damage, but low defence
  • Knight(?) – Fighter with magical skills
  • Exemplar – Has self buffs and opponent debuffs
  • Elementalist – Fire & Water caster
  • Voodoo – Life & Death caster – heavy on debuffing and dot
  • Arcanist – Lightening caster
  • Spirit Walker – Ethereal damage
  • Pyremaster – Fire & Death caster

Ok, ok, I have too many casters and not enough melee :)

Welcome

March 10, 2008 on 10:29 am | In Messages | No Comments

Welcome to the official Blog of theWulfen. This blog will be used to record the progress I am making on the new theWulfen game (W2). Its going to be a combination of ‘work done sofar’ and a sounding board for ideas.

Feel free to post comments, but please be aware that they will require approval before they appear on the site.  I’ve learned that mistake the hard way before now…

Entries and comments feeds. Valid XHTML and CSS. ^Top^ Powered by WordPress with jd-nebula-3c theme design by John Doe.