3D Game and Visualization Engine, Android, iOS, Mac and Windows

MigueldeIcazaMigueldeIcaza USXamarin Team Xamurai

Hello!

We have just released a new package called UrhoSharp, it provides a 3D and 2D game and visualization engine. Think of it as a cross-platform SceneKit, with many of the SceneKit features that you have come to love on iOS, but you figured "I could never use this, it would never work anywhere else".

We have posted documentation, samples and API docs.

Check it here:

http://developer.xamarin.com/guides/cross-platform/urho/

And here is a cute animated gif of one of the games, it consists of about 1,300 lines of C# code. Which I bet would be 300 lines of F#:

Tagged:

Posts

  • PaulKellyPaulKelly USMember ✭✭

    Just saw this as was looking to start doing some game development.
    Looks great !

    Little Suggestion to list this under Game Development heading on the Guides web page.
    You have CocosSharp and MonoGame there and think this should be there also.

    So now which do I start learning as I now have more options.
    My requirements are as follows
    Currently only working on iOS but may change in the future.
    Want to start with basics so guess just 2D but interested in 3D if all goes well.
    Looking for good tutorials on which ever engine/API I go with.
    My overview is that all games engines/APIs work the same way with nodes and layers etc ....just naming diffences....but could be completely wrong too.

    All thoughts and suggestions welcome.

  • MigueldeIcazaMigueldeIcaza USXamarin Team Xamurai

    Good suggestion on the link on the web site.

    CocosSharp has already been out for a while, so if you want to just do 2D, that is likely a better option to start now.

    Urho3D supports both 3D and 2D and might provide a path for you to start from one and move to the other, but it is also a lot younger (while the engine is very mature, the binding has not been exercised completely, so we might have to adjust and make changes as we get feedback).

    Both are fun frameworks to use. As for tutorials, there might be more available today for CocosSharp than UrhoSharp, so that might be an issue. I am hoping that the forum can be a place where we can provide some guidance and learn about what kinds of guidance people want.

  • BenjaminGmeinerBenjaminGmeiner USMember ✭✭
    edited December 2015

    Hi, I posted a reply a few days ago but it's still not visible???

    Edit: I got told that the post is awaiting release by the moderator or something like that? Is it gone? :(

  • MikeGringauzMikeGringauz ILMember
    edited December 2015

    Hi, I'm interested in trying develop games with UrhoSharp.

    Currently I'm developing 2D games (with physics) for mobile (iOS/Android) with Cocos2d-x/C++.

    I always find it hard to integrate 3rd side services to game rather then developing a game itself.
    Cocos2d-x has added recently SDKBOX to ease services integration such as Analytics (Flurry, GA, etc), Ads (Chartboost, Appodeal, etc..), Social (Facebook) and etc which is a big help for any indie developer I guess.

    I want to know how hard it will be to integrate all those services into UrhoSharp game?

  • Hello.
    I'm just trying Urho and I've got a problem with tiled map.
    I start by using FeatureSamples #36. All is ok.
    Using TiledMap, I just create a new map (100x100) and use tmw_desert_spacing.png from tiled map sample. I simply fill the map with a tile, saving all (tmx and png file) in FeatureSamples/Assets/Data/Urho2D/
    I change Urho2DTileMap.cs file to load my tmx file => TmxFile2D tmxFile = cache.GetTmxFile2D("Urho2D/desert.tmx");
    Running Mac version is OK.
    In both projects Android and iOS, I have put links on the 2 new files.
    Running on Android (simulator and real device) is OK. (Files properties are set automatically to AndroidAsset)
    Running on iOS (simulator and real device) is bad : the map did not show on the screen. (Files properties are set automatically to BundleResource, I have checked)
    What problem can it be? (Xamarin Studio 5.10.1 on Mac, UrhoSharp version 1.0.264 from Nuget)

  • MigueldeIcazaMigueldeIcaza USXamarin Team Xamurai

    Hello @MikeGringauz,

    In general, we do have components in components.xamarin.com that integrate with most of those services. If there are specific services that we are missing, we would love to hear about them, because we can add them.

    And those components integrate with UrhoSharp, just like every other part of our stack.

  • EgorBoEgorBo BYXamarin Team ✭✭✭

    @ANNETTEGEIRNART said:
    Hello.
    I'm just trying Urho and I've got a problem with tiled map.
    I start by using FeatureSamples #36. All is ok.
    Using TiledMap, I just create a new map (100x100) and use tmw_desert_spacing.png from tiled map sample. I simply fill the map with a tile, saving all (tmx and png file) in FeatureSamples/Assets/Data/Urho2D/
    I change Urho2DTileMap.cs file to load my tmx file => TmxFile2D tmxFile = cache.GetTmxFile2D("Urho2D/desert.tmx");
    Running Mac version is OK.
    In both projects Android and iOS, I have put links on the 2 new files.
    Running on Android (simulator and real device) is OK. (Files properties are set automatically to AndroidAsset)
    Running on iOS (simulator and real device) is bad : the map did not show on the screen. (Files properties are set automatically to BundleResource, I have checked)
    What problem can it be? (Xamarin Studio 5.10.1 on Mac, UrhoSharp version 1.0.264 from Nuget)

    Try to open iOS project properties and uncheck the "Optimize PNG images for iOS" flag in "iOS Build" tab. I'll update the projects.

  • Good thinking ... but not :( (I have do a clean build to be sure).
    If I'm using the original png file isometric_grass_and_water.png it is working.
    So I'm thinking about the png... Just an idea, so I change it to by a multiple of the tile size, but not better.

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited December 2015

    @ANNETTEGEIRNART can you share your image? You can actually debug it in the native Urho using XCode.

  • Here the tmx and png.
    Hum... Xcode... ?!?? ;)

  • Is there any available tutorial on creating 2D game with Urho engine?

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited December 2015

    @ANNETTEGEIRNART said:
    Here the tmx and png.
    Hum... Xcode... ?!?? ;)

    I guess you should use a power-of-two resolutions for textures, I opened your png, changed size to 256*128 (same ratio) and it worked (iOS)

    @MikeGringauz said:
    Is there any available tutorial on creating 2D game with Urho engine?

    There are some 2D specific samples, and you can find some native urho public 2D project on theirs forum.

  • Thanks a lot! Yes it works for me too... also on my real project ;)
    The only strange thing is that it work on other platforms. But when we know, it's not a problem. Once again I tell you a big thank you for your time taken to help me.

  • VincentwxVincentwx CAMember ✭✭

    I am trying to get started with this engine following the instruction here on windows desktop.

    http://developer.xamarin.com/guides/cross-platform/urho/introduction/

    Somehow the following line failed even after I have added the font.ttf to the project as instructed. I can see the cube rotating but not the text.

            helloText.SetColor(new Color(0f, 1f, 1f));
            helloText.SetFont(
                font: ResourceCache.GetFont("Fonts/Font.ttf"),
                size: 30);
            UI.Root.AddChild(helloText);
    

    The error from the console is "Can not find fesource Fonts/Font.ttf"

    Any idea?

    By the way, I have tried the feature samples and the sample game. They both worked very well and are very impressive.

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited December 2015

    @Vincentwx said:

    I am trying to get started with this engine following the instruction here on windows desktop.

    http://developer.xamarin.com/guides/cross-platform/urho/introduction/

    Somehow the following line failed even after I have added the font.ttf to the project as instructed. I can see the cube rotating but not the text.

          helloText.SetColor(new Color(0f, 1f, 1f));
          helloText.SetFont(
              font: ResourceCache.GetFont("Fonts/Font.ttf"),
              size: 30);
          UI.Root.AddChild(helloText);
    

    The error from the console is "Can not find fesource Fonts/Font.ttf"

    Any idea?

    By the way, I have tried the feature samples and the sample game. They both worked very well and are very impressive.

    Try to change "Fonts/Font.ttf" to "Fonts/Anonymous Pro.ttf" or add your any ttf font to "Fonts" folders. Nuget package contains some basic assets including the "Anonymous Pro.ttf" font. I guess we can rename it to "Font.ttf" or change the doc.

  • VincentwxVincentwx CAMember ✭✭

    @Egor_Bogatov
    I have copied the Font.ttf file from SamplyGame and put it into the \Data\Fonts folder. I have my project directory structure in the attached files. Can you check it an let me know if I put it in the correct place? I have tried a few places already but neither worked.

    I really want to get it working and move on

    Thanks.

  • VincentwxVincentwx CAMember ✭✭

    I removed the data folder, put Fonts folder directly under the execution home folder and it worked. I am not sure if that's the correctly solution since all the samples have Fonts, Modesl.... under Data folder. But having the Fonts under the home execution folder seems more logic to me.

    Thanks

  • EgorBoEgorBo BYXamarin Team ✭✭✭

    @Vincentwx what do you pass to UrhoEngine.Init(...) ? For Windows it expects a path to assets and so you should put your fonts there. (if you didn't pass any arguments to Init it means your assets should be located in *.exe folder)

  • VincentwxVincentwx CAMember ✭✭
    edited December 2015

    @Egor_Bogatov

    I don't have parameter passed to UrhoEngine.Init() before. Now here is the change I made.

    static void Main(string[] args)
    {
    UrhoEngine.Init("Assets");
    new MyGame().Run();

    }

    Now my project directory is something like this and it worked. Is this the correct structure?
    Game(prjects)--Assets --Fonts --Font.ttf

  • EgorBoEgorBo BYXamarin Team ✭✭✭

    @Vincentwx In your case it depends on Project "Output directory" it should be "Game(projects)" to use those Assets. You can add all assets to the project (and set Copy to output = "Copy if newer") actually.

  • Can I use UrhoEditor for creating 2D scenes? It seems like very powerful WYSIWYG editor but I couldn't find any tutorial about it.

  • PaulKellyPaulKelly USMember ✭✭

    Can you create a new Forum Thread just for UrhoSharp like you have for CocosSharp.
    It will make it easier to find comments and questions with answer etc.

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited December 2015

    @MikeGringauz said:
    Can I use UrhoEditor for creating 2D scenes? It seems like very powerful WYSIWYG editor but I couldn't find any tutorial about it.

    Yes it works for 2D too and you can find some tutorials on youtube

  • MikeGringauzMikeGringauz ILMember
    edited December 2015

    One more question regarding 2D game with Urho I have is how to develop a game for multi-screen resolutions?

    My workflow In Cocos2d-x is I prepare 3 folders of graphical assets for high-resolution devices, standard and low-resolution devices.
    During game initialization I check device's screen resolution and decide which assets to use hd, sd or ld and add search path for assets to that folder.
    I also set the Design-Resolution (resolution during design)to be the resolution of the chosen assets folder and Resolution-Policy which specifies which sides of the screen to truncate if device's screen resolution doesn't match to Design-Resolution of assets folder.

    Also there is now notion of camera in Cocos2d-x 2D game, as it works with Design-Resolution and assets scaling.
    On the other side Urho doesn't have Design-Resolution and policies and uses orthogonal camera instead. (It least from what I understood but I'll be very grateful for more clarifications)

    So, how to prepare game and assets to support multi-screen resolutions in Urho game?

  • EgorBoEgorBo BYXamarin Team ✭✭✭

    @MikeGringauz said:
    One more question regarding 2D game with Urho I have is how to develop a game for multi-screen resolutions?

    My workflow In Cocos2d-x is I prepare 3 folders of graphical assets for high-resolution devices, standard and low-resolution devices.
    During game initialization I check device's screen resolution and decide which assets to use hd, sd or ld and add search path for assets to that folder.
    I also set the Design-Resolution (resolution during design)to be the resolution of the chosen assets folder and Resolution-Policy which specifies which sides of the screen to truncate if device's screen resolution doesn't match to Design-Resolution of assets folder.

    Also there is now notion of camera in Cocos2d-x 2D game, as it works with Design-Resolution and assets scaling.
    On the other side Urho doesn't have Design-Resolution and policies and uses orthogonal camera instead. (It least from what I understood but I'll be very grateful for more clarifications)

    So, how to prepare game and assets to support multi-screen resolutions in Urho game?

    It doesn't have any built-in resolving mechanism but the simplest way is to do something like this:

    var dpi = GetCurrentDpiSomehow();
    var texture = ResourceCache.GetTexture($"Textures\{dpi}\MyTexture.png");
    
  • MikeGringauzMikeGringauz ILMember
    edited December 2015

    How to setup Camera component for 2D game to capture whole screen of a mobile device (regardless of resolution and aspect ration)?

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    FYI I had problems accessing assets as well until I found out that I had to pass new ApplicationOptions("Data") as argument to Application's constructor.

Sign In or Register to comment.