Jump to content
  • Advertisement
Sign in to follow this  
Angelic Ice

Unity Cross Platforming: Switching to Java?

This topic is 907 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Dear gamedev.net community!

 

During the last days I started thinking to stop my development of my C++ visual novel and switch to Java or another language being better/easier in multi platforming.

 

However I am quite far in terms of development thus I would lose a lot of progress, also I rely on a C based GUI library and SFML.

I really like C++ but it feels like it is a hassle to cross platform it. Especially because I wanted to support Windows, Linux, Mac, Android and iOS. Therefore supporting Mac sounds a bit difficult when I am on a Windows computer.

 

Since everything I need is a bit of managing images, some visual effects, text and a neat GUI library, I am not sure how to progress.

Everything I use is supposed to support cross-platforming, which is SFML, Lua, Lunajson and TGUI.

 

I am not a big fan of Java but it feels like the only logical solution if I want to support all (popular) platforms.

It is a really bitter feeling move though so I wanted to ask you for some thoughts and ideas about this.

 

Also I am aware that I should have started to check if my application is able to run on the other systems already. However I was way too much into the work flow that I missed this out. I learned from this already. Additionally (as mentioned above), I cannot really test it on Mac at all.

 

Are there any easier solutions for me?

What libraries/scripting languages could compensate the mentioned ones when using Java?

Should I maybe look into a completly different language?

Is sticking to C++ a wise decision in this case?

 

Right now I am bit worried about this project because this whole subject about cross platforming is such a huge topic and feels a bit overwhelming.

I would be really thankful for some suggestions!

Edited by Angelic Ice

Share this post


Link to post
Share on other sites
Advertisement

Java is not going to magically make everything work flawlessly on multiple platforms. You still need to pay attention to what you're doing, choose libraries that are available one way or another on all platforms (just because the library is written in Java does not mean it does not use some interop to a platform-specific feature). So you'll still have to test it; if you can't test it on a Mac now, you can't test it on a Mac with Java, and so you should not support the Mac.

 

I wouldn't bother. You have project in a language you know that mostly works and that you're comfortable with. The effort you expend solving your outstanding cross-platform issues with that code may very well be the same as (or less) than the effort in starting over in a unfamiliar language with very little.

 

Stick with what you have and finish it.

Edited by Josh Petrie

Share this post


Link to post
Share on other sites

I'll suggest an alternative - what about something like Unity? I believe that would offer you significantly easier cross platform ability. I think you could also target browsers too but I haven't tried that, only a simple windows game when I wanted to try it out.

Share this post


Link to post
Share on other sites

Dear gamedev.net community!

 

During the last days I started thinking to stop my development of my C++ visual novel and switch to Java or another language being better/easier in multi platforming.

 

However I am quite far in terms of development thus I would lose a lot of progress, also I rely on a C based GUI library and SFML.

I really like C++ but it feels like it is a hassle to cross platform it. Especially because I wanted to support Windows, Linux, Mac, Android and iOS. Therefore supporting Mac sounds a bit difficult when I am on a Windows computer.

 

Since everything I need is a bit of managing images, some visual effects, text and a neat GUI library, I am not sure how to progress.

Everything I use is supposed to support cross-platforming, which is SFML, Lua, Lunajson and TGUI.

 

I am not a big fan of Java but it feels like the only logical solution if I want to support all (popular) platforms.

It is a really bitter feeling move though so I wanted to ask you for some thoughts and ideas about this.

 

Also I am aware that I should have started to check if my application is able to run on the other systems already. However I was way too much into the work flow that I missed this out. I learned from this already. Additionally (as mentioned above), I cannot really test it on Mac at all.

 

Are there any easier solutions for me?

What libraries/scripting languages could compensate the mentioned ones when using Java?

Should I maybe look into a completly different language?

Is sticking to C++ a wise decision in this case?

 

Right now I am bit worried about this project because this whole subject about cross platforming is such a huge topic and feels a bit overwhelming.

I would be really thankful for some suggestions!

 

 

First, I think learning java is important for both learning process and usage process (Where you actually have to deploy a java application).

So go ahead and start learning.

Secondly, is it wise using java? Depends on your end goal,

If you really need to make fast development rather gaining much more stable application with C++, then yes.

If you consider yourself time wise and you have the time to develop a serious application with C++. Then no.

 

It is all based on your goals and motivations. 

See Java as a tool that resides in your toolbox. Not an easier solution for something,

 

Edit:
Forgot to mention, Java has many good libraries to work with. If you're an experienced OpenGL developer, you don't even need to relearn any api.

Edited by WoopsASword

Share this post


Link to post
Share on other sites

Java is not going to magically make everything work flawlessly on multiple platforms. You still need to pay attention to what you're doing, choose libraries that are available one way or another on all platforms (just because the library is written in Java does not mean it does not use some interop to a platform-specific feature). So you'll still have to test it; if you can't test it on a Mac now, you can't test it on a Mac with Java, and so you should not support the Mac.

 

I wouldn't bother. You have project in a language you know that mostly works and that you're comfortable with. The effort you expend solving your outstanding cross-platform issues with that code may very well be the same as (or less) than the effort in starting over in a unfamiliar language with very little.

 

Stick with what you have and finish it.

Oh, well, but is not maintaining Java on multiple platforms way easier? Once I am done checking whether my libraries and everything is perfectly working for all the operating systems, it could not be such a hassle as in C++ whenever I want to change just a little thing? I might be totally wrong at this point but as far as I know, providing an ultimate build of C++ supporting all operating systems is not meant to be done (compile once, run everywhere)? Well, I read about defining the operating system in headers but then again it was not recommended to do.

 

Also using the NDK seems to be something one should avoid if there is a chance to use Java. It also seems to add up to the effort once I want to support mobile support.

 

Sticking to it really gave me some confidence at first but then made me feel bad. Only sticking to it because I have done stuff in it but then realised that C++ might be not the ideal decision? Feels like such a lazy move of mine : (

 

I'll suggest an alternative - what about something like Unity? I believe that would offer you significantly easier cross platform ability. I think you could also target browsers too but I haven't tried that, only a simple windows game when I wanted to try it out.

Sorry, I am not interested in using an engine.

 

 

Josh Petrie's advice about testing is spot on. It certainly is much easier to deploy Java across multiple platforms these days. Libraries like LibGDX make it a painless process. Low-level bindings like LWJGL ship with all of the binaries they need on each platform. You only need to compile on one platform and the world is your oyster. Still, it's possible for platform-specific bugs to pop up in those low-level libraries, and they do from time to time. So you should always test on every platform to which you plan to deploy.

That said, there's a cost-benefit issue here. Is the benefit of using Java greater than the cost of abandoning your current implementation and starting over in Java? From what you describe, the answer is most likely "no." There are other factors to consider besides deployment, such as productivity in an unfamiliar language. You are using cross-platform libraries anyway, and that greatly reduces the amount of work you need to do for multiplatform in C++.

So, a) since you're already rather far along in the project, b) apparently the only problem you're trying to solve is to avoid compiling and packaging on multiple platforms and c) you ought to have those platforms available for testing even when using Java, then I would advise you to stay your current course.

Well so this basically backs up using Java in terms of cross platforming, right? Java is a not an unfamiliar language to me. I am just not a huge fan of it.

You mentioned that using multiplatform libraries would greatly reduce the effort I would have to commit using C++. However is it not a really exhausting progress to keep all my builds working?

 

 

Dear gamedev.net community!

 

During the last days I started thinking to stop my development of my C++ visual novel and switch to Java or another language being better/easier in multi platforming.

 

However I am quite far in terms of development thus I would lose a lot of progress, also I rely on a C based GUI library and SFML.

I really like C++ but it feels like it is a hassle to cross platform it. Especially because I wanted to support Windows, Linux, Mac, Android and iOS. Therefore supporting Mac sounds a bit difficult when I am on a Windows computer.

 

Since everything I need is a bit of managing images, some visual effects, text and a neat GUI library, I am not sure how to progress.

Everything I use is supposed to support cross-platforming, which is SFML, Lua, Lunajson and TGUI.

 

I am not a big fan of Java but it feels like the only logical solution if I want to support all (popular) platforms.

It is a really bitter feeling move though so I wanted to ask you for some thoughts and ideas about this.

 

Also I am aware that I should have started to check if my application is able to run on the other systems already. However I was way too much into the work flow that I missed this out. I learned from this already. Additionally (as mentioned above), I cannot really test it on Mac at all.

 

Are there any easier solutions for me?

What libraries/scripting languages could compensate the mentioned ones when using Java?

Should I maybe look into a completly different language?

Is sticking to C++ a wise decision in this case?

 

Right now I am bit worried about this project because this whole subject about cross platforming is such a huge topic and feels a bit overwhelming.

I would be really thankful for some suggestions!

 

 

First, I think learning java is important for both learning process and usage process (Where you actually have to deploy a java application).

So go ahead and start learning.

Secondly, is it wise using java? Depends on your end goal,

If you really need to make fast development rather gaining much more stable application with C++, then yes.

If you consider yourself time wise and you have the time to develop a serious application with C++. Then no.

 

It is all based on your goals and motivations. 

See Java as a tool that resides in your toolbox. Not an easier solution for something,

 

Edit:
Forgot to mention, Java has many good libraries to work with. If you're an experienced OpenGL developer, you don't even need to relearn any api.

 

As I said above in this post, I already gathered experience in Java.

 

Fast development is not really for what I am looking. I just like the idea of having something that is cross platform once done well. Having one final application that supports so many operating systems (including mobiles) sounds like a really wonderful concept.

 

How would an application in C++ be more stable?

 

This whole cross platforming support really makes me anxious about programming in the future. On the one hand it feels like something I really want to support for my applications but then again being bound to Java to achieve this feels really restricted.

Edited by Angelic Ice

Share this post


Link to post
Share on other sites

Oh, well, but is not maintaining Java on multiple platforms way easier? Once I am done checking whether my libraries and everything is perfectly working for all the operating systems, it could not be such a hassle as in C++ whenever I want to change just a little thing?


If you are changing just a little thing and it breaks a platform, something is horrifically bad with your code.

That said, set up a CI (Continuous Integration) system. You shouldn't manually compile and test each change for each platform. A CI system will check your changes for you either after every single commit or even before each commit (if you're using a change review process, i.e. pull requests in git).

There are a number of relatively cheap services or free tools for setting up CI that will work for all interesting platforms (Windows, consoles, Android, iOS, OSX, Linux, etc.).

Share this post


Link to post
Share on other sites


Well so this basically backs up using Java in terms of cross platforming, right? Java is a not an unfamiliar language to me. I am just not a huge fan of it.
You mentioned that using multiplatform libraries would greatly reduce the effort I would have to commit using C++. However is it not a really exhausting progress to keep all my builds working?

 

For a new project, perhaps. I just don't think the costs of compiling and deploying a project on multiple platforms add up such that they outweigh the cost of switching to a new language midstream. I also don't think it's as exhausting as you make it out to be. Using cross-platform libraries, you should rarely, if ever, touch any platform-specific code.

Ease of cross-platform testing and deployment is certainly a rational factor to consider when selecting a language in the beginning of a project, but it's not a reason to switch languages halfway through.

Share this post


Link to post
Share on other sites

As I said above in this post, I already gathered experience in Java.

 

 

 

Fast development is not really for what I am looking. I just like the idea of having something that is cross platform once done well. Having one final application that supports so many operating systems (including mobiles) sounds like a really wonderful concept.

 

How would an application in C++ be more stable?

 

This whole cross platforming support really makes me anxious about programming in the future. On the one hand it feels like something I really want to support for my applications but then again being bound to Java to achieve this feels really restricted.

 

 

I meant making a C++ stable application, not that C++ is more stable than java. 

 

C++ can be easier to use as Java if you are experienced enough, I don't think it should be your limitation.

Your considerations should focus on all aspects of the technologies:

- Experience with it (The quickest rode is the one you know),

- Limitations (Is there X/Y/Z in this technology). 

- What kind of platforms you want to work with. 

- Performance of the technlogoy (And your performance goals). 

- Deploy costs.

- Much more...

 

As I said in my previous post, you should stop thinking about it so much and keep it as a tool in your toolbox to use when you really need to,

and not when Cross-platform seems neat to you. 

Share this post


Link to post
Share on other sites


Oh, well, but is not maintaining Java on multiple platforms way easier?
I might get downvoted but I'm going to say yes. Library linking/loading is standard and behaves the same in all the OSes that (desktop) Java supports.

 

Now the issue is that desktop Java isn't the same as Android Java. Yes, with desktop Java you get fairly simple multi platform support in all major OSes, with deployment of the application itself as simple as copying exactly the same .jars in all of them. LWJGL is well made, it will automatically load the native lib of the platform you're running the application on (for all the combinations between Linux, Windows, OSX, x86, x86_64).

 

But Android is different, you will have to code specific parts for it (input, display, sound, etc), moreover, you will need to "downgrade" your language support for whatever Java 6/7 bastard Android supports nowadays. iOS was supported through RoboVM for free, but Xamarin bought the company and moved it to their kind of strategy (ie, gotta pay up monthly). Same scenario if you want to use C#.

 

Also while you can reasonably expect the runtime of any OS to run your C++ program (or at worst you need to bundle some tiny binary, say a MSVS2015 redistributable), with Java you need to either bundle a 40-60Mb VM (not as complex as it sounds though) or provide a link for the user to download the VM from Oracle's site (and remember, Oracle bundles crapware with their JRE isntallers). Moreover, the "executable" itself might be multi platform, but it wont get you an OSX installer, Windows installer or a .deb package. That part you have to do on your own, probably regardless of the language you're using.

 

I still think its an scenario better than what you're left with C++, there are plenty of parts of the standard lib that are the same across desktop and Android, deployment is simpler albeit heavier, and ultimately, Java is a much simpler language to manage than C++.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Similar Content

    • By Alexander_Vovk
      Hello Guys!
      Please share your experience, where is it better to find sales manager  specialists for indie team of 6 + people(remotely)?
      Maybe someone has a good experience of cooperation with finding projects through sale managers(USA and Canada)?
      Thank you
      Best Regards
      Alex Vovk
      Co-Founder of Sixteen Squares
      Alexander_Vovk@outlook.com
       
    • By RoKabium Games
      Been a bit quiet recently, but we've been busy bug fixing and tweaking things... Now we have lots more 'Particle effects' in the game, specifically here the Flamethrower and Enemy attacks!
    • By JoshuaFraser
      Hi and thanks for reading, I have an issue with this reactive crosshair script, everything works fine until I start changing the offset. Give the script a go and you will see what I mean, when I do SetOffset(0f); it doesnt always set back to the origional state, if anyone can spot a fix I'd be super appreciative!
      using System.Collections; using System.Collections.Generic; using UnityEngine; public class ReactiveCrosshair : MonoBehaviour { [SerializeField] GameObject c_limb_prefab; private float center_offset = 0f; private float current_offset = 0f; private float max_offset = .5f; private int number_of_limbs = 4; private float limb_length = .05f; private float limb_width = .005f; private List<GameObject> c_limbs = new List<GameObject>(); public void SetupCrosshair(){ for (int i = 0; i < number_of_limbs; i++) { GameObject line_go = (GameObject)Instantiate (c_limb_prefab); line_go.transform.SetParent (this.transform); Vector3 limb_pos = new Vector3 (0f,0f,0f); //line_go.transform.position = limb_pos; line_go.transform.localPosition = limb_pos; LineRenderer line = line_go.GetComponent<LineRenderer>(); line.startWidth = limb_width; line.positionCount = 2; line.SetPosition (0, line_go.transform.localPosition + new Vector3(center_offset, 0f, 0f)); line.SetPosition (1, line_go.transform.localPosition + new Vector3(center_offset + limb_length, 0f, 0f)); line.useWorldSpace = false; c_limbs.Add(line_go.gameObject); } if (c_limbs != null) { OrientLimbs (); SetOffset (0f); } } public void OrientLimbs(){ for (int i = 0; i < c_limbs.Count; i++) { float rotation_step = 360f / (float)c_limbs.Count; c_limbs [i].transform.RotateAround (c_limbs[i].transform.position, c_limbs[i].transform.forward, 90f + (rotation_step * (float)i)); } } public void SetOffset(float _current_spread){ float offset = Mathf.Lerp (0f, max_offset, _current_spread); for (int i = 0; i < number_of_limbs; i++) { if (offset > current_offset) { Vector3 pos = c_limbs [i].transform.position + (c_limbs [i].transform.TransformDirection (Vector3.right) * offset); c_limbs [i].transform.position = pos; } if (offset < current_offset) { Vector3 pos = c_limbs [i].transform.position - (c_limbs [i].transform.TransformDirection (Vector3.right) * offset); c_limbs [i].transform.position = pos; } } Debug.Log ("SetOffset() offset: " + offset.ToString () + " _current_spread: " + _current_spread.ToString() + " localPos: " + c_limbs[1].transform.localPosition); current_offset = offset; } }  
    • By Erik Nivala
      So, as the title says i am trying to figure out a good way sync all that information with other players in Unity. My problem is that i can't come up with a good solution since i am used to creating classes for everything e.g. attachments are its own class and then the weapon would save a reference to that attachment. But since you can't send custom classes over [Command] & [ClientRPC] i am a little stuck. A solution for this would be giving each attachment for a slot a unique ID and then passing the ID to other player but i feel like that is very error prone if other ppl add a new attachment or the IDs get mixed up.
      Is there a "standard" way that this is usually done that i am missing?
      I am fairly new to programming so any help is appreciated!
    • By MintyLyton
      I'm looking for any team / people that need a programmer for their project. I'm looking to expand my portfolio which you can see Here. I'm more experienced with Unity but I can spend the time to learn new Engines if that's your preference. I have worked on Unreal Engine 4 before but I might take some time to re-learn it, if the project requires it. Feel free to DM here or use the contact info on my website. 
    • By ethancodes
      I'm working on a system for my game that will allow the player to stack pick ups in a queue. As one pick up expires, the next automatically activates. I'm having an issue though where if I pick up the first one, it activates fine, but if i pick up a second directly after it, it overrides the first one, activates the second one, and then once it has run it's course, everything goes back to normal gameplay, no first pick up. I'm not sure why this is happening. Hopefully someone can spot what I'm doing wrong in my code.
      Here is the code for the pick up manager:
      // Update is called once per frame void Update () { if (pickUpQueue.Count != 0 && !pickUpActive) { pickUpActive = true; pickUpQueue[0].ActivatePickUp(); } DeactivatePickUp(); } void DeactivatePickUp () { if (pickUpQueue.Count != 0 && pickUpActive) { Destroy (pickUpQueue [0]); pickUpQueue.RemoveAt (0); pickUpActive = false; } } And here is the PickUp:
      public override void ActivatePickUp () { ball.GetComponent<Ball>().Speed = 2.0f; //increase ball speed... ball.GetComponent<Ball>().StartCoroutine(timer); //...set time that power up is active }  
      There is also a Base Pick Up:
      public void OnCollisionEnter2D (Collision2D collision) { Vector2 tweak = new Vector2 (Random.Range(0f, 0.2f),Random.Range(0f, 0.2f)); this.gameObject.GetComponent<Rigidbody2D>().velocity += tweak; //if the pickup makes contact with the paddle or ball.... if (collision.gameObject.tag == "Paddle" || collision.gameObject.tag == "Ball") { GameObject.FindObjectOfType<GameManager>().GetComponent<PickUpManager>().pickUpQueue.Add(this); Destroy(gameObject); //...and finally destroy power up object } } As a side note, I am trying to find a solution to this that will work for all of my pickups. Some pickups are ammo based, some are timed. 
    • By D34DPOOL
      Edit Your Profile D34DPOOL 0 Threads 0 Updates 0 Messages Network Mod DB GameFront Sign Out Add jobEdit jobDeleteC# Programmer for a Unity FPS at Anywhere   Programmers located Anywhere.
      Posted by D34DPOOL on May 20th, 2018
      Hello, my name is Mason, and I've been working on a Quake style arena shooter about destroying boxes on and off for about a year now. I have a proof of concept with all of the basic features, but as an artist with little programming skill I've reached the end of my abilities as a programmer haha. I need someone to help fix bugs, optomize code, and to implent new features into the game. As a programmer you will have creative freedom to suggest new features and modes to add into the game if you choose to, I'm usually very open to suggestions :).
      What is required:
      Skill using C#
      Experience with Unity
      Experience using UNET (since it is a multiplayer game), or the effort and ability to learn it
      Compensation:
      Since the game currently has no funding, we can split whatever revenue the game makes in the future. However if you would perfer I can create 2D and/or 3D assets for whatever you need in return for your time and work.
      It's a very open and chill enviornment, where you'll have relative creative freedom. I hope you are interested in joining the team, and have a good day!
       
      To apply email me at mangemason@yahoo.com
    • By davejones
      Is there a way to automatically change the start position of an animation? I have a bunch of animations set up on 3D models in unity. The issue is that I need to move the 3D models, however when I do so the animation start positions are not updated and I have to do it manually.

      Changing the transform of key frames is time consuming with the amount of animations I have, so I was wondering if there was a way to do it automatically?
    • By MoreLion
      hey all! We are looking for members for our Unity horror game! 
      Here’s the story:
      After a deadly virus plunges the world into chaos killing 85% of the human population there are now what they call “zones” these zones are watched very closely by the surviving government, people are checked every day for the virus, even if you touch the spit or any human waste or fluids of the victim who is infected, you will die. But one day, people in the west zone start to go missing, 1 woman goes outside the walls to uncover the mystery, is there more to the virus than meets the eye?, That is where your story starts.
      This game is not a long development game, I have loads other game ideas,
      I will also allow you to have a bit of creative freedom if you wish to add or share a idea!
      And no, it’s not a zombie game lol I feel like zombie games are too generic, in this game you will encounter terrifying beasts!
      There is some concept art one of our concept artists have made
      If interested email liondude12@gmail.com
    • By Canadian Map Makers
      GOVERNOR is a modernized version of the highly popular series of “Caesar” games. Our small team has already developed maps, written specifications, acquired music and performed the historical research needed to create a good base for the programming part of the project.

      Our ultimate goal is to create a world class multi-level strategic city building game, but to start with we would like to create some of the simpler modules to demonstrate proof of concept and graphical elegance.

       

      We would like programmers and graphical artists to come onboard to (initially) create:

      A module where Province wide infrastructure can be built on an interactive 3D map of one of the ancient Roman Provinces.
      A module where city infrastructure can be built on a real 3D interactive landscape.
      For both parts, geographically and historically accurate base maps will be prepared by our team cartographer. Graphics development will be using Blender. The game engine will be Unity.

       

      More information, and examples of the work carried out so far can be found at http://playgovernor.com/ (most of the interesting content is under the Encyclopedia tab).

       

      This project represents a good opportunity for upcoming programmers and 3D modeling artists to develop something for their portfolios in a relatively short time span, working closely with one of Canada’s leading cartographers. There is also the possibility of being involved in this project to the point of a finished game and commercial success! Above all, this is a fun project to work on.

       

      Best regards,

      Steve Chapman (Canadian Map Makers)

       
  • Advertisement
  • Popular Now

  • Forum Statistics

    • Total Topics
      631399
    • Total Posts
      2999854
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!