AngelScript 2.20.1 is released

Started by
30 comments, last by WitchLord 13 years, 1 month ago
I can't do that because all my script exported functions are in native conventions only. Refactoring or adding the support for the generic calling convention will take me quite a long time because there are a lot of them.

However, I can try to help as much as I can with compiler options, code fixes. Tell me if you prefer me to try things directly with you (fix/compile/test etc.).

EDIT : also it already seems to handle the case for big endian in as_config.h :
#if _XBOX_VER >= 200
// 360 uses a Xenon processor (which is a modified 64bit PPC)
#define AS_XBOX360
#define AS_XENON
#define AS_BIG_ENDIAN
#else


Cheers,
Rémi Gillig.
Advertisement
I'll see if I can reproduce the problem on my Mac where I can run the rosetta simulator for a PPC processor. If the problem is not in the as_callfunc_xenon.cpp code I should be able to find it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Okay, let me know if you need more information on the crashes I have like specific values of variables. I had crashes happen in other cases of the ExecuteNext switch than the one I put in example.

EDIT : Maybe there were modifications to as_callfunc_ppc.cpp that were not applied to as_callfunc_xenon.cpp (the comments say it was based on ppc). I can also give you some hardware information if necessary.
I couldn't reproduce the problem on my mac with ppc, but I took a closer look at as_callfunc_xenon.cpp and believe I discovered the problem. When the native function was returning a bool as_callfunc_xenon.cpp did an endian swap. The problem was that it didn't check if the bool type was returned by value or by reference, so it messed up the reference to the bool returned by the index operator.

As I was reviewing the code I also fixed a couple of other bugs, such as the code not handling int8 and int16 types correctly. There are also a couple of more bugs that I saw but didn't fix, because it would require more testing, e.g. the code doesn't support int64 parameters, nor passing objects by value.

Obviously I haven't been able to test these changes, so I may have broken some things while changing the code. Please let me know if everything is working as before and if the bug you reported has been fixed too.

The code fixes are in SVN revision 789.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks a lot, I'll report back on Monday from work. I think passing objects by value is used in my code so I could be able to help you on that too.

Cheers,
Remi Gillig.
Sorry I didn't have the time to try the fixes for Xenon yet.

However, I found a weird behaviour with some expressions :
_feuilleRonce00.rotation = _feuilleRonce00.rotation + (((plant[0].path.angleAt(easeIn(plant[0].alpha) - 0.1f)) - 0.5f) - _feuilleRonce00.rotation) * 0.1f;
_feuilleRonce00.rotation = _feuilleRonce00.rotation + (((plant[0].path.angleAt(easeIn(plant[0].alpha) - 0.1f))) - _feuilleRonce00.rotation) * 0.1f;

The only difference is the "- 0.5f" but it crashes with this callstack (unfortunately in release only and on PS3) :
[attachment=1353:Clipboard-1.png]

EDIT : also this seems to compile "_countKill[12)++;" (that's not a typo)
I'll investigate it

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I fixed the parser error for "_countKill[12)++;" in revision 802.

However, I have not been able to find any problem with the compilation of the complex expressions. I tried reproducing it with the following test:


engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL);
RegisterScriptArray(engine, true);
asIScriptModule *mod = engine->GetModule("", asGM_ALWAYS_CREATE);
mod->AddScriptSection("script",
"class vec { \n"
" float angleAt(float) {return 0;} \n"
"} \n"
"float easeIn(float) {return 0;} \n"
"class t { \n"
" float rotation; \n"
" vec path; \n"
" float alpha; \n"
"} \n"
"class a { \n"
" t _feuilleRonce00; \n"
" void main() \n"
" { \n"
" t[] plant; \n"
" if( true ) \n"
" _feuilleRonce00.rotation = _feuilleRonce00.rotation + (((plant[0].path.angleAt(easeIn(plant[0].alpha) - 0.1f)) - 0.5f) - _feuilleRonce00.rotation) * 0.1f; \n"
" else \n"
" _feuilleRonce00.rotation = _feuilleRonce00.rotation + (((plant[0].path.angleAt(easeIn(plant[0].alpha) - 0.1f))) - _feuilleRonce00.rotation) * 0.1f; \n"
"}} \n");
r = mod->Build();
if( r < 0 )
TEST_FAILED;
engine->Release();


As the problem occured in the compiler it shouldn't really matter how you have registered the various types.

Have you checked the compiler settings you use on PS3? Maybe there is something that goes wrong if you use high level of optimizations for the angelscript library? Or maybe there is a limit to the number of recursive calls on the stack on the PS3?

Is there anything else you can give me on this problem?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Sorry for the delay, we were a little busy. The problem came from a too small stack size for our threads that were loading the script. It is now resolved.
Ah, that's good to know. Thanks for the info.

Did you get to validate the fix for xbox 360?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement