• 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
clb

Try Angelscript live!

9 posts in this topic

It's really cool to see different techs come together like this. Thanks for sharing.

I'll have to look into these other projects you link to. They all look interesting.

Thanks for the compliments on AngelScript. I'm very pleased to see you value exactly the features that made me start writing AngelScript almost 10 years ago, i.e. strong/static typing, and proper C++ integration.
1

Share this post


Link to post
Share on other sites
Hey, something I was thinking while doing this: Are there any C++->Angelscript bindings generators out there? Something that would take in a set of .h/.cpp files and automatically generate the interop code for the symbols contained in those files?

That's something I ended up doing with this project, and I was wondering whether it is sensible to continue with that effort, or whether tools for that already exist?
0

Share this post


Link to post
Share on other sites
Perform a forum search with "Generate" there are some binder generator scripts posted before.

i have started such project. Serious hurdles are:

- Can not determine object type. Is it a Value, NOCOUNT, Refcounted or Garbage collected
- Parameter type, &in &out &inout . Easy way out is enable unsafe refs.
- Inheritance, not enough to scan a single .h file. Allow casting or not?
- How about primitive typedefs
- Heap corruption errors, Yeah, they happen a lot. you can't spot these until functions are used in script. So, lots of test cases ?

my solution is to put preprocessor directives before some risky declarations.
I am getting tired, just too many cases to handle.
Manually registering them is way easier.
0

Share this post


Link to post
Share on other sites
Alpha_ProgDes: thanks!

[quote name='saejox' timestamp='1355222239' post='5009379']
Perform a forum search with "Generate" there are some binder generator scripts posted before.

i have started such project. Serious hurdles are:

- Can not determine object type. Is it a Value, NOCOUNT, Refcounted or Garbage collected
- Parameter type, &in &out &inout . Easy way out is enable unsafe refs.
- Inheritance, not enough to scan a single .h file. Allow casting or not?
- How about primitive typedefs
- Heap corruption errors, Yeah, they happen a lot. you can't spot these until functions are used in script. So, lots of test cases ?

my solution is to put preprocessor directives before some risky declarations.
I am getting tired, just too many cases to handle.
Manually registering them is way easier.
[/quote]

I use doxygen as the backend for my script generator. A lot of the required information is specified in the comments. For example, if a function has a comment /* @param outTriangleCount [out] Receives the number of triangles generated. */, then the presence of the string '[out]' tells the generator to use '&out' for the binding. The bindings are generated at a global project scope, not by scanning a single .h file, so the generator has knowledge of which types the script engine understands, and it automatically leaves out those signatures that contain symbols that aren't understood. Inheritance, #defines and typedefs are detectable, since doxygen knows about those, and the generator can be guided with special comments inside doxygen tags like [noscript] or [valuetype], etc. Whether the types have custom ctor/dtor/assignment/copyctor is known, and function default parameters can also be detected.

This is the third script bindings generator I have written with the same doxygen-based backend code. I have used the same approach with C++ -> QtScript bindings and C++ -> JavaScript (embind) bindings.

So far the generator is very primitive, and only used to expose MathGeoLib value types. What I'm looking for currently is whether I am duplicating my effort here and if it's sensible to write this at all, or whether someone else has solved this already.

I am still a beginner to Angelscript, so your insights on what exactly are the "not-automatically-detectable-by-introspection" kind of cases are very valuable to me. If you can give some pointers on what kind of "external" decisions a developer makes when building interop, that will be very helpful.
0

Share this post


Link to post
Share on other sites
using doxygen is a great idea since it parses both comments and code.
i have used clang, unfortunately clang doesn't parse comments. boost::wave for preprocessor directives.
I dont like how mine turned out. It is a mess. Hard to use and integrate.
What is the point if i have to manually write directives for every parameter.

Maybe a GUI utility to help me fill those missing parts.
a workflow like this

1- generate xml from headers
2- open xml in gui
3- edit unwanted types, parameters, cast, constructors
4- press generate to create bindings
5- see them in gui, if dont like em go back to 3
6- save it so we dont repeat ourself later

generating binding is not worthy if process is just as hard as writing them by hand.
0

Share this post


Link to post
Share on other sites
As you already pointed out, some things cannot be automatically generated. For example when to use autohandles, or when to use &in or &out. In these cases a manual decision has to be made. In many cases you also do not want to expose all types and functions either. Access profiles is another thing that has to be chosen manually.

My idea for an auto generator would work like this:

1. For a first time generation, the generator would parse the C++ files looking for potential types and functions that can be registered with the script engine. It should preferrably be possible to filter which C++ files to parse, so the generator doesn't try to understand the inner guts of the program.
2. The generator would store what it finds in an intermediate file where the user can select the types and functions that should and shouldn't register, as well as make the manual decisions mentioned before.
3. From this intermediate file, the generator would then generate the actual binding code that will be built with the application.
4. The generator should also have the capability of doing a new sweep over the C++ files to look for changes that have been made since the last time the binding code was generated. When this happens it should update the intermediate file, clearly marking what has been modified, yet keep the user added information where the C++ file has not been modified.

This 4th bullet is where the real benefit of an auto generator comes in. That is, the ability to automatically identify changes to keep the binding code synchronized with the C++ code.

The generator could have a couple of additional features, such as a GUI to browse and update the intermediate file, as well as to keep track of comments to be used to generate the documentation for the script writers. These features are however much less important.

All this should be done without requiring special comments in the actual C++ files. All user edited information should be kept in the intermediate file.

Regards,
Andreas
0

Share this post


Link to post
Share on other sites
Thanks saejox and Andreas for the good insight! I think I've now got a good grasp of how to proceed. The tool will be available on github if you are interested in trying it out later.
0

Share this post


Link to post
Share on other sites
It would be great to add a tool like this to the [url="http://www.angelcode.com/angelscript/resources.html"]list of useful AS resources[/url].
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