Game Development Community

dev|Pro Game Development Curriculum

AFX, Guis and Blacksmiths

by Gareth Fouche · 06/18/2007 (11:18 am) · 4 comments

Life has been busy lately, but game dev work continues, however slowly. A lot of it has been visually unimpressive, such as gui tweaks. I would just like to state, for the record, that I hate guis. Fiddly little buggers, they suck up an inordinate amount of time for the gain.

However, what isn't so bad is that I have finally implemented drag and drop icon based guis! Thanks to the awesome drag and drop button resource which I scavenged from the MMO Kit, my inventory is now a whole lot snazzier. Please ignore the programmer art and the grey background, I haven't got round to proper art for that yet. Marvel at my awesome paper doll picture :P

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_075-00001.jpg
What I have got round to is making a (spell)book in photoshop. I love that program :

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_075-00002.jpg
You will also notice the quickbar in those shots. One of the cooler new pieces of functionality is the quickbar, which works as you expect. You can drop items, spells, abilities etc into it, and if you press the appropriate number key it will perform an appropriate action, such as equip a weapon, use an item or set a spell as the "Current Spell". All the use needs to do is drag and drop an icon into it. A lot of work to get something which, when done right, the user will never even think about. Most of gui creation is like that.

Of more interest is my abilities system. You might have been following these blogs, and read about how I seperated out the graphics and the logic of effects, putting ArcaneFX in charge of the graphical side of things, and my own database driven scripts on the logic side? Well, that has been extended into the RPGAbilities system, abilities covering special attacks, spells, whatever.

Basically, when you use an ability, the script checks the DB and looks for a AFX spell to associate with that ability. This AFX spell is sort of a delivery system. It does nothing but graphics, but when it "hits" a target, it uses AFXs ability to perform script calls to pass the impacted object into my RPGAbility scripts. These in turn check the database, and based on settings there perform any number of actions on the impacted object (and potentially anything in an area around the impacted object). This can include applying RPGEffects to the target, which in turn create AFXEffects on them. It's probably best understood with an example.

Lets say you have a snowball spell, an ice based version of a fireball. You cast it. The DB is checked, and determines creates the associated AFX spell, called afx_snowball. This flies at its target, and explodes in a burst of blue particles. Now, that is just graphical, nothing has happened yet. When the AFX spell impacts, it calls back into script with the name of the RPG effect that created it, namely snowball. The DB is checked, and it is determined that snowball does 10 cold damage + 1 per level of the casters evocation skill to everything in a 10 foot range of the impact point. The script has pointers to the caster, so it looks up his skills, does the calc and applies to the damage to creatures in the area, using a simple radius search. Additionally, the DB specifies that snowball applies a penalty effect to creatures agility, as they are frostbitten. This effect lasts for 1 minute per level of the caster. So, RPG Effects are created which are applied to creatures in the area, reducing their agility. As explained in my last post, each RPG Effect creates a visual AFX Effect, which handles the graphical side of things. These RPG Effects control the lifespan of the AFX Effects, which is what allows me to easily vary the lifetime based on the caster level.


Its a powerful system, if a little complex. Here is a diagram depicting the structure :

i99.photobucket.com/albums/l300/nakedninja_2006/RPGAbility_diagram.jpg
And, of more interest, here are some pics of the effects in action :

Flame Aura burns enemies nearby (notice the orc holding his side in pain? Thanks Motion Pack!) :

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_065-00006.jpg

Firing magic missiles :

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_073-00002.jpg

Blink (a short range teleport, almost exactly like the mage spell in WoW, thanks to Jeff Faust for the code snippet ;) )

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_073-00016.jpg

On the modelling side, I've been a bit busy with code to do much, but now that I've got some time, I've been playing with the awesome CTor 1.02. Such a great app. Heres my latest creation, a smithy :



i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_081-00003.jpg
i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_081-00007.jpg
The anvil and sign post I modelled in max :

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_081-00010.jpg
The interior still needs some work :

i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_082-00001.jpg
i99.photobucket.com/albums/l300/nakedninja_2006/screenshot_082-00004.jpg


Anyway, till next time....

#1
06/18/2007 (11:23 am)
wow dude.. its looking great!!! You've been making some good progress there.
#2
06/18/2007 (2:50 pm)
This looks like some pretty sweet work!
#3
06/18/2007 (3:42 pm)
Nice screenies Gareth, Keep up the good work! :)
#4
08/10/2007 (6:07 pm)
nice work, nice indeed