I have never done any 3D programming and will be working on a 3D aircraft crash simulation. I am going to do it in Java, though I know C++ is probably more popular for this sort of thing, but I have no experience with it and a limited time frame.
Could anyone recommend any engines or wrappers? I know there is Java3D, but isn't it getting a bit old now? I have also seen JMonkey Engine, although that is for games I am sure it would be fine for simulation software?
Thanks!
You're going to have to firm up your fidelity requirements before you're going to get a truly useful answer to this. Some observations:
Java 3D - It doesn't appear to have had much active development since 2008 (though it looks like it's been ported to use JOGL). If it does what you need, go ahead and use it, but don't expect it to get any new features anytime soon (unless you want to write them yourself). Since it's mainly a scene graph manager, it may be of use for display, but it doesn't have any physics simulation capabilities.
JOGL - This is the OpenGL bindings for Java. Its most recent stable version is also about 4 years old, but there are indications it's undergoing some development to take advantage of newer OpenGL features.
jBullet - This is a physics engine for gaming purposes. It's essentially a Java port of the C++ Bullet Physics engine.
jMonkey - This is a gaming engine, which combines both a rendering engine (Java 3D) and a physics engine (jBullet) into a single package.
Back to my main point. If your requirements can be satisfied with a game engine, then you're okay to go with something like jMonkey or if you want to strip it down, just use JOGL and jBullet.
The downside is that most physics engines used for gaming don't deal with aerodynamics so much as collision detection and constrained movement. There appear to be a few flight simulator extensions for jBullet, but I can't make any recommendations about their quality... I suspect they too are for gaming purposes.
If you want to start dealing with structural failure simulation for the purpose of engineering analysis and the like, you might be able to get these tools to do the rendering and at least a small part the physics associated with it. But a physics engine tuned for gaming is not well suited to this kind of analysis. For that you will need a professional engineering package, or a professional engineer with a background in aeronautics, mechanical engineering, modeling and simulation... and who knows how to program in Java.
As for
what happens to other aircrafts in the airspace, actions taken by
aircraft controllers and the debris field.
Most of this is not going to be included in any physics engine, even one suitable for engineering analysis. There's some aeronautics and mechanical engineering involved, but that only constrains what's possible. What you're talking about deals with human behavior under stressful situations. That's a focus of much research, but you're unlikely to find anything available either as open source or commercial software to satisfy that part of your project.
Bottom line, get a better understanding of your requirements. If you don't have that understanding up front, you're going to be solving the wrong problem.
Other alternatives are:
lwjgl (website) A gaming library including GL binding and support for controls and sound .
ode4j (website) A 3D game physics library. This is a Java port of the ODE C/C++ physics library.
Related
I am making an RPG game in libGDX and have been reading about how to implement quest systems and a lot of people are telling me to use a scripting language such as LUA or Javascript.
I have never used a scripting language before and am curious about how exactly I would program my game to read them. I've looked for tutorials online but there doesn't seem to be any good ones that explain how to get started.
Could someone point me in the right direction on how to get started? Thanks.
There isn't any special task that would require using anything other than java. LibGDX and its friends covers everything you will need when working on an RPG game.
Using scene2D its fast and easy to set up your scenes stages and actors. With TMX support you can load your map in minutes.
There is Box2D for an easily manageable physics world.
Provides easy to use file handling system:
https://github.com/libgdx/libgdx/wiki/File-handling
And there is gdxAI: https://github.com/libgdx/gdx-ai
With features like: Movement AI,
Steering Behaviors,
Formation Motion,
Pathfinding,
A*,
Hierarchical Pathfinding,
Path Smoothing,
Interruptible Pathfinding,
Decision Making,
State Machine,
Behavior Trees,
Infrastructure,
Message Handling,
Scheduling,
And still a lot more. LibGdx is huge and provides everything you need.
I realize JavaFx 2.0 has only been out for a short time but was hoping someone is aware of an FX 2.0 game engine ( or even such a project in open source development )? I've been unable to find one- so if you do please point me in the right direction.
I'm also wondering how JavaFX2.0 will change java game programming. From what I've read and the small experiments I've made I can definitely say it is much more pleasant to code in. And I believe it runs on a faster hardware accelerated graphics engine than regular Java swing or awt based stuff. But is it complete enough to support an entire game framework of any complexity?
JavaFX is great for simple browser based / 2D games - the kind of areas where Flash is currently most common. Reasons:
Great performance for 2D apps (good use of hardware acceleration under the hood)
Very easy to skin with CSS - web designers will love this
The new JavaFX 2.0 API is very usable from pure Java (or other JVM languages like Scala, Clojure)
Cross platform, so can reach the largest possible audience
It's unlikely to be suitable for complex / high performance 3D games where you will need a proper OpenGL game engine like jMonkeyEngine.
I think the jury is still out with respect to the games in the middle ground (shoot-em-ups, 3rd person view RPGs, RTS games etc.). These games don't necessarily need a full 3D engine but do need good, smooth graphics performance. I suspect JavaFX would be fine for these on modern hardware, but I'd strongly suggest doing a quick prototype just to check the performance meets your requirements.
javaFx is not much more than a GUI toolkit like Swing, but with some extras. It is already possible to render a proper game engine into a javafx node. Here is a dome showing this.
http://www.java-gaming.org/topics/lwjgl-javafx-integration/27801/view.html.
But this does not solve the problem to lock the mouse for first person like games.
please don't mind my question since I don't know much about software because I come from a web perspective.. For example, in web css is used for the design and appearance
so..
How are the designs, templates, and environments created for software and games made with programs like c++ and java?
Are they designed with the same languges?
Are they designed with the same languages?
It depends on how the game developer has decided to do it.
They could be implemented in (just) the coding language; e.g. C++ or Java.
They could be implemented in part using some language provided by a standard games engine or framework ... or a more general (non-gaming) graphics / presentation framework ... or some general purpose scripting language (with an embeddable interpreter).
They could be implemented in part using a game-specific language implemented by the game developer as part of his/her.
Or some combination ...
There are many facets to developing a game. Most games consist of the following:
1) A rendering engine. This is the presentation layer and provides scene-graphs, math, particle effects, post-processing effects, and a whole host of other things. Unreal is such an engine. A good free rendering engine is Ogre
2) A sound engine. This takes care of processing sound effects (usually handling it in 3D space), and streaming audio. An excellent free audio-layer is OpenAL.
3) Video compression/playback (E.g BINK) if your game requires it. A free version is Theora.
4) Networking. This is something that might well be written in house, or got off the shelf like the other components, e.g. Raknet.
5) Scripting. It doesn't always make sense to have the entire game written in C/C++/Java. Sometimes the logic and flow of a level is easier to describe in a scripting language which makes changing it on the fly without recompilation much easier. Good candidates are LUA, Python and even Squirrel. LUA is used by World of Warcraft for example and is easy to bind to C++. Civ4 uses Python.
Obviously some or all of these can be written in-house, but it make sense from a cost point of view that if it has been done well already, why bother? You also need some software to edit your assets (3D Studio Max for 3D, for example, Blender if you want a good, solid, free package).
I'm thinking of writing a new web-based game, and wondered if anyone had any suggestions on which platform I should opt for.
The game will be 2D sprite based, but will need to maintain a decent fps rate (there'll probably be up to 20 things moving at once). It'll all be controlled via the mouse.
I use .NET daily, so Silverlight seems a natural choice for me, but I want to make sure as many people can play it as possible...
Can Silverlight games be developed straight out of Visual Studio (I have VS 2008), or do I need additional software (and does it cost...)
What limitations does Silverlight have in terms of .NET version (can I use .NET 3.5 for example?)
What physics engines can I use?
Would Flash be a better choice? Are there free development environments for it (that are any good)? (I don't care about learning curve)
Is Java still an option?
So I just wanted some feedback on what's the best thing for me to use for a simple 2D web-based game.
EDIT:
can you provide more information? is
this single-player/multi-player? what
kind of genre? will there be a lot of
classical UI involved (lots of forms
with lots of button/checkboxes,
datagrids etc.)? will there be a lot
of animation and effects?
Single player game, with "attack waves" of enemies
enemies are only thing that move, player just points and clicks
no classic UI, just clicking on buttons (no lists / dropdowns etc)
minimal animation and effects, only graphical requirements are movement of enemies (which will require little animation)
I'm also interested in web-based 2-d games. I personally favor silverlight because:
I'm already familiar with c#/.net.
It has a lot of capabilities, even if it's not as many as full-blown WPF. I hear that LINQ alone is awesome for games. Local storage may also be a plus. There is a rich selection of controls you can use for the gui portions of your games. Honestly, WPF loses to silverlight in terms of interesting controls.
It's totally free. You need to download the silverlight toolkit for VS, but that's no issue.
One cool thing is that you can do full-screen displays. I also found it is fast enough (on my core2 duo laptop) to handle a decent amount of objects. The fact that silverlight is going to be a big part of winmobile 7 is also a good point (though we'll have to see how that turns out).
There are a number of silverlight games out there so you can see the possibilities.
http://www.silverlightclub.com/
http://silverlightgames.org/
http://www.silverarcade.com/
I suppose the main negative is portability and making people install "yet another plugin". Flash obviously has the broadest user base, but if your game is decent enough, people probably won't mind installing the plug-in. It's a painless install.
In terms of physics engines, FarseerPhysics that TomTom mentioned is most popular.
There is one other thing that I thought was really cool and compelling: http://www.codeplex.com/silversprite. From the website:
Run XNA games without code changes in Silverlight 3. SpriteBatch based graphics only, no 3D. Since the game compiles into straight Silverlight code, it will run anywhere that Silverlight can. [emphasis added]
The XNA-in-Silverlight approach is potentially really good (especially for more complex games that you might want to try profiting from) because that also opens you up to Xbox with minimal porting effort. However, I don't have any experience in that, so I can't comment further.
Edit in response to the OP's edit:
Since your game sounds even more simple than I had imagined, if you don't mind the learning curve or potential difficulties with doing a pure HTML+CSS+Javascript approach (which may in fact not be so great), I'm going to say maybe that's the best route after all. That's because of portability.
That said, I'm lazy and don't care if a few people miss out on my game, so I'd just stick to silverlight. =P
If you want maximum playability do it with all HTML and javascript and don't even use canvas and then the game will work basically everywhere, including mobile. You can balance what extra work that might cause you against developing for Flash or Silverlight and having a very limited mobile audience. You can check out processing.js as well.
If you want to go the HTML + javascript way, you can take a look at processing.js. It's a Javascript port (by John Resig) of the Processing language.
Pros:
Totally free.
Easy syntax.
Portability. No plugins.
Cons:
Still under development, some Processing functions (like the 3D functions) aren't ported yet
Also, check out John Resig's tower defense game in Processing.js.
IMHO Java is still an option, in particular JavaFX (http://www.javafxgame.com might be a good starting point).
However, your experience with a language/technology is probably more important than the choice of platform, so you should choose .NET (given that none of the suggested alternatives stands out so far).
As stated by Benny, Silverlight is a great platform if you're already familiar with .NET, and most of the tooling you need is built into Visual Studio (VS2010 has a built-in designer but the current RC version doesn't support the upcoming Silverlight 4).
One cool feature of Silverlight is its ability to utilize the GPU. This should provide a nice performance boost. I don't know if Flash offers this.
The Silverlight runtime is very small (under 5MB). And you can easily enable out-of-browser support, so that your game may be launched from a desktop shortcut, for instance, without the need for launching the browser (and being online). Silverlight 4 adds the ability to use elevated privileges (this gives you access to the native network stack instead of the sandboxed browser stack). With SL4 you also gain webcam support, if that's important to your games.
Silverlight MAY need additional tooling for Visual Studio, but this is a free download. Basically 2008 was made before silverlight, so you need to download the tooling for it.
Silverlight runs on a limited version - read the documentation.
I would in geneeral advice to go .NEt 4.0, Silverlight 4.0, Visual Studio 2010 - those are aruond the corner and you wil ldevelop longer han a month anyway.
Java - no sorry, why. I mean, theoretically yes, but if you are a .NET person, you have more knowledge there, siverlight is XAML (WPF similar experience, always nice). Why should you giv all that up for using Java?
Flash - DAMN, NO ;) Seriously ;) You dont want to deal with that unless you have to.
Physics engine - no idea. Need to check. Not sure there is a lot for it. Did you google? http://www.codeplex.com/FarseerPhysics comes up first.
I think it is a good approach. Silverlight is a small download to start - so, I dont think you loose too many people by it. I would do it.
I absolutely love good defender games (e.g. Gemcraft, Protector: reclaiming the throne) as they can be intellectually quite challenging; it's like playing chess but a little less thinking and a bit more action. Sadly, there are not that many good ones out there and I thought I would create one myself and share it with the rest of the world by making it available on-line.
I have never worked with ActionScript but when it comes to on-line games, this is the main choice. I have tried to find a decent 2D game in the form of a Java applet but to no avail. Why is this so? I could write the game, most comfortably, in Delphi for Win32 but then people would need to download the executable, which could deter some form downloading it, and also it would only work on Windows. I am also familiar with Java, having worked with Java for the last four years or so; although, I don't have much experience with games programming.
Should I not be deterred by the fact that all on-line games are written for in Flash and create my defender game as a Java applet, or should I consider learning ActionScript and games development for the ActionScript Virtual Machine (AS3 looks very much like Java... but still, it's an entirely new technology to me and I might never use it professionally.)
Could you, please, just answer the the question in the title? Why Flash, not Java applets? Is it only 'politics'?
Flash is more popular since its penetration rate is huge.
Flash is also more powerful when it comes to create and integrate graphics assets (since Flash CS* is also a vector animation editor).
It's also very easy to embed sounds and fonts assets, to play with bitmap effects, without using any aditional library.
And last but not least, there's a lot of sites who offers ActionScript APIs in order to earn money with your games by adding various ads in it (such as MochiMedia, Kongregate...)
Flash provides a fully-built graphics and sound engine that will handle separate objects ("sprites") on paths and animation.
In Java those features would need to be provided by third-party library. Java does provides the necessary building stones to build such an engine, however.
JavaFX might change this, however.
I can provide a little insight on the Java side: Early in the history of Java, Sun tried to push Java applets as the new way to display dynamic content in a browser. This attempt was doomed to failure by the combination of the following factors:
Java had (and still has) a lengthy load time for the (JRE) runtime;
Java originally had only AWT as a GUI toolkit, and AWT is limited and really ugly;
Java used to be a lot slower before the advent of faster CPUs and JIT compiling;
Java was (many think intentionally) supported very half-heartedly by Microsoft in IE, so it wasn't well integrated and ran poorly.
All this gave Java (deservedly) a horrible reputation, from which desktop and browser Java have still not recovered. To most people, Java stands for ugly, slow and often not working applications. It still suffers from this stigma today.
While both Java and Flash are Turing complete programmng environments, Java is more universal, with a bigger set of libraries for all kinds of different purposes. Sun strove to have the Java environment be universal among platforms, so browser-side Java includes a lot of libraries that are usually not needed. Again, more load time.
Simple answer: the flash player is installed in almost all of PCs, but JRE isn't.
Flash has a much wider install base, that can be the only reason. I personally don't install Java on my machines....flash, of course.
Why write something for a far smaller audience? I'm not saying it's wrong to, but that's usually the reason when you're making games for a profit.
Think of this equivalent with consoles, with the second generation playstation there were hardware add-ons available...but they were useless unless the games used them. You had 3 options as a game developer, package it with your product - driving the price up, assume they have it - smaller audience, or assume they don't - maximum audience, maximum profit. The result is the hardware never really sold much because as a game developer you had to assume they didn't have it.
For me, that equates that to Java vs Flash, if I have to install it, the price for me accessing it goes up...assuming they have the most common thing and you're safe, minimum cost of entry, maximum audience.
However, if you have a great game, I could be convinced to install :)
Flash typically performs better at the kind of drawing, animation and video features that games require, since that's what it was originally designed for. In addition, the strict-OO nature of the Java language does not lend itself well to the kind of ad-hoc rapid development environment that is common for games.
More importantly from an author's point of views, Flash is by far the more commonly-deployed browser plugin. Java just doesn't have the penetration on the desktop. Applets were historically despised for their instability and poor performance (particularly slow startup); whilst that has improved somewhat, Sun are continuing to undermine what user acceptance they have left with their obnoxious bundling updater. It is a brave company that develops anything much for desktop Java these days.
should I consider learning ActionScript and games development for the ActionScript Virtual Machine
It's definitely worth learning JavaScript/ActionScript. (They're almost the same language, sharing a standardised common core.) Then you can apply your Flash scripting knowledge to browser scripting. You can even consider implementing games in JavaScript/HTML itself!
AS3 looks very much like Java...
In as much as it's a C-like-language, yes. However the concepts and practice are very different; you'll have difficulty if you try to write JS/AS like Java.
A lot of flash developers are designers who have crossed over into making games. They used flash as a design tool before a programming tool.
Plus it seems to be something of a precedent now for online games to be written in flash so I guess people do not want to deviate from "the norm"
Future Flash CS5 could creates iPhone applications directly, so you'll be creating games for 2 platform at the same time.