Has any of you thought about going back to C/C++?

I’m seriously thinking about going back to C, after all I found out that it is so much easier to develop portable OpenGL programs with C without all the boundaries set up. This is not because some faggot at gamedev.net told me that java sux omg omg noob.

Java is great and all, and I’m never going to forget it. Perhaps I will still write tools with Java, but I think C is just the right tool for what I’m doing. It wasn’t the speed issue nor the inefficiency of java. It was more the reason that Java doesn’t have direct OpenGL support and access to the hardware, which is quite useful. And the fact that I’m huge fan of parsimony and accessing OpenGL through LWJGL was quite pointless.

C++ is just a huge mess, so I’ll continue with good old C. As I write this I’m firing up Watcom C/C++ 11c. I will definately miss Java.

I won’t be leave these boards, though. This is one of the best overall sources for hobbyist game development. I’ll just stay as an observer.

You’ll probably change your mind if you actually try writing something large and complete, like a full game. Besides, what’s wrong with LWJGL anyway?

Cas :slight_smile:

I don’t think I’ll change my mind. Why would I? C? More work, yes. I just thought it is worth it. It doesn’t stop me from using Java though.

My grief with everything in Java is Sun’s attitude towards everything else. If Sun isn’t going to change, they’ll loose the battle. If they keep building incredible machines like Swing, they’ll never get to the point where the “fast” languages are.

I think I can write C++ code as fast as Java code, so what is the point? It isn’t even that hard to port C++ code, and I’m going to consider porting when I have actually something worth porting.

Yes, I have thought of going back to C (or C++ since I got quite fond of OO) and I actually did at one point.
Indeed, C++ is an over-complicated mess but OTOH you don’t have to use everything and you can write neat code in C++ too. I fiddled a bit with it but after messed having to mess with windows API, MFC (aargh), direct-X (aaaargh) and after I made my 1st 2 pointer arithmetic errors (and accompanying BSODs. Yes, my C is rusty :wink: , I decided not to bother and get back to comfy java in which everything seems so much more elegant and easy.
I have a life too, you know.

Anyway, good luck.

I never did more than the most basics of C - at uni it was all pascal and delphi and since then I’ve used Java for most of the practical programming- so there is no back for me to go to. Currently I’m being trained in C# for work so maybe I’ll end up moving over to that but ultimately I think the ideas matter more than the language and currently I can make the quickest translation in Java, so I’ll certainly be staying here for the time.

[quote]I never did more than the most basics of C - at uni it was all pascal and delphi and since then I’ve used Java for most of the practical programming- so there is no back for me to go to. Currently I’m being trained in C# for work so maybe I’ll end up moving over to that but ultimately I think the ideas matter more than the language and currently I can make the quickest translation in Java, so I’ll certainly be staying here for the time.
[/quote]
You may notice somehting funny or ironic going on…

go to gamasutra.com click on features and start reading the howto game design articles…the ones with code in them…

Guess what programming language over 75% of the articles is using …it snot C++ or C either…

actually rather than swing you should be using SWT instead…and the people at eclipse.org are nice and helpfull when you have questions…

[quote] actually rather than swing you should be using SWT instead…and the people at eclipse.org are nice and helpfull when you have questions…
[/quote]
Well thats a statement ::slight_smile:

Use whichever api suits you best …

Not really, is it SUN making the swt? No, what are they doing? Wasting resources on swing.

[quote]No, what are they doing? Wasting resources on swing.
[/quote]
First up, I couldn’t care less about either api, since I use LWJGL ;D
However that said, SWT isn’t all that good:

  • It has no where near the flexibility (regarding component customization) that swing has
  • You need to manually manage resources claimed, since it isn’t automaticall GC’ed
  • Speed isn’t all that great! - I swear on my p4 @2.7, Netbeans performs just as great (and has way more features than Eclipse) - granted most don’t have 2.7 GHz - but I don’t give a f uck - for ME swing’s performance “issues” are not an issue.
    Swing has its own problems, which I won’t argue here - but needless to say, any developer needs to evaluate an api before using it - there is no clearcut answer on when to use Swing or SWT - or AWT or LWJGL for that matter…

If you think that SWT is the answer to all your problems, then more power to you - but the fact remains that SWT/AWT/Swing/LWJGL (<-- yes I do need to advertise :)) are api’s that serve the same thing, but has been implemented with different features in mind.

I never want to go back to a non-garbage-collected OO-language.

Yes, you can access OpenGL best from C. But that’s it. Then you have to do everything yourself. Integrating high-level libs with C/C++ is just pain in the ass compared to Java.
Imagine you cannot use HashMaps any more. I cannot remember how programming was when there were no such things like HashMap. C++ doesn’t offer hashed containers until now (at least AFAIK).
Imagine you have to write an eventing system without GCed objects! Reference counting? Beware!
Imagine you cannot code most of the time but play with a debugger 2/3 of your day. vomit

I feel very comfortable with Swing. Powerful, complete and easy to use. Did you ever use MFC?? Wake up!

I recently finished a project in Java/Java3D and the only solution I would have considered switching to would have been Director and its Shockwave3D. The focus of the project was productivity and I would have had no chance to build it on time if I would have had to implement basic funtionality like model loaders and scenegraph structure with picking etc.

Java3D currently performs too badly and much of its functionality, like the available model loaders and its 3D-sound functionality, are too immature to be competitive. However, if it ever catches up with Shockwave3D on maturity/performance and integration with 3rd party tools like Maya and physics engines we will have a very powerful API to build real games with (if you are only interested in building small 3D-demos using OpenGL, then I guess C/C++ would be an alternative too).

[quote]Java3D currently performs too badly
[/quote]
I hear different views on that and I haven’t done enough Java3D to really comment on that. But if this is true, does anyone know why Java3D performs badly? Is it because it’s just badly written, because it’s not written especially for games, because java is just too slow for this kinda thing, or what? I’m having a hard time with either of these arguments, but I’d love to see anyone to profile java3d in a typical 3d game and show where the bottlenecks are then and why it is slow.

[quote]accessing OpenGL through LWJGL was quite pointless
[/quote]
Why is that?

Nah, it’s mainly because it’s a) really big footprint and b) because it’s so difficult to understand most people use it wrongly and c) because it’s still not perfect yet.

I’m sticking with me LWJGL and Java code, it’s fast as feck and it’s just so damned nice to be able to say new MessageBox()… and forget about what happens to it later…

… now give my my structs or I’ll sulk.

Cas :slight_smile:

I don’t feel it’s slow. But J3D is a big machine. Therefore it lacks the bare speed of OpenGL. And if you apply that big machine to a problem that can easily be solved with direct OpenGL, the performance appears to be poor. J3D is somewhat biased in that respect.
But if you leave the field of special-purpose rendering towards more general environments, where who-knows-what can appear for rendering any time, J3D catches up.

Sure, typically many games are of the first type. But some are of the latter. If you have one of these, J3D performs well.

J3D for sure was not made for games. It’s for VR, CAD, scientific visualization.

Loaders indeed could be better and better be maintained and supported. But at least J3D offers an infrastructure that allows to write loaders independantly, just bc. it is a complete engine. So we can wait for the real one.

Check your needs!

When I say that Java3D performs too badly, I really mean that it performs too badly “out of the box” for an unproven API that wants to compete in a performance-sensitive market with proven solutions like raw OpenGL or Shockwave3D.

I have used Java3D with great success in several academic projects where performance has not really been a priority and where I have been able to throw lots of hardware at the problem. However, I do not feel confident enough in that the API can be tuned to perform well enough for mainstream games to recommend it for use in a performance-sensitive commercial project. I am very interested in seeing what the Magicosm guys will be able to turn out.

The problem I am working on right now is how to get sound playback (and eventually video texture playback) without stuttering using JMF while performing a basic flight simulation in an indoors environment with collision detection at 50 fps (or even 30 fps) on a 2Ghz PC and Geforce4 Ti4600 gfx card. It is quite funny since my artist friend who wrote his first piece of code in december has spent the last few weeks building a 3D-environment in Director where he is playing several 3D-sounds while doing physics simulations using collisions with Havoc on a 700 Mhz PC.

I am sure I will solve the problem eventually, but I am also surprised that I have to spend so much time on tuning considering the hardware difference.

Hm - I feel that sound is not really very good in Java3D. We play a couple of ambient sounds w/o problem, but our needs are not very sophisticated.
I would be suprised if video textures with JMF would be very fast indeed…
Despite that, a Java3D environment on THAT hardware can perform very well with >100FPS. Ok, whatever hardware you use, you will be able to kill it - but quite a lot of things can be displayed on such a beast at high framerates.

But if I had to guess - I’d consider the havoc stuff to be faster… that’s true. BTW, the Quake engine is faster as well…

LWJGL through java? Mainly, because it feels unnatural and the fact that things can be done more easily in C/C++ resulting in better performance makes me feel sick.

But if ONLY OpenGL access is better? For a game, that’s kind of a minor detail!

It’s the whole package that counts!

I have to say that there’s really hardly any OpenGL going on in A.F. For sure dealing with buffers is rather ugly but it’s less than 1% of the code.

Cas :slight_smile:

Maybe something like structs could help?? ;D