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

AngelScript on WindowsRT

14 posts in this topic

I am in the process of porting my engine to Windows Store and Windows Phone 8.  I have encountered a problem with scripting however.  On all platforms the library compiles.  Upon execution of and start up is when the problem shows.

 

I have traced through start up, and when i get to this line of code 

 

engine->RegisterObjectType("Array<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE);

 

that fails with an error code of -7, and "configFailed" is then set to true, at which none of my scripts compile.  All of this runs perfectly fine on Windows 8 (Desktop apps).  I am not sure what configuration setup i need to have for Windows RT or WP8.

 

Thanks for any help 

 

It is also throwing a -17 error, InvalidConfiguration.  This leads me to think i am missing a setting or define that is needed.

Edited by NiteLordz
0

Share this post


Link to post
Share on other sites

It is strange that RegisterObjectType() returns -7 (asNOT_SUPPORTED). Are you certain that it is this call that returns this error?

 

Anyway, I guess Windows RT requires a different configuration in as_config.h to work properly with native calling conventions. Can you provide a list of the predefined macros that the compiler uses when compiling for Windows RT? I'll need that to see what can be used to identify Windows RT as the target and decide how to configure the library for it.

0

Share this post


Link to post
Share on other sites

i have tracked it down further, and found that the calling convention is not supported, thus returning -17, invalid configuration.  after that, all other register calls return -7.  

0

Share this post


Link to post
Share on other sites

as for preprocessor defines, is there anything in particular you would like?  i program mostly in windows store and RT, and i know a few of the triggers i go off of, and i have a few custom ones that i use within the engine.

 

this url provides a few of the techniques that i use to define my application for my enterprise solutions as i have to support ARM, X86, X64 and Windows Phone 8.

 

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/3965645c-978c-4148-b32c-1853f7fd22b3/platform-defined-macros-for-windows-store-app?forum=winappswithnativecode

0

Share this post


Link to post
Share on other sites

Probably the only thing that needs to change in as_config.h is the following:

 

Line 465 :

 

#ifdef _ARM_

 

to

 

#if defined(_ARM_) || defined(_M_ARM)

 

Can you give that a try and see if it resolves the problem?

0

Share this post


Link to post
Share on other sites

Applying that addition, i receive 6 unresolved errors for 

Error	1	error LNK2019: unresolved external symbol armFunc referenced in function "unsigned __int64 __cdecl CallSystemFunctionNative(class asCContext *,class asCScriptFunction *,void *,unsigned long *,void *,unsigned __int64 &)" (?CallSystemFunctionNative@@YA_KPAVasCContext@@PAVasCScriptFunction@@PAXPAK2AA_K@Z)	D:\Development\KeefersKorner\Aurora\Development\Build\WinStore\Engine\Urho3D\AngelScript.lib(as_callfunc_arm.obj)	Urho3D

all stemming from as_callfunc_arm.obj

 

On line 646 i also saw that define, so i applied the additional define there, but no joy.

 

Would it be easier to discuss more real time, email, etc... ?

0

Share this post


Link to post
Share on other sites

The missing symbols armFunc?? are implemented in as_callfunc_arm_msvc.asm. You'll need to include this when compiling the library for ARM CPUs. 

 

Since it is an assembler file you'll probably need to use a custom build option. Unfortunately I don't know the command line tool for compiling arm assembler routines, but I suppose it is similar to what is used for x64:

 

ml64.exe /c /nologo /Fo$(OutDir)as_callfunc_x64_msvc_asm.obj /W3 /Zi /Ta %(RootDir)%(Directory)\%(Filename)%(Extension)
0

Share this post


Link to post
Share on other sites

So i have it compiling (well assembling) the as_callfunc_arm_msvc.asm file.  It compiles out the library, upon linking i get an error message saying the obj file can not be found.

Error	1	error LNK1181: cannot open input file 'C:\@Projects\TFS Cloud\Aurora\Development\Temp\Store\AngelScript\Debug\as_callfunc_arm_msvc.obj'	C:\@Projects\TFS Cloud\Aurora\Development\Build\WinStore\Third Party\AngelScript\LINK	AngelScript

I am using Visual Studio 2013, and i have added the Microsoft masm Build Customization File target as checked, and also in the properties of the asm file i have "Item Type" set to Microsoft Macro Assembler, and under "Object File" i have "Make All Symbols Public" set to yes.

 

I apologize, but my lack of asm skills is very apparent lol.

 

Thanks much in advance

0

Share this post


Link to post
Share on other sites

Sounds like the assembly output file (as_callfunc_arm_msvc.obj) didn't end up in the directory where the linker expected it.

 

Can you send me the MSVC project file (*.vcxproj) for the library? I'll see if I can spot the mistake.

0

Share this post


Link to post
Share on other sites

Hmm. I see Microsoft has changed the layout of the .vcxproj file since MSVC2012.

 

In your project file I only found the following related to the assembler files:

 

  <ItemGroup>
    <None Include="..\..\..\..\Source\ThirdParty\AngelScript\Source\as_callfunc_arm_gcc.S" />
    <MASM Include="..\..\..\..\Source\ThirdParty\AngelScript\Source\as_callfunc_arm_msvc.asm">
      <FileType>Document</FileType>
    </MASM>
    <None Include="..\..\..\..\Source\ThirdParty\AngelScript\Source\as_callfunc_arm_xcode.S" />
    <MASM Include="..\..\..\..\Source\ThirdParty\AngelScript\Source\as_callfunc_x64_msvc_asm.asm">
      <FileType>Document</FileType>
    </MASM>
  </ItemGroup> 

 

But there is no information on how the files should be built, much less the fact that only the arm version should be included in the ARM build and only the x64 version should be included in the x64 build. Perhaps MSVC2013 stores this information somewhere else?

 

In the MSVC2012 project file I have it looks like this:

 

  <ItemGroup>
    <CustomBuild Include="..\..\source\as_callfunc_x64_msvc_asm.asm">
      <FileType>Document</FileType>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ml64.exe /c  /nologo /Fo$(OutDir)as_callfunc_x64_msvc_asm.obj /W3 /Zi /Ta %(RootDir)%(Directory)\%(Filename)%(Extension)</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)as_callfunc_x64_msvc_asm.obj;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ml64.exe /c  /nologo /Fo$(OutDir)as_callfunc_x64_msvc_asm.obj /W3 /Zi /Ta %(RootDir)%(Directory)\%(Filename)%(Extension)</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)as_callfunc_x64_msvc_asm.obj;%(Outputs)</Outputs>
    </CustomBuild>
  </ItemGroup>

 

(of course, I don't have a WinRT target in my project yet, so there is no compilation step for the arm assembler file.)

 

Have you checked that the as_callfunc_arm_msvc.obj is actually generated somewhere when compiling the library? If so, in what directory is it being generated? If it is not generated, check what command MSVC is actually running when getting to the assembler files (the project settings should have an option to visualize the command line).

0

Share this post


Link to post
Share on other sites

Hah, I forgot to read my own manual. I had already included instructions on how to compile the as_callfunc_arm_msvc.asm file there. rolleyes.gif

 

As far as I can tell armasm is still the tool that should be used to compile the as_callfunc_arm_msvc.arm file for WinRT/Windows Phone, so you need to include a custom build step with the proper command line for that tool.

0

Share this post


Link to post
Share on other sites

NiteLordz and I have been exchanging e-mails on this topic. With his help I've been able to update AngelScript to allow it compile and link the library successfully for Windows Phone with ARM CPU. Unfortunately we've hit a roadblock on getting the native calling conventions to work properly.

 

I've investigated some of the disassemblies from the regression test suite and I can see that the Windows Phone 8 ARM ABI is not the same as what is already implemented in the library. Some of the things I see as different from the current implementation are: the assembler routines in as_callfunc_arm_msvc.asm doesn't guarantee 8 byte alignment on the callstack and the assembler routines are not using the floating point registers when passing or returning float values. There may be other differences too, but only testing will tell.

 

To get the native calling conventions fully working it would be necessary to adapt the code written for the Linux ARM with hard float ABI to work for MSVC too, and then run the test_features regression tests to make sure everything is working. Unfortunately it is not possible to test the native calling convention code with the Windows Phone emulator that comes with the SDK, so it requires a physical Windows Phone device to do that, which I do not have. So I'm not able to progress any further at the moment.

 

Is anyone with a Windows Phone 8 and a little skill with assembler (not much is really needed) interested in giving a hand in getting this to work?

0

Share this post


Link to post
Share on other sites

MSVS SLN with my commits. Work perfect with vc10-vc14 hire

VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
If you needed Express Edition version of SLN write issue on github.

 

About Working  with ASJIT:

I join any kinds of pull request

0

Share this post


Link to post
Share on other sites

Hi cmd.exe,

 

I would like to take a look at the changes you've done to incorporate them into the official repository. But unfortunately your link doesn't appear to be working.

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