<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7090461718496077050</id><updated>2011-07-30T19:45:04.746-05:00</updated><category term='Screenshot'/><category term='SkynetDB'/><category term='BIF'/><category term='SOX'/><category term='LB'/><category term='Performance'/><category term='PS3'/><category term='Cloud Computing'/><category term='CC'/><category term='Load Balancer'/><category term='AH'/><category term='CAM'/><category term='Objectives'/><category term='Test'/><category term='CG'/><category term='Apocalyx'/><category term='ANNE'/><category term='Tests'/><category term='Upgrade'/><category term='KVS2'/><category term='AI'/><category term='Framework'/><category term='AGENT'/><category term='SMASH'/><category term='Action Handler'/><category term='CMD'/><category term='MMO'/><category term='Eliza'/><category term='KVS'/><category term='CNPC'/><category term='WIP'/><category term='MNESIA'/><category term='Grid Computing'/><category term='Status'/><category term='LUA'/><category term='CS'/><category term='BSP'/><category term='Erlang'/><title type='text'>SMASH - MMO Engine in Erlang</title><subtitle type='html'>Scalable Multiplayer Application &amp;amp; Simulation Handler&lt;br&gt; 
About the endeavor of creating a massive multiplayer online game engine capable of housing at least 1000 concurrent users. Public development blogbook.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-130053800535680601</id><published>2010-05-20T12:10:00.006-05:00</published><updated>2010-05-20T13:06:26.177-05:00</updated><title type='text'>Project on hold for a while</title><content type='html'>&lt;span style="font-family:arial;"&gt;I am currently fighting on too many fronts to be able to keep up with this side project, which doesn't mean it's dead, I definitely want to see some progress here, but at present this is impossible.&lt;br /&gt;&lt;br /&gt;This fact not withstanding, whenever I play a MMO I think how I could this or that in SMASH, like f.e. I find myself intrigued with Star Trek Online's design.  Cryptic implemented STO in such a way that there is only one realm for the whole game but every location is an instance to avoid sending hundreds if player data to each client, you get sent to a certain instance and that's about 20 players or so, nothing more, chat however is sent to all instances.  I like this design and I have wondered how this relates to SMASH.   My conclusion is that this could be implemented by means of what server you are connected to, so chat messages could get relayed like they do now, but player data f.e. could be limited to be sent only to the users on that same server, voila, we got instancing.   It would only be required to allow instance switching, by means of logging a user out of one server and on the desired instance server, I am not yet 100% sure if I am not overlooking anything, but I guess SMASH can easily handle instancing this way.&lt;br /&gt;&lt;br /&gt;To handle instances like private raid dungeons this is a bit more complex, as it would require copying zone data into a new zone, but we are still far from this approach anyway, so not much to worry about, yet.&lt;br /&gt;&lt;br /&gt;Not many updates for now, but at least a sign of life.   My goal is to have a working SAD demo by the end of 2010 with a simple zone, I cannot promise more given all the stuff I need to handle at the moment and my apologies for that.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-130053800535680601?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/130053800535680601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=130053800535680601' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/130053800535680601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/130053800535680601'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2010/05/project-paused-for-while.html' title='Project on hold for a while'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6373446684707487691</id><published>2009-09-15T12:31:00.020-05:00</published><updated>2009-09-17T11:21:57.160-05:00</updated><title type='text'>ANNE gets more emotional</title><content type='html'>&lt;span style="font-family:arial;"&gt;It's been a while since my last post and that is due to the fact that I have been testing ANNE and expanding her emotional range.  I am trying to set up a neural network for a "Smith and Ellsworth" style model, which reflects the feelings of &lt;span style="font-style: italic;"&gt;happiness, sadness, anger, fear, disgust, surprise, boredom, challenge, hope, interest, contempt, frustration, pride, shame &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;guilt &lt;/span&gt;by determined by the external factors of &lt;span style="font-style: italic;"&gt;pleasantness, responsibility, certainty, attention, effort and control&lt;/span&gt;.   Given that I &lt;/span&gt;&lt;span style="font-family:arial;"&gt;don't have access to the model I am making up the matrix as I go.  It takes around 15 min (!!) to train ANNE, but evaluations are instantaneous (Erlang is speedy), oh well if you need more precision, it takes 149 microseconds (&lt;/span&gt;µs&lt;span style="font-family:arial;"&gt; = millionth of a second) on the average, a mean of 1&lt;/span&gt;µs &lt;span style="font-family:arial;"&gt; and a maximum time of 15900&lt;/span&gt;µs&lt;span style="font-family:arial;"&gt; (most likely the first call), so you could perform over 6700 calls per second to it, not even the most emotionally unstable human could evaluate that many ;) .   What this shows is that a single process running this ann could easily evaluate emotional feedback for thousands of NPCs in the game world.   Believe it or not, this rather simple matrix of (6, 20, 15) takes up 7 KB !!  That's quite a mouthful of data, but anyway.   Random tests show very logical although on occasion rather unexpected results, remember that anns do pattern matching, not value matching.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a style="font-family: arial;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qeU32xsq_yA/Sq_gnZAkEUI/AAAAAAAAAGk/ANjZIdXvjuo/s1600-h/anne_ext_emo.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 239px;" src="http://3.bp.blogspot.com/_qeU32xsq_yA/Sq_gnZAkEUI/AAAAAAAAAGk/ANjZIdXvjuo/s320/anne_ext_emo.jpg" alt="" id="BLOGGER_PHOTO_ID_5381767047063802178" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;Here some random inputs with E being the emotions ann, note that sometimes even when changing 2-3 inputs they still result in in the same emotion.  Curious, but consistent and no worries, it really does evaluate to all possible emotions depending on the training matrix and input.  -1.5 denotes the lowest possible value, 1.5 the highest possible one, so f.e. -0.3 pleasantness means a little bit unpleasant, 0.5 control , means some control and so on.   The output shows how certain ANNE is regarding the highest match, results near 1 mean very certain, while f.e. a "0.40 surprised" could mean a little bit surprised so you really get an emotion and a degree, the higher, the stronger.    I am starting to love neural networks, this is so much fun :) .   I am thinking, that animals probably don't need all these emotions, nor all the input factors, which might lead to different anns for different entities.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Well, it seems to me that I will still spend some time with the fine tuning, so be patient with me.  If there is enough interest, I might publish the source code, too.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6373446684707487691?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/6373446684707487691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=6373446684707487691' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6373446684707487691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6373446684707487691'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/09/anne-gets-more-emotional.html' title='ANNE gets more emotional'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qeU32xsq_yA/Sq_gnZAkEUI/AAAAAAAAAGk/ANjZIdXvjuo/s72-c/anne_ext_emo.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-5658649931037887142</id><published>2009-08-17T09:53:00.000-05:00</published><updated>2009-08-17T14:12:19.741-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AI'/><category scheme='http://www.blogger.com/atom/ns#' term='AGENT'/><title type='text'>Fleeting thoughts on AI</title><content type='html'>&lt;span style="font-family:arial;"&gt;No doubt about it, AI is a fascinating topic and there are no clear cut answers, possibilities are simply endless.   AI may depend first of all on the game genre, so a platform game will have a different AI compared to an evolutionary game.&lt;br /&gt;&lt;br /&gt;Nowadays from what I have seen most seem to have some kind a Finite State Machine (FSM), where certain conditions are analyzed and actions are taken accordingly, this works similar to IF..THEN..ELSE statements.   So a NPC just stands around forever on the same spot doing nothing or walking senselessly around day after day without rest, at most the NPC is going through its FSM and that's it.  When aggroed, as pointed out, most NPCs keep a hate list, where the NPC sorts who has caused how much aggro, be it through heals or damage dealt and decides who to hit on.  Run out of range and the NPC resets, the hate list is wiped, it's got a clean slate, boy do I envy those NPCs !!!&lt;br /&gt;&lt;br /&gt;Well, IMHO I find this kind of NPC extremely boring.   I envision a bit more and I'll mention an example inspired by Matt Buckland's book "Programming Game AI by Example".&lt;br /&gt;&lt;br /&gt;A story from the fictitious mining town "Backwater":&lt;br /&gt;&lt;br /&gt;Miner Irwin goes every morning out to the mine to fill his pockets with gold, during this process he will get thirsty, hungry and sleepy, but he also appreciates digging up a certain amount of gold, once satisfied he goes to the bank and deposits the money, if he gets thristy he visits the local saloon, has a drink and talks to his buddies, if he gets hungry he goes home to have his lady who serves him some stew (both will need to communicate as well), if he gets sleepy he will lay down, when rested he gets up and at it again.   Let's add to this some more sense, he may be receiving input from his surroundings, so f.e. he one day detects within 50 yds. an orc, he also determines his level and notes that he has weapons equipped, his emotional ann determines fear and he runs back to town and alerts the guards.  His goals may temporarily change in favor of self preservation, Irwin goes to the local saloon for more drinks until the danger is over.    Guard Erl hears him shout and stands ready to fight the orc.  Erl loses the fight to the orc with the rusty spoon.&lt;br /&gt;&lt;br /&gt; -HALT- Design decision ahead -&lt;br /&gt;&lt;br /&gt;Option 1:  Normal MMO AI's would wipe their memories, Irwin engages in the fight before perishing, the new Erl is just as "savvy", as he was before, and both will just respawn and surely be killed again and again and again.&lt;br /&gt;&lt;br /&gt;Option 2:  Erl preserves his short term memory through death, he remembers that the orc with the rusty spoon was 3 levels higher than him, he modifies his internal state and makes a note to himself: if dead by attack and enemy_level + 3 then update in table fights[self+3] values pleasantness - 0.1 and control - 0.1 .   When next confronted with that orc the ANNE with emotional responses will evaluate the situation differently, there will be a moment when anger becomes fear and he may just run for his life and/or call for additional help, this orc William is just too much for him alone.   The internal goal seeker of Erl might determine that when he has lost 3 battles in a row, he needs further training and emerges as a level+1, he will now be tougher than before, after some cycles, the orc finally loses the battle and Erl, 4 levels higher and 20 generations later maybe feels invincible again.   He keeps standing around for a while and his abilities might slowly degrade to the original skills/levels (&lt;/span&gt;&lt;span style="font-family:arial;"&gt;or he might stay at his level)&lt;/span&gt;&lt;span style="font-family:arial;"&gt;, this learn and forget setup would avoid players farming certain NPCs but ensures that on the long run the game world is somewhat stable.   He will slowly forget that he lost 8 battles against orc William and won 2.  However he just might remember in his long term memory how many battles he lost and won sorted by enemy levels and how many attacked him.  He may also communicate this to his peers, in case of SMASH maybe on the same city chat channel or a special guards channel.  Erl will also change guards with others and not just stand there forever, but swap with Marlo, while Marlo stands guard, Erl goes for lunch or dinner and sleeps a while.   Meanwhile our miner Irwin either asks the guards for dangers and/or notices that the threat has gone away, he no longer perceives orc William in the surroundings scanning some 100 yds (just to be sure) and goes back to his original goal of getting his pockets full of gold.&lt;br /&gt;&lt;br /&gt;If enough orcs have attacked the city, the council members might stage an all out attack against neighboring orc villages to protect themselves.&lt;br /&gt;&lt;br /&gt;While this is still future music, this is what I have in mind for the AI, a simulation rather than just a cheap FSM.&lt;br /&gt;&lt;br /&gt;This requires an agent capable of perceiving its surroundings (sight and words)&lt;/span&gt;&lt;span style="font-family:arial;"&gt;, a certain personality to evaluate perceptions&lt;/span&gt;&lt;span style="font-family:arial;"&gt;, a goal seeking Hierachical FSM (HFSM) capable of sorting goals, a neural network (-&gt; ANNE) to analyze what emotions result from its current situation applied to the personality and a HFSM that decides on memory, learning and thresholds whether to pursue its goals or take alternate actions and then carry them out. Let's call this the perception system (PS), goal seeker (GS), personality profile (PP), ANNE you already know, the memory records (MR), the decision maker (DM) and the action machine (AM).   If you wanted to implement a hive mind, you would need to sync the goal seeker, the memory and probably the personality profile or if you do it in Erlang, just call the processes that represent those per hive mind.&lt;br /&gt;&lt;br /&gt;I believe this design should enable for different actions according to each NPC's personality: f.e. when insulted, Eliza might feel sad, run home and cry, while guard Erl while take his sword and apply a subtle lobotomy.  When attacked, Irwin might run for his life, while Erl fights back.  When applying evolutionary rules, their behavior might even change over time.  Most literature does not recommend to enable long term learning when you go life, because results will inevitably be unpredictable, so only time will tell if long term evolution is a good choice or not.&lt;br /&gt;&lt;br /&gt;I highly recommend downloading and running "AI Planet" from sourceforge.net and also read the author's design notes, it is fascinating to watch how creatures evolve over time.  Imagine this in the settings of a MMO and I am sure it will create immersion for the player, but it would also mean the game to be different according to when you joined, tough call.&lt;br /&gt;&lt;br /&gt;In the end though, some restrictions may apply, according to how much processing power you have on the server side, if you have 200'000 NPCs in your game world, you'll probably downsize the AI a bit to match CPU power versus NPC numbers, I am eyeing the shared process structure as mentioned above.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-5658649931037887142?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/5658649931037887142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=5658649931037887142' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5658649931037887142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5658649931037887142'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/08/fleeting-thoughts-on-ai.html' title='Fleeting thoughts on AI'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-2486155718817592344</id><published>2009-07-16T11:04:00.019-05:00</published><updated>2009-07-16T17:09:13.721-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AI'/><category scheme='http://www.blogger.com/atom/ns#' term='ANNE'/><title type='text'>News on ANNE</title><content type='html'>&lt;span style="font-family:arial;"&gt;The toughest task in a programmer's life is not the actual algorithm but the bug hunting, I noticed that something was still weird in ANNE and I found some more bugs in my code, but well.&lt;br /&gt;&lt;br /&gt;I implemented some improved trainers for XOR operation and for the emotion part, but this time not by running a fixed number of epochs, but  by checking for the LMS (least mean squares) of the training sets, which actually works nicely so.   When setting the trainer to 0.01% LMS:  ann structure = input:(hidden layers): output&lt;br /&gt;&lt;br /&gt;* XOR works after 11422 epochs with 2 hidden layers and it takes 11855 epochs with 1 hidden layer, 2:(2:2):1 versus &lt;/span&gt;&lt;span style="font-family:arial;"&gt;2:(2):1&lt;/span&gt;. &lt;span style="font-family:arial;"&gt;Precision seems to be on par of both by 1%.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;* Emotions are trained after 25201 epochs with 2 hidden layers and 18387 epochs for 1 hidden layer, the first is 6:(6:6):6 and the other is 6:(7):6.  Their precision is about on par for learned values, but the first is much more precise towards one or the other emotion when interpreting new values, the second would allow for some more varied emotions (like primary and secondary).&lt;br /&gt;&lt;br /&gt;My interpretation here is that while for most practical purposes a second layer is not required, it does add a lot of precision if you care for it and if you don't mind the extra time for the training.&lt;br /&gt;&lt;br /&gt;I believe ANNE is now working correctly.  Now I will start trying different AI scenarios for NPCs, it seems that ann's are suited to be the brains of a NPC, let's see.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-2486155718817592344?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/2486155718817592344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=2486155718817592344' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/2486155718817592344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/2486155718817592344'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/07/news-on-anne.html' title='News on ANNE'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3076854339556613189</id><published>2009-07-08T16:13:00.030-05:00</published><updated>2009-07-10T17:31:57.976-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AI'/><category scheme='http://www.blogger.com/atom/ns#' term='ANNE'/><category scheme='http://www.blogger.com/atom/ns#' term='Eliza'/><title type='text'>ANNE to ELIZA: Think before you talk !!</title><content type='html'>&lt;span style="font-family:arial;"&gt;As I said before, there are so many, many components that need to be built for the complete SMASH, one that I have barely mentioned so far is the AI part, no game ever would be really complete without some intelligence.    So let's talk smart today.&lt;br /&gt;&lt;br /&gt;Eliza will most likely be part of the NPC perception system and and it will be important for stateful conversations with the added context info (which will later form a sort of decision tree) and when I coded Eliza, I had the idea of also including something e&lt;/span&gt;&lt;span style="font-family:arial;"&gt;lse, one thing that I find about basic Eliza is that it feels too cold, there are no emotional reactions behind it.   We humans associate words with feelings, like it or not, so I started looking into that.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Now, how do we translate input into emotions ??&lt;br /&gt;&lt;br /&gt;In order to do that association I dug up a couple of AI books on my shelf and found a nice model about how a NPC (I recommend the book: &lt;a href="http://www.powells.com/biblio?isbn=9781584503231"&gt;Programming Believable Characters for Computer Games&lt;/a&gt; by Dr. Penny Baillie-de By&lt;/span&gt;&lt;span style="font-family:arial;"&gt;) can translate situational information into emotions, which turns out to be an artificial neural network (ann), so after some real messy programming sessions A&lt;/span&gt;&lt;span style="font-family:arial;"&gt;NNE was born: &lt;span style="font-weight: bold;"&gt;A&lt;/span&gt;rtificial &lt;span style="font-weight: bold;"&gt;N&lt;/span&gt;eural &lt;span style="font-weight: bold;"&gt;N&lt;/span&gt;etwork &lt;span style="font-weight: bold;"&gt;E&lt;/span&gt;ntity.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;ANNE is a fully connected multilayer feedforward network with normal error backpropagation.  I will spare you yet another explanation of how ann's (also called sometimes multilayer&lt;/span&gt;&lt;span style="font-family:arial;"&gt; perceptrons) work, mathwise, I found however this very insightful page: &lt;a href="http://www.willamette.edu/%7Egorr/classes/cs449/intro.html"&gt;Introduction to Neural Networks&lt;/a&gt; which does an awesome job at explaining them.&lt;br /&gt;&lt;br /&gt;While it's tempting to implement each neuron in Erlang as a process, I didn't, because I do not like to have processes just laying around doing nothing 99% of the time, rather, I implemented this as a list of lists, which can now ve&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ry conveniently be saved to KVS*.   This way you don't have to retrain it every time, just save a trained version on KVS2 and with KVS* replication, you now have the model ready to use across all SMASH nodes.&lt;br /&gt;&lt;br /&gt;I wanted to see just how many neurons ANNE could support, so after some partial testing I can say that I &lt;/span&gt;&lt;span style="font-family:arial;"&gt;was able create f.e. an ann with 500 inputs, 2 hidden layers with 5000 neurons each and 500 outputs, let me tell you that this a hell of a list of lists with a total of 30 Mio internal &lt;/span&gt;&lt;span style="font-family:arial;"&gt;weights, so be patient during the training process.   Most literature also does not speak about how many iterations are required to train an ann, but it would seem to me that it requires about 50'000+ epoch (epoch = 1 run with all training sets) to perceive a convergence of the weights.   Erlang impressed me yet again, I was unsure if it could hold THAT much data in a single list .... but it did.&lt;br /&gt;&lt;br /&gt;Now, let's get a feel for it: &lt;/span&gt;&lt;span style="font-family:arial;"&gt;My first test was as suggested by Mrs. Penny a simple XOR operation (with 2 inputs, 2 hidden layers neuron in a single layer and 1 output neuron) which after sufficient training works just fine. Once it passed the initial runs I grabbed that emotional model &lt;/span&gt;&lt;span style="font-family:arial;"&gt;described in the book looks like this (chapter 7.5.2):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qeU32xsq_yA/SlfBDvAMCiI/AAAAAAAAAGc/F9UCi0sZtxk/s1600-h/ann676.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 239px;" src="http://4.bp.blogspot.com/_qeU32xsq_yA/SlfBDvAMCiI/AAAAAAAAAGc/F9UCi0sZtxk/s320/ann676.jpg" alt="" id="BLOGGER_PHOTO_ID_5356962551681518114" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;What you see here &lt;/span&gt;&lt;span style="font-family:arial;"&gt;on t&lt;/span&gt;&lt;span style="font-family:arial;"&gt;h&lt;/span&gt;&lt;span style="font-family:arial;"&gt;e left is the lower part of the trained ann with 6 inputs, 1 hidden layer with 7 neuro&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ns and 6 output neurons.   The ann is then trained with 6 x 6 samples for about 50'000 epochs, returning the new trained ann, the output values should be loosely binary as intended, meaning 5 ceros and a single 1 value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The call to anne:ann([INPUT], ANN) accesses the anns knowledge, so I fed the values from the bo&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ok into it, knowing that those values will need to be interpreted and hoping that the 4th v&lt;/span&gt;&lt;span style="font-family:arial;"&gt;alue is clearly the highest one of them, .... indeed the 4th parameter is the highest with 0.88 ... which is correct !!!   In this example it represents: "fear", also note that th&lt;/span&gt;&lt;span style="font-family:arial;"&gt;e 3rd value is 0.24 which stands for "anger", the beauty of an ann is that it states the most prevalent emotions, but you could also take into account the 2nd strongest one, so maybe this input to the NPC will cause it to run away in fear cursing angrily.&lt;br /&gt;&lt;br /&gt;I now need to find some example with 2 hidden layers to test ANNE on, but so far everything works just fine.&lt;br /&gt;&lt;br /&gt;I have not decided yet how a fully grown NPC will have to work, it might be a sort of hierarchical finite state machine (HFSM) with modules of Eliza and ANNE integrated into it or just ANNE + Eliza, but I believe this is good progress already on the NPC AI.&lt;br /&gt;&lt;br /&gt;One more nice thing is, if you embed an ann into a looped process you would only need a single instance on all of the SMASH servers for all NPCs to interpret that input.   Maybe several anns will feed its data into a HFSM and make it trigger its actions and responses.&lt;br /&gt;&lt;br /&gt;ANNE is still an uncooked meal, but the ingredients look fine.   And that's all for now folks. Until next time.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3076854339556613189?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3076854339556613189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3076854339556613189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3076854339556613189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3076854339556613189'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/07/anne-to-eliza-think-before-you-talk.html' title='ANNE to ELIZA: Think before you talk !!'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_qeU32xsq_yA/SlfBDvAMCiI/AAAAAAAAAGc/F9UCi0sZtxk/s72-c/ann676.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-5675458000348453358</id><published>2009-06-17T18:25:00.011-05:00</published><updated>2009-07-31T09:01:20.354-05:00</updated><title type='text'>Eliza expands its mind</title><content type='html'>&lt;span style="font-family:arial;"&gt;I have looked at many Eliza implementations and most only match a single word in the sentence, or a word in the middle and the rest after the match, so I took it a bit further, I can now match stuff like: &lt;span style="font-weight: bold; font-style: italic;"&gt;"I %% flowers **"&lt;/span&gt; and also stuff like &lt;span style="font-weight: bold; font-style: italic;"&gt;"I %% and %% flowers **"&lt;/span&gt;.  This would catch several multi-word patterns in between and whatever goes behind flowers.  Given that Eliza does pattern matching but the humans employ several words for the same thing if only your Eliza could  group by similarities for example by &lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;font-family:arial;" &gt;["love","like","fond of","don't hate","don't dislike"]&lt;/span&gt;&lt;span style="font-family:arial;"&gt; .   Another example: how many Elizas can tell that these are equivalent to a human: &lt;span style="font-weight: bold; font-style: italic;"&gt;["MAC", "MACs", "Macs", "Mac", "Macintosh", "mac", "macintosh", "apple", "Apple", "Macbook", "mac mini", "Macmini"]&lt;/span&gt; ??  So how do you catch different ways of expressing tastes with different nouns, that tell you more or less the same thing ??&lt;br /&gt;&lt;br /&gt;Answer: pattern expansion !!   I expanded Eliza's linguistic abilities to match similar patterns, you only need to create a pattern list of synonyms and specify that list in another pattern as an expansion pattern like &lt;span style="font-weight: bold; font-style: italic;"&gt;"I ## ##" &lt;/span&gt;where ## stands for the synonym list, here is how:&lt;br /&gt;&lt;br /&gt;To recreate the above example you would create 3 records in the Eliza file, the first is the pattern and the other 2 are merely variables.&lt;br /&gt;&lt;br /&gt;{["I ## ## **"],&lt;br /&gt;["I live inside a computer","I can live inside a Mac","Maybe I reside in a Mac right now"],&lt;br /&gt;{subject,computers,&lt;span style="font-weight: bold;"&gt;["##1", "##2"]&lt;/span&gt;,["like","Mac"],[]}},&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;{["##1"],&lt;/span&gt; &lt;span style="font-family:arial;"&gt; ["love", "like", "fond of", "don't hate", "don't dislike"],&lt;/span&gt; &lt;span style="font-family:arial;"&gt; {internal,synonyms,[],[],[]}},&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;{["##2"],&lt;br /&gt;["MAC","MACs", "Macs", "Mac", "Macintosh", "mac", "macintosh", "apple", "Apple", "Macbook", "Ibook", "Macmini"],&lt;br /&gt;{internal,synonyms,[],[],[]}},&lt;br /&gt;&lt;br /&gt;So now the pattern "I ## ##" is expanded against both variables &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;["##1", "##2"]&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;. which creates in this case 150 patterns in run-time, but your file only required a simple entry and again Eliza returns some values that your AI can now chew on.   Those variables can obviously be reused in other patterns &lt;/span&gt;&lt;span style="font-family:arial;"&gt;and it's needless to say that I will be able to teach her new stuff in run-time.&lt;br /&gt;&lt;br /&gt;Things that I find are still needed be it either on Eliza's or the AI's side is to catch specifically nouns and verbs, maybe by matching against another list and trying to find a corresponding context for them, like when your application knows nothing about flowers, but flowers are plants and maybe your AI knows something about plants or maybe it lacks info on Mac's but knows about computers.  And Eliza should also be able to ask the user and remember its question&lt;/span&gt;&lt;span style="font-family:arial;"&gt;.   But for the time being, I am quite happy with the implementation, it will suit SMASH well to have NPCs that the user can actually talk to.   The current version is stand alone, future ones will likely put their info on KVS* for easy data access and replication.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-5675458000348453358?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5675458000348453358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5675458000348453358'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/06/eliza-expands-patterns.html' title='Eliza expands its mind'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-1862217419615870847</id><published>2009-06-13T17:17:00.045-05:00</published><updated>2009-06-14T10:00:30.228-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eliza'/><title type='text'>Eliza speaks Erlang with a twist</title><content type='html'>&lt;span style="font-family:arial;"&gt;As I said in the previous post, Eliza  should be fairly easy to implement in Erlang and so it was, I present to you the &lt;/span&gt;&lt;span style="font-family:arial;"&gt;first Eliza that speaks Erlang:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qeU32xsq_yA/SjUPD5naLiI/AAAAAAAAAGE/_gYH9UC0PTc/s1600-h/smash_eliza_in+erlang2.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 220px;" src="http://1.bp.blogspot.com/_qeU32xsq_yA/SjUPD5naLiI/AAAAAAAAAGE/_gYH9UC0PTc/s320/smash_eliza_in+erlang2.jpg" alt="" id="BLOGGER_PHOTO_ID_5347196692252470818" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;The image on th&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;e &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;left&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt; show&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;s the Erlang Shell where you can see some examples of Eliza being called as&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt; &lt;span style="font-weight: bold;"&gt;eliza:start(Text)&lt;/span&gt; &lt;span style="font-style: italic;"&gt;[&lt;/span&gt;&lt;span style="font-style: italic;"&gt;also possible: &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;eliza:start(Text, Bot)&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;span style="font-style: italic;"&gt;(not shown)&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic;"&gt;to&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic;"&gt; choose some kind of personality]&lt;/span&gt;.  El&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;iza w&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;ill &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;try to load its text file for interpretation from disk.&lt;br /&gt;Eliza prints &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;o&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;ut in t&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;he shell and returns a tuple with: the input string&lt;/span&gt;, context information&lt;/span&gt;&lt;span style="font-family:arial;"&gt;, extra words from the pattern matching and the answer from Eliza.&lt;br /&gt;&lt;br /&gt;What for ??   &lt;/span&gt;&lt;span style="font-family:arial;"&gt;A normal Eliza implementation has no idea what you are talking about, it does no provide or save the context of the conversation, so my implementation has a little twist, you can provide some additional info to each question-answer list, meant to be used by an AI implementation, so like above when stating your name, Eliza answers with {name,player} and the player na&lt;/span&gt;&lt;span style="font-family:arial;"&gt;me, so your AI could register that Eliza just got the player's name or whatever the player tells Eliza, like dislikes, likes, emotions, hobbies or whatever, your AI could then save the data to a database or you could also load a different Bot context file to chat more specifically on a topic.  I will incorporate this in my AI modules in the future and in the meanwhile this will serve for some "dump" entertainment in SMASH.  A miniature dictionary to showcase Eliza is included in the code.   I also see a use for this on the CNPC's to detect automatically abusive or foul language, as mentioned on many previous posts.&lt;br /&gt;&lt;br /&gt;If there is anybody interested in the code, let me know and I'll publish it here on the Blog, it's deceptively simple, just under 200 lines and not yet optimized, but it's a first step towards implementing AI in Erlang.&lt;br /&gt;&lt;br /&gt;And now back to CAM.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-1862217419615870847?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/1862217419615870847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=1862217419615870847' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1862217419615870847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1862217419615870847'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/06/eliza-speaks-erlang-with-twist.html' title='Eliza speaks Erlang with a twist'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qeU32xsq_yA/SjUPD5naLiI/AAAAAAAAAGE/_gYH9UC0PTc/s72-c/smash_eliza_in+erlang2.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-612951322605730067</id><published>2009-06-09T23:33:00.029-05:00</published><updated>2009-06-10T23:33:39.346-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CAM'/><category scheme='http://www.blogger.com/atom/ns#' term='CMD'/><category scheme='http://www.blogger.com/atom/ns#' term='AH'/><category scheme='http://www.blogger.com/atom/ns#' term='CNPC'/><category scheme='http://www.blogger.com/atom/ns#' term='Eliza'/><category scheme='http://www.blogger.com/atom/ns#' term='CC'/><title type='text'>Huh ??  Did you SAY something ??</title><content type='html'>&lt;span style="font-family:arial;"&gt;As CAM goes forward, I am defining user permissions, channel permissions, guild structures and user levels which go from guest to game developer with each level having unique commands, which of course brings us to the point of what the final command structure will look like, I believe it's going to be something like: &lt;span style="font-weight: bold; font-style: italic;"&gt;{CHANNEL:REQ:PARAMS} &lt;/span&gt;where each &lt;span style="font-weight: bold;"&gt;REQ &lt;/span&gt;that comes from the socket is seen as a &lt;span style="font-weight: bold;"&gt;request for action&lt;/span&gt; by the CC component before being sent to its Action handler (AH) and from there to the channel controlling NPC &lt;/span&gt;&lt;span style="font-family:arial;"&gt;(let's call it CNPC for future reference)&lt;/span&gt;&lt;span style="font-family:arial;"&gt;.   Only the CNPC's can return &lt;span style="font-weight: bold;"&gt;commands &lt;/span&gt;that need to be applied to each CC.   Some commands will need to take into account distances, which will be done in the CC, commands like "SAY", movement and position data or Area of Effect spells, Thor gives in his book an example on how to do that kind of calculation easily and without spending much on calculations.   Apocalyx will need to translate the server packages from &lt;span style="font-weight: bold;"&gt;{CHANNEL:WHO:{CMD1:PARAMS}&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;{CMD2:PARAMS}&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;{CMD3:PARAMS}&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;}&lt;/span&gt; into &lt;some&gt; action on the client and &lt;span style="font-weight: bold;"&gt;WHO &lt;/span&gt;is obviously derived from the CC.&lt;br /&gt;&lt;br /&gt;Note to self:  Commands are better off as binary structures or at least send the commands list with a number to the client and have the client use a number to shorten sent IP packets.  Maybe SOX will translate and package this at some point into a binary format.&lt;br /&gt;&lt;br /&gt;Once again I find that prototyping takes so much longer than actual coding, because it really pays off to think before you program and avoid conventional code at all cost !!  Erlang rewards those who create the application logic by pattern matching.&lt;br /&gt;&lt;br /&gt;Which reminds me, a nice little Eliza implementation for a CNPC might be fun to start with, for those who don't know Eliza, it was invented as a program that would apparently answer with AI to a sentence by analyzing the sentence structure, recognizing certain words and answer with premanufactured phrases, making people think they were talking to a person, well, in the 70's it was surprising, that is.  It's still fun though and with little modifications, KVS could provide a short term memory for Eliza to keep track of what users talked about.  You may notice that &lt;span style="font-weight: bold;"&gt;pattern matching&lt;/span&gt; is precisely what makes Eliza strong ;) and hence should be trivial to implement in Erlang.&lt;br /&gt;&lt;br /&gt;&lt;/some&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;One last side note, I have not yet replaced Mnesia in SMASH&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;some&gt; given that I am still debugging KVS*.&lt;br /&gt;&lt;br /&gt;That's all for now folks,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/some&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-612951322605730067?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/612951322605730067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=612951322605730067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/612951322605730067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/612951322605730067'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/06/huh-did-you-say-something.html' title='Huh ??  Did you SAY something ??'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6842901714583042616</id><published>2009-06-08T08:47:00.014-05:00</published><updated>2009-06-09T23:32:07.751-05:00</updated><title type='text'>Tuples here, there and everywhere</title><content type='html'>&lt;span style="font-family:arial;"&gt;As I am trying to make some progress on the authorization module, I find that the required databases are getting more and more complex and with them the record structure, meaning that tuple pattern matching is quickly becoming a logistical nightmare, stuff like &lt;span style="font-style: italic; font-weight: bold;"&gt;{_,_,_,_,Variable,_&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;font-family:arial;" &gt;,_,_,_,_,_,_,_,_,_,_,_&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;} = Some_tuple&lt;/span&gt; is not very practical.   Erlang has a native &lt;span style="font-style: italic; font-weight: bold;"&gt;record&lt;/span&gt; definition, but it has some important restrictions, so I had to create a record structure for KVS2, that can correctly create, modify and read records in KVS2 by naming the fields, for this you need to create a list entry on the 2 DB structure tables.   After that, you can simply call kvs2:crtrecord(DB,Key,Data), where DB is the table &amp;amp; table structure, Key is the record name and Data is a list of tuples of {field_name, Value}, you can read with getrecord(DB, Key, [Fields]) and modify an entry with updrecord(DB,Key,Data), which works similar to crtrecord, you only need to specify the fields that will be modified.   This greatly simplifies data management and allows to change the database format in the future, too.  You can also use this functionality to manage any kind of tuple with crttuple &amp;amp; updtuple.   This should provide some more flexibility than native Erlang to manage structured tuples.  With this addition KVS2 can now handle Key-Value pairs with structured value tuples.&lt;br /&gt;&lt;br /&gt;This tuple management and the magical pattern matching will make authorizations ... almost ... a breeze.&lt;br /&gt;&lt;br /&gt;BTW, for those of you who can already employ version R13, note that there is a new function called:&lt;span style="font-weight: bold; font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a  style="font-weight: bold; font-style: italic;font-family:arial;" name="erlang:make_tuple-3"&gt;&lt;span class="bold_code"&gt;erlang:make_tuple(Arity, Default, InitList)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; &lt;/span&gt;which can create tuples with initial values, very nice addition, unfortunately Ubuntu has no support for R13 yet (unless I compile manually , yuk!), well, you can't have everything I guess.&lt;br /&gt;&lt;br /&gt;Soon more on the Chat Authorization Module (CAM).&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6842901714583042616?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/6842901714583042616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=6842901714583042616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6842901714583042616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6842901714583042616'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/06/tuples-here-there-and-everywhere.html' title='Tuples here, there and everywhere'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6368438147740423149</id><published>2009-05-26T16:28:00.006-05:00</published><updated>2009-05-27T12:55:11.283-05:00</updated><title type='text'>Regarding Status Post</title><content type='html'>&lt;span style="font-family:arial;"&gt;I believe the Status Post (below) was long, long overdue.  It describes in more detail the structure used in SMASH.   Comments are forbidden on it, so please do so on this post, the status report will stay linked on the right and change according to progress obtained.&lt;br /&gt;&lt;br /&gt;They say a picture says more than a 1000 words, so I hope that this makes all the other postings crystal clear and show what piece fits where or maybe it eliminates the last bit of clarity you had on SMASH.&lt;br /&gt;&lt;br /&gt;I believe another post with screenshots of Apocalyx and development pictures might be nice, too, maybe the next post.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6368438147740423149?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/6368438147740423149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=6368438147740423149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6368438147740423149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6368438147740423149'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/05/regading-status-post.html' title='Regarding Status Post'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-1175859035051258228</id><published>2009-05-26T10:30:00.026-05:00</published><updated>2009-06-25T11:25:17.932-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SMASH'/><category scheme='http://www.blogger.com/atom/ns#' term='Status'/><title type='text'>SMASH Status</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:78%;"&gt;Last edited on 25.06.2009&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;This document is a more technical description of where SMASH stands, describing the internal flow and architecture.  Please make sure you have read the &lt;a href="http://sunweaver.blogspot.com/2007/06/welcome-to-smash-project.html"&gt;Introduction&lt;/a&gt; first.   If you are looking for an interesting read, I also recommend Thor Alexander's two books "&lt;/span&gt;&lt;a href="http://www.amazon.com/Massively-Multiplayer-Game-Development/dp/1584502436/ref=pd_sim_b_1"&gt;&lt;span id="btAsinTitle"  style="font-family:arial;"&gt;Massively Multiplayer Game Development&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;", I use them very heavily for SMASH's development, knowing the books will make it easier to get a grasp on certain concepts.   This document will change over time as progress is made, so today's read will be different from tomorrow's and then again, maybe it won't.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;The Goal of SMASH&lt;br /&gt;&lt;/span&gt; Once SMASH is finished you will be able to create a Massive Multiplayer Online Game (MMO), a messenger-, a dynamic webpage-, an IRC- or SMS-network or anything that requires sending messages across groups of users on different servers, while being completely independent of the platform, as long as Erlang compiles on the OS.   SMASH can be upgraded in run-time without missing a beat.   The application behavior is dictated by the channel controlling NPCs or Sim Proxies (see below).&lt;/span&gt;&lt;span style="font-family:arial;"&gt;   This is why you will hear me call SMASH a&lt;/span&gt;&lt;span style="font-family:arial;"&gt; "framework" here and there, because it's mostly a generic communication network on which you can build whatever functionality you require.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;The SMASH Concept&lt;/span&gt;&lt;br /&gt;At its very heart, SMASH is a chat network, which was inspired by Joe Armstrong's e&lt;/span&gt;&lt;span style="font-family:arial;"&gt;xample from "&lt;/span&gt;&lt;a href="http://www.pragprog.com/titles/jaerlang/programming-erlang"&gt;&lt;span style="font-family:arial;"&gt;Programming Erlang: Software for a Concurrent World&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;".   Joe be at ease, I replaced all your good code with all new, lousy code.&lt;br /&gt;&lt;br /&gt;But anyway, every event in SMASH is essentially a messa&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ge sent from one participant to another.   Messages are always tell &lt;/span&gt;&lt;span style="font-family:arial;"&gt;commands, either to another player or a virtual player, also called NPC.  The means of interaction with several other players and with the game world is via chat groups, which are controlled by NPCs, those NPCs are fundamentally the same object than a player proxy, but with a different plugin to control its behavior.   To chat in channel "X" the player sends a tell to the NPC "X" which validates, if needed, the intended message and then relays it to all other subscribers of that channel "X".  So, for simple chat channels those NPCs might be doing nothing else than relaying text or they might filter offensive messages and raising flags or mute a player for a while.    NPCs will handl&lt;/span&gt;&lt;span style="font-family:arial;"&gt;e zone behaviors, by receiving requests from players, validating them and relaying resulting actions; other NPCs in that zone will be implemented as simple scripts or as other NPCs, that receive messages like any other player and act upon them.   At one point in the far future, all NPCs might be virtual players, have a decent AI and really "live" in this simulated world.&lt;br /&gt;&lt;br /&gt;Zone NPCs might want to communicate with a Physique server to validate movement action or with other zone NPCs for overlapping zones, or maybe you have a server where a simulation runs and have that simulation feed its data into SMASH;  Leo, aut&lt;/span&gt;&lt;span style="font-family:arial;"&gt;hor of Apocalyx has done a great many demos, so maybe I will modify some of his demos to transmit their actions via TCP/IP and players would be able to watch one of his soccer simulation, or car races or robot fights.  Time will tell.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How does a single SMASH node work&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qeU32xsq_yA/Shwx4NQmk7I/AAAAAAAAAEs/Ij1YBeL7QPE/s1600-h/CWF01.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_qeU32xsq_yA/Shwx4NQmk7I/AAAAAAAAAEs/Ij1YBeL7QPE/s200/CWF01.jpg" alt="" id="BLOGGER_PHOTO_ID_5340198099856298930" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;In practice a single commands in the Erlang shell starts the master node which triggers certain start-up functions and initializes the framework.  Each new node starts up as a slave node, the services get started from the master node automatically.&lt;br /&gt;&lt;br /&gt;A client connects to the SOX server (SOX) which returns a client socket for each new connection and notifies the chat server (CS) module of it.  The CS starts a new chat client (CC) or client proxy, which is the representation of a player in the framework, so if someone disconnects his virtual representation persists for a programmer defined interval.  So if someone disconnects during a fight, his toon will persist and most likely die, disconnecting won't save him, some online games omit this.  The CC can have a plugin (action handler) linked to it that will validate incoming messages, so one moment the toon is under player control, the next it might be doing some scripted action, or a NPC lives in this game world driven by this kind of plugin support.&lt;br /&gt;&lt;br /&gt;The-soon-to-be authorization module will automatically join the player to the channels he needs to be in and grant him the authorized commands with which he can operate in this virtual world.  For each group a specialized NPC is started that controls the behavior of this channel (Sim Proxy).   It might load a Logic Module for it, connect to a Physique server, load scripts to simulate objects in the zone, a dictionary to filter offensive words or even connect via TCP/IP to an application written in your favorite programming language.  At some point some NPCs will need to start by themselves to simulate an on going economy, weather or connect to another simulation.&lt;br /&gt;&lt;br /&gt;The command structure will be &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;{CHANNEL:REQ:PARAM1;PARAM2; ... PARAMn}&lt;/span&gt; from the client side, where the client can only send requests, the CC will validate if a user is authorized to that request command and if so forward it to the CNPC, which will be the unique instance to convert that request into some action and send a chat command back to each client in its channel.   The CC will pick this up, modify its value on the serve side and send back the command to the client, which handle the commands with the following structure:&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;{CHANNEL:WHO:{CMD1:PARAM1;PARAM2; ... PARAMn}&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;font-family:arial;" &gt;{CMD2:PARAMS}{CMD3:PARAMS}&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;}&lt;/span&gt;&lt;/span&gt; .  &lt;span style="font-family:arial;"&gt;This protocol is currently plain text for easy trouble shooting.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Underlying to the whole framework are some services like the Observer (OB) and Load Balancer (LB) that will restart broken services, auto start code on new nodes and decide where processes should run according to available resources.  The lowest layer so far is the database, which will be migrated from Mnesia to KVS*, the Key Value Services.  The envisioned structure is KVS for temporary NPC data or to cache behind the result of a function call to speed up certain things.   Its data is also replicated among all nodes by KVS2.   KVS2 on the other hand is a RAM resident, self replicating database.  It saves data periodically and reorganizes by itself should the master node fail.   In the future the OB and LB will follow that behavior to create a fully self reorganizing network.   All relevant data will be thrown from local loop data to KVS/KVS2 to enable a swift restart of fallen services without any data loss.   KVS* requires that SMASH follows the WORM principle (write once, read many) where only one writes a record, but any other can read it, several processes writing to the same record will mostly certainly lead to disaster and chaos.   On the other hand KVS* enables SMASH to have a fast replicating database without write locks.   KVS3 does not exist as of now and maybe never will.   The 3rd database layer is always handled in a separate module, programs must never write directly to the master database.   Currently this 3rd layer is mnesia, in the future it may be KVS3 or a separate database server cluster which will be accessed through a TCP/IP, bundling access to that database into one module makes it easy to change without breaking everything.   This layer is meant for persistent data that requires 100% accuracy and has no special speed requirement, like billing data, realm data, account information etc.  This layer will be fully implemented when everything else works.&lt;br /&gt;&lt;br /&gt;As you can see, there are not all that many pieces to the puzzle, the intention is to have as little and as few but versatile parts as necessary.   And from those right-sized buildings blocks we shall make something large, yet manageable (hopefully).   Still missing here are AI, state machines, scripts, ... you name it, a lot of stuff.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;How do several SMASH nodes work together&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qeU32xsq_yA/Shwxsf2yZeI/AAAAAAAAAEk/Dm3VSCdFEMc/s1600-h/cwf02.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 152px;" src="http://2.bp.blogspot.com/_qeU32xsq_yA/Shwxsf2yZeI/AAAAAAAAAEk/Dm3VSCdFEMc/s200/cwf02.jpg" alt="" id="BLOGGER_PHOTO_ID_5340197898689865186" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;As stated above SMASH is meant to handle many servers as one unit, so on each node the same services run and communicate through the unique Sim Proxy to each local chat group object, which in return notifies each player or virtual player (maybe smart and not zone bound NPCs).&lt;br /&gt;&lt;br /&gt;Erlang-wise these nodes need to be able to ping each other.  This inter-node behavior already works.  What's more, you can compile and update all of the code in run-time without missing a beat and given that Erlang code is platform independent, SMASH couldn't care less if a node runs on Windows, Mac, Linux, BSD or &lt;you-os-here&gt;"Your-favorite-OS-here", a small tip here, linux sockets have proven to be roughly 3x faster than Windows sockets and beginning NT4 Workstation Windows sockets will only serve up to 10 connection concurrently (on desktop versions), while others will stay idle, I don't think this has changed, so you will need to use a server version to handle many clients in parallel or use some other platform for massive amounts of connections.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The vision of the finished SMASH framework&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/you-os-here&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_qeU32xsq_yA/Shw0OEfpkVI/AAAAAAAAAE0/b2Fn9xZO5Ns/s1600-h/cwf03.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 136px;" src="http://4.bp.blogspot.com/_qeU32xsq_yA/Shw0OEfpkVI/AAAAAAAAAE0/b2Fn9xZO5Ns/s200/cwf03.jpg" alt="" id="BLOGGER_PHOTO_ID_5340200674483867986" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;This picture shows clients connecting to a global TCP/IP server which reads global data and decides where the user was at last.   So each SMASH cluster might be a zone, an instance, a realm, a site or a different game altogether.  The clients would always see the same IP it connects to, hiding the full infrastructure behind it, although this is still talking about the far future, this might well be the culmination of the whole project, a sort of "SMASH Game&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;&lt;you-os-here&gt;s Googolplex", let's call it SMAGG in short for future reference.&lt;br /&gt;&lt;br /&gt;At this point I have no idea how easy it will be to write a game in SMASH, once the CC plugin support is due, I will see to this,  SMASH will most certainly not be for script kiddies, but rather for seasoned developers with advanced skills, but I sure hope that the framework will lift the tons of weight for you to make a large scale project happen.   Once finished I will write a Database editor that will hopefully have the power to create a full game, we'll see.&lt;br /&gt;&lt;br /&gt;The current size of SMASH is under 1MB (source +compiled programs), so as you can see Erlang rocks when it comes to code size and I believe even once finished the compiled programs will be around 1 MB.   The largest part will be most definitely the database.&lt;br /&gt;&lt;br /&gt;Currently undecided is whether it's going to be open-sourced, if it will be worth while writing a book about or if I'll just scratch everything and plant a tree or two.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Contributions or how you could help&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well, while I have no real time table, given that this is just another hobby, you might be able to help, if you have a/some public domain  ... :&lt;br /&gt;&lt;br /&gt;1)   city sized BSP level(s) I might use as a zoned demo level(s).&lt;br /&gt;2)   action figures for the demos, be it cowboys, spacetroopers, aliens, elves, etc.&lt;br /&gt;3)   any kind of 3D objects, animals, furniture, etc.&lt;br /&gt;&lt;br /&gt;I am not really a 3D artist, so any free material might help, if not I'll just use Apocalyx demo material and when releasing a first playable demo ask the user to use all of Leo's .DAT files.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Signed,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/you-os-here&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-1175859035051258228?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1175859035051258228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1175859035051258228'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/05/smash-status.html' title='SMASH Status'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qeU32xsq_yA/Shwx4NQmk7I/AAAAAAAAAEs/Ij1YBeL7QPE/s72-c/CWF01.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7797488261138661664</id><published>2009-05-18T09:51:00.022-05:00</published><updated>2009-05-21T12:37:19.936-05:00</updated><title type='text'>There is always another way .. again</title><content type='html'>&lt;span style="font-family:arial;"&gt;Ulf was right, &lt;span style="font-weight: bold;"&gt;io:format(user,Format, Args)&lt;/span&gt; does print on the console it's running on, which works out so much better for me than having to install any code previously on a VM.   There is always another way, nice trick, thanks !!  I will leave the code below anyway as a proof of concept that I did at least once in my life OTP compliant Erlang code :)  !!&lt;br /&gt;&lt;br /&gt;if anybody out there knows how to make a node ping the master node from the commands line, please let me know, so far I can only make this work with &lt;span style="font-weight: bold;"&gt;-mnesia extra_db_nodes [&lt;node(s)&gt;] -mnesia start&lt;/node(s)&gt;&lt;/span&gt;.   I tried  &lt;span style="font-weight: bold;"&gt;-net_adm ping &lt;node&gt; &lt;node&gt;&lt;/node&gt;&lt;/node&gt;&lt;/span&gt;, but it does not work.&lt;br /&gt;&lt;br /&gt;My favorite fun function of the month:      &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;[net_adm:ping(X) || X &lt;- nodes(known)] &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;While I could not have any exact documentation on what "known" stands for, it seems to be a list of all nodes from previous start ups, hence this function pings &lt;span style="font-weight: bold; font-style: italic;"&gt;any&lt;/span&gt; previously known node and the result looks like a Wild West Showdown =).&lt;br /&gt;&lt;br /&gt;But anyway, with the above modification in place, once a new server connects to the master node (where the load balancer runs) the code gets copied and started automatically, the new KVS2 database gets sync'ed and the output is now relayed locally, it works like a charm.  KVS2 updates now always use the most recent record.&lt;br /&gt;&lt;br /&gt;Currently in the works is the authorization scheme to channels and what users can use what commands.   I am "erlagnizing" the concept to make pattern matching easy.    I believe it's going to be divided into 4-5 table, a &lt;span style="font-weight: bold;"&gt;user table&lt;/span&gt; with groups/channels, guild info, allowed commands and revoked commands, an account level, factions and other stuff.   Another table with the &lt;span style="font-weight: bold;"&gt;channel permissions&lt;/span&gt;, a table for account levels to differentiate guests from normal players or supervisors, a &lt;span style="font-weight: bold;"&gt;factions table, &lt;/span&gt;a&lt;span style="font-weight: bold;"&gt; guild table&lt;/span&gt; and last not least a &lt;span style="font-weight: bold;"&gt;commands resolver&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;table&lt;/span&gt; that assigns commands permitted according to account level and channel permissions.  Commands, will be the heart piece of the framework to enable players to move, fight, eat, sell, chat and other stuff, or supervisors to create new contents in run-time.   The revoked commands are meant as a feature f.e. to silence a player, or make drinking during fights impossible, immobilize a player and other mean administrator things.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7797488261138661664?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7797488261138661664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7797488261138661664' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7797488261138661664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7797488261138661664'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/05/there-is-always-another-way-again.html' title='There is always another way .. again'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-8014243362593795604</id><published>2009-05-14T17:25:00.007-05:00</published><updated>2009-05-15T16:42:49.275-05:00</updated><title type='text'>New remote process starter module</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Although process starting has never been an issue, I find one thing not so cool in Erlang, all io:format output gets sent to the node where you started it, which is very inconvenient IMHO, so I created something simple and new: the smash proxy (SP), which is a remote process starter.   Imagine you already have a set of servers running and want to join new ones with everything and starting the services on them remotely, so you monitor new nodes coming online, copy the code over to them and start processes on them, but this time around, all messages they generate will be displayed on &lt;span style="font-weight: bold;"&gt;their &lt;/span&gt;console window, not on the console you triggered that from.&lt;br /&gt;&lt;br /&gt;When starting up a new node (slave1@pcname) start the SP with the command line options "&lt;span style="font-weight: bold;"&gt;-s sp&lt;/span&gt;" or "&lt;span style="font-weight: bold;"&gt;-s sp start &lt;master-node-name&gt;&lt;/master-node-name&gt;&lt;/span&gt;", the first option will start the service, but it won't join you to the other nodes, the second option will generate a &lt;span style="font-weight: bold;"&gt;net_adm:ping(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;master-node-name&gt;&lt;/master-node-name&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;)&lt;/span&gt; saving you from having to do it manually.   From this point on you can start processes from another node on this one by sending &lt;span style="font-weight: bold;"&gt;rpc:sbcast([slave1@pcname], sp, {start,{Mod, Fun, Arg}})&lt;/span&gt; [note hat Arg must be a list, as it is passed on to spawn] to it and SP will start the process for you locally.  So it's a remote local process caller.&lt;br /&gt;&lt;br /&gt;Here is how:&lt;br /&gt;1)   Create a folder where all the other Erlang OTP applications reside, I called it "sp" (app root folder), underneath that create a folder called ebin and one called src.&lt;br /&gt;2) create a file called "info" under that root folder and put these lines in it:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:78%;"&gt;group: tools&lt;br /&gt;short: A generic SMASH process starter&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;3) go under source and create a file called "sp.erl", then throw these lines of code in it:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;-module(sp).&lt;br /&gt;-compile(export_all).&lt;br /&gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;rpc(Mod, Fun, Arg) -&gt; rpc({start, {Mod, Fun, Arg} }).&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;start() -&gt;&lt;br /&gt;register(sp, spawn(?MODULE, loop, []) ).&lt;br /&gt;start(Master) -&gt;&lt;br /&gt;register(sp, spawn(?MODULE, loop, []) ),&lt;br /&gt;io:format("SP: Spawning ping to: ~p~n",[Master]),&lt;br /&gt;?MODULE:rpc(net_adm, ping, Master).&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;%%   Normal rpc call to this same node&lt;br /&gt;rpc(Query) -&gt;&lt;br /&gt;sp ! {self(), Query},&lt;br /&gt;receive&lt;br /&gt;{kvs, Reply} -&gt;&lt;br /&gt;Reply&lt;br /&gt;after 3000 -&gt;&lt;br /&gt;{error, noresponse}&lt;br /&gt;end.&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;loop() -&gt;&lt;br /&gt;receive&lt;br /&gt;{Rpcpid, {start, {Mod, Fun, Arg}}} -&gt;&lt;br /&gt;      P1=spawn(Mod, Fun, Arg),&lt;br /&gt;      Rpcpid ! {kvs, P1},&lt;br /&gt;      loop();&lt;br /&gt;{start, {Mod, Fun, Arg}} -&gt;&lt;br /&gt;      io:format("SP: Spawning ~p ~p ~p~n",[Mod, Fun, Arg]),&lt;br /&gt;      catch(spawn(Mod, Fun, Arg)),&lt;br /&gt;      loop();&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:78%;"  &gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:78%;"&gt;%%  Standard interface&lt;br /&gt;  quit  -&gt;&lt;br /&gt;  io:format("SP: Smash Proxy shutting down=~p~n",[quit]),&lt;br /&gt;  {ok, true};&lt;br /&gt;  upgrade  -&gt;&lt;br /&gt;  io:format("SP: Smash Proxy upgrading ...~n"),&lt;br /&gt;      ?MODULE:loop();&lt;br /&gt;Any -&gt;&lt;br /&gt;  io:format("SP: Smash Proxy received Msg=~p~n", [Any]),&lt;br /&gt;  loop()&lt;br /&gt;end.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;4)   Now create &lt;span style="font-weight: bold;"&gt;sp.app&lt;/span&gt; under the &lt;span style="font-weight: bold;"&gt;ebin &lt;/span&gt;folder:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;{application, sp,&lt;br /&gt;[{description, "Serves to start applications remotely"},&lt;br /&gt;{vsn, "1.0"},&lt;br /&gt;{modules,&lt;br /&gt;[&lt;br /&gt;sp&lt;br /&gt; ]},&lt;br /&gt;{registered, [sp]},&lt;br /&gt;{applications, [stdlib, kernel, net_adm, io, mnesia]},&lt;br /&gt;{env, []}&lt;br /&gt;}&lt;br /&gt;]}.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;5) Create a file &lt;span style="font-weight: bold;"&gt;sp.appup&lt;/span&gt; under &lt;span style="font-weight: bold;"&gt;ebin&lt;/span&gt;:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;{"1.0.0.0",[],[]}.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;6) Compile the erl file and make sure that the generated beam ends up under the &lt;span style="font-weight: bold;"&gt;ebin &lt;/span&gt;folder.&lt;br /&gt;&lt;br /&gt;You are done now, call the proxy at start up as described above and you can now do remote starts with local display of data.  The src folder is not required on each node, only the &lt;span style="font-weight: bold;"&gt;ebin&lt;/span&gt;, so make sure to throw it into each new node installation and you are done.   Or take the erl/beam file only and start the Erlang VM from the same folder, it does the same job.   If you ever need to upgrade the code in runtime, then replace the beam file and send a command like this to it: &lt;span style="font-weight: bold;"&gt;sp ! upgrade&lt;/span&gt; to renew the code or do a &lt;span style="font-weight: bold;"&gt;rpc:sbcast &lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;to all nodes, as you please.  I hope it helps for your projects, too.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-8014243362593795604?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/8014243362593795604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=8014243362593795604' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/8014243362593795604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/8014243362593795604'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/05/new-remote-process-starter-module.html' title='New remote process starter module'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-896899332575081475</id><published>2009-05-11T12:22:00.017-05:00</published><updated>2009-05-14T17:26:33.468-05:00</updated><title type='text'>KVS2 continued</title><content type='html'>&lt;span style="font-family:arial;"&gt;I have extensively tested the stability of KVS2 and I am almost satisfied.   The infrastructure is rather difficult to kill now, which is a nice thing.&lt;br /&gt;&lt;br /&gt;All data written now stores when the last update happened to it and when the data is due to expire, to enable short term memory data&lt;/span&gt;&lt;span style="font-family:arial;"&gt; functionality and in the future sync'ing data among master nodes.  Now let's invent a new term, each database has a certain foundation and principles it's based on, mnesia f.e. defines that as the ACID properties, eg. atomicity, consistency, isolation and durability.  Given the design choice of KVS2 we define:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The WORM principle:&lt;/span&gt;  or "write once, read many"&lt;br /&gt;Only one single process writes a record, every other process can read from it.   &lt;/span&gt;&lt;span style="font-family:arial;"&gt;If several processes write to the same record you will have at some point inconsistent data, given the lack of write locks and random order writes.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;It would be more appropriate to call it " one writes, many read", but who can remember the acronym OWMR ??&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;So, f.e. loot data must be implemented on a zone level and hence be managed through the "zone player" process and auction house handling must be implemented as if it was a zone, WORM for the win.&lt;br /&gt;&lt;br /&gt;If we apply the WORM principle to our programming style, in theory, we preserve the ACID property that mnesia enforces on application level and we add an "S" for speed to ACID, becoming ACIDS, because mnesia fails to live up to the part where it should be real-time.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Writing a distributed database is a lot of work and fun. I wonder, how long will I be able to do without write locks ?? Hmmm !!&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;Improvements needed&lt;/span&gt;:&lt;br /&gt;1)   Make sure that a newly elected master node is really running --&gt; with a separate process on each node that verifies the masters list, its status and trigger a reelection process when needed&lt;br /&gt;2)   During start up, ping all previously know nodes, try to find running instances there, get more node names, ping them and only then start up or else you get several masters elected&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-896899332575081475?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/896899332575081475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=896899332575081475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/896899332575081475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/896899332575081475'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/05/kvs2-new-rpc.html' title='KVS2 continued'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6953522670133356483</id><published>2009-04-29T17:32:00.005-05:00</published><updated>2009-04-30T15:11:19.662-05:00</updated><title type='text'>Unintended and useful feature</title><content type='html'>&lt;span style="font-family:arial;"&gt;As mentioned in the PD below now that both modules KVS and KVS2 are working it is very easy and actually extremely useful to integrate both.   I believe the best way to do that is to make KVS post into KVS2 and once the cache is expired, delete the data again, hence creating a distributed "short term memory".   This looks like complete awesomeness for NPC memory data, imagine a NPC being killed over and over by the same player, he could remember him for a w&lt;/span&gt;&lt;span style="font-family:arial;"&gt;hile or to avoid NPC grieving, maybe it elevates its level each time, quest givers re&lt;/span&gt;&lt;span style="font-family:arial;"&gt;membering for some time who visited them, a reminder when somebody casts a spell or the spell cooldown time. Sounds like fun and it was fairly easy to implement, too.  A couple of lines to check for KVS2 and then shoot the data to it.   It had not occurred to me before, but our brain also has like 6 different memory types, so why not simulate it.   And of course, the data is replicated to the other nodes that run KVS/KVS2.  Now I am almost ready to replace mnesia.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_qeU32xsq_yA/SfjaTqemH6I/AAAAAAAAAD0/2_zuIEVnE-M/s1600-h/cube_small.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 125px;" src="http://3.bp.blogspot.com/_qeU32xsq_yA/SfjaTqemH6I/AAAAAAAAAD0/2_zuIEVnE-M/s200/cube_small.jpg" alt="" id="BLOGGER_PHOTO_ID_5330250190347968418" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;And on anoth&lt;/span&gt;&lt;span style="font-family:arial;"&gt;er &lt;/span&gt;&lt;span style="font-family:arial;"&gt;n&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ote, s&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ince I migrated to Ubuntu, programming is so much more fun, this is how my desktop look&lt;/span&gt;&lt;span style="font-family:arial;"&gt;s like, you can see the cube spinning with an aquarium in the mid, a text windows for code edition and on each plane a separate Erlang VM, very nice, programming in 3D, not on the level of Swordfish, but well almost.  Oh and the background is made from an Stargate Atlantis "the Sunken City" wallpaper I modified to become a very nice looking seamless skydome.&lt;br /&gt;&lt;br /&gt;Laters,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6953522670133356483?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/6953522670133356483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=6953522670133356483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6953522670133356483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6953522670133356483'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/04/unintended-and-useful-feature.html' title='Unintended and useful feature'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_qeU32xsq_yA/SfjaTqemH6I/AAAAAAAAAD0/2_zuIEVnE-M/s72-c/cube_small.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-2324236888849736563</id><published>2009-04-24T08:26:00.005-05:00</published><updated>2009-04-27T09:16:46.319-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KVS'/><category scheme='http://www.blogger.com/atom/ns#' term='MNESIA'/><category scheme='http://www.blogger.com/atom/ns#' term='KVS2'/><category scheme='http://www.blogger.com/atom/ns#' term='SkynetDB'/><title type='text'>Replicate this !!!</title><content type='html'>&lt;span style="font-family:arial;"&gt;Before we start, I installed the SMASH framework on a Linux machine and boy are those sockets fast, the message sync error commented in the post below does not occur, curious, latency speed gain 3:1 over Windows sockets, I am impressed.&lt;br /&gt;&lt;br /&gt;But that is no the main topic of today, I have gone over the edge and I am currently programming a 2nd Key Value Server (KVS2).  The original KVS server is a Key Value (or Name server), that caches function call results for x amount of time recaching every n seconds, the KVS2 is different.   KVS2 is designed to be a database, aka mnesia, replacement.&lt;br /&gt;&lt;br /&gt;Mnesia is a very cool design and I like it, I especially love the fact that f.e. RAM nodes can access the DB just by declaring where the master DB is, you can fragment a DB over several nodes, it has transaction capabilities and it can reside on several nodes.  If you have a lazy look up application that is awesome, but I found in real life that usually the different nodes cannot keep up with transaction volume of a MMO framework in absolutely no way, if I create one master node then I face the challenge that when a slave node does a transaction it can take up to several seconds to get a result back and if the master goes down, well, so does the whole system, if you define several masters, synchronization takes too long, way to long and if one node goes down the other starts complaining and blows up.&lt;br /&gt;&lt;br /&gt;So here comes the salvation, I hope, the birth of KVS2.  The code is distributed through the LB to the code and auto started.  The first node in the system reads its data from text files and other slave nodes copy the tables over, each table runs as a named process.   When you change or delete data that node will issue a broadcast to the other nodes to do the same transaction, hence they sync and each node enjoys having a local cache, speed, speed, speed.   If the master goes down, big deal, the other KVS2 servers are linked to the master and detect its death, so they choose a new one, so far they pick the new master simply by name, I could also very easily ask the LB and cache with KVS the value, so that they all get the same answer, but ehm, I don't.   This node is then declared the new master and end of story.  The master saves the data every 5 min to disk and you can even force a node to be the master, like when the original comes back up.   A word of warning here, if several nodes write to the same record, you can have confusing results, as there is no check that all nodes have the same data, if messages for the same record arrive in different order, you can have different records on each node, be careful, this general scheme assumes that only one process manages a certain record, like for example in SMASH, only supervisors write records.   Yet when accuracy is critical, it is very easy to send a message to the master node, the rpc interface handles that, so it can send it to the master and the master will then send it around, an easy way to ensure transactions or uniqueness without conflicting records.   Simple, short and powerful.  Obviously this still needs to be tweaked and debugged, but it is already working.   I will later on integrate a time stamp to enable servers to sync data if someone has more recent data, but for the time being I believe this new scheme solves my database requirements nicely, I have a local cache, self replicating data and a system that will work until the last node is shut down, removing all mnesia draw backs.  &lt;br /&gt;&lt;br /&gt;I will also integrate, somehow, preferred servers to be master nodes, which should make it easier to know where the files get saved to.   The keen observer may have noticed, that we lose any kind of indexes and filters, for the time being.   Filters are easy to implement actually given the &lt;span style="font-weight: bold;"&gt;[X || {Y,X} &lt;- List]&lt;/span&gt; functionality, normally we know the key "Y" and get "X" as the value, but we can filter like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Value=[Pid || {Pid,Node} &lt;- Answers, Node=:=Filter]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;grab the PID from a tuple, when we only know the node name passed to the function as "Filter".  Here we grab the value as the search value. &lt;br /&gt;&lt;br /&gt;And there will be no indexes, it is cheaper to define a small routine that creates a separate table instead.  So, a couple more days until I have the KVS2 debugged and then off to replace mnesia completely with calls to KVS2, I have to replace something like 100 calls, quite doable actually.&lt;br /&gt;&lt;br /&gt;And then I will implement the authorization scheme, urgh !!!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;P.D.   Debugging is almost done, all possible things seem to be accounted for, given the intrinsic structure of KVS and KVS2, they work like a short and long term memory, hmm I might call them both in the future Skynet Database, sounds better than Key Value Server, doesn't it ??&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-2324236888849736563?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/2324236888849736563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=2324236888849736563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/2324236888849736563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/2324236888849736563'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/04/replicate-this.html' title='Replicate this !!!'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7481819051805234674</id><published>2009-04-17T09:37:00.009-05:00</published><updated>2009-04-17T17:38:51.962-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KVS'/><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><category scheme='http://www.blogger.com/atom/ns#' term='CS'/><category scheme='http://www.blogger.com/atom/ns#' term='LB'/><category scheme='http://www.blogger.com/atom/ns#' term='BIF'/><title type='text'>There is always another way</title><content type='html'>&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;br /&gt;"There's an Italian painter, named Carlotti, and he uh, ahem, defined beauty. He said it was the summation of the parts working together in such a way that nothing needed to be added, taken away or altered [...]"    Cris Johnson (Nicholas Cage) in Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Good thing he did not talk about our code because each time I look at it I find another way of doing things, Erlang is really much faster when it matches patterns rather than using traditional programmatic code, so perfection or beauty is still a long way down the road, but anyway.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;RTFM or ... how I should really read the manual more often, I had completely overlooked the function &lt;span style="font-weight: bold;"&gt;net_kernel:monitor_nodes(true)&lt;/span&gt; .  When you subscribe to this function, in our case the load balancer (LB) does as of now, you receive a message {nodeup,Node} the instance a new node comes up so now the code gets copied and started instantly on new nodes, it couldn't be faster than this, if you blinked you just missed the copy+start process.  A message of {nodedown,Node} tells you when one disconnects.&lt;br /&gt;&lt;br /&gt;I also stumbled upon another very useful function called &lt;span style="font-weight: bold;"&gt;rpc:sbcast(Name,Msg)&lt;/span&gt; which sends a message across all connected nodes to a registered named process.  Until now the group process caches a list of all groups on the different nodes and new groups can take a while (up to 20 sec. so far) to be seen by others nodes, but given that we now register each group on each node, this function could speed this process up, without relying on cached mnesia data, my only questions is, what happens when 2 nodes do not yet see each other ??&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;Speed-Ups&lt;/span&gt;:   Every time I look at pattern matching I learn an easier way to do something, when I first started I was tempted to use traditional loops like the function &lt;span style="font-weight: bold;"&gt;lists:foreach&lt;/span&gt; then I switched to:&lt;br /&gt;&lt;br /&gt;lookup(G, [{G,Pid}|_]) -&gt; [Pid];&lt;br /&gt;lookup(G, [_|T])       -&gt; lookup(G, T);&lt;br /&gt;lookup(_,[])           -&gt; [].&lt;br /&gt;&lt;br /&gt;I find that structures like the one here are even faster than the other two:&lt;br /&gt;&lt;br /&gt;[X || {Y,X} &lt;- L]    where X is our return value , L our list to look up a value from and Y our variable to pick the correct tuple from a list.   This function is so fast that it is causing me some synchronization problems among my processes for reasons yet unknown.  This function will also serve as a command interpreter, when the client sends a string of commands, like "{cmd1:arguments}{cmd2:arguments}", I convert that list with a function I designed into a list like this [{cmd1,"arguments},{cmd2,"arguments"}] and I can then use the above [fun(Y,X) || {Y,X} &lt;- L] to run some function on each element in the list.  I might even displace Mnesia altogether, just load data in lists into the KVS&lt;span style="font-weight: bold;"&gt;, &lt;/span&gt;&lt;span&gt;look up / filter values&lt;/span&gt;&lt;span&gt; with &lt;/span&gt;&lt;span&gt;pattern matching and sync the nodes with &lt;span style="font-weight: bold;"&gt;rpc:sbcast&lt;/span&gt;. I could use the module &lt;span style="font-weight: bold;"&gt;dict&lt;/span&gt; to create a dictionary instead of a table or list, too.  Each dictionary could run in its own thread, hmm interesting.   &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;This sounds so crazy, it might &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;actually&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt; work.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;Remember that Mnesia is nice when speed is not critical, but when you need to do thousands of look ups per second across "n" nodes then the generated overhead is just too much, mnesia can't keep up, no matter how I structure it, be it several disk nodes, 1 disk node several ram nodes, the worst thing is the lack of a local cache on a ram node, hence the KVS working as a local cache.   From a mnesia centric application framework I am getting more and more towards a KVS centered data structure, the above scheme might eliminate the caching errors and I do not require really the supertight transaction property that Mnesia offers, I'll gladly trade that for speed.&lt;br /&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Designing the authorization module&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;(AUT)&lt;/span&gt;:  it will mean a large impact, because I will need to define a whole lot of logic around this, including what commands each user can perform, guild channels, raid &amp;amp; instance channel, guild structures and more, so this will take some time to complete, but the design isn't finished yet, I am still prototyping the logic.  Some nice features that will most likely come up are f.e. you will be able to define as many guild channels as you like and define their authorizations to differentiate the general channel from officer, class lead, raid or other group channels below the guild.  I will also consider instances and raid channels with ownerships, to prevent problems like an invited outsider stealing raid IDs, a documented problem that happened to other large MMOs.  Under the devised scheme an invitee will not have ownership or admin rights and it should be an easy thing to do that certain instances must be started by the owner/admins and hence avoid getting a started raid instance stolen.  The user commands wil also be important to avoid that a guild master leaves the guild without reassigning ownership to somebody else, so a GM will lack a command of GQUIT, but have a GOWN, while other members will have GQUIT, but none afiliated will have the GJOIN command sombody unafiliated will have.  The authorization module will need to combine speed with functionality so a huge fun part is coming up here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;With the speedups like the ones above, I am now facing sync problems between threads (that should not exist on the first place), the first or first few messages from a client get lost in cyberspace, I know that this is due to me cacheing values from mnesia, so I am thinking that the easiest way to avoid lost messages will be to implement a ping-pong protocol to allow the client to ping the server (once authenticated) until he gets a pong response and only then start asking the server for more stuff or start chatting.   The cacheing delay can be anything from unnoticeable to several seconds.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another curious fact is that the more functionality I design the smaller the modules get.&lt;br /&gt;The module CS which was in the beginning the master of the whole framework is becoming less and less important, with groups registering now, it is not much more than central resource locater/creator.   The CG module is now the local node relay station, down from channel admin, the logic has gone to the channel NPC.  Both are still very much required, but their role has drastically changed during development, curious.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7481819051805234674?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7481819051805234674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7481819051805234674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7481819051805234674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7481819051805234674'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/04/there-is-always-another-way.html' title='There is always another way'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-1657068944870333795</id><published>2009-04-13T09:55:00.004-05:00</published><updated>2009-04-13T12:43:48.137-05:00</updated><title type='text'>Auto Config ... baby steps</title><content type='html'>&lt;span style="font-family:arial;"&gt;While bug hunting my code I came back to one thing I always wanted, have new nodes initialize themselves, like Skynet, becoming aware of new resources and start using them.   Erlang provides a so called boot server, but no documentation exists that would clarify as to how it works, only one developer posts like half the instructions as to how set it up, but I could not make it work, I get to the point where the boot server starts, it sends the boot file and the remote node exists with an initialization error (and yes I did follow the instructions and the boot file oly contains the Erlang required modules), even analyzing the source code did not make a difference, although I found some undocumented calls, like erl_boot_server:add_subnet(mask,IP) and :would_boot that add a whole subnet to the boot server, compared to the normal function that requires you add each single IP address, which makes no sense to me and would_boot tells you if a certain IP could connect or not, fun functions, if only somebody would comment on how to set it up the whole way.  &lt;br /&gt;&lt;br /&gt;Anyway,  I said to myself, there must be another way and of course I found one.  The Load Balancer (LB) on the master node now checks for node changes every 10 sec. and reports on nodes lost (without any action so far, in the future it might restart lost processes on other nodes), nodes that stayed up (they stay untouched) and new nodes.  If a new node is found it verifies rather crudely if SMASH is loaded on that node, if not it copies the code to it and starts afterwards a slave node and tries to fire up the socket server as well, this will fail for secondary nodes on the same machine, but that's ok, the supervisor table keeps track of which one stays up, so no problem here.&lt;br /&gt;&lt;br /&gt;What this means for the framework is that you only have to start up and connect a node to the master and not worry about anything else, I love self configuring or so called zero configuration programs, so this is a step towards it; f.e. at some point when you want to fire up simulation parts and use the LB to pick a node, you know that the basic framework is already up and running, which is nice. &lt;br /&gt;&lt;br /&gt;Notes to self:&lt;/span&gt;&lt;span style="font-family:arial;"&gt;   1) keep a record of the internal and where possible external IP address of the SOX instances, maybe the No-IP Service can be helpful here.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;   2) Some work needs to be done now at the observer program to auto-restart lost processes.   3) we now create a player instance for each channel, so we probably only require to track those for the simulation, maybe every xx time we save their data to Mnesia and/or to the other group (CG) instances for pure safeguarding, both would work, Mnesia is probably the slowest yet cleanest approach.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-1657068944870333795?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/1657068944870333795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=1657068944870333795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1657068944870333795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1657068944870333795'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/04/auto-config-baby-steps.html' title='Auto Config ... baby steps'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-1004373679775041839</id><published>2009-04-07T22:05:00.004-05:00</published><updated>2009-04-08T11:37:47.704-05:00</updated><title type='text'>There is a bug in the electrical system !! (Agent J)</title><content type='html'>&lt;span style="font-family:arial;"&gt;With the new functionality in place some rewrites were necessary and some debugging of course, *sigh*.   It's impressive how many bugs one can find in his own code, I did quite some trouble shooting these days and I have finally found some strange disconnect errors, where a client would randomly DC for no apparent reason, but my latest stress tests with a couple of test clients bombarding the SMASH framework are keeping up nicely, so after the first 30 Mio I will make the audacious assumption that the bugs are now gone, the counter will hit 100 Mio sent messages across the system by tomorrow, I hope for the best =) !!  Good news also is that the system is much faster than before and the KVS is shining in our quest for speed lookups. Hmmm, now I will need to read about LUA code again and prep that Apocalyx client for testing.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;P.D.   100+ Mio messages ran through SMASH and it keeps running and running, the bugs have been eliminated and the framework is now more than ever a stable multi server soft real time messaging system, so far so good. =)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-1004373679775041839?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/1004373679775041839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=1004373679775041839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1004373679775041839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1004373679775041839'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/04/there-is-bug-in-electrical-system.html' title='There is a bug in the electrical system !! (Agent J)'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3950880043778528139</id><published>2009-03-31T11:39:00.006-05:00</published><updated>2009-04-02T10:18:13.643-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><category scheme='http://www.blogger.com/atom/ns#' term='CC'/><category scheme='http://www.blogger.com/atom/ns#' term='Action Handler'/><title type='text'>And: Action !!</title><content type='html'>&lt;span style="font-family:arial;"&gt;It is 2009 already and I have finally some time again to keep programming.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Action handling&lt;/span&gt;&lt;br /&gt;After much thought on how to implement the application behavior, currently all chat was sent around without validation and a MMO needs to have an application logic behind each channel, so specific action handling needed to be implemented to process each client info before sending it around in the channel.    I have come to the conclusion, that probably the best way to do that is to implement them as a player (CC) module with an action handler (AH), both are stand alone processes, so whenever a group gets started up, it will automatically seek in a table for the AH of that group or else start up the generic entry as the handler.  ANY message to be sent in a group gets sent to that single automated player entity, which then decides how to proceed, so for chat channels one can implement a word filter, NPC data can be implemented from here or zone channels will be able to send the movement data first to a physique server (far future) before sending that data to the clients. This single AH per channel will also keep track of connected clients, no matter what node they come from.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some lessons learned of programming in Erlang:  &lt;/span&gt;&lt;br /&gt;First lesson: there are so many ways of implementing a certain behavior, it's mind boggling, one can choose from creating vanilla subroutines, a cherry mono- or multi-tasked applet, a table entry, a DB table or whole self managed entities, the choice is really vast and the problem is that you can be quite dynamic, so I have to sometimes go back and reread where all the magic comes from, all or most choices seem to be on par speedwise.   Once decided, implementing it is a snap.&lt;br /&gt;Second lesson:  right size your multi-tasking; it's so tempting to create many, many processes, but syncronization can sometimes be a pain, so double check when to MT and when no to. Even when sync-ing is no problem, don't forget the possible size of the outcome, f.e. in the very beginning I sent each chat command as a separate task, but when I did the stress test with 50'000 generated users over 5 servers I found that 2.5 Billon concurrent tasks was a tad too much to handle for the framework, I wonder why that would be, how lame  !!!     =P&lt;br /&gt;Third lesson:   And Erlang programmers will hate me for this: OTP sucks big time, I found that it is much easier to write my own functionality, including but not limited to code upgrades in runtime across all connected servers, which requires a Doctor title in OTP to get to work, but only little effort to programm oneself, nowadays I only kick in some very few lines of code and voila, it upgrades !!&lt;br /&gt;Forth lesson: they say love comes quickly and so does complexity !!  Programs in Erlang are short and concise, but when implementing something new I find myself rewriting code in 5-6 programs in parallel, which isn't harder, but very different from "normal" programming languages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Next&lt;/span&gt; to come is a channel authorization table that decides at logon (or later) what client should connect to which channel(s).  I will also implement channel authorizations for that, which will be interesting =O, some must be system assigned (zones and instances), others with password, by group assignment (like a guild f.e.), open or user managed, so this will be an important feature and also some piece of work as I need to rewrite some code for that.  Before or after that I will implement the first NPCs with some limited actions, oh and I still need to get the object table into the Apocalyx client to handle mutiple objects.  But after these tasks I have the basic capabilities for an MMO, that is good news.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;And Hello World !! &lt;/span&gt; Since my last update I seem to be getting quite a lof of hits on this blog I can even google this blog, much to my surprise actually and scary, too.   SMASH is not ready for prime time after all and it may still be a while, due to the fact that I only do this on my spare time.   So for the newcomer:   feel free to read the MISSION STATEMENT&lt;mission&gt;. This is still vaporware, but whatever is mentioned herein is actually implemented, so one day (hopefully this year) the framework will be up and running and I will set up a closed alpha server for some testing.   But I will not haste anything, quality overrules time requirements.&lt;br /&gt;&lt;br /&gt;That's all for now !!&lt;br /&gt;&lt;br /&gt;Cheers&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/mission&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3950880043778528139?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3950880043778528139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3950880043778528139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3950880043778528139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3950880043778528139'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2009/03/and-action.html' title='And: Action !!'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6409776280395232636</id><published>2008-09-03T12:00:00.005-05:00</published><updated>2008-09-03T12:11:47.235-05:00</updated><title type='text'>No updates around here ??</title><content type='html'>&lt;span style="font-family:arial;"&gt;As it happens from time to time, excess of activities force us to put some of our projects on-hold during those moments, so for the moment there are no updates because of lack of time for development, but the project is not dead.   Also, I recently stumbled across another MMO platform that comes conveniently with source code, which I am studying, too; the Mangos-Project.   Interesting and inspiring stuff, although I won't implement their ideas into SMASH.   I guess some more news will be out like at the end of September, with the multi-player display and some improved chat functions.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6409776280395232636?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/6409776280395232636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=6409776280395232636' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6409776280395232636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6409776280395232636'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/09/no-updates-around-here.html' title='No updates around here ??'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-239241929416631083</id><published>2008-06-02T16:48:00.005-05:00</published><updated>2008-06-02T17:38:47.418-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><title type='text'>Dynamic Environments</title><content type='html'>&lt;span style="font-family: arial;"&gt;There hasn't been any update in almost 2 weeks, I know, and there won't be much to talk about at the moment.   I am trying to find out how to create Dynamic Environments, sort of "SimCity"-like dynamic scenarios, where you create buildings and everything.   Simple as it sounds, this is quite a challenge for the noob-Apocalyx'er like me, so you can imagine the fun I am having here.   What I have in mind is something like this:&lt;br /&gt;&lt;br /&gt;1)   Changeable height maps (at some point), at first the world is going to be flat as a flounder.&lt;br /&gt;2)   The Wild West:   People build houses, villages, mountains, valleys,  farming, dynamic trees, etc.&lt;br /&gt;3)   Mega Cities:  Think of living in a &lt;a href="http://en.wikipedia.org/wiki/Mega-City_One"&gt;Mega City&lt;/a&gt; like in the movie "The Judge" or "Star Wars" cities like &lt;a href="http://en.wikipedia.org/wiki/Nar_Shaddaa"&gt;Nar Shaddaa&lt;/a&gt; (cf. Wikipedia links). &lt;br /&gt;&lt;br /&gt;Once we have the ability to just drop building blocks onto each other we can then build in runtime really large scenarios, with very high buildings, several levels, etc.   This sounds very appealing to me and will allow for a more dynamic game play.  What it implies is to create a collision detection per object, bounding boxes and a physique simulator, all of which are included in Apocalyx, it's just a question of finding out "how".   =O&lt;br /&gt;&lt;br /&gt;And well, I have yet to finish the routine to add multiple object to the scene, that will enable the above functionality in the first place, much work ahead and so little time, but then it's better to do it right from the beginning, instead of fixing it later on.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-239241929416631083?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/239241929416631083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=239241929416631083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/239241929416631083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/239241929416631083'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/06/dynamic-environments.html' title='Dynamic Environments'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7113980632800672746</id><published>2008-05-19T10:35:00.005-05:00</published><updated>2008-05-19T13:31:27.897-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><title type='text'>And the changes go on</title><content type='html'>&lt;span style="font-family:arial;"&gt;There hasn't been much to show for the moment and for some reason.   In order to progress on the GUI side it is much required to be able to know, who is present on the channel, so any object present in a zone needs to report it's there, so the CG was modified and now responds with the names of everyone present, this will now require an object database, where you can then look up what's what and who's who, so the client knows what to draw, most likely it will inquire each CC object to avoid DB lookup penalties.  Once that is done, we can now proceed to create the SIM Object table on Apocalyx. &lt;br /&gt;&lt;br /&gt;Also, another change was made to the CI routine, the one that compiles and installs new code on all connected servers, it now recognizes all Smash processes on all nodes and updates those processes that run old code, it does that by swiping the processes on all nodes and sending upgrade signals to the "old ones", just as a fail safe to make sure that all processes are ready for upgrade anytime.  Updating the whole system in runtime has never been safer, remember that one of the goals is to update the system without ever shutting it down.   And to all Erlang veterans: this is about a 1000x easier than using the OTP way, which requires a doctor degree to make upgrades happen.  In this system just open a node for compiles, debug your code changes until no errors occur in the shell (or else running processes bomb out as per Erlang VM specs) and then type "ci()", which will distribute and upgrade all code on all nodes, now THAT is easy.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7113980632800672746?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7113980632800672746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7113980632800672746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7113980632800672746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7113980632800672746'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/05/and-changes-go-on.html' title='And the changes go on'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7232702910592517978</id><published>2008-05-12T10:59:00.011-05:00</published><updated>2008-05-12T14:12:10.913-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BSP'/><category scheme='http://www.blogger.com/atom/ns#' term='LUA'/><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><title type='text'>Testing a BSP level</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_qeU32xsq_yA/SChzV-6g3FI/AAAAAAAAACg/-T_CGx7g9QE/s1600-h/smash-2.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px; height: 154px;" src="http://2.bp.blogspot.com/_qeU32xsq_yA/SChzV-6g3FI/AAAAAAAAACg/-T_CGx7g9QE/s200/smash-2.png" alt="" id="BLOGGER_PHOTO_ID_5199532591302106194" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;As stated before, the next updates will be somewhat slower because of the obvious learning curve to understand LUA &amp;amp; Apocalyx.   Some work has been going on to create a login screen, which is still incomplete, but it's underway at least a first glance:  the background comes from the gui.lua demo and is using the GLGooey for the dialog (so far).  The background will change, the important things is to try that GUI out.&lt;br /&gt;&lt;br /&gt;As I tried to adapt a city level BSP, I ran into some noob problems, but fortunately Leo (creator of Apocalyx) helped promptly to solve them [ Thanks again Leo ], so here is what the same soldier looks like in a city:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: arial;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qeU32xsq_yA/SChz2u6g3GI/AAAAAAAAACo/nrMm2xx06sM/s1600-h/smash-3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_qeU32xsq_yA/SChz2u6g3GI/AAAAAAAAACo/nrMm2xx06sM/s200/smash-3.png" alt="" id="BLOGGER_PHOTO_ID_5199533153942821986" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;What you see here is Leo's city from Urban Tactics.   The toon's position now gets transmitted automatically every 200 ms whenever the position is marked "dirty", meaning, that there was a change and the 200 ms is the minimum interval permitted by Smash, send more often and your client will be in trouble, because the sockets are blocked for 200 ms (to avoid flooding) on the server side.&lt;br /&gt;&lt;br /&gt;Currently underway is making the login work and creating the table structure for all network created objects like other players, NPCs, cars, trees, grass, boxes and whatever comes to mind.   I am thinking of make certain objects client persistent, so the server sends those persistent objects once specifying model, position, orientation, size, expiration and an object name and all the following times the client only checks those objects by expiration date and object name only, instead of downloading the full set of data again, once I get the object table in place that is.&lt;br /&gt;&lt;br /&gt;Live long and prosper,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7232702910592517978?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7232702910592517978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7232702910592517978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7232702910592517978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7232702910592517978'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/05/testing-bsp-level.html' title='Testing a BSP level'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_qeU32xsq_yA/SChzV-6g3FI/AAAAAAAAACg/-T_CGx7g9QE/s72-c/smash-2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3950725966345272048</id><published>2008-05-07T08:33:00.012-05:00</published><updated>2008-05-07T17:35:12.004-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><category scheme='http://www.blogger.com/atom/ns#' term='Screenshot'/><title type='text'>A first peek at SMASH</title><content type='html'>&lt;span style="font-family:arial;"&gt;A picture says more than a thousand words, so here it goes, this is the very first screenshot taken from the Smash Apocalyx Duo (should I call this SAD ??):&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_qeU32xsq_yA/SCG16IORodI/AAAAAAAAABU/kDydf5uXFJA/s1600-h/smash-1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_qeU32xsq_yA/SCG16IORodI/AAAAAAAAABU/kDydf5uXFJA/s320/smash-1.jpg" alt="" id="BLOGGER_PHOTO_ID_5197635455206662610" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;What you are seeing is a modified version of one of the basic model demos from Apocalyx with the console overlay displayed, where one can see the  network information, in this case a successful logon, some positional data that the client sent and some other test clients who logged onto the server.  Now we need to display other items, users and chat in this empty game world and a change on the framework (probably a whisper from each CG) to know who is on each zone channel, but we are getting there =) .   &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Laters,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3950725966345272048?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3950725966345272048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3950725966345272048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3950725966345272048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3950725966345272048'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/05/first-peek-of-smash.html' title='A first peek at SMASH'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_qeU32xsq_yA/SCG16IORodI/AAAAAAAAABU/kDydf5uXFJA/s72-c/smash-1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-1495125677471967948</id><published>2008-05-05T09:39:00.004-05:00</published><updated>2008-05-07T09:04:06.456-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><category scheme='http://www.blogger.com/atom/ns#' term='CG'/><category scheme='http://www.blogger.com/atom/ns#' term='CC'/><category scheme='http://www.blogger.com/atom/ns#' term='WIP'/><title type='text'>Still working on a first Apocalyx front-end</title><content type='html'>&lt;span style="font-family:arial;"&gt;Well, Apocalyx LUA is tougher than envisoned, we are still trying to produce a first GUI, but just not ... yet.   A couple more days I suppose.   So far we merged the MD3 demo with the network demo and the mini applet connects to the server, authenticates and the soldier runs around in circles, you can send position data at the push of a button and that's it so far.   We are still fighting with the camera, which just won't stick to the avatar, but well.   What's clear is that we need somehow a channel manager that logs who is on each server channel, so newcomers can query for other objects in the gaming world or we need to expand the CG threads to report that info back per node, it would be less error prone if something fails.  And also required now is a vocabulary check at the socket server level, to filter out what commands a user can utilize, remember that users should be able to do different things according to their profile and/or authorizations.  Also maybe a filter should be implemented that allows only one command of a certain category, like movement, chat, whisper, change equipment and such, or users might wanna cheat sending several movement commands at once and move faster than allowed, so that needs to be taken care of.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So the next steps for the week to come are:&lt;/span&gt;&lt;br /&gt;*   Sending Apocalyx movement, orientation, char and chat data around a chat channel&lt;br /&gt;*   Chose a BSP scenario, not just a blank endless terrain, maybe Genoa or city.bsp&lt;br /&gt;*   Modify CG behavior to include a report on who is on that channel&lt;br /&gt;*   Command permissions per user level and/or specific user&lt;br /&gt;*   Filter multiple commands to avoid cheating (+fix a CC send bug)&lt;br /&gt;&lt;br /&gt;And that's plenty for now.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-1495125677471967948?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/1495125677471967948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=1495125677471967948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1495125677471967948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1495125677471967948'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/05/still-working-on-first-apocalyx-front.html' title='Still working on a first Apocalyx front-end'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-1430732276017630358</id><published>2008-05-03T10:37:00.004-05:00</published><updated>2008-05-19T13:39:27.722-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Load Balancer'/><category scheme='http://www.blogger.com/atom/ns#' term='LB'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloud Computing'/><title type='text'>The Load Balancer is ready for prime time</title><content type='html'>&lt;span style="font-family:arial;"&gt;The Apocalyx frontend is not yet ready, I am still messing around with that and well it's not showing yet anything, but soon, very soon.   BUT, the Load Balancer (LB) is ready to be integrated into SMASH.   The LB will check for speed on each connected node and how many processes are running, then it calculates what that means in terms of availability for the cloud.   This game is a zero sum game, but for the final evaluation, every single node will count, negative values are not permitted, then the total percentage is done.   For the end user there are 2 procedures to be called, remote rpc (rrpc) and remote spawn (rspawn).  rrpc will spawn a procedure remotely and wait max. for one sec for the result or rspawn will spawn a procedure remotely and return the PID, in case that the procedure takes longer or you need to spawn a server.   Those 2 procedures should do for the generic cloud service.   This might even mean a strong impact on the Simulation itself that will run on the framework, the initial idea was to run a zone one a single node, but with the LB there is really no need for any kind of restriction, you could run the Sim threads all over the place.   Let's see what that does for the framework :) .&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-1430732276017630358?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/1430732276017630358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=1430732276017630358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1430732276017630358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/1430732276017630358'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/05/load-balancer-is-ready-for-prime-time.html' title='The Load Balancer is ready for prime time'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3456796570219283292</id><published>2008-04-28T09:07:00.006-05:00</published><updated>2008-05-19T13:33:11.111-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KVS'/><category scheme='http://www.blogger.com/atom/ns#' term='CC'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloud Computing'/><title type='text'>Some more remote utilities</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;Some might know that SMASH has included into its belly an automatic updating system, which allows to compile all modules and reload them on all connected nodes in run time, without ever shutting the system down.   On occasions this fails and a certain service shuts down.   To get a hang on this, we have created some utility routines, one permits to execute commands remotely (on the other nodes) and the other shows if any module is executing old code, so very soon we will be able to first check what module on which node is executing old code before a new compile is allowed.   So far the problem seems only to reside on longer lasting timers, which are not included in the update signal, all others update correctly (it seems).   Also with these utility routines we could now easily start all preconfigured services (in the cluster file) remotely, without needing to touch then anymore.   Some other fixes are that the CC proxy can now send tells or whispers without subscribing to any channel; KVS can now cache and forget, when you ask kvs:cache(M,F,A,Timer) it now will update every "Timer" ms and forget about the value after a minute, so the dictionary does not pile up with hundreds of unused values, this works like a garbage collection to keep KVS trim and slim.&lt;/span&gt;   And more tests on Mnesia have been executed and curious enough on remote nodes the dirty function is slower than the normal database access with transactions and as to be expected KVS suffers from the initial Mnesia access, but afterwards blazes thru repeated accesses, so no matter how much we try to optimize the database access, the cached behind KVS approach is still the best when repeated access to data is required.   Dedicated MMO literature also comes to the conclusion that processes on a multi server structure should update their data every 5 sec., less seems to be too much.  And the cloud infrastucture has given some new ideas, Erlang already has the ability to spawn remote processes, so I guess, we just might implement our own flavour of it, by speed measuring each connected node and on the other hand check how many processes are already running there, this could be something like a routine task that executes per "X" interval and then when asked to spawn a process it checks for the best node to do so, a kind of "cloud_spawn(M,F,A)".   This would make the SMASH ready to process any kind of task actually, not just a specialized Simulation Framework.  It just might happen =) .&lt;br /&gt;&lt;br /&gt;And Apocalyx can indeed use tables to store toon data, I played around with the Urban Tactics demo and it can easily handle some 200 toons running around there, very nice, now we need this networked.  ;)&lt;br /&gt;&lt;br /&gt;Laters,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3456796570219283292?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3456796570219283292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3456796570219283292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3456796570219283292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3456796570219283292'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/some-more-remote-utilities.html' title='Some more remote utilities'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-5389980072284189865</id><published>2008-04-25T16:17:00.007-05:00</published><updated>2008-04-25T17:43:28.664-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Grid Computing'/><category scheme='http://www.blogger.com/atom/ns#' term='Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloud Computing'/><title type='text'>Does SMASH do Cloud Computing ??</title><content type='html'>&lt;span style="font-family:arial;"&gt;I was asked the other day if the SMASH does Cloud Computing or Grid Computing [cf. &lt;a href="http://en.wikipedia.org/wiki/Cloud_computing"&gt;Cloud Computing&lt;/a&gt; from Wikipedia] and the answer is that while there is still a lot of ground to cover, in essence that is what the basic framework will do.   The Load Balancer (LB) will check for the best resources to allocate (this is still future music) and distribute the simulation accordingly.  The basic idea is the same, if you look at the &lt;a href="http://en.wikipedia.org/wiki/Cloud_computing#Architecture"&gt;graphic&lt;/a&gt; on Wikipedia, the cluster table (that we will have at some point and which will define how the cluster should behave) corresponds loosely to service catalog, the provisioning tool basically does what the LB will do and the Monitor is in essence what the Observer does.   Once the pieces fall in place we will obviously also need a Systems Management component, which might be part of the cluster behavior.&lt;br /&gt;&lt;br /&gt;So, given that this project was started like 4 years ago, the word "Cloud Computing" did not exist at that time, it seems to have formed during late 2007, but the idea of covering massive computations by networking them on many servers, instead of a large scale server is the same, so in essence I guess, SMASH is a Cloud Computing Framework and what's more, thanks to the unbelievable Virtual machine that Erlang runs on, we can already run cross-platform, the test cluster SMASH is being programmed on, consists of Windows, Linux and MacOS X systems.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-5389980072284189865?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/5389980072284189865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=5389980072284189865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5389980072284189865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5389980072284189865'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/does-smash-do-cloud-computing.html' title='Does SMASH do Cloud Computing ??'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7983950219958433020</id><published>2008-04-21T10:29:00.011-05:00</published><updated>2008-04-25T16:39:03.650-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KVS'/><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><title type='text'>48 hours of endurance</title><content type='html'>&lt;span style="font-family:arial;"&gt;Alright, not much to report for now, except for some minor changes on the Observer side, which did not catch all required objects.     And the channel management requires a major overhaul, whisper commands currently trigger being subscribed to that channel, which isn't exactly desirable, meaning that we will require authorization management, ouch.  That's a major CG (chat group controller) rewrite, but anyway.&lt;br /&gt;&lt;br /&gt;And now to the 48 hours test: yes the server holds up.   The caching Key Value Server (KVS) makes the whole thing fly and no messages pile up, things have never been so fast, it does not matter where a client connects to, the SMASH framework relays the messages blazingly fast to other nodes, so we know by now.  This concludes stability and speed tests for the time being.&lt;br /&gt;&lt;br /&gt;Leo, if you are reading this, I sure hope that Apocalyx permits me to create each 3D object as a table entry and not just as a variable, like your examples showing variables like avatar0 - avatar6 and so on.   I will be needing to create a LUA table and put each avatar as one entry and then update that table.   I guess once your new Gun Tactyx is out I might try to "socket" it and permit people to connect to a fighting event, we'll see, so now back to learning Apocalyx.   And yes you should be able to see some kind of graph here soon, to reflect what we got so far.&lt;br /&gt;&lt;br /&gt;Stay tuned,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;EDIT: I shortened the post.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7983950219958433020?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7983950219958433020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7983950219958433020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7983950219958433020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7983950219958433020'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/48-hours-endurance-test-take-1.html' title='48 hours of endurance'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3365623411363359241</id><published>2008-04-17T08:42:00.006-05:00</published><updated>2008-04-25T16:40:03.031-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KVS'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>And there shall be speed</title><content type='html'>&lt;span style="font-family:arial;"&gt;It seems that the new caching KVS server does miracles, the message throughput of the whole framework went through the roof, up from a maximum of 7000 messages per second (averaging 2500 at heavy load) to a minimum of 150'000 messages, that's a 2100% increase, not bad.   So, now we are indeed ready for the next step, Apocalyx here we come, the next thing will be to visualize our first GUI.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3365623411363359241?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3365623411363359241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3365623411363359241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3365623411363359241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3365623411363359241'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/and-there-shall-be-speed.html' title='And there shall be speed'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7770624287326417411</id><published>2008-04-15T09:24:00.004-05:00</published><updated>2008-04-25T16:41:18.546-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tests'/><category scheme='http://www.blogger.com/atom/ns#' term='KVS'/><category scheme='http://www.blogger.com/atom/ns#' term='PS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Need for speed</title><content type='html'>&lt;span style="font-family:arial;"&gt;When doing the first message bombardment on the server and the news are mixed ones.   On the one hand the server does not crash, which is nice, but after a while it starts to behave irrationally, like when logging out and logging back in, it does not seem to delete users from the DB anymore, so a kind of measurement is needed.   Writing some quick benchmarks it turns out that the Chat Server (CS) can do 600'000 messages per second (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;mps&lt;/span&gt;) and the DB &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;lookup&lt;/span&gt; in the chat group can only do about 6'800 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;mps&lt;/span&gt;, with 16 clients connected we get up to 2'600 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;mps&lt;/span&gt;, but I suppose that the constant bombardment becomes a problem at some point, because &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Erlang&lt;/span&gt; starts piling up messages and the missing client deletion from the DB is most likely the same cause, so a first conclusion is that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Mnesia&lt;/span&gt; can't keep up with all those &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;lookups&lt;/span&gt; on the DB and this causes messages to pile up like crazy.   Fortunately this was likely to happen and now we have a legal excuse to use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;KVS&lt;/span&gt; (Key Value Server), which has been completely dormant until now.   The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;KVS&lt;/span&gt; will need to grab this kind of data from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Mnesia&lt;/span&gt; and put it in a local table.  The big difference now will be this, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;KVS&lt;/span&gt; will only load the data from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;Mnesia&lt;/span&gt; every "x" time intervals, like maybe every second or every 5, meaning that we will lose precision in order to gain speed.   We will now have to segregate our operations,  those that require ultimate precision like close by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;moveable&lt;/span&gt; objects, banks, auction houses, trades and loot operations and others like chat, or even general environment operations that do not require the most precision.  And we need to start with the Chat Group structure.  This should be really easy to do, we will see if things speed up &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;afterwards&lt;/span&gt;.   A general throughput of 500'000 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;mps&lt;/span&gt; looks like our boy, but 7'000 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;mps&lt;/span&gt; does not.&lt;br /&gt;&lt;br /&gt;And surprise, surprise, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;Playstation&lt;/span&gt; 3 is not nearly as powerful as hoped for as a server, it's depending on the test 4-10 slower than a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;Dual core&lt;/span&gt; Windows Laptop, averaging so far like 6x slower, how very &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_18"&gt;disappointing.&lt;/span&gt;   In the CS test it scores at 95'000 mps, the DB lookup only gets 4'400 mps and it takes 24 sec.  to create 10'000 CC clients, while the Laptop does that job in 7 sec., OUCH !!!!!&lt;br /&gt;&lt;br /&gt;Long live the benchmarks.&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;Sunweaver&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7770624287326417411?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7770624287326417411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7770624287326417411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7770624287326417411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7770624287326417411'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/need-for-speed.html' title='Need for speed'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7760406378808965471</id><published>2008-04-09T08:53:00.013-05:00</published><updated>2008-04-25T16:41:33.820-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WIP'/><title type='text'>Notes on the work in progress</title><content type='html'>&lt;span style="font-family:arial;"&gt;Today we will get into some more detail as to what the WIP list means and check what comes next:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Work in progress (WIP) of the To-Do List:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Create an action plug in template [easy / pending]&lt;/span&gt;&lt;br /&gt;Currently a user logs on and a socket +  chat client process are created, what is needed now is another process that will sort out what to do with the messages, what this means is that the socket is the non-transient part of the user, if he disconnects this process gets killed immediately, but the CC client stays there for "x" time, so a user cannot just logout when in danger and no harm will happen to him, this CC socket guarantees, that he cannot cheat by quickly logging out.   The plugin is required to process his requests and whatever comes to him, this includes for example:&lt;br /&gt;&lt;br /&gt;&gt;&gt; Action dictionary:   what actions the user may execute, like chatting, moving, joining other channels, changing clothes and other stuff, so with that you could simply delete chat from his action list and mute the user, remove his movement ability and have him stand still or disallow a certain spell for a while.&lt;br /&gt;&lt;br /&gt;&gt;&gt; Swap the action plugin:  under certain circumstances you may want to put the user under script control, like for cut scenes or "mind control" a user by another user, so being able to switch the action plugin is helpful.&lt;br /&gt;&lt;br /&gt;&gt;&gt;  Put in the ability to have several plugins, this way we could f.e. log all chat activity, maybe this is not required.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Internal user registration (to avoid same user on several nodes) [easy / partially done]&lt;/span&gt;&lt;br /&gt;This is done for the CC processes, but needs to be done as well for socket processes, this shouldn't be too hard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Cluster behavior [medium&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;]&lt;/span&gt;&lt;br /&gt;Here we might predefine what server does what task and what to do when that server is unavailable.   This way we don't have to configure our cluster each time we start it up.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Zone Simulation Manager [medium / WIP]&lt;/span&gt;&lt;br /&gt;This part will include a chat manager for a certain zone and to extract from the database all the objects that are contained within it, like fixed objects and moving objects.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* TPC/IP server with authentication [medium / WIP] + protocol converter [medium / WIP]&lt;/span&gt;&lt;br /&gt;This is basically done, what's missing is the above mentioned database registration for logged on users.  The server has already functionality in place to block certain IPs and to avoid flooding by disallowing the port for 100ms, hence only 10 actions per second are possible.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* TCP/IP test client [medium / WIP]&lt;/span&gt;&lt;br /&gt;First client is done, which is a simple text client that displays all messages and crashes *sigh* after minutes or hours because it can't handle all the display stuff, next a graphical client is needed, this will be done in Apocalyx.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Apocalyx integration [medium&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;]&lt;/span&gt;&lt;br /&gt;The first client in Apocalyx is right ahead, this is the next step that we need to create, hopefully not too much of a mess to do.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Master node [hard / WIP]&lt;br /&gt;&lt;/span&gt;The ultimate goal of this is to run a process on the master node that "thinks" for the rest of the infrastructure, like how many processes are running on each node, how many SOX users, CC users, Sims and so on and rebalance the equation, this will require a lot of work and will be most likely the last thing to do.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* NPC scripts [hard&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;]&lt;/span&gt;&lt;br /&gt;This will represent a mayor effort to finish, given that this will have to handle scripted quest givers, movement from one place to the other and simulate AI to give the NPCs a certain life and methods of learning, exciting but difficult, given the overall broad approach.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Subscription Server [hard / partially done]&lt;/span&gt;&lt;br /&gt;The first part is already implemented, each user has a validity period after which he cannot log on anymore, you can already, per shell, increase the period, but we cannot handle prolonged subscriptions as of yet nor do we have like a web-based secure server in place for this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Interrealm connector [hard&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;]&lt;/span&gt;&lt;br /&gt;In a word:  Think BIG !!   Each realm might be a separate instance of the same Simulation/Game or it might be a completely different game, so user data needs to be copied over, and obviously a domain/realm browser needs to be created.  Sounds like fun.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;* Physique server implementation [medium / pending]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;This can be done the easy or the very hard way by duplicating all the Apocalyx logic into Erlang (sounds like disgusting) or to use Apocalyx itself.   If we use Apocalyx, then we have to have a client (probably for each zone) that runs it and every user will send their requests like this:&lt;br /&gt;&lt;br /&gt;game client --&gt; SOX --&gt; CC --&gt; action plugin (sorting out movements) --&gt; physique server (sort out the ACTUAL possible moves) --&gt; action plugin --&gt; CC --&gt; SOX --&gt; game client.&lt;br /&gt;&lt;br /&gt;In order to make this work, the Physique server needs to do a simple rendering, that does not use any textures or coplex figures, so we might represent of all items only the bounding boxes for collisions and represent users as boxes, this should make this process painless and fast and if a collision is detected then only the real movement gets reported back.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So the next steps are the SOX database registration to avoid double logins and to create a simple Apocalyx client.   After that the zoning and char room part with authorizations is due.&lt;br /&gt;&lt;br /&gt;Warm regads,&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7760406378808965471?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7760406378808965471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7760406378808965471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7760406378808965471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7760406378808965471'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/notes-on-wip.html' title='Notes on the work in progress'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6171093240438879716</id><published>2008-04-04T09:18:00.006-05:00</published><updated>2008-04-25T16:41:55.026-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOX'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><title type='text'>SOX now upgrades correctly</title><content type='html'>&lt;span style="font-family:arial;"&gt;One issue in the past had been, that the socket server could not be upgraded in runtime, but now it works, so we can as of now upgrade the code in runtime the whole system and not lose a heartbeat, no disconnects, nothing, the system keeps running.   What this means is that we can have our game running, while you kepp customizing your code and then just compile+load the code on all connected servers while players are online and they won't even notice you changed something.   This should greatly facilitate maintenance tasks and avoid any kind of downtimes.  And now back to the other pending items.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6171093240438879716?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/6171093240438879716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=6171093240438879716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6171093240438879716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6171093240438879716'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/sox-now-upgrades-correctly.html' title='SOX now upgrades correctly'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-5658547233326473833</id><published>2008-04-01T13:04:00.007-05:00</published><updated>2008-04-25T16:42:15.095-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WIP'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Tuning to perform</title><content type='html'>&lt;span style="font-family:arial;"&gt;The initial performance is being tweaked, while not bad we feel, that more can be done here regardng message passing and some first strange errors have appeared, no showstoppers, but something to deal with.&lt;br /&gt;&lt;br /&gt;Also under current analysis is how to proceed with zones and where players show up, should one player appear in the next zone when he is close to the next one, that would mean like overlapping zones and if a player is in the center he only reports his position into one if he runs towards a corner he would potentially  run into up to 4 overlapping zones ... or is it better to make smaller zones and always send the coordinates into all surrounding zones, which would mean always to transmit into 9 zones.   Zones could also be done through range lists and handle everything like one large zone.   In order to determine this, Apocalyx will be required, so next steps must include a graphical frontend already.  More coming soon.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Work in progress (WIP) of the To-Do List:&lt;/span&gt;&lt;br /&gt;* Create an action plug in template [easy / pending]&lt;br /&gt;* Internal user registration (to avoid same user on several nodes) [easy / partially done]&lt;br /&gt;* Cluster behavior [medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;br /&gt;* Zone Simulation Manager [medium / WIP]&lt;br /&gt;* TPC/IP server with authentication [medium / WIP] + protocol converter [medium / WIP]&lt;br /&gt;* TCP/IP test client [medium / WIP]&lt;br /&gt;* Apocalyx integration [medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;br /&gt;* Master node [hard / WIP]&lt;br /&gt;* NPC scripts [hard&lt;/span&gt;&lt;span style="font-family:arial;"&gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;br /&gt;* Subscription Server [hard / partially done]&lt;br /&gt;* Interrealm connector [hard&lt;/span&gt;&lt;span style="font-family:arial;"&gt; / pending&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-5658547233326473833?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/5658547233326473833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=5658547233326473833' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5658547233326473833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/5658547233326473833'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/04/tuning-to-perform.html' title='Tuning to perform'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3752852276426135414</id><published>2008-03-24T10:34:00.006-05:00</published><updated>2008-04-25T16:42:55.079-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOX'/><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><title type='text'>SMASH to Planet Earth ... ??</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:arial;" &gt;While not finished by a long shot, we can now communicate between TCP/IP clients and the SMASH framework.  The integration is not yet 100% complete, but one can now authenticate from any TCP client against the accounts table and create a chat client (CC: the player proxy).   Any chat as of yet joins prefixed chat channels, this needs still a lot of work, like a channels DB, with authorizations to join, chat, listen, member list, password and so on, but at the very least you can now chat in 'general' and broadcast to any connected "player".   This also works across nodes, so you can connect to different SOX servers that run on SMASH and even if the CC was created on a different node and still persists, as expected, the SOX thread correctly communicates with that CC, phew !!!&lt;br /&gt;&lt;br /&gt;So, what's next ??   Now comes first of all a light test, after creating a scripted Delphi client, we will now do some tests over Apocalyx and create a VERY simple game world.   After that there will be some very heavy work where we need to create a character selection / creation something and a channel table with all kinds of authorizations, cheers !!!   This will be fun.   And also upcoming then is a command parser, to enable the server to start validating stuff, because up to this point each client will decide positioning and capabilities, which is obviously not acceptable.   During this step we will also have to implement a physique server, current thoughts are to put an Apocalyx client to do that, but to omit texture rendering and represent clients only as cubes (for line of sight), so we could verify very precisely physical conditions in the game without reinventing the wheel, but much lighter than a client side reproduction, let's see how that works out.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Stay tuned, a graphical test client is just around the corner.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3752852276426135414?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3752852276426135414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3752852276426135414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3752852276426135414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3752852276426135414'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/03/smash-to-planet-earth.html' title='SMASH to Planet Earth ... ??'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-966272819489602816</id><published>2008-03-14T10:12:00.004-05:00</published><updated>2008-04-25T16:43:26.083-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Test'/><category scheme='http://www.blogger.com/atom/ns#' term='PS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>First benchmarks</title><content type='html'>&lt;span style="font-family:arial;"&gt;We have conducted the first couple of test series on a single-core notebook (sc),  a dual-core notebook (dc) and the PS3, where creating 10'000 users takes 1:11 min., 0:22 min and 0:42 min respectiviely.  We then proceeded to send chat messages between the 3 systems and the results are similar in ratio.   What is very apparent is that the PS3 displays the text relatively slowly, so in my opinion given that the CEL processor should be very superior to the dual-core it seems that the display is what makes it slow.   We will conduct a modified test series, without the display part to check on performance.   There is also the aspect of the hard disk performance, but the both series, user creation and chat showed more or less the same difference and user creation requires hard disk access, while chatting does not, so the difference of the 5400 rpm on the PS3 and the 7200 rpm on the dc do not seem to make that much of a difference.&lt;br /&gt;&lt;br /&gt;Last not least, it may be that Erlang is not really optimized for CEL processors and maybe it does not distribute the processes correctly, but our personal appreciation is that the display is the bottleneck.&lt;br /&gt;&lt;br /&gt;We will see what happens next.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-966272819489602816?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/966272819489602816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=966272819489602816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/966272819489602816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/966272819489602816'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/03/first-benchmarks.html' title='First benchmarks'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-8912618462772104377</id><published>2008-03-11T09:59:00.006-05:00</published><updated>2008-04-25T16:43:58.174-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PS3'/><title type='text'>PS3 + YDL + Erlang = ready for prime time</title><content type='html'>&lt;span style="font-family:arial;"&gt;Ok, it's been a long Sunday, but I did manage to install Yellow Dog Linux on my Playstation 3 successfully.   It took much longer to backup the PS3 than it did to configure YDL.   After that I installed VNC Server to remote control the machine and let me tell you, that the Gnome Desktop is a beauty.   Installing Erlang was as simple as downloading and compiling it, so no new really on this end, either.   In other words, the server platform is ready for deployment, I will now go ahead and run the SMASH framework on it to compare speed ratios among my test systems, let's see what happens next.  This is for me a major milestone, given that THIS PS3 will be the mother of all SMASH development nodes.   I will have some time next week as well to push the conection between the socket server (Mr. SOX) and the SMASH framework, so I definitely hope to have some empty game world that people can actually connect to by next week.   If that holds true, we might do a very first game world logon, maybe, maybe, maybe.&lt;br /&gt;&lt;br /&gt;Oh and by the way, some may ask, WHY Linux and PS3 at all ???   Very simple, the thought process behind that is, that I want to be able to provide a server frame work taht is inexpensive and powerful, because regular servers are definitely more $$$ heavy and not everybody will be able to afford buying Windows Server licenses, so nothing beats Linux moneywise and a U$500 PS3 server should make a nice duo.   Now, that much said, many people are scared of Linux, because it's not exactly intuitive, well, given that we only need a DVD install and later on a simple download + install of Erlang, that should be fairly simple to do for everyone and ALL the others tasks can be done thru native Erlang, no more touching of the PS3 is required, I am planning on adminstrating everything from a more comfortable platform, without losing the power of the solution.&lt;br /&gt;&lt;br /&gt;Stay tuned.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-8912618462772104377?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/8912618462772104377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=8912618462772104377' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/8912618462772104377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/8912618462772104377'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/03/ps3-ydl-erlang-ready-for-prime-time.html' title='PS3 + YDL + Erlang = ready for prime time'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-3246254000909686261</id><published>2008-03-05T08:51:00.003-06:00</published><updated>2008-04-25T16:44:18.137-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOX'/><category scheme='http://www.blogger.com/atom/ns#' term='PS3'/><title type='text'>What's next ??</title><content type='html'>&lt;span style="font-family:arial;"&gt;Alright, it's 2008 and I finally have some time to come back to the SMASH project.   One of my goals was to buy a PS3 and install Linux on it, so at last I got me one and I will install Yellow Dog on it this weekend.   Why a PS3 ??  The processor of the PS3 has internally 6 cores that are ready for use and it is said to be a very powerful server, so I will set up Erlang on it and see just how fast it goes.   Erlang recognises multiple cores, so this should prove to be a powerful combination, a dual-core versus single-core scores about 40% speed increase, so 6 internal cores should make quite a difference.   I will post how it went, both installation and benchmark.&lt;br /&gt;&lt;br /&gt;I am also working on the TCP/IP server and I should soon have a first first alpha server up and running where people can connect to (probably a pretty empty world).&lt;br /&gt;&lt;br /&gt;See you soon.&lt;br /&gt;&lt;br /&gt;Sunweaver&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-3246254000909686261?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/3246254000909686261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=3246254000909686261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3246254000909686261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/3246254000909686261'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2008/03/whats-next.html' title='What&apos;s next ??'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-7683158669791400130</id><published>2007-06-25T17:11:00.001-05:00</published><updated>2008-04-25T16:45:22.656-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOX'/><category scheme='http://www.blogger.com/atom/ns#' term='WIP'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Stability &amp; endurance tests</title><content type='html'>&lt;span style="font-family:arial;"&gt;Alright, let's get to this week's updates.   It is still to early to post any code over here, but we shall give some progress reports.   In the last post we commented about next tasks&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;, &lt;/span&gt;&lt;span style="font-family:arial;"&gt;I took on these fellows:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;*  Internal user registration (to avoid same user on several nodes or processes)   [&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;easy&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;] :&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;Every user that creates a client proxy, automatically registers on the mnesia database to avoid errors.  Done for the moment, but this needs to be revised when we get to account management.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;*  Cluster behavior   [&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;]&lt;/span&gt;  &lt;span style="font-family:arial;"&gt;:   The cluster config will require several things, but the very first one to grab was to define a master.   For this a special process called observer was created.   The observer is a special registered named service "ob" that stands by and waits that every persistent or longer lasting process needs tro register with and like highlander there can be only one, you cannot run a second observer on your cluster. Once it receives a request it writes that into a public ets table and starts an asyncronous link to that task.   If that task or node dies, it will be able to start a stored function, which may decide whether or not to restart or do some desaster recovery, but in the very least, it writes a special local table called monitor (the table does not get replicated for performance issues) to record all of the closed-while-monitored tasks, no matter why, this way we will ALWAYS know what happened, even if you close a whole node, actually, this is why I designed a central Observer, to catch crashed nodes, local receovery was not enough for my taste.    The observer is currently a signle point of failure, because there is no backupo for it at this time, this requires improvement.&lt;br /&gt;&lt;br /&gt;Now this topic will be ongoing, the cluster behavior obviously does not stop here, it got barely started with this, we will have to look at other topics like:&lt;br /&gt;--&gt;   Server tasks (DB, Players, Simulation, NPCs, Chat, etc.)&lt;br /&gt;--&gt;   Is a cluster dynamically or statically built, does it load-balance ??&lt;br /&gt;--&gt;   We need to notify when a player is between two zones, in order to get smooth character display or else they would just suddenly pop into existence in the next zone,&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;--&gt;   Can we resize the managed zone in run-time ??  For densely populated areas f.e., this maybe rather complicated to implement as it requires continuous terrains.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TCP/IP server with authentication&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;I have &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;started to develop the TCP/IP interface which worked actually easier than I thought.   So far you can connect to it, the server sends back a challenge which in the future will be a MD5(random) sort of function and the client will have to answer with an account name, MD5(challenge), which the server will validate against the database, if the password is wrong the servers disconnects, if it's correct the server will check if the user is already online and so forth and finally create the client proxy, which will be the man in the middle between the TCP/IP interface and the chat client (the low level connector&lt;/span&gt;)&lt;span style="font-family:arial;"&gt;.   I am undecided if I do an action plugin to the CC or do a proxy that just uses the CC to connect to the low level functions, most probably I will scratch the action plugin and replace that functionality with this client proxy, it sounds like a better idea, but it also means that per client we would have 3 processes running at the bare minimum.  Advantage is that you can just write whatever small program and have it call the CC or call the CC directly from the console and monitor a certain chat channel.  So many decisions, so little time :) .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-family:arial;"&gt;Endurance tes&lt;/span&gt;t:&lt;br /&gt;&lt;/span&gt;&lt;span&gt;It seems somewhat early to do stress testing, but I find that most applications don't get off the ground because the backbone has been poorly designed, so thoroughful testing is of the essence.  &lt;/span&gt;I have tried to open massive clients and I designed a special routine for this, so far I can very easily create 10'000 or 100'000 clients, which open without any problem and send messages between them, we are on the right track and if you close one of those large nodes you get a whole lot of notifications in the database, but no errors, everything is stable, even the code updates keep working, right on !!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Next steps:&lt;br /&gt;&lt;/span&gt;Next we will go for the action plugin or client proxy and start designing the simulation behavior, this is a major decision, so a clean and logical design will mean the world (quite literally).    Also, a backup behavior for the Observer is needed, given that all his information is stored in an ets table a restart should be quite easy to implement and a second master node needs to be coded.   Also the TCP/IP server needs still a lot of work.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Next tasks on the To-Do List:&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;*  Create an action &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_29"  style="font-family:arial;"&gt;plug in&lt;/span&gt;&lt;span style="font-family:arial;"&gt; template   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;easy&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;*  Cluster behavior   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;*  Zone Simulation Manager   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;* New:  backup observer and restart design&lt;br /&gt;* New:  mnesia fallback behavior ( to have 2 master nodes, one in stand-by mode )&lt;br /&gt;*  &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"  style="font-family:arial;"&gt;TPC&lt;/span&gt;&lt;span style="font-family:arial;"&gt;/&lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"  style="font-family:arial;"&gt;IP&lt;/span&gt;&lt;span style="font-family:arial;"&gt; server with authentication   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]   +   protocol converter   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;*  &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"  style="font-family:arial;"&gt;TCP&lt;/span&gt;&lt;span style="font-family:arial;"&gt;/&lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"  style="font-family:arial;"&gt;IP&lt;/span&gt;&lt;span style="font-family:arial;"&gt; test client   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;* &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"  style="font-family:arial;"&gt;Apocalyx&lt;/span&gt;&lt;span style="font-family:arial;"&gt; integration   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;medium&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt; &lt;span style="font-family:arial;"&gt;&lt;br /&gt;*  Master node   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;hard&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;*  &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"  style="font-family:arial;"&gt;NPC&lt;/span&gt;&lt;span style="font-family:arial;"&gt; scripts   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;hard&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;*  Subscription Server   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;hard&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;*  &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"  style="font-family:arial;"&gt;Interrealm&lt;/span&gt;&lt;span style="font-family:arial;"&gt; connector   [&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;hard&lt;/span&gt;&lt;span style="font-family:arial;"&gt;]&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-7683158669791400130?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/7683158669791400130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=7683158669791400130' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7683158669791400130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/7683158669791400130'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2007/06/stability-endurance-tests.html' title='Stability &amp; endurance tests'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-2634374660021807501</id><published>2007-06-12T17:12:00.000-05:00</published><updated>2007-06-14T08:47:11.175-05:00</updated><title type='text'>Status: June, 13th 2007</title><content type='html'>&lt;div&gt;&lt;span style="font-weight: bold;"&gt;Project Scope&lt;/span&gt;&lt;br /&gt;The complete implementation foresees multi-domains, account administration, zone-groups, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;NPCs&lt;/span&gt; and other simulation handling, but you have to start somewhere and that is from the ground up. In this case that means that we have to build the most basic components first to make the whole work.   &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Making it happen&lt;br /&gt;&lt;/span&gt;&lt;div&gt;Our first task here is to build a multi-server structure.   There are two aspects to it, start using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;mnesia&lt;/span&gt; for self-replicating persistent data across the nodes and the next part is a sort of chat room server across the nodes the facilitate message passing among processes that have common interests, like for example guild chat, which obviously needs to function for members no matter on which zone and server they play or you could have your users connect to server X, zone Mainland, but start the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;NPCs&lt;/span&gt; for that zone on server Y, given that you can connect your servers at 1&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Gb&lt;/span&gt; speed, but might only have a 20Mb pipeline, speed is not the issue.   This way you could also connect on server Y a service that records all the chat in a certain channel to scan for example for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;spammers&lt;/span&gt; and foul language.   The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;mnesia&lt;/span&gt; and multi server chat is already done, next we need to do a sort of internal &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;logon&lt;/span&gt; procedure and create an action &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_7"&gt;plug in&lt;/span&gt; for the internal player/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;NPC&lt;/span&gt; proxies.   The final implementation will open a client &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;TCP&lt;/span&gt; process for every client connected, but there is going to be ALWAYS an internal client proxy, which will stay alive, even when the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;TCP&lt;/span&gt; client disconnects, so the proxy is part of the simulation &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;implementing&lt;/span&gt; behavior through the action &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_12"&gt;plug in&lt;/span&gt;, while the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;TCP&lt;/span&gt; client is just the external connector.  The client proxy is going to be a fixed program implementing basic &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_14"&gt;behavior&lt;/span&gt; regarding how to plug into the chat server, but we may want to be able to put the player in control of his char or even a "mind-controlled" &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;NPC&lt;/span&gt; or disable user input for a while, when a small script runs, so the actual character behavior needs to be handled by a changeable action &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;plug in&lt;/span&gt;.   So the action &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;plug in&lt;/span&gt; will determine how to handle requests, a user might send a request to move or chat to the proxy, the proxy sends &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;the&lt;/span&gt;data to the action handler which might determine, that the user can move or maybe he wants to chat, but given abusive behavior the administrator decided to mute this user for some time and the chat request is discarded.   We can see that user handling is so much easier, but how do we start a whole zone ??&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-weight: bold;"&gt;Zone handling&lt;/span&gt;&lt;br /&gt;Let's give some initial thoughts on zones:&lt;br /&gt;*   Zones can be shared across servers with our multi chat room servers&lt;br /&gt;*   Some servers should be dedicated to user connections and not run &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;NPCs&lt;/span&gt; or Sim events, they will be busy with filtering/&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_20"&gt;handling&lt;/span&gt; requests and optimizing bandwidth usage&lt;br /&gt;*   If we assign zones to servers, how to handle load balancing ?  Maybe assign fallback servers ?&lt;br /&gt;*   How to handle instances ?   This needs to be coded right into the core structure&lt;br /&gt; Thought: any zone is an instance, zones are linked instances, instances are stand-alone&lt;br /&gt;*   How to handle weather and global economic events ?&lt;br /&gt;*   How to handle &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;NPCs&lt;/span&gt; that walk across regions ?&lt;br /&gt;*   How to handle flocks and armies ?&lt;br /&gt;*   When a node's down, where do we put his processes without interrupting?&lt;br /&gt; The chat rooms stay the same, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;sim&lt;/span&gt; needs to be restarted on a different node&lt;br /&gt;&lt;br /&gt;It looks like we need a global resource manager and do some cluster configuration.   So the cluster master needs to do some load balancing, know the optimal &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;configs&lt;/span&gt;, backup &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;configs&lt;/span&gt; and if else fails improvise.   He will require to know number of running processes on each node, which ones are connection nodes (for users), which ones are &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;sim&lt;/span&gt; nodes (for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;sim&lt;/span&gt; and/or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;NPCs&lt;/span&gt;), the main database node that writes to disk should not run anything and probably the master node, it is thinkable that the subscription master node runs password authentication on local &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;mnesia&lt;/span&gt; tables which do not replicate on a separate and isolated node.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Next tasks on the To-Do List:&lt;/span&gt;&lt;br /&gt;*  Create an action &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_29"&gt;plug in&lt;/span&gt; template   [&lt;span style="font-weight: bold;"&gt;easy&lt;/span&gt;]&lt;br /&gt;*  Internal user registration (to avoid same user on several nodes or processes)   [&lt;span style="font-weight: bold;"&gt;easy&lt;/span&gt;]&lt;br /&gt;*  Cluster behavior   [&lt;span style="font-weight: bold;"&gt;medium&lt;/span&gt;]&lt;br /&gt;*  Zone Simulation Manager   [&lt;span style="font-weight: bold;"&gt;medium&lt;/span&gt;]&lt;br /&gt;*  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;TPC&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;IP&lt;/span&gt; server with authentication   [&lt;span style="font-weight: bold;"&gt;medium&lt;/span&gt;]   +   protocol converter   [&lt;span style="font-weight: bold;"&gt;medium&lt;/span&gt;]&lt;br /&gt;*  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;TCP&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;IP&lt;/span&gt; test client   [&lt;span style="font-weight: bold;"&gt;medium&lt;/span&gt;]&lt;br /&gt;*  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;Apocalyx&lt;/span&gt; integration   [&lt;span style="font-weight: bold;"&gt;medium&lt;/span&gt;]&lt;br /&gt;*  Master node   [&lt;span style="font-weight: bold;"&gt;hard&lt;/span&gt;]&lt;br /&gt;*  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;NPC&lt;/span&gt; scripts   [&lt;span style="font-weight: bold;"&gt;hard&lt;/span&gt;]&lt;br /&gt;*  Subscription Server   [&lt;span style="font-weight: bold;"&gt;hard&lt;/span&gt;]&lt;br /&gt;*  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;Interrealm&lt;/span&gt; connector   [&lt;span style="font-weight: bold;"&gt;hard&lt;/span&gt;]&lt;br /&gt;&lt;br /&gt;I will go through the list be degree of difficulty (which also reflects time required to do it).&lt;br /&gt;&lt;br /&gt;Until next time,&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;Sunweaver&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-2634374660021807501?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sunweaver.blogspot.com/feeds/2634374660021807501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7090461718496077050&amp;postID=2634374660021807501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/2634374660021807501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/2634374660021807501'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2007/06/status-07-06-15.html' title='Status: June, 13th 2007'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7090461718496077050.post-6434543475017715674</id><published>2007-06-12T12:37:00.005-05:00</published><updated>2009-05-27T11:13:02.486-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apocalyx'/><category scheme='http://www.blogger.com/atom/ns#' term='Framework'/><category scheme='http://www.blogger.com/atom/ns#' term='MMO'/><category scheme='http://www.blogger.com/atom/ns#' term='Erlang'/><category scheme='http://www.blogger.com/atom/ns#' term='Objectives'/><title type='text'>Welcome to the SMASH project</title><content type='html'>&lt;span style="font-family:arial;"&gt;Hello reader.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;This blog marks the beginning of a project that has the objective of producing a massive multiplayer online project written in Erlang. Actually the project started in 2005 with a lot of research, but not much code was produced until 2007. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Is it Vaporware ?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;For all those in knowing whether this is real or not, be calm don't argue, it is vaporware ... until the day we publish code, so in the meanwhile, don't get anxious or annoyed.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;When you say MMO, do you mean MO or MMO?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;MO stands for multiplayer online game and the second M puts the massive into it. We classify hereby that any engine that only supports some 15-20 users as an MO and engines that can handle 1000+ users as MMO. Nowadays you see many announcements of people claiming to have built MMO engines, when truly they start to choke on 20+ connections. This is mostly due to a bad initial design because of a platform that cannot handle massive requests and also due to limits of a single server being used. The goal of the project is to produce an engine that can handle multiple servers and at least 1000+ users in real-time, being the limit basically only the throughput of a LAN and CPU power or the speed requirement of the application, so if a given application can live with less updates per second, thousands of users must be supported simultaneously. We don't want another toy, we want a serious MMO engine instead&lt;span style="font-weight: bold;"&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Why limit the project to 1000 users ?&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;This is not really meant as a limit, rather a minimum requirement and something achievable, but one thing for sure, if the Smash framework can handle 1000 its uses are unlimited, because in order to produce a 2000 user framework, you only would have to communicate 2 networks, so assuming that 1000 works, a million is easily within our grasp, too.  The current tests have shown that the framework does not even choke on 50'000 test users, although sending out 50'000 messages takes some time, so 1000 really isn't a problem to accomplish and overshoot, but we need to set a target, so 1000 is the initial target, that's all.&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Time frame&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;There is no specific time frame, which is why we classify ourselves as vaporware. The complexity of this endeavor is quite high, so trying to extrapolate a date is too difficult at this time.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Project components&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Defining the development platform is vital, so Erlang is defined as the server platform and Apoxalyx for the GUI.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Why Erlang ? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* It runs on several OS like windows, Linux, BSD, MacOS and others.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* It is concurrent on the very heart, creating threads is easy and independent from the OS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* It's soft real-time, which is what we need&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* One can share easily information across threads&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* The Mnesia database replicates across the connected nodes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* You can update the application during normal operation&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* It can be operate fault-tolerant&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To mention a few advantages of Erlang, more on &lt;/span&gt;&lt;a style="font-family: arial;" href="http://erlang.org/"&gt;http://erlang.org&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Why Apocalyx ?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Because it is easy to use through LUA scripts, it's fast and it's pretty, more on &lt;/span&gt;&lt;a style="font-family: arial;" href="http://apocalyx.sourceforge.net/"&gt;http://apocalyx.sourceforge.net&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Why this blog ?&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;It sometimes helps to write stuff down as you go and often a loving comment of a reader/listener can help to improve things, so for now I will write here on progress and ideas and if there is something you want to contribute, please message me, note that flame posts or any unrelated posts will be deleted without question.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Bye bye,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Sunweaver&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7090461718496077050-6434543475017715674?l=sunweaver.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6434543475017715674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7090461718496077050/posts/default/6434543475017715674'/><link rel='alternate' type='text/html' href='http://sunweaver.blogspot.com/2007/06/welcome-to-smash-project.html' title='Welcome to the SMASH project'/><author><name>Sunweaver</name><uri>http://www.blogger.com/profile/00856277163542936059</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
