Monday, June 30, 2008

Big change almost done and programmer type

It turns out that using dynamically compiled VB.NET code is easier than I thought. Using some nice tutorial, I've been able to quickly rebuild the engine and did some improvement on how the threads are handled. Now the longest part is to convert all the LUA code to .NET, which is almost finished. Beta server should be back online this weekend as planned.


While working on Golemizer, I had to rethink more than one system, figuring out they were too limited or performed too badly (after release I plan to write a post about this).

When I face this kind of situation, it often seems like a huge mountain across my path but mostly end up being quickly resolved. Without sounding full of myself, I'm sometime amazed how "painlessly" I'm able to turn a system upside down to transform it into what I really need.

According to this post from Joe Ludwig, I'm probably of the Workhorse type. In some way, I think I would have never got that far without being of the workhorse type. I've been working on this project for 1 year now (part time, night and weekend) and I'm just about to hit release.

Of course, if you go read that post, you'll see the downside of the workhorse type and I fully admit it. I never considered myself like a "top of the line" coder and my desire to get things done sometimes lead me down to some dark places. In my case, the destination matters most than the path taken. I do "like" coding to some degree but I don't code because I like it. I code because I need it. Creating is what drives me, not programming.

However, knowing my weak side, I also know to be careful. Otherwise, if I mess it up too bad, it will be an hindrance to my first objective, creating. Creating something that doesn't work well ain't any good for me so I try to be careful and try to get away from the keyboard when I'm about to do something silly.

To the Workhorse, add some Explorer too. While I did work on 2 other browser games, Golemizer is a whole different matter. Remember, my background is web site development/business data software so I was miles away from what a (mini) MMORPG requires, though that didn't stopped me to search, learn, try and do.

Once again, that Explorer side is goal driven. No need to get dirty if it doesn't get me what I want. However, if needed, I'll jump in the mud and learn what's needed to get it done.

Some may think applying "tags" to yourself is a bit oversimplifying one's personality but I find it helpful to describe yourself to others and mostly to yourself. Most people won't admit it but knowing yourself correctly is not always an easy task, just for the fact that you might not have the right words to do so.

Those words, as generic as they may be, may help to know what can and can't be done. What's within your reach and what will end up just being another project left for dead after so much hype.

Now, back to work! It ain't over yet!

Read More......

Sunday, June 29, 2008

Throwing LUA out the window

After spending a week on this problem and even taking a day off from work friday to try to fix the memory leak frequently crashing the server, it seems I cannot overcome this with the current mechanic. I have tried many things, even refactored some of the code but...

Each LUA call from .NET seems to leak memory. I spent a lot of time testing various cases and it all comes down to LUA in the end. And since there's now about a hundred NPCs in the game doing calls about every seconds to LUA each... I guess it's just too much to ask from the library I'm using. Without telling about the random errors that pop from time to time for no apparent reason.

That doesn't mean LUA with .NET (using LUAInterface) isn't good. It just mean that it's not good for my project. It's just frustrating that I noticed this problem so late, just when I was finally ready to release. But with previously little NPCs in the game and no daily testers I guess that was the best I could do.

I did a quick test with dynamically compiled .NET code and that will be what I will replace the LUA AI scripting with. My knowledge of VB.NET is far more better than my knowledge of LUA and I won't have to use a third party library to accomplish this.

So what does it means? First, no "official" release yet... I'll probably shut the current instance of the game for those that already created an account there since the server isn't stable anyway. Tomorrow it's a holiday here so I'll work all day long to get the new AI engine running and at least have some basic AI running. My objective is to have the new system running this weekend with almost all AI operational.

It of course means I'll have to recode every AI. If anyone know of a good LUA -> VB.NET converter, that would be helpful...

Read More......

Monday, June 23, 2008

Banner test concept #1

Preparing slowly but surely for release...

I'm not planning a large campaign for now but some efforts won't hurt. I'm not an artist and I'd rather spend money for graphics in the game so I'm trying to keep things simple here. Comments welcomed!

Click to see the banner

Read More......

Thursday, June 19, 2008

The LUA brain of a quest giver

I thought this might interest some people so here's the AI of one of the quest givers in the game.

Initialization section

LOOPTIME=1000; GODMODE=1; HP=10; MAXHP=10;

--------------
--------------
LOOPTIME: Loop speed in miliseconds
GODMODE: I'd like to keep (most) of my quest givers alive please
HP - MAXHP: Pretty much useless here but heh

Looping code

inmessage = getheard();
name = inmessage.sender;

if (name ~= '') then
if (inmessage.message ~= '') then
if (gotbadge(name, 14) == 1) then
saymessage = 'Thanks for helping me. Oh and I hope you didn\'t touch anything...';
sayto(saymessage, name, 2);
else
if (inmessage.message == '/talk') then
-- 1=quest active, 0=quest not active
questactive = badgegetvalue(name, 14, 1);

if (questactive == 1) then
-- Check if killed 5 zombies
queststatus = badgeexpectedkillsstatus(name, 14);

if (queststatus[0] == 1) then
addbadge(name, 14);
badgeresetexpectedkills(name, 14);
addprestigepoints(name, 10);
givemoney(name, 1);

saymessage = 'Thanks a lot. Look, my pockets are quite empty right now so all I can afford to give you is 1 gold coin.

You didn\'t touch anything in there, did you?

-------------
You received a new badge';
sayto(saymessage, name, 2);
else
if (queststatus[2] == 0) then
saymessage = 'So, you found the zombies in the basement?';
sayto(saymessage, name, 2);
else
saymessage = 'You only killed ' .. queststatus[2] .. '? Think you can kill at least ' .. (queststatus[1] - queststatus[2]) .. ' more?';
sayto(saymessage, name, 2);
end
end
else
saymessage = 'When I woke up this morning, I heard some strange noises coming from the basement. I went to take a look and there was zombies everywhere!

I have no idea how they got there. I think they must have digged they\'re way to my house but I haven\'t found where exactly.

I fought some of them but there is too many. Think you can help me a bit?';
askyesno(name, saymessage, 'I\'ll see what I can do', 'Maybe later', '/ok', '');
end
else
if (inmessage.message == '/ok') then
-- Set quest active
badgesetvalue(name, 14, 1, 1);
-- Wait for 5 zombies killed from Stanford basement
badgeaddexpectedkills(name, 14, 24, 0, 5);

saymessage = 'Thanks. Go in there and look in the basement. They shouldn\'t be hard to find.

----------------
Defeat 5 zombies from Stanford\'s basement';
sayto(saymessage, name, 2);
end
end
end
end
end

--------------
--------------

You'll notice that some functions here are not from LUA (getheard, sayto, gotbadge, ...). These functions are .NET functions allowing LUA to access and update the game data. So far, there's 59 of those functions allowing NPCs to walk, talk, attack, follow, give rewards, take items from players and other traditional actions we expect from an NPC.

getheard:
Check first message received by the NPC. When a player "talks" to an NPC, he is in fact adding a command to an array (first in, first out). getheard retuns an object containing the name of the sender (which could also be an NPC) and the command we expect the NPC to react to.

gotbadge:
Just checking if the current character has already done the quest associated with the quest giver.

sayto:
This command can either send a private message or show a dialog box. This command is also used to get two NPCs to "talk" to each others (like go attack my current target).

badgegetvalue:
Used to keep track of the progress of the quest like how many items of a type were given to the NPC so far and other useful stuff to change how the NPC interact with the player.

badgeaddexpectedkills:
This command tells the server that from this moment, we want to count the kills done by a character (and by his golems). In this quest, the NPC ask the player to destroy 5 zombies. So this command starts the counter.

badgeexpectedkillsstatus:
Just returning the data compiled after using badgeaddexpectedkills.

addprestigepoints, givemoney:
Rewards! Some NPCs also use the command "giveto" to give players specific items.

askyesno:
Much like sayto, used to ask a yes/no question type, allowing deeper interactions with NPCs. Eventually, I'd like to add a window that would allow players to type text to NPCs and/or a window allowing to chose an answer among more than 2 choices.

This quest is a very basic one. I'll keep the more complex ones for later!

Read More......

Tuesday, June 17, 2008

That performance problem

While beta haven't been very popular, it did helped me. One comment I kept receiving was the poor performance. Not the server (it's doing surprisingly well) but the client. Well I found the bottleneck...

Back when the game was still in alpha, I never had any performance problems. There was probably near a hundred cows running around in about 4-5 zones. That was before I completed the characters' creation system.

At first, when you created a character, you were selecting an avatar and that was it. The new characters' creation system added the possibility to chose a body, face, suit, hat and hairs.

All layers were dropped on top of each other as background images in 5 DIV tags. Background images are needed to switch the view of the character (walking left, right, up and down). The problem is that background images aren't very good for performance. I'm sure there's a nice explanation somewhere about this...

So I did a small test and removed everything but the body layer, leaving only one background image per avatar (players and NPCs) and the performances were back where they were in alpha. Just like PNG files were slowing down the whole thing, too many background images creates a huge bottleneck.

So to fix this problem and still allow full character's customization, I'll have to merge all layers in every possible ways so that each avatar on the screen contains only one background image. That's a lot of files but it looks like it's the only way to do it.

Ah, the joy of web development...

Read More......

Monday, June 16, 2008

Looking to buy someone else's time

Eve Online, Pirates of the Burning Sea, a trip back to SWG... Wish I had more time to visit those games.

And the following trailer is enough to add Vanguard to my list:
http://www.vgwalkthroughs.com/page/guides/4

Sigh... I'm feeling like a kid in a candy store with no money in his pockets :-(

Read More......

Saturday, June 14, 2008

So I'm SEKA

This kind of test doesn't really tell you anything new, just give you a title to brag about and seek other people like you.

Here's my result:

SEKA players are usually very interested in the the 'total experience' of a virtual world--meeting other people and finding the unique places within it. They don't care much for PVP or levelling, but meeting up with online friends to see new parts of the world is usually fun and exciting.

Breakdown: Achiever 13.33%, Explorer 73.33%, Killer 40.00%, Socializer 73.33%

Well, the test got me right. One thing I don't understand though: "The game that has the highest proportion of people like you (SEKA) is Unreal Tournament."

Well, I played Unreal Tournament for quite some years, beating everyone at the office (to the point where they wouldn't play with me again... sad story). But then I stopped and tried later and had lost all the speed and reflex I had. I'm getting old I guest? Never liked the addition of vehicules anyway... InstaGib forever!

So, what "letters" are you? Go take the Bartle Test to know.

Read More......

Sunday, June 1, 2008

Players' Bounties as PvE as PvP

Still working on adding content. Some new commands were added to the AI and now the sheriff is in.

The sheriff is an NPC that will reward you for hunting a specific golem owned by another player. As long as there are golems in the world, the sheriff will keep giving you missions to hunt them down. The number of missions completed is tracked down so badges or special rewards could be awarded after 50,100,1000 missions.

From now on, with all the new commands recently added, I should be able to add more quests without touching the code. Thinking of all the commands needed to track data in an efficient way was tricky at first but I finally figured a generic system that should be able to handle "go destroy", "craft", "gather", "go talk", "give", "pay" type of quests.

It's going well. End of june is still my targeted release date...

Read More......