• Content count

  • Joined

  • Last visited

Community Reputation

307 Neutral

About fagiano

  • Rank
  1. What ever happened to Squirrel?

    About sqdbg on linux, try this post http://squirrel-lang.org/forums/post/810.aspx About the confirmation emails, I have to look into it. Could just be beacuse of hotmail's spam filter? Tools wise, given that sqdev works pretty well and that's pretty much all we needed in the last 3 years of development of my project that, if the designers do not keep pushing new stuff, will be out in a month or so. I cannot imagine what would be required. (BTW for bindings we use pretty much what is in the DXSquirrel sample on the wiki) Alberto
  2. What ever happened to Squirrel?

    As the author of the language I can tell you is in part my fault because I never advertized Squirrel at all. Anyway Squirrel is young, 4 years for a language is very little. However there are quite a few company using squirrel, expecially in the asian market. Looking at the website access, squirrel appears to be quite popular among Japanese devs, with quite a few notable names in the list(I guess because of the Unicode support and the ability of have variables/methods names in Japanese). There's even already a language derived from Squirrel(aka minid) that features "squirrel-style classes". Indeed the forum is not amazingly active, mostly embedding talk, I'm not sure that's necessary a bad thing. Squirrel is very stable, has a very well accepted syntax, and feature wise I'd say is mature. Bottom line, I think is mainly a matter of trend, something like "everybody uses lua, there must be a reason". Squirrel works well, if you want to use it, do it, is not going to abandoned any time soon. If you prefer Lua, use it, is great too. Syntax wise I bet you'll find more non programmers that are comfortable with C style syntax than the hybrid lua one. Mostly because of javascript. In crytek we were using lua and I've been asked 100000 times "How is the for loop again?" In my current project I hardly had any talk about squirrel itself. Anyway, IMO non programmers should not write scripts anyway, except maybe if they are absolutely trivial. Squirrel lives... ciao Alberto
  3. The code is viewable, rename a .pak to .zip and enjoy. What you are interested in is Scripts.pak if I remeber correctly. The scripts are compiled at loading time. ciao Alberto
  4. Quote:sadly that none of my favorite scripting languages workes on my current installation Suse10.0 x86_64 squirrel with sqplus creates a segfault After your bug report I did another spin with the test suite on my 64 bits linux, and everything worked just fine. If you really want to use squirrel, I'd suggest to spend a little time and spot the problem. Is probably just some compiler setting. Did you define _SQ64 in your projects? to use the make file include in the distribution you must type "make sq64" _SQ64 has to be defined in any project that include squirrel.h ciao Alberto
  5. Benchmarks

    Quote:Original post by Anonymous Poster Comment on : " real-world applications (such as large MMO with several megabyte of data living in the VM, etc.) " Any MMO that requires regularly accessed data in VM is a poor candidate for a 'typical' real-world applications MMO' . Cache misses should be only a small issue as slow as most of these script languages run, but waiting for Virtual Memory disc access is so much horribly slower that it usually spells failure on any game client or server. Yeah but what kind of disk access would a game server need to do? (Rather than log and few DB queries per sec that are both very asynchronous). In our server we have 2GB of RAM and we just use about 160Mb for about 1000 Actors walking around. Both disk and Virtual Memory are very relaxed. Using a proper memory allocator there is no 'real' memory allocation at all, the number of virtual pages committed stays stable through the whole server lifetime. Anyway I must say that IMHO this post is kind of pointless. I don't know what you guys do with scripting, we do a lot. The scripting takes something like 5% of our CPU. Now we are discussing about shaving maybe 30% from 5% of the game loop. I personally would choose a language based on usability, robustness, tools, elegance, and extensibility etc... and not care too much about 1% +/- in performances. But that's me. ciao Alberto
  6. Squirrel and SqPlus

    Hi, at the moment I'm on holiday so I'm not working on Squirrel, I'm still following the forum. The login is working for me and other members as well maybe the DB was down when you tried(let me know). I'm not directly involved with SQPlus, you should contact John Shultz. I'll be back on Squirrel in about a week but I think John follows this forum as well. ciao Alberto
  7. Lua Question: Multiple States

    Quote:Original post by Kylotan I think people might disagree on what a 'real script' is. :) I agree, what a 'script' is, is not really well defined. I always start with the assumption that 'script' means gamecode, that is true for very few games. Most of the time is a bit more than a config file. Probably this kind of design issues are way too broad to be descussed on a public forum. ciao Alberto
  8. Lua Question: Multiple States

    This is how would be done in my current game class Monster extends Entity { constructor() { //init stuff GotoState("ToTheNorthEdge"); } </ type = "state" /> ToTheNorthEdge = { function OnEnterState() { MoveTo(northEdgePosition); } //called when moveto reaches the target pos function OnTaskCompleted(event) { GotoState("WaitForEnemy"); } } </ type = "state" /> WaitForEnemy = { function OnEnemySeen(enemy) { GotoState("ToTheSouthEdge"); } } </ type = "state" /> ToTheSouthEdge = { function OnEnterState() { MoveTo(southEdgePosition); } function OnTaskCompleted() { SetTimer(60) // waits a minute and then returns to the northern edge } function OnTimer() { GotoState("ToTheNorthEdge") } } } Looks much more complicated, but a real script doesn't just move a guy from A to B, probably a would add more event handlers to stop if something happend, timeouts, enemy encounters etc... I've tried to prototype a concurrent system using generators but wasn't very good to work with. IMHO an even driven system is more natural and scales better. The issue I found is that a real game object usually has to react to different inputs also while is performing a scripted action. ciao Alberto
  9. Squirrel Plus and Polymorphism...

    Quote:Original post by Zazu Well at first glance it looked perfect. The problem I have however, is that the scripting system is a plugin as well. All of the bindings are in plugins. The binding plugins aren't specific to an implementation since they bind the interface classes only, not the implementation. And the plugins that contain the implementations can't contain any binding code for a specific scripting language. Thats my problem. Well I guess I can sway away from the current way of doing things and make a set of plugins that bind specific implementations to Squirrel, however this means I need to write a binder for every implementation. Well if the only difference beween implementations is the contructor, then you should just have some function in you plugin to enumerate implementation name and a class factory. you could even have some sort of symbolic way to describe parameters, and pass an array of them to you object factory. Then you can dyncamically inherit from your base class and implement the contructor engine side(the plugin doesn't even have to be dependent on squirrel). something like typedef void *(*CONTRUCTOBJECT)(PARAMSARRAY *a); struct AutomationDesc { char *classname; char *basename; ContructionParamsType *params; int nparams; CONTRUCTOBJECT func; } BOOL GetAutomationDesc(AutomationDesc *desc) just an idea Alberto
  10. Squirrel Plus and Polymorphism...

    take a look at the DXSquirrel sample in SQPlus. Check the binding for ID3DXMeshBase and ID3DXMesh. check this out for a non AddRef()/Release() approach: _MEMBER_FUNCTION_IMPL(BaseLight,constructor) { StackHandler sa(v); return sa.ThrowError(_T("BaseLight cannot be constructed directly(is pure)")); } _MEMBER_FUNCTION_IMPL(BaseLight,doSomething) { StackHandler sa(v); _CHECK_SELF(ILight,BaseLight) self->doSomething(sa.GetInt(2)); return 0; } _BEGIN_CLASS(BaseLight) _MEMBER_FUNCTION(BaseLight,constructor,NULL,NULL) _MEMBER_FUNCTION(BaseLight,doSomething,2,_T("xn")) //takes 2 params (this and a number) _END_CLASS(BaseLight) _IMPL_NATIVE_CONSTRUCTION(OglLight) _MEMBER_FUNCTION_IMPL(OglLight,constructor) { OpenGLLight *newinstace = new OpenGLLight(); //squirrel will automagically call delete the class when needed return construct_OglLight(newinstace); } _BEGIN_CLASS(OglLight) _MEMBER_FUNCTION(OglLight,constructor,0,NULL) _END_CLASS_INHERITANCE(OglLight,BaseLight) ciao Alberto
  11. "Lua has become stackless" ?

    stackless means that when you make a pure lua function call, the VM doesn't make a real C call internally(so doesn't use the OS stack). This allows the program flow to be interrupted(aka coroutines) without hacking around with the C native stack. With a stackeless approach is also possible to perform certain runtime optimization to allow deep recursion or even recursion unrolling(tailcalls) and avoids risk of stack overflows. Python on the other hand does a C function call for each python call. In fact it 'only' implements generators that are a light version of coroutines(they only allow to suspend 1 function, no nesting). I personally don't understand the design choice behind python-style calls is simply less flexible. However, I haven't looked into python's VM too deeply, too much code for my taste. ciao Alberto
  12. Squirrel - Function in Function?

    In Squirrel you can nest as many script to C++ and C++ to script call as you wish...(as far as you have enough stack space :) in your system). Same for LUA. ciao Alberto
  13. SqPlus(Squirrel) docs/examples/feature-list

    :: in front of the function is not mandatory. Just like in C++. Is just explicitly telling the compiler that the symbol is in the global scope. Again same behaviour/syntax as C++. About the 'confusing' doc. If soumenone points me to the confusing part, I'll try to improve it. ciao Alberto
  14. Quote: Reference counting is often used as a form of garbage collection as it has the desired effect. It's main short comings are 1) Inadequate handling of cyclical linkage 2) Continuous run time cost of updating count. 1) really not a biggie(you solve it with weak refs) 2) my profiling on squirrel shows that's very far to be a performance issue(at least in Squirrel). I did some research in that direction 2 years ago. I actually implemented a incremetal collector in lua 4(three colors). It doesn't really improve things at all, 1) introduces as much work as refcounting; you have to check if you assign an object to a alredy marked one(+ mark&sweep). 2) it needs tweaking based on context(how much mem you got) 3) spikes do not go away because you always have 2 very big objects, A the global object, B the one you use to store C++ references. 4) has all the other artifacts of any other type of collector A random order of deletion, B unpredictable resource deletion, C load dependent performances. 5) debugging it couses permanent brain damage(believe me :) ) ciao Alberto [Edited by - fagiano on September 18, 2005 3:33:05 PM]
  15. Improvements to reference counting

    I've asked for references on Linearity, but seems that most of the stuff is on ACM. However seem that John already did some research for us :) . Alberto