What's the best cross-platform language?
#1
Posted 15 January 2012 - 04:53 AM
In the sea of languages and APIs and whatnots out there, I'm trying to figure out exactly what's the best compromise to make it easier to develop my games for PC and Mac OSes. Being a neophyte to this, I'm not exactly sure how to ask the question. I'd like to find a language and a few APIs by which it is easy to use to produce platform-independent code, or at least code that only require minor tweaks to hop around from OS to OS. I'm willing (and able) to go through a few hoops and code things like custom wrappers to handle it all. Even if I have to code a bit more to make things more adaptable, I'm cool with that.
Thanks!
#2
Posted 15 January 2012 - 10:36 PM
#3
Posted 15 January 2012 - 11:53 PM
Also, I've come across haXe on here. Did some research on it. Looks pretty good... Can it handle high-end game programming? If so, that looks like a really favorable option.
#4
Posted 16 January 2012 - 11:02 AM
They have moved into HTML 5 development tools.
Doing true cross platform development is a pain, you have there options
1) Compile time generation
2) Interpreted code
3) Translated code
Compile time generation means that when you hit build all, a version is built for each platform supported, so you have one binary for each platform.
You have to rely on whomsoever creates the system to provide libraries and a compiler for each platform.
Interpreted code is the way Java ( puke ) works. You have a virtual machine for each platform but one binary. Generally virtual machines are limited in that they can only support the minimum spec hardware available. Since they have to run on all of the supported platforms, it's tricky to get the VM to support special case hardware.
Translated code is the one I like, you compile to an intermediate bytecode that is translated into native code when you load the binary. You have a single binary that runs on all supported hardware without recompilation. You get the best mix of portability and speed.
Whichever system you plump for you are still going to end up with run time flags to handle missing hardware ( or maybe compile time flags for the 1st option)
Cross platform coding isn't yet a simple task, unless of course you are only worried about a small subset of devices, but with the number of mobile phones still increasing and the number of games machines pretty constant, well it's up to you how far you want to go.
#5
Posted 16 January 2012 - 01:00 PM
If you stay with cross-platform libraries like SDL and OpenGL, your code will work on pretty much any (library-supported) OS.
#6
Posted 16 January 2012 - 02:26 PM
Gnarlyman, on 15 January 2012 - 04:53 AM, said:
Everyone's jumped the gun. You want a cross-platform language for what end? It'd be a different answer if you wanted to make a YATC (Yet Another Tetris Clone) versus I want Crysis 15 on everything.
#7
Posted 16 January 2012 - 10:45 PM
Alphadog: no, lol, not a YATC; "real deal" games. I'm fairly content to master something essential like OpenGL and its shader libraries and use that to write cross-platform code. To be honest, out of the confines of console planning, I'm even confused somewhat as to all the levels of code--the various binary codes, compiler functionings, etc. I learned that stuff somewhere in the past, but being a 360er, I'm having to get a little more techie about what I usually just muddled over a bit more in abstractions. All I know is... I'd like to have a website where I let a user download what amounts to the "engine", and then download "gamefiles/game packages" for each game I produce that the engine will intake. I'd like to have it all work on Windows and OS X. Linux, I dunno, I'll start with the biggies. If I can employ a single content type (OpenGL and associated shaders, for instance) and make it all simple for me to hit both platforms, it'd be awesome.
#8
Posted 17 January 2012 - 10:15 AM
Now I don't think you could use it as is, but it might give you some ideas about how you want to design your engine.
#9
Posted 17 January 2012 - 05:05 PM
#10
Posted 17 January 2012 - 05:15 PM
#11
Posted 18 January 2012 - 11:14 AM
http://fabiensanglar...eview/index.php
#12
Posted 18 January 2012 - 11:30 AM
So you wrote the game in our own macro code, then just included a header file for the z80 or the 6502 or the 68000.
While that technique is way, way, out of date, the principle is still valid.
How about you take the source code of one of the many scripting languages and port it to the targets you want to support. Extend the basic language with a native rendering library, and code everything for that.
Or if you are only targeting PC and MAC, stick with the XNA you know and get involved in the mono port of XNA.
Don't have time to look for the link, but I did look at it some time ago and there was quite a bit of progress on the project last I looked
#13
Posted 18 January 2012 - 07:58 PM
Gnarlyman, on 16 January 2012 - 10:45 PM, said:
In that case, any engine will do. Any engine loads a game world, or elements thereof. The fact that the download source is online vs local is a minor distinction.
Look for a few modern, cross-platform engines with source to learn from them. SFML, Irrlicht, etc. These all target the main OSes, but not many have desktop + mobile targets *and* available source. Then, to learn, get on forums to talk to the devs and ask why they made some of the decisions they made.
BTW, the upcoming Win8 platform screws up the cross-platform scene. And, depending on the extent of "cross-platform", if you go with C#/Mono, you can add engines like Axiom and Horde3D. It's not so much that the engine is cross-platform, as it runs on a layer that is itself cross-platform.
There's also OpenTK to look at for cross-platformy ideas in the game dev realm.
#14
Posted 19 January 2012 - 10:49 AM
Gnarlyman, on 16 January 2012 - 10:45 PM, said:
That's exactly what Unity does. Since you already code in C#, you should feel right at home.
#15
Posted 19 January 2012 - 03:20 PM
#16
Posted 19 January 2012 - 05:12 PM
So, it looks like something like Unity would do the trick. However, I wanna make sure I'll be able to add my own "extensions" to the engine. That's the reason I was developing my own prototype engine code in the first place, as I want to implement my own algorithms, shaders, and flat-out engine design pieces at certain places. Whether or not to take an existing engine and add-on or modify or to just build my own is the issue. I have several different approaches to matrices, lighting, and polygon manipulation that I've developed, and I'm figuring, what with help on this forum, that I'll actually be able to use an existing 3D engine/platform and modify/add rather than cook my own deal up from scratch. The main thing is, I'd like to jump on board to an existing engine/API that can handle window functions, already has a math set, has interfaces with which to talk to the GPU, and...all that low to mid-level hard-core tech stuff that cooking up from scratch would be fairly bonkers to do.
So, in a way, I'm trying to have both cross-platform games AND a cross-platform engine. If XNA and that mono port deal could do the trick, or if I could structure my own C# code around Unity, then I'm good. But what's this about Win8? Do I need to be planning around that? If so, does that screw up either or both of the XNA and Unity schemes?
#17
Posted 20 January 2012 - 11:02 AM
It is organised in two layers. The new front end is based on HTML 5 and does not support any legacy code (no XNA, no Unity, etc.)
However Win8 intel based machines can still run legacy code, they just cannot use the new front end.
(Note this does not apply to risc based Win8 machines, even C# apps will not be supported on them which I find stupid)
Well at least that's the state of play as I know it. There are a lot of arguments about what Win8 really is, and mixed messages coming out of Microsoft are not helping.
Just look at http://forums.create...ms/t/91616.aspx and you will see what I mean.
#18
Posted 20 January 2012 - 01:50 PM
Gnarlyman, on 19 January 2012 - 05:12 PM, said:
I know! always competent, helpful people around. I've been on this forum since Flipcode closed, and there since '99.
Gnarlyman, on 19 January 2012 - 05:12 PM, said:
Algorithms - no problem.
Shaders - no problem
Engine design - might be a problem. It depends on what you want to do. If you buy the most expensive license (very, very expensive), you get access to the source, I think.
#19
Posted 20 January 2012 - 03:55 PM
Gnarlyman, on 19 January 2012 - 05:12 PM, said:
Windows 8 will create a dichotomous platform:
- Metro/WinRT which currently is somewhat restrictive, where Unity may or may not go (and currently, the web player will not work there)
- Desktop, where the current Unity will keep on being available. What this means is that, until some sort of "Unity For Metro" comes out, you will not be selling Unity games for Metro through the Windows Store. (Although, the store, I think, will have links to outside sites, but that means you have to run a store yourself.)
#20
Posted 20 January 2012 - 04:49 PM
Wowzers, I totally wasn't up to speed on Win8. (I've been slowly migrating in body and consciousness towards Mac, and now other things are forcing me to get realz with Win and all.) I find that all quite odd... Is there a particular and strong reason why MS is flipping over so much of the apple cart for the new OS? I do understand, and applaud, much newness and more streamlined/simple techs when redoing an OS, but it doesn't seem like backwards integration is huge there. I would wish that such things like XNA wouldn't be "legacy" things that require a bit of shapeshifting to work, but something that can take a seamless step into the new environment. Darn... Crossplatform stuff was hard enough, nevermind crossing a platform within a platform...
Several peeps on that forum mentioned D3D11. Would using D3D within a simple .NET environment right now be the best way for me perhaps? I suppose I'd just have to wing it more on my own with the engine components. Not crazy about D3D being only Win though... Perhaps just OpenGL is my way to go. ...Is that going to fly on Win8? Also, I couldn't tell exactly the gist about C++ and C#'s future there...
Also, on Unity: I downloaded it yesterday, played around with it, learning about it. It seems it's more of a "game creation" environment more than an actual code-oriented software (although I know that's there judging from online tutorials). I need to be able to programmatically mess around with nuts and bolts polygon and vertex info, lighting junk, blah blah, basically a bunch of custom shader and algorithm stuff that needs to fit in the pipeline in its heart. I'm trying to ascertain how much of the raw pipeline Unity shields you from, which is something I'm trying to avoid. Deal is, as mentioned above, I have my own set of polygon and lighting algorithms which are unorthodox in some ways, and I'm trying to find an engine, platform, API set, etc., which allows me to use the root, raw basic graphics functions (like displaying a window and handling polygon and world matrices...simple simple) and then program the rest on my own. Unity looks awesome; I just need to be able to get down 'n dirty with the code.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












