Aug 08
Reapplying the Decal
A while ago, I avidly played a MMORPG called Asheron’s Call, from Turbine Games. Indeed, so great a fan was I that I collaborated with a group of others in the creation and maintenance of what is still one of the most advanced “third party” systems for any game. Consisting of custom network, GUI, input and management APIs, it integrated so perfectly into the AC client that it’s indistinguishable from the ingame system. It became very popular, and is called Decal.
Recently, AC released a new expansion pack, “Throne of Destiny”, in which Turbine significantly reworked the client. Well, our wonderful integration is no longer quite so perfect. In fact, it’s entirely broken. So, along with much of the same crew as before, we return to stick that Decal back onto AC, that it might continue to provide useful tools without (we hope) allowing a great deal of evil.
As I’ve just returned from a fortnight of moor walking, I figured I’d jump in with something I’m reasonably familiar with – the actual display of the GUI components. As this article is targeted at people who might not be programmers, I’ll quickly go over the concepts you’ll need to understand. Experienced folk can ignore this bit, and I ask their forgiveness for my (over) simplifications.
When you play Asheron’s Call, you’re sitting in front of a computer. This might sound obvious, but at the end of the day, computers are incredibly stupid. All they can do it go through a huge list of instructions, stepping from one to the next, adding a number, moving it around in memory, and little more. As you can imagine, with such limited capacity, it takes a lot of these instructions to get anything done. Millions, in fact. Hundreds of millions.
As humans, we find that very hard to deal with. After all, when I want to write down “Hello” onto a piece of paper, I don’t create a huge list of instructions telling me how to move my hand one millimetre at a time – I just do it! So, we make it easier to program our computers by writing languages that help us express what we want to do more clearly.
A popular method of doing this is via “object oriented languages”. These languages let us talk to the computer in terms we can more easily deal with. Rather than a big list of instructions, we can say “Take this “Hello” object and “Draw” it onto this “Paper” object”. The people who programmed the “Paper” object have already dealt with the drawing instructions for us, making our job much clearer, so we can get things done!
In Decal, we deal with a lot of objects. There are objects representing plugins, controls on the screen, events from the game and many others. When we’ve finished creating all these objects, we “compile” our objects back into these huge lists of instructions that we can send to you, the player.
We also deal with some objects we didn’t write, some that are provided by Turbine. This is the task of finding the fabled “memlocs”. Turbine wrote lots of objects of their own, and compiled them into Asheron’s Call. We can’t see them, as all we have are the big instruction lists. When finding the “memory locations”, we go through these lists, and work out which chunks of it belong to which object. We can then note them down and use them just like Turbine did.
Right, back to the problem. When the new client was released, one of the major changes was the graphics update. To facilitate this, a change was made, from DirectX 6 (a set of objects that deal with graphics and multimedia) to DirectX 9. Our original code worked with DirectX 6, and it doesn’t much like Direct X 9.
So, what’s first? Well, lets explain how Decal gets from our hearts to your screen in the first place. When you run Decal, it sets up “hooks” into your system that sit and watching what you run. They don’t do anything until they see AC start up, when they suddenly spring to life, and step in. “Excuse me, AC”, they say, “I’ll just stop you for a second”. Before the poor game knows what’s happened, BAM, it’s over! We’ve been inside it, and looked around. We find the objects that it’s creating (in this case, the graphics objects), and we replace them with some of our own.
Our fake objects are so perfect that when AC wakes up, it doesn’t know what’s happened. It carries merrily on, using our new objects when it would have used its own. Except that the new objects are secretly reporting everything to us, so we know what’s happening. When the graphics object reports to us that it’s drawing your screen, we wait until it’s done, and again step in at the last moment. It’s in this period that we can draw onto your screen. This is the code that was broken when they upgraded the graphics engine.
So, how do we fix this? Well, the first thing we need is some new fake objects, ones that’ll work with DirectX 9. They’re easy to create, and after that’s done (more by Hazridi before I came back), we end up with an AC that we can draw on again. To prove these new objects work, we’ll draw a test.
Great, we can draw inside AC again. Next up, we need to start putting in the original graphics. We’ll hook up our old GUI objects with our new drawing object, and we get…

Hmmm. That text looks suspicious. What’s going on here!? Well, after poking around, it turns out that our new fake objects are not quite so indistinguishable from the real ones anymore. When we sneak in and try and draw, the objects AC created are fighting back! DirectX 9 does not allow a lot of what DirectX 6 does, and as such, our old techniques are not quite so effective. So, let’s sit back, take stock, and examine the options.
In our corner, we have a set of graphics designed for drawing onto an object that no longer exists. In fact, all plugins are likely to be using a similar system to us. That means we can’t just change our code and walk on – all the plugins will break! We need to find a solution that will keep everyone happy. After some thought, three options come to mind…
- We could stop using the objects, and do everything ourselves
- We could try and update half our code so that it integrates better with the new system. Perhaps rather than drawing right onto the screen, we could create a 3D model and draw onto that?
- We could blackmail the original objects into letting us do what we want
As with all such choices, there are no right or wrong answers. All our options are equally plausible, so we’ll have to try them all.
[Sound of keyboard]
OK! After option 1, we have a problem. By bypassing the way that we’re “meant” to work, we have massively slowed the system down. You see, if we refuse to use the objects we’re given, we have to manually look at all the images and decide what to paint, and where. But your system doesn’t like this – it hates people looking at images that have already been created. As such, everything slows down to a crawl (in fact, only 1 frame per second). So, option 1 in a failure, and 100 lines of code vanish into the recycle bin.
Option 2! This one sounds fun, it has 3D in the title! After clattering away for a while, option 2 does work, but has a similar problem to option 1. In converting our old style image to a new style 3D object, we have to do a lot of work every frame. Decal redraws itself all the time (as do plugin HUDS), so we have to constantly convert between what we already can do, and what we need for the new client. End result, 1 frame per second again. Sigh. 150 lines down the tube.
So, option 3 it is. Now, being honest, most of the performance problems from options 1 and 2 have been in preserving what we call the “colour key”. When Decal draws onto your screen, it keeps a special colour as “transparent”, so then when plugins appear on your screen, this colour disappears and you can see the game underneath. Old versions of the DirectX did this for us, but the ability is largely gone from DirectX 9. Options 1 and 2 ended up having to create big copies of the screen, and draw onto them, them put them back onto the game again, obeying this colour key.
But, if we manage to persuade AC that we can draw right onto it again, we’ve solved most of our problems – we don’t have to deal with big copies! After some fiddling, it turns out that the back buffer (the bit that it actually drawn onto by AC every frame) is almost right for what we want. So, we use our fake objects to force AC to create a back buffer that’s right for us. It’s still good enough for AC not to notice, and it lets us work our magic. Hence, our end result.

Those of you with good vision will notice some lurid turquoise in that image. That’s the colour key inside the plugin windows – our option 3 doesn’t quite solve that. So, tune in another day, and you might find part deux, whereby hideous colours are banished forever!
Oh, and for those of you interested, the end solution was 2 lines. Yes, 0.7% of the code written for this project. So, when reading programs, remember – for every line of code you see, there are at least 10 dead lines lying somewhere by the roadside. Salute these dead lines, and remember, they died in the cause of good software.
Adam Wright (As Asriel)
PS – There are several other people working on bringing Decal back to you. In truth, what I’ve done here is a minor part of a much larger operation.
PPS – A study in software creation will resume soon!
Disclaimer - This is “code in progress” and may not reflect actual code delivered to the end product. So if it still takes another month to finish, don’t blame us.


August 9th, 2005 at 1:18 am
My comment is simple. I am one of the player of old who remembers playing without decal in the beginning. I am an believer and user of decal. I love what it has brought to the game. I am very impressed that you took the time to do this write up and explain whats going on. Like most I miss decal very much however I know all the hard work you guys put into it each and every month and have trust and faith in your skills to know eventually it will be back up.
Thanks you from Madgic Clan on Harvestgain.!!!!!!!!!!!!!!
August 9th, 2005 at 1:18 am
Great Article, wish I could study the code!
August 9th, 2005 at 1:45 am
Great read. That is the best update of Decal I’ve seen.
/tips hat.
I just wonder what this line means … “So, along with much of the same crew as before, we return to stick that Decal back onto AC, that it might continue to provide useful tools without (we hope) allowing a great deal of evil.”
Would I be correct in assuming that you want (or plan) the new Decal to not allow programs like ElTank to work?
August 9th, 2005 at 2:12 am
Thank you for the explaination for those that don’t understand
what makeing a program work means. For them I’m sure it helps as
they wait for your rewarded work to be finished. I’m an old ac
player my self, but do to heath issues I now use Decal and a few
other plug ins to make my play easier.
I would also like to say Thank you very much for the program as
I am still playing because of all your Dev’s work….
Locke Cd Webb
August 9th, 2005 at 2:33 am
That was great. Please keep publishing stuff like this.
August 9th, 2005 at 3:53 am
Even as a fellow developer (and returning AC player), I found this blog incredibly interesting
Thanks for all your hard work, and for sharing your experiences with us!
August 9th, 2005 at 6:12 am
Thank you so much, this is by far the absolute best update I have read to this situation. It is with great admiration that I say bravo! The AC community reall needed something like this, not only to show us the technical bits and the progress, but it adds a human side to the whole thing. The posts on AC Vault where just getting out of hand (mine included). So again, let me thank you for your hard work, and great write-up!
Very nice!
Bowdiddly HG
August 9th, 2005 at 7:36 am
Decal is a hack. You are a disgusting hacker. You enable cheaters and destroy the game. I hope you fail this time.
August 9th, 2005 at 1:13 pm
Thanks for the kind words, those that left them. I’ll probably write up something similar again today.
As to Sweet Mary, well, I won’t delete your comment. You’re entitled to your opinion, but you should know that, yes, Decal *is* a hack. But a hack is not a bad thing - a hack is just using or modifying a system in a way that renders it somewhat different to its origin. I think you’re looking for the word “crack”, which has all the evil connotations you want.
I will state, most strongly, that I significantly disagree with some of what Decal has been used for. I personally distain combat macroing, even in the attended form, and believe it’s been detrimental to the game.
However, the fact of the matter is that Decal is used for a lot more than combat macroing. There are plugins to assist the disabled, plugins to manage your chat, plugins to manage your inventory – standard features in other MMORPGs that Asheron’s Call doesn’t have (mainly for budgetary reasons). The only way all of these features will realistically appear is via something like Decal, and in this way, it is a good thing.
So, we could stop updating it, and within 20 minutes, the combat macros will be back on another platform. But these other platforms can’t provide the UI features of Decal, things not needed for the macroers, but that are needed for the useful plugins. As such, if we choose to stop, we basically kill the useful, “good” plugins, and allow the combat macros to continue. This doesn’t seem like a good idea.
You’re certainly passionate about your cause, so let’s try and channel your passion into something more useful. Feel free to try and PRIVMSG me as Asriel on irc.sorcery.net (or email me), and we can discuss how we can actually work together to get rid of the “bad” without loosing what I’m sure you can’t argue is “good”.
adamw
August 9th, 2005 at 1:19 pm
Oh, and to Arch Magi, whilst I (and the other devs) would like to find some technical solution to the combat macroing problem, we’ve yet to find a useful technqiue. I’m sure we’ll keep looking, and if we can find something that effectively stops the bad without destroying the good, you can expect to see it implemented. We’ve always been committed to following (and in places, exceeding) the CoC.
August 9th, 2005 at 3:45 pm
Greetings. It is with great appreciation that I also add that if it were not for Decal and the many plugins, due to the discomfort associated with carpal tunnel, I would have stopped playing or at least decreased the frequency of logins to enjoy time with my online friends and a wonderful way to recreate. I had quit for a year and came back with a completely new view on the whole ‘decal issue.’
I have to admit, that years ago, I was a “purist” in my views of playing a game. However, I did not take the over zealous approach as Sweet Mary has. To each his/her own. If life were as black and white as Mary would profess, and everyone creating the tools that enable many to enjoy a game that would otherwise be unable to join and contribute to this fine online community were unable or stopped, people like Mary would realize (too late, unfortunately) the adverse impact on Turbine and Dereth. Remember that you cant be sure who is on the other side of the screen of that toon you suspect is using decal, macroing or running scripts. As well, you may be hunting with someone who is 75% automated to enable them to simply navigate the game while contributing to the conversation and the experience of the game 100%. I had the opportunity to hunt and befriend an individual with the use of one hand and limited mobility. For 8 months I hadnt a clue he was handicapped due to your “hacks”. So hack on, sirs. You are not only exercising your skills and thumbing your noses at zealots like Mary, but you are helping a portion of the online community that are eagerly anticipating the fruits of your labor.
*raise glass*
Eno
August 9th, 2005 at 4:17 pm
Adam ,
Thank you for you time and understanding A+ for yoir intricate wording and AAAAAA+ for knowing how to deal with purist wannabe closet case decal users
August 9th, 2005 at 5:28 pm
Thanks for the write-up. For us non-programmers it was most informative. My hat is off to all the developers, both Decal and plug-ins alike. While I too am no fan of UCM capability, the convenience the vast majority of plug-ins offer is tremendous. Setting up buffing profiles, scanning corpses or vendors for specific items of interest or making quantities of potions, rations, arrows and the like using a macro takes much of the tedium out of the game and makes it all the more playable. AC is a great pasttime. Thanks for your contributions to the AC gaming community!
August 9th, 2005 at 5:44 pm
I thought I would miss decal with ToD. I even thought I wouldn’t play as much but I’ve come to realize that now i’m playing AC again. I’m buffing, paying attention to whats vulned. At this point i’d rather see Decal never come back so none of us ever have to deal with the macroers again. Decal is great and all the hard work that has been put into is more than I can probably imagine but it’d be nice if AC was once again a game you had to play and think with not just turn eltank on and go watch TV. So I say thank you to the decal dev’s and I hope you can never fully get decal working again for the sake of gaming!
August 9th, 2005 at 6:14 pm
[...] Decal: Part 2 Filed under: Programming, Code — Adam Wright @ 6:14 pm Well, yesterdays article seems to have gone down quite well. So, as promised, here’ [...]
August 9th, 2005 at 7:26 pm
Thanks for insightfull well written article. Most of the decal developers have gone to doing nothing but snide remarks instead of productive work. I,m disabled and decal allowed me to play a mage. I can,t now, but raither than talk to them i would the whole game would die.I won,t say names, but i hope they all become disabled.That would change there outlook.
August 9th, 2005 at 8:26 pm
Thank you so much for this article and all your hard work
I am one who does not macro yet uses many other assistant plugins, and I appreciate your kindness in commenting to Sweet Mary, something I myself may not have been able to do in the heat of the moment:/ Swet Mary, play on! And remember, we do not truly compete with each other (except maybe an extreme few) so maybe there is room for more than one style of play 
August 10th, 2005 at 1:42 am
Great articles (this and part 2). All your hard work is very appreciated as trying to play ToD without Decal has lost some of the soul of the game. I miss the tradebots, and buffbots. I miss RoboChef. And of course I miss any plug-in that helps me find loot and salvage quickly.
Also ignore SweetMary - I know people that have caught her macroing.
August 10th, 2005 at 7:02 am
Hacker
“One who uses programming skills to gain illegal access to a computer network or file.”
“A programmer who breaks into computer systems in order to steal or change or destroy information as a form of cyber-terrorism.”
“A malicious meddler who tries to discover sensitive information by poking around.”
I used to believe some plug-ins are good and some are bad. Not anymore. That’s because I have seen beyond AC (AC was the first online game I played). I have seen that the gaming community at large considers any 3rd Party program to be a cheat. There’s no question about it… they are straight up cheating. Allow any and you have a big problem. You can’t draw a line and say where the good ones end and the bad ones start. By allowing any, you have a grey area that cannot be resolved.
If you insist in continuing to support cheaters, at least prevent access to combat features, and access to the things that destroy DT.
Saying others will find a way and combat macro anyhow is a pathetic excuse. It’s like saying, “Others rob banks and kill people, so since that’s going on, we feel fine robbing banks as long as we don’t kill people.”
Right your wrong. Let Decal die.
August 10th, 2005 at 12:55 pm
I’ve said it before, Sweet Mary go walk infront of a bus.
August 10th, 2005 at 1:53 pm
Again thanks for the kind words. To reply to Sweet Mary, though I suppose you are correct in the dictionary sense, the word has been hijacked by the popular media - the definition I use (and most programmers will use) is basically what http://teladesign.com/ma-thesis/glossary.html has (though “breathtaking technical and creative proficiency” might be stretching it a tad).
You claim that most of the community at large thinks 3rd party applications are a cheat. Well, one can never sample an entire population and get the correct answer for all minorities within it - the “tyranny of the majority” causes far more problems than it solves. It does seem clear to me that a great number of AC players want a Decal like application to help paper over the lack of features in the client, things that are unlikely to get implemented by Turbine.
As such, “here’s no question about it… they are straight up cheating” is an opinion, rather than a fact. Whilst I agree we’ve created somewhat of a “grey area”, I still maintain the good has outweighed the bad. Would I work on another Decal like project in, say, World of Warcraft (if such a thing were allowed)? No - because the developers have basically built Decal in for us! Would I in Everquest? No - because it’s prohibited specifically (and Everquest just isn’t fun - we only work on games because we really enjoy them).
Here’s a pledge I can make. If Turbine came out and said “We don’t want Decal”, I would stop development the minute I authenticated the message. If you can persuade them (and they are the only people who can ever finally rule on what is and is not “acceptable”), you’ll have persuaded me. Until then, I and the other developers have to use our judgement, and keep track of the ambient community feeling as best we can. My current feeling is that more want a Decal like application that specifically do not want it, and as such, I’ve done the work I’ve done.
My offer of communication still stands, if you’re interested. I tend to be a bit of a hit and run developer though (jumping project to project), so I’m not sure how much longer I’ll be working on this phase of Decal. Come join the debate – at the very least, it will be entertaining and enlightening for both sides!
August 10th, 2005 at 2:52 pm
[...] be see through anywhere”. This one required a bit of lateral thinking. We know from the first article that we’re now drawing straight onto the AC window – as such, [...]
August 10th, 2005 at 3:29 pm
[...] ocation”. For this to make any sense, we’ll have to dig into how computers work a bit. We already know that computers are stupid – all they can do is follow instruc [...]
August 10th, 2005 at 5:06 pm
Bitter Mary will have as much luck getting a group of people at a BBQ to go vegan as she will coming to a 3rd party development forum and trying to convince them its bad.
August 10th, 2005 at 6:17 pm
To Sweet Mary: Some see only the good and some only the bad (as in your case). Both are blinded by their own tunnel vision and narrow mindedness.
The real qustion is: Does Decal and the associated plug-ins do more good than bad thus providing a greater service to the Asherons Call gaming community. Of course it does!
Like in real life there are those who abuse the system for their own personal gain; like UCMing. Let Turbine enforce the bans against those and let those who use Decal as an incredibly convenient tool enjoy the fruits of a lot of hard working people freely giving to the betterment of our in game experience.
August 10th, 2005 at 6:28 pm
Wonderfully written, Adam. I look forward to reading more of your work.
August 10th, 2005 at 7:56 pm
Sweet Mary !! Now Now be sweet and kind as I know you can
be. We both know your capible of it. Why the bad words?
You should slap your fingers for leaving that post!!!!
Locke Cd
August 11th, 2005 at 6:44 am
Great works guys, cant wait for the next version of my favorite self buffing plugin to be released;.
Cheers
Sucamarto
August 11th, 2005 at 7:02 pm
Thanks for the very informative articles. 99.9% of the players out there either greatly appreciate the time you folks put into developing Decal, or they don’t use Decal and don’t get bothered by the fact that others do.
Just a warning: Please don’t feed the trolls. Sweet Mary is a hack in the same sense that John Stewart used to describe the former hosts of Crossfire when he was on the show. In fact, the name Sweet Mary, being associated with vitriolic complaints and vigilantism, could have been entered by anybody. So perhaps Sweet Mary is a hack in more than one sense.
Life’s too special and too short to spend it being bitter about a game. Don’t let yourself get riled up by what is likely either a cesspool of bitterness or a hacker just trying to be a troll by using a moniker made infamous by the bitterness associated with the name.
August 11th, 2005 at 8:58 pm
Grats on a totally excellent article…:)
I really appreciate someone taking the time to explain the complexity of the task.
It’s hard to imagine people complaining about decal considering that everytime someone walked into and interacted with a tradebot…it was decal that was pumping the blood through it’s tradebot heart..:-P
Great work…:)
August 11th, 2005 at 10:31 pm
Great article. Thanks for all of your hard work.
August 12th, 2005 at 12:36 am
Thanks a ton for the informative article… all i can say about the “hack” contraversy is…. washing machines and moving pictures used to be the devil…. i can’t imagine ever going back to scrubbing my clothes on a rock or sitting beside a radio trying to imagine a storyline… but oh well, that’s just me… It is all the same. Technology perserveres and we always try to find ways to make our lives easier and more fulfilling by taking away the tedium in it… “hack” on gentlemen and thanks again for your efforts =)
August 12th, 2005 at 6:43 am
Lolitha, your little speech about progress does not fit for games. Games or sports don’t see “aids” as progress, there’s another name for it… Cheating.
And since AC is the only place that its become acceptable, that’s mostly what’s left of AC… a community of cheaters.
August 12th, 2005 at 12:25 pm
It’s funny how a little statement can make people worry. I’m sure the Decal Devs would have said by now if they were going to intentionally break this plug-in or that one.
Great article, great work both past and present, keep it up and hope to see ya IG sometime.
September 13th, 2005 at 8:32 pm
It’s odd that Sweet Mary continues on her crusade against Decal, while at the same time using Decal to run a “buffbot” for her allegiance.
April 8th, 2008 at 2:24 pm
Thanks for all your work on Decal and the time you have given us in its creation and development. Some are grateful for your efforts and some are not it seems. The majority of us playing use decal and do appreciate what you have done though.
I stumbled in to this site through the Rangers on WE as they have this linked and i was glad and happy to see this. I got back to the very early days of AC in 2000 right after it started and remember how tedious it was with all the mouse clicks and movements you had to make and decal sure helped my wrists with this.
Thank you!
David