Jump to content
  • Advertisement
Sign in to follow this  
WitchLord

AngelScript 2.27.1 is here (so soon? yes)

This topic is 1940 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

I'm actually really excited to hear anything about a reduced memory footprint. AngelScript is already so small and optimized that it's amazing you can squeeze any more performance out for the features we get.

Share this post


Link to post
Share on other sites

The void expression sounds interesting. Would that be something like this?

bool GetInventoryItem(string name, out Item@ item)
{
    // if item exists, pass it out and return true
    // else return false
}

// ...

if (GetInventoryItem("map", void))
{
    //  we have the map but don't care about using it at the moment
}

I can't find any mention of it in the documentation, although that's probably since it's such a new feature that you haven't updated it yet.

Share this post


Link to post
Share on other sites

Nice! I like it a lot. I'm stuck in C# for my current language so I've had to use Lua (ugh), but I'm looking forward to getting back to C++ and playing around with the features you've added since I've been gone.

Share this post


Link to post
Share on other sites

Hi,

 

This release of AngelScript is quite small as I wanted to get started on the next big update. ...

what are the next big features / addons / updates that you will add?

Share this post


Link to post
Share on other sites

I'm working on improving the initialization lists. Not only will they be more efficient, but they will also be more versatile, and should allow AngelScript to be viable option for those looking for a script language to do a lot of data configuration.

 

Currently the initialization lists are very limited as the compiler is only able to use them via the index operator. It will then invoke the index operator for each element provided in the initialization list. This works well for ordinary arrays, but when you want something a little more complex, like a dictionary or grid of data, then the current solution doesn't work well at all.

 

With the new solution that I'm working on, the application will be able to define the pattern that the initialization list for a type must follow. The compiler will do the validation of this pattern at compile time, and will then provide a single buffer with all the data to the object constructor/factory. The object constructor can then parse this buffer to initialize the entire object before leaving.

 

The way the application will register the desired pattern will be something like this:

 

RegisterObjectBehaviour("array<T>", asBEHAVE_LIST_FACTORY, "array<T> @f() = {T repeat}", ...);

RegisterObjectBehaviour("dictionary", asBEHAVE_LIST_FACTORY, "dictionary @f() = {{string ?} repeat", ...);

RegisterObjectBehaviour("grid<T>", asBEHAVE_LIST_FACTORY, "grid<T> @f() = {{T repeat(x)} repeat}", ...);

 

For the array, the list will then be a list of values of the type T, e.g. {1, 2, 3, 4}

For the dictionary the list will be an array of key-value pairs, e.g. {{"car", @Car}, {"health", 23}}  

For the grid the list will be an array of arrays, where the compiler will guarantee that each row has the same amount of elements as the first one, e.g. {{0,1,2},{3,4,5},{6,7,8}}

 

I will take a while to have this implemented, and I may not be able to finish it all for version 2.28.0. For now I'm focusing on just implementing the way the buffer is initialized and then passed to the constructor. This may seem simple but I need to make sure the exception handler is capable of handling errors in the middle of the execution and also to have the offsets within the buffer adjusted properly when saving the bytecode to keep it platform independent.

Share this post


Link to post
Share on other sites

Is there any chance that the same syntax could eventually be used to register variadic function definitions?

Edited by Jake Albano

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!