• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
_Engine_

huge problems with precompilde byte code

19 posts in this topic

Hi!


We are using angel script in our game engine, but we encountered with serious problems. Before 2.25 we try use precompiled byte-code but
they are was error in loading byte-code. So we just compile script in runtime and this works fine until script became too big and app on ios forced to close because too much memory consuption take place when compiling script. Now with 2.25 when we save byte code angel script just crashes.

Also always triggered assert in when compiling script
as_compiler, line 925
if( !hasCompileErrors )
{
asASSERT( tempVariables.GetLength() == 0 );
asASSERT( reservedVariables.GetLength() == 0 );
}

Can we send source code and nessesery data so you can debug angel script code and figure out what we did wrong or what bug lie in angel code?


Best regards.
0

Share this post


Link to post
Share on other sites
Asserts in AngelScript is most likely a bug in the script engine. Sometimes they may be hit due to invalid scripts, but it would still be a bug in the library.

When the assert happens in the compiler, can you inspect the outFunc member in the compiler to determine which script function is being compiled, and then post that function here (or send it to me by e-mail) so I can take a look at it?

If the assert hits in the compiler, how is it that you manage to save the bytecode?

Please don't send me the full source code. At least not without trying to narrow down the problem first.
0

Share this post


Link to post
Share on other sites
Hi!

?ssert itself not a problem because script work fine. Real problem is not working precompiled byte code - previosly byte code load don't work and now byte code saving are broke and this is real problem because we working at commercial project and almost failed because angel script leads to huge techincal problems with we can't solve by ourselfs (((
0

Share this post


Link to post
Share on other sites
just send function is not a solution because we have very complecivity using of angels code so only full code is solution and also we cannot fix angelcode bug because problem too complex ((( Edited by _Engine_
0

Share this post


Link to post
Share on other sites
The fact that the assert fails is likely the related to why the precompiled code doesn't work, even if running the scripts work seems to be working ok.

The specific assert that is failing tells me that the compiler is doing something wrong with the temporary variables. There is probably a specific expression in which the compiler fails to deallocate one of the temporary variables. This kind of problem can make the code in the bytecode serialization fail is the instructions don't match up when it adjust the positions to keep the saved code platform independent.

Seeing the function that causes the assert failure will hopefully allow me to identify what expression the compiler is having trouble with in order to fix it.
0

Share this post


Link to post
Share on other sites
HI!

looks like i managed how to create script thats halting on assert. Please download this archive - http://www34.zippyshare.com/v/78988412/file.html
In archive modifaed project of tutorial project with comes with angel script and problematic script.
0

Share this post


Link to post
Share on other sites
I've reduced the script to the following:

[code]
shared class SPoint
{
SPoint@ opAssign(const SPoint&in assign)
{
return this;
}
}
class SBuilding
{
void ReleasePeople()
{
SPoint cellij;
if ( GetRoadOrFreeCellInAround(cellij) ) // <-- the assert happens here
{
}
}
bool GetRoadOrFreeCellInAround(SPoint&out cellij)
{
return false;
}
}
[/code]

It's definitely a bug in the compiler. I'll let you know when I have it fixed.
0

Share this post


Link to post
Share on other sites
Alright. I've fixed the assert() failure in revision 1441.

The assert() was hit because the SPoint opAssign method returned a handle instead of a reference. This caused the compiler to allocate a temporary variable to store that handle, but it was then never released again. This was actually causing a memory leak, as the SPoint object would never be freed.

Let me know if you still have trouble with saving/loading the bytecode after picking up the fix.

If the problem still exists, then can you call the WriteConfigToFile() function from the helper add-on in your application after registering the interface? It will save all the registered functions to a file that I can then use to recreate the same configuration even without the full implementation of your engine.

Regards,
Andreas
0

Share this post


Link to post
Share on other sites
Hi!

So there are no more halting on assert. But precompiled bytecode still do not work properly. Looks like problem lies in imported functions. Somehow some function do not imported successfully from another module. This functions use shared classes as input and return value. In simple script i cannot reproduce problem. We have no choise expect drop off imported functions and use function pointers instead.
0

Share this post


Link to post
Share on other sites
Hm, looks like function pointers is something strange. Imported functions are planned to deprecate in Angel Script 3.0 but i can't understend how modules can communicate using function pointers. So imported feature do not work and there are no another solution. We are stucked (((
0

Share this post


Link to post
Share on other sites
Hi!

So problem is - byte code can't load and it return -1 on loading. Error comes when loading shared constructors section.
This link http://www63.zippyshare.com/v/43593543/file.html leads to archive with modifaied sample "include" from angel code also archive contain scripts with leads to bug when loading shared classes.
0

Share this post


Link to post
Share on other sites
I've reduced the problem to this script:

[code]
shared enum ResourceType {}
shared class Resource
{
void getType(ResourceType) {}
}
[/code]

There is definitely something wrong with the combination of the shared enum and shared class.

I'll update when I have the fix.
0

Share this post


Link to post
Share on other sites
I've fixed the bug in revision 1444.

The problem was that the shared enums were not treated as shared when loading the bytecode, so each module got its own unique enum. This caused the other shared entities (classes, functions, etc) that used that enum to not match the original declaration, which is why the loading failed.

Thanks for the help in producing the code that allowed me to debug this.
0

Share this post


Link to post
Share on other sites
Big big thanks :)

this problem was gone but, but i found another bug.
This link to archive with problem code - http://www36.zippyshare.com/v/57990345/file.html
in sample fisrt loaded testbed.as and second goes second.as. BuildingDesc are included in testbed.as but not in second.as but comiler successfully find SBuldDesc when compiling second.as. When we try load bytecode for second.as complier can't find SBuldDesc and that is right. So problem is compiler find description of type that declared in another module but this must be are error as it is when loading bytecode or this should work and for byte code but i think is wrong becasu this no logical.
0

Share this post


Link to post
Share on other sites
You're right. The compilation of second.as should fail if it doesn't declare the shared SBuildingDesc. I'll look into this when I get home tonight.
0

Share this post


Link to post
Share on other sites
The problem was with shared classes. When a shared class was found during compilation and it had already been compiled in a previous the members were not compiled again so it wasn't detected that they were using some types that were otherwise not declared in the script. When the script was then saved, the full declaration of the shared class was saved including the reference to the other types.

I've fixed this in revision 1445. The missing declaration will now be properly detected during compilation of the script.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0