View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 17:22 
Hey everyone -

I'm working on getting the Cryengine SDK installed on the computers in my department, and I was thinking of implementing Crymono into the workflow because our department uses Unity/C# for the core curriculum and I figured it'll make life easier for C#-people in terms of scripting. I had a few questions I was hoping you guys could answer for me.

1) While the design department's Unity program is C#, our Comp Sci department does C++... can we switch between the two (it at least looks like Crymono allows for scripting in C++ as well, am I right?)? I guess I mean, is the core installation the same whether we want to use C++ or C# for scripting and is it that we decide which we want to go with afterwards? To what degree is there coexistence/interoperability between scripts written in the two languages (like, Unity allows scripts in a project to be written in any compatible language, it's just that if you have two scripts written in different languages, you can't call on functions in one from the other)?

2) If we have Crymono installed, can we still use Lua (as is standard with the CE3 SDK) if we want to? And the same coexistence/interoperability question here. Again, I just want to leave as many options open as possible for when we make the decision; plus, other students in the lab besides our team may wish to stick with Lua for other projects.

3) Is the current build stable/feature complete enough for us to be able to use it full-on over a two year development cycle, or at least for the first year? The department reimages the systems each summer, and I'm not sure what the process for getting incremental updates is, so I want to make sure that the current build is solid enough for us to be able to use at least until next summer, when the department can reimage with the latest CE3 SDK and Crymono available then. If it makes any difference, we'll mainly just be working on creating a working prototype of the core mechanics rather than creating a full product for the first year.

PS) Also, any straightforward installation guides for Crymono? Do I drag-drop the folder somewhere in the installation directory? Different procedures for 32-bit vs 64-bit?

User avatar   Has no life Has no lifeMember since: 11.07.2008, 20:25Posts: 11740Location: Nottingham, UK Likes: 89
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 19:08 
Quite the set of questions but I could do with a brief break from writing code :)

1) With CryMono integrated into the SDK, you potentially have two options for programming in C++.

Firstly, you can edit the GameDLL project directly, as you would without CryMono installed. There's limited interaction; within the CryMono project, you can manipulate the C# environment as you like via Mono, but the reverse is only possible via what are called scriptbinds. These expose C++ functions to C# code, and that's how we link our libraries to the engine.

Thinking of C++ in this instance as being a level below the higher-level C# should help. The C++ is responsible for the C# environment; it's effectively in control.

The second method, and I should state that this is highly untested, is to use C++/CLI, a variant of C++ that runs on the .NET framework (formerly known as managed C++). In theory, it should be possible to compile this to an assembly that can be referenced by your C# code and loaded by CryMono, providing language interoperability. This is not, however, the same as standard C++. It's a language unto itself, and concepts from C++ don't always translate. On the flipside, it's .NET, so you get extra features like a garbage collector.

Unity's interop is derived from the fact that both C# and their proprietary UnityScript are .NET languages. CryENGINE3 uses native C++, not C++/CLI, so interop is only possible via the methods mentioned above.


2) You can still use Lua to a degree. CryMono overrides how game rules (the classes that control game flow and logic) work and consequently Lua gamerules will not work. Most Lua entities will work though, except in instances where they themselves are dependent on the Lua gamerules.

Lua code itself cannot see C# code (again, Lua is called directly by the native C++ engine whilst C# runs in our Mono environment). However, we're working to make the inverse true; we're creating an interface so that C# code can access Lua scripts.

You could also, in theory, create Lua scriptbinds in C++ that interact with the C# environment but that seems like an awful lot of work for not a lot of gain.


3) The stability is pretty good for the following tech stack: .NET (game scripts) loaded by .NET (compilers) loaded by .NET (CryBrary) loaded by C++ (CryMono) with the help of pure C (Mono) loaded by C++ (the GameDLL) loaded by C++ (the engine) ;)

More seriously, we're not yet at 1.0, which we're aiming to be the first production-ready release. With regards to the imaging, we iterate on CryMono fairly quickly; 0.1 was released back in December, and we've just shipped 0.5, bearing in mind some of these versions have included the wrapping of whole engine systems. Obviously I don't know how strict your IT department are but finding a way to get updates would be hugely beneficial, given that even the Free SDK will go through a few releases in a year. If necessary I can provide support for upgrade instructions etc.

Finally: you can use Seasons (the stock SDK with CryMono) or Angry Boids (a minimal SDK build with CryMono) as a base; this comes with CryMono preinstalled. However, to get the latest and greatest versions, you'll want to compile from source.

Hope that answers your questions! Just shout if stuff isn't clear.


Out now! CryENGINE Game Programming with C++, C#, and Lua
Ex-Crytek, now with Deep Silver Dambuster Studios
  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 21:17 
How would I go about doing a source code compile? Any ETA on the 1.0 release? And would this source code compile need to be redone with every release (I assumed yes, but I guess what I'm asking is is it complicated/will we retain compatibility with projects started in earlier versions)? Doing the source code compile would allow us to start from scratch without Seasons or Angry Boids, correct?

And I looked at the Seasons git - is it/Crymono not 64 bit compatible? And when the repository says "stripped down 3.4", what's been removed? I'm really interested in Seasons if only because it seems like the AIO solution we could easily distribute (instead of doing a source code compile ourselves).

Anyway, basically, would you suggest going with Crymono or sticking to the default Lua scripting?

Thanks so much for the help ^_^ and sorry if I seem a little noobish, haha.
User avatar   Has no life Has no lifeMember since: 11.07.2008, 20:25Posts: 11740Location: Nottingham, UK Likes: 89
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 21:39 
Unfortunately we haven't got an ETA on the 1.0 release as we're constantly reassessing progress; sometimes we'll get stalled by engine bugs for days, other days we'll make massive leaps forward. The source code recompile will need to be done whenever you upgrade, yes. Compatibility is mostly preserved between releases, with the caveat that we may make API changes. These should at worst be minor changes to function calls etc.

CryMono is completely x64 compatible, we just don't ship default versions to save space. You can do this yourself by compiling source; with Seasons or Angry Boids downloaded, download the source code repo I linked to and place the contents inside <engine root>/Code/CryMono/ (you'll be asked to overwrite some files, that's fine); it should look like this:

Image

Then open up Solutions/CryMono.sln in Visual Studio and compile all projects.

Please note that as we've only included Bin32, to enable x64 support you'll need first to copy Bin64 across from a stock CryENGINE installation, compile Code\Solutions\CryEngine_GameCodeOnly.sln for x64 and then compile CryMono in x64 mode too. All files should automatically be generated in the right place provided you place CryMono as indicated above :)

Seasons is stripped down in the sense that it doesn't include most of the stock art assets that ship with CryENGINE, to conserve space.

As an advocate of C# of course I'll recommend it over Lua ;) but then I'm biased. C# is faster than Lua, strongly typed (with the option to use dynamic typing if desired) and includes a huge class library for common and even not-so-common operations; this has the tradeoff that memory usage is slightly higher than when the engine is purely using Lua.


Out now! CryENGINE Game Programming with C++, C#, and Lua
Ex-Crytek, now with Deep Silver Dambuster Studios
  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 22:21 
Cool. So do you think we can get a good start on 0.5, and there aren't any major features missing that'd hinder development? I will try my damnedest to work out updates, but just in case.

If we want to keep the stock assets - for the prototype - can I just copy in all the files from defaultSDKroot/Game after I make the 64bit compile based on the Seasons build/how would I go about doing this? (Or would I just be better off/would it be simpler compiling Crymono into the stock SDK myself if we wanted to keep the stock assets? I imagined the former would be simpler)

On the x64 note - I noticed the stock CE3 SDK only has one GameCodeOnly.sln... why does it need to be recompiled for x64?

And just to make sure my understanding is correct... any projects started with the Crymono compiled version of the SDK should all allow for scripting in C# through Visual Studio?

(If it's not apparent, I'm slightly confused/in over my head here, heh)

On C# being easier to work with... yeah, I'd totally agree. I've been trying to teach myself Lua; I've done Java, Processing, and C# before, and Lua just looks and feels completely different, kinda intimidating =[ I cried a little on the inside, heh.
User avatar   Has no life Has no lifeMember since: 11.07.2008, 20:25Posts: 11740Location: Nottingham, UK Likes: 89
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 22:28 
Yeah, with 0.5 you can build entities, flownodes, and gamerules, the three main ingredients of a CryENGINE game :) And yes, any projects with CryMono integrated allow for C# scripting; by default, we've placed a Visual Studio solution with a C# project in Game\Scripts that contains our example gamerules and such.

Copying assets across should work just fine. Integrating CryMono into the SDK yourself would require a bit more work as we have to make some GameDLL changes to get CryMono loading and working.

There's only one solution, CryEngine_GameCodeOnly, but it's set up to compile in various modes; you'll need an x64 version compiled if you want x64 support.


Out now! CryENGINE Game Programming with C++, C#, and Lua
Ex-Crytek, now with Deep Silver Dambuster Studios
  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 09.06.2012, 22:49 
Thanks for all the help -

[See update below]

And I'm just gonna be a dumbass here, I have no idea how to compile or do anything in Visual C++...


Last edited by UnforgottenDannyK on 10.06.2012, 04:57, edited 1 time in total.
  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 10.06.2012, 02:22 
Yeah I seriously have no idea what I'm doing (sorry to double post) -

All I get is errors from Visual Studio. Got Professional, that reduced the number, but I still get an error about CryBrary.Documentation.shfbproj when I open Crymono.sln so I can recompile... and then I also get a handful of errors during the build process for Crymono.sln. No errors at launch for GameCodeOnly but a few during the build process.

I don't even know if build is what I'm supposed to being doing, whether I should check just the x64 in batch build rather than all of them (or if batch build is even what I'm supposed to do), blah blah. Debug? Profile? Release? None of this makes sense.

--
Errors

When building GameCodeOnly.sln (just selected the x64 Debugs in the Batch Build, after setting them all to x64 in the config manager)
Error LNK2001: unresolved external symbol _DllMainCRYStartup; File - LINK; Project - CryAction
Error LNK1120: 1 unresolved externals; FIle - CryAction.dll; Project - CryAction

So it looks like CryAction fails to compile.

When building CryMono
Error LNK1104: cannot open file "... \Solutions\BaseAddress.x64.text' (LINK; CryAction)
Assembly generation -- Referenced assembly CryBrary.dll targets a different prcessor (CryBrary.Tests)
warning MSB8004: Output directory does not end with trailing slash (Microsoft.Cppbuild.targets, line 299, column 6; Crymono
warning C4800: forcing value to bool "true" or "false" (performance warning) (MonoDomain.cpp, Line 82, column 1, Crymono)

CryAction fails to compile here as well.


Last edited by UnforgottenDannyK on 10.06.2012, 04:56, edited 1 time in total.
User avatar   Has no life Has no lifeMember since: 11.07.2008, 20:25Posts: 11740Location: Nottingham, UK Likes: 89
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 10.06.2012, 02:47 
I'll put together a complete build tomorrow. :)


Out now! CryENGINE Game Programming with C++, C#, and Lua
Ex-Crytek, now with Deep Silver Dambuster Studios
  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 10.06.2012, 04:55 
Baaaah thanks =\ I mean, I would like to learn how to do this properly for future builds... Each of them just has one fail from errors, and I just need to know which profiles or whatever to select when building? What was I missing?

I at least tried to launch the editor with what I had (the errors above, CryAction failing to compile), and I just got IEditor:Init failed (something like that), and then it couldn't find the crash handler, etc etc.

Oh, and I'm working off the Seasons base if that makes a difference.

X(

PS: Crymono won't affect Perforce compatibility, right?
User avatar   Uber Modder Uber ModderMember since: 19.03.2009, 12:21Posts: 2037Location: Sweden Likes: 36
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 10.06.2012, 11:54 
You need a professional (read: non-express) version of Visual Studio in order to compile in 64-bit mode. For the CryAction issue see the first post in the Common compiler errors thread. :)

In summary, it's probably easier to just utilize the builds we set up at the AngryBoids and Seasons repositories, and just add / remove assets from there.

Ruan will have a build set up for you ready whenever he awakens from his slumber, including x64 binaries. :)


  Beginner BeginnerMember since: 14.05.2012, 06:22Posts: 60 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 10.06.2012, 17:54 
Yeah, sorry, I wanted to at least take a stab at it, and I would genuinely like to know how to do this in the future so I don't have to bother anyone hah.

And yeah, I got that I needed the professional version after I got it and realized 2/3s of the error went away. XD What exact build settings do I need to use? Was I doing everything right (debug, x64), except for making it build Cryaction?

The specific error I get at launch when opening Crymono.sln, the only one I still get at launch, is "[...]/CryBrary.Documentation.shfbproj cannot be opened because its project type (.shfbproj) is not supported by this version of the application" . Is this normal?;

Eagerly awaiting so I can distribute to the team and get it over to the department digital systems guy.
  Beginner BeginnerMember since: 10.06.2012, 08:15Posts: 5 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 11.06.2012, 22:05 
For those of us who don't have access to Visual Studio Professional, is there a way we could develop for 64b in C# using alternative tools?

I'm coming over from doing a lot of heavy development in with Java, and C# is going to be much easier for me to pickup than diving head-on into C++ (at least I think so). I would like to use Editor integration, and willing to take the time to set everything up, but at the moment if there's no x64 support without having VisualStudioPro I'm going to be mightily disappointed (so I'm hoping!).
User avatar   Uber Modder Uber ModderMember since: 19.03.2009, 12:21Posts: 2037Location: Sweden Likes: 36
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 11.06.2012, 22:46 
Quote by Sleaker:
For those of us who don't have access to Visual Studio Professional, is there a way we could develop for 64b in C# using alternative tools?

I'm coming over from doing a lot of heavy development in with Java, and C# is going to be much easier for me to pickup than diving head-on into C++ (at least I think so). I would like to use Editor integration, and willing to take the time to set everything up, but at the moment if there's no x64 support without having VisualStudioPro I'm going to be mightily disappointed (so I'm hoping!).


We do compile 64-bit binaries for our AngryBoids builds, however we do not include the default engine ones due to space concerns. If you want this, simple drag in these from the default Free SDK bin64 folder and everything should work fine. :)


  Beginner BeginnerMember since: 10.06.2012, 08:15Posts: 5 Likes: 0
 

 Post Topic: Re: Some Crymono Setup/Implementation Questions
PostPosted 11.06.2012, 23:54 
Quote by i59:
We do compile 64-bit binaries for our AngryBoids builds, however we do not include the default engine ones due to space concerns. If you want this, simple drag in these from the default Free SDK bin64 folder and everything should work fine. :)


Ahh ok, was kind of confused on this since every document I open kept telling me to pull in stuff from one of the other projects, but all I was wanting to do was use the defaults to start with.

As far as the rest of the logic is concerned, they don't need to be compiled 64b or 32b specifically, correct?

Also, I'm very visual. It would be helpful if there was a file list of what should be in each directory somewhere, and the exact git repo/folders that contain these files. I have a hard time making the correlation in my mind when there are 3-4 diffferent projects and each one has different instructions associated with it.