Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now
- - - - -

Random questions

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Ysaneya   Members   


Posted 03 November 2004 - 10:28 AM

Hi ho, It's quite funny that i'm a regular member of gamedev since 5 years now and never visited this forum before. Well, today i did, and so far i'm impressed. Awesome work, Witchlord! I'm working on a game engine (including 3D, sound, networking, GUI, input, etc..) that i hope to become commercial one day. It's starting to grow quite a lot (currently 65k lines for the 3D engine "only"), and so i'm slowly starting to look for a script language easy to interface with. 1. I particularly appreciate the ease-of-use of AS, its C-like syntax and how easy it is to call application code. I've read the overview, but it's not quite clear how you can get from the application the return value of a function executed by AS ? Can it return objects, arrays of objects or structures too ? 2. So far i was considering seriously Python and LUA. Did anybody make a performance comparison between Python, LUA and AS (or any other script language) ? Since AS works on top of a virtual machine with strong typing (as opposed to Python and LUA), i am guessing AS should win quite easily.. Thanks! Y.

#2 Rain Dog   Members   


Posted 03 November 2004 - 11:19 AM

In some previous tests it was discovered that LUA was approximately 50% faster than AS, then witchlord made some changes and optimizations and i believe the last statistic was that AS is now 50% faster than LUA.

Lua: 20.499574 sec
AngelScript: 23.772902 sec 1.9.1-WIP1
1.9.2 = 10% faster = 21.47
ASM VM 50% faster = 14.31
1.10 final 10% faster = 12.8
new asm promises 25-50% increase in speed.

These are the results just extrapolated from the performance increases based on the different versions, and
do not promise to be correct, only a guideline from which to follow. As you can see, it thereby follows that AS is
now approximately 40% faster than LUA.


[Edited by - Rain Dog on November 3, 2004 5:19:24 PM]

#3 Andreas Jonsson   Moderators   


Posted 04 November 2004 - 01:21 AM

Hello Ysaneya, and welcome to my forum

This forum is quite new (it was created in March), so it's not so strange that you never noticed it before.

1. Yes, AngelScript can return objects. It will do this using a calling convention similar to that of C/C++. Unfortunately this means that it is a bit cryptic, since the application needs to pass a pointer to the memory that should receive the object. Here's an example code for that:

asIScriptContext *ctx;
ctx->Prepare(engine->GetFunctionIDByDecl(0, "Vector3 TestVector3()"));

// Allocate memory for the returned object
// Note: The memory should be uninitialized
char buffer[sizeof(Vector3)];
Vector3 *ret = (Vector3*)buffer;

// Pass the pointer to the memory as first parameter
// Note: This parameter is hidden and wasn't declared by the script
ctx->SetArguments(0, (asDWORD*)&ret, 1);
int r = ctx->Execute();
// Use the returned object, or copy it to a more permanent location

// Call destructor on the returned object (only if the execution was successful)


I'm working on automatizing this, so that the application can simply call a function with the parameters it wishes to pass to the script.

2. As Rain Dog said, Lua was found to be almost 50% faster than AngelScript. I couldn't allow that of course so I have since worked hard on improving the speed of AS. Since version 1.9.0 AS has become between 2 and 3 times faster, depending on the situation. And there is still more that can be done.

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

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.