Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

_Engine_

Member Since 24 Nov 2003
Offline Last Active Mar 13 2013 04:54 AM
-----

Topics I've Started

in and out keywords in parameters

28 January 2013 - 08:40 AM

Hi!

When we want to change income parametr in C++ function we just declare this - void SomeFunc(type& parametr). This are never was a trouble - never. But in managed languges we must add in or out keyword and that leads to unessesery work and sometimes to stupid mistakes. It is to sad that Angel Script force us to this annoing thing. It is possible to disable this behaveor - we don't want managed style we want c++ style :)

perfomances issues with classes in array

21 January 2013 - 02:22 AM

Hi!

 

In script we store data in angel script classes. Also we have array of classes.

 

Sample look like:

 

class StoreData

{

   int data1, data2;

   float data1, data2;

}

 

array<StoreData> data;

 

But big problem lie in fact that in memory 100 elements of array is just pointers. Actual data lies randomly in memory, so if we try to access to field data1 of 100 elements in loop we catch many many cache misses. Also we cannot binary save this array we must access to every field of every element in array.

 

So classes in array is big bottleneck.

 

Is it possible to avoid this issue?


crash on asCContext::CleanStackFrame()

10 December 2012 - 02:51 PM

Hi!

We encountered with crash in

as_context.cpp, line: 4159

// Only destroy the object if it is truly alive
if( liveObjects[n] > 0 )
{
asSTypeBehaviour *beh = &amp;amp;m_currentFunction->objVariableTypes[n]->beh;
if( beh->destruct )
m_engine->CallObjectMethod((void*)(asPWORD*)&amp;amp;m_regs.stackFramePointer[-pos], beh->destruct); // crash here
}

looks like problem occurs when using script function like

string FormatInt(int val)
{
if (val < 10) return "0" + val;

return "" + val;
}

void SomeFunc()
{
...
Log(FormatInt(a) + ":" + FormatInt(b) + ":" + FormatInt(d));
...
}

so problem definitely in returning string in function as result. That's lead to illegal stack and crash.

And worse of all of this - crash occures on IOS and on Android and not on PC. SO we can't provide sample to you.

registering virtual properties

16 November 2012 - 07:02 AM

Hi!

I can declare global class throught binding with c++ code. Can i bind virtual properties? I don't find any clue in documentation about this feature (((

char* or const char* in binding functions to script

30 October 2012 - 01:59 AM

Hi!

In script we can use only string but they are very very slow because using of strings leads to lots of allocations.

Simple example:

strint str;
str = "lots" + " of " + "allocations";

this simple line of code leads to 7 allocations and 3 deallocations. If we put 10 such line of code and we got 70 allocations and 30 deallocations in single frame. And this is awefull because this becaume bottlenck.

This problem may gone if i would bind functions like void opAdd(const char* in) / void opAdd(char* in) but i can't do that (((

Also in c++ code we never use std::string, we use only char str[] and we never have problems with unnecessary allocations. Also, because
we can't bind function with char* as parameter almost always we got unnecessary allocation when we call c++ function from script containing string as parametr.

Is there are any solution to avoid problem with string allocations? Do not use strings not a option (((

PARTNERS