Advertisement

Precompiled Bytecode format

Started by February 15, 2013 06:31 AM
14 comments, last by Tzarls 11 years, 9 months ago

Now your questions make perfect sense to me. smile.png

It sounds like a fun project. I look forward to seeing more of it.

I doubt there are any stand-alone IDEs for AngelScript, as the scripting library is for embedding into application rather than something to create standalone programs with. For this reason the IDE would have to understand the application in which the scripts will be executed in order to be useful. Most users tend to write their own IDEs as part of their content creation tools.

If you're only looking for source editor with syntax highlighting though I'd recommend Notepad++, or Scite. You can visualize the AngelScript code as if it is C++ and the syntax highlighter does a pretty good job.


If I get iterative execution (I really have no idea what to call it) working well enough, I'll send you a patch. It shouldn't be too difficult. Even if you don't need to know the opcount of the execution, there are other situations where you want to limit it without having to change the script itself.

Take a look at this thread:

http://www.gamedev.net/topic/636508-angelscript-on-flascc/#entry5015807

The guy there talks about a code editor he´s made... maybe you can get in touch with him and see if he can share his sources?

Advertisement

Take a look at this thread:

http://www.gamedev.net/topic/636508-angelscript-on-flascc/#entry5015807

The guy there talks about a code editor he´s made... maybe you can get in touch with him and see if he can share his sources?


I'll have to take a look at that, thanks.

Also, Andreas, I've successfully made it so it can be interrupted. What I've done is somewhat hackish so I want to clean it up first. I was thrown off by the copying of the register data in the start of ExecuteNext, as there is apparently local data in l_** which is not in the registers, so it was being blown away when I returned within the loop. I solved that with some struct/RAII trickery.

On the original premise of this post, though - is it possible to get some sort of assembly readout, even if text? Something users can look at and go "Oh, that's where my opcodes went!"?

About the IDE: if you can make your (postprocessed) AS code appear as close to C++ as possible (enforce semicolons at the end of class definition, use array<int> instead of int[] etc.), #include a file that defines some keywords (like #define interface class), and autogenerate "headers" with definitions of your registered classes and functions, then Visual Studios (including the free Express editions) prior to 2010 do more than good job for working with AS. Syntax highlight, type sensitive (sic) autocomplete, jumping to code definition, search for symbol references, class view and all other features work without any problems. The only thing that this setup is lacking is the embedded debugger.

The (detailed) propaganda continues here: http://www.gamedev.net/topic/594639-symbols-table-andor-syntax-tree/#entry4806355

with screens: http://www.gamedev.net/topic/603001-creating-as-ide-thoughts/#entry4817006

It requires some initial, one-time investment of time to make it work, but it's definitely worth it. And let me stress it again that it works with free versions of MSVC,

Take a look at this thread:

http://www.gamedev.net/topic/636508-angelscript-on-flascc/#entry5015807

The guy there talks about a code editor he´s made... maybe you can get in touch with him and see if he can share his sources?

He posted the link to the source code further down in that thread. He also said that the IDE is tied into his engine, which is exactly what I mentioned earlier. Still, the code for his IDE might be a good start to write your own if you intend to do that.

Also, Andreas, I've successfully made it so it can be interrupted. What I've done is somewhat hackish so I want to clean it up first. I was thrown off by the copying of the register data in the start of ExecuteNext, as there is apparently local data in l_** which is not in the registers, so it was being blown away when I returned within the loop. I solved that with some struct/RAII trickery.

On the original premise of this post, though - is it possible to get some sort of assembly readout, even if text? Something users can look at and go "Oh, that's where my opcodes went!"?

The local variables are for optimizations. The compiler is able to put the local variable into the CPU registers, but the context's class members can't be placed in the CPU registers, so using those directly is a lot slower.

I have an output of the bytecode in readable text for debugging purposes. You can probably use that one in your project. It's in asCByteCode::DebugOutput().

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

He posted the link to the source code further down in that thread. He also said that the IDE is tied into his engine, which is exactly what I mentioned earlier. Still, the code for his IDE might be a good start to write your own if you intend to do that.

Sorry.... somehow I got the idea he was releasing only the binaries as his IDE is tied to the game...

This topic is closed to new replies.

Advertisement