Flash animation-like 2d graphical library for C++ or Java - java

I'm looking for a good (hopefully free) 2d graphical library in C++, or in worst case, Java, which helps create the look and feel of Flash animations, the typical ones you can find in most flash games.
The best would be if it provided most of the features and easiness of Flash animation programming, like layers, or even collision detection, etc., without all the micromanagement of pixels typical for opengl. Of course, it can be built upon opengl...
Edit: interactivity is important, it might not been clear in the first description. So I'm not aiming just for an animation, or presentation. A good collision, gravity, etc. system is very much welcome, as are good GUI widgets.

Checkout the new ForPlay from Google.
It compiles to java, javascript, android and more.
Edit: Moved and name changed to PlayN
There is also a stackoverflow tag

Potential ideas:
Processing has been used to make some very good visualizations.... depending on what you want to do this may be a good option.
JavaFX was designed as a framework for building Rich Internet Applications (a bit like Flash). I think it has a lot of the Flash-like features you are referring to.

I don't know if this is exactly what you're looking for, but you can take a look at SFML.

Related

Is Processing (2d graphics) appropriate for larger projects?

I'm going to be working on a decent-sized game in clojure and for now it will have 2d graphics. Is Processing (or rather, Quil, which is just a clojure wrapper for Processing) an appropriate tool to use for this.
Processing presents itself as a way to quickly experiment with different ways of generating and manipulating graphics rather than a scalable 2d graphics library, but I don't see any obvious reasons why it couldn't be used as such, so long as you take care to properly separate logic code from rendering code.
If there are better options, let me know.
Processing is certainly cool, but is somewhat specialised towards visualisation / interactive animations. It also has it's own mini-language designed for visualization applications. While it is possible you could make a decent game using it, you might start running into performance issues as this is going outside its usual usage.
For a decent-sized game I expect you will ultimately want to use OpenGL directly, in which case LWJGL might be a better option.
Ultimately, you probably need to prototype using both and figure out what works best. As a rough benchmark, you will want to render a full screen of tiles plus 1,000 sprites at 100+ FPS with less than 20% CPU. If you can demonstrate that processing can handle that then you may be fine.
Other options that you can consider:
Swing - good for simple 2D games. Has the advantage that it is built-in to the standard Java distribution and has lots of good tutorials. Wasn't really designed for games but works fine providing you aren't too demanding.
JavaFX 2.0 - roughly intended to plat in the same space as Flash (rich internet applications). Looks pretty cool, but is still fairly new. Again, probably fine for simple Flash-style games.
I would be careful of using processing for this. I'm not sure about PC, but on the Mac Processing can have pretty hi CPU usage, depending what you are doing. So if your game is cross platform there might be a better option. If it's an online game why not use Flash? The scripting languages are not too far apart and in the book 'Processing: A programming handbook for visual Designers and Artists' (Casey Reas & Ben Fry) there's a handy little section at the back (pages 686 - 691) showing the comparative syntax of Processing, Java, Actionscript & Lingo that would be a useful way of getting you started.

java JOGL and similar resources

just joined this awesome siteā€¦
Ive recently been working in XNA on C#, making a library for that framework.
Ive gotten interested in java at was going to try making a similar library for java.
Thats when the problem arrived, there doesnt seem to be a standard 3d renderer on it.
Ive heard of JOGL, but it seemed to be discontinued (project inactive), and i prefet high level anyway,
Then I saw jMonkey and espresso 3D, but both seemed less efficient and less pretty then directx.
JavaFX discouraged me by saying that its for rich internet content.
My question is, which out of these are optimal. What is the technical difference between OpenGL and DirectX, are jMonkey and co. Actuallh effective? And if not is there a framework similar to XNA for java?
I only ask you name some and point me in the right direction, as this got me a bit confused after the 1 way .NET xD.
Also, as this is my first post here, feel free to correct any mistaked I may have made.
I think jmonkeyengine or jogl are probably the best choices, but it really depends on what your doing. Jogl looks like its still going but is now part of a fuller set of libraries, jogamp, which covers sound and gpgpu programming as well as graphics.
http://jogamp.org/
Jogl is essentially a java wrapper around OpenGL, so will be low level and require to write shader code in order to do anything modern. Jmonkeyengine is probably more the sort of thing you're after since it comes with a lot of prepackaged functionality (including its own IDE).
The real standard 3D API for Java -- in the sense that it's the one that Sun once considered "official" -- is Java3D, which is a scene graph API, something like Open Inventor. I never liked it much, and the level of support these days is pretty low. But it's worth considering, if only for completeness.

Keeping GUI Development skills sharp

I've been developing in Java Swing for a while now, and I'm starting to feel that Swing-based desktop applications are feeling a little stale and are tedious to develop.
I'm seeing new applications that look very sleek and modern, like TweetDeck and Synthesia (a piano game). Despite the wisdom in Haase & Guy's "Filthy Rich Clients," I imagine that writing applications like these in Swing would be quite a chore.
Presuming that desktop applications won't totally disappear within the next 5 years (or that the division between the web and the desktop will become seamless), what UI languages and technologies should front-end developers be exploring to keep current? What's the next big thing?
Microsoft's WPF is probably one of the newest, coolest technologies out there.
It allows you to make much better looking GUIs.
You should also look into some of Microsoft's Expression products. They let you put that extra flare into your GUIs.
I'm not sure there's "the next big thing" in desktop UI development. If anything, "the next big thing" is a multi-touch based interface ala popular tablets and smartphones. Given that, I think it might be smart to learn how to create multitouch UIs by downloading a sdk for a mobile phone or tablet that supports multitouch.
If you like Swing, Take a look at Google GWT.
It is like Swing for the Web, well almost.
There will always be a need for OpenGL/Direct3D developers, but that might be further down than you're talking about.
On the Windows side WPF and Windows Forms are available.
On the Mac/iOS Cocoa is the way to go.
On Linux there's a few options such as GTK or QT.
You might just want to bite the bullet and learn some HTML5/JavaScript though. I doubt that's going to go away any time soon.
I'd suggest looking into Flex. It's much more interesting to develop than Swing and b/c it's Flash it can run in a browser or on a desktop.
Java still works fine. You simply replace standard controls with images and use image states to change the look on mouse overs and clicks.
I would also suggest WPF as another UI framework to get under your belt, because it does afford some pretty powerful UIs in desktop applications (and most of what can be one in WPF is translatable to Silverlight for webapps).
On the flipside, instead of looking for the next new UI language or technology, I think you may be better served looking at UI from a usability standpoint, and tracking the trends currently making waves.
As an example, one of the paradigm shift I'm seeing in UI development (mostly on the web) is the switch to making important things bigger and less important things smaller - including yes/no buttons in a dialog. I'm still warming up to this idea because it flies in the face of a consistent button look to show users their options.
Instead of providing options in a world today where we are constantly making decisions, the goal of this newer UI look is to breadcrumb the happy path. If the user decides they want to do something different, they can, but the UI is going to make the user put in a little effort and read the fine print.
Another example is flash-highlighting a recent change a person has made (SO does this, but I forget the term used to describe this effect) when coming onto a website.
Lastly, and this is one of my favorites, the shift from an administrative/user view (also mostly in the webapp sphere), to an ad-hoc WYSIWYG editor...Flickr is a prime example of this, where you can change captions on a picture by clicking on the current caption and editing it inline, without the need to go to a separate admin view to edit these values.
Is anyone else seeing trends like these that are interesting and new?
You've been programming in Swing for a while and you only just started feeling it looks outdated? :)
Swing looks like crap, no matter what look-and-feel tricks folks do for it. It actually put vendors of Swing-based desktop apps like ourselves at a disadvantage because of how shiny and pretty WPF stuff looks.
If you want to stay in the Java realm, I encourage you to try out SWT and JFace. You don't need Eclipse for it. But it's a much better looking system with a much nicer API.
If you want to go for attractive, WPF is your friend. You're limited to Windows and can't use Java (both showstoppers for me), but you can't ignore the aesthetics benefits of that SDK because it is so tightly bound to recent versions of Windows.
I think the point of the book you mention, and most of the answers here, are that most languages give you the tools, (or enough rope to hang yourself ;) to throw out the basic ugly controls of ANY OS you are on, and paint whatever user experience you want to. Yes it is tedious to skin or otherwise manually take over the visual representation of the controls in a UI, but if that's whats important to you, then you'll do it, and possibly be rewarded for it. Or castigated for breaking the "platform UI standards".

Which platform to develop web-based game in?

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.

Is XML or XUL the future of Java GUI building?

After spending a lot of time and code on programming in Swing, I thought this can't be state-of-the-art Java GUI building. After not finding a user-friendly visual gui bilder for eclipse I stumbled upon declarative GUI building with XML UI toolkits... and I thought: This must be it! I think it's the right way to go, easy and also close to web-programming.
But after looking around in the web and on SO, I got the impression that it is not very common! Although there are many implementations and APIs, it seems like most of them are kind of dead and had no updates in the last 5 years..
So I wonder: Is my feeling right, that XML is not very widespread for java GUIs? And if so - what are the reasons? Maybe it couldn't become accepted or it has some major drawbacks or people are doing everything in the web instead with fatclients or there are better alternatives, maybe javafx?
I just need to know if it is worth spending time in that area or better look for alternate ways. As I dont read developer magazines I just don't know what the trends in gui building are and which technologies are believed to have a future. But I can't imagine that people still spend so much time on writing nasty swing (or swt) apps.
There new fresh and interesting approach - it uses YAML. Check it out at http://code.google.com/p/javabuilders/
Sun's answer to that seems to be JavaFX.
It has a declarative language for specifying the GUI and there will be builder apps as well.
There is some prototype work going on for e4 (Eclipse 4), which would allow building a GUI by editing an Ecore model and customizing it via CSS.
See this blog post for some details and instructions to try it out yourself.
Five to ten years ago XML was very popular. Although fine to provide some kind of standardisation for transferring data between heterogeneous systems, it's not suitable for programming. It always starts with the easy stuff, and lets declare everything. But any real system requires code. XML then falls down. There is also the problem that XML is a bad syntax for humans, and even languages like Java are easier to read.
On the other hand, there is clearly a need for the rails of GUIs. Naked Objects is the closest reasonable attempt I have seen.
I came to the same conclusions as you about the declarative frameworks out there. It is not worth learning a new GUI syntax unless it's widely supported. XUL as an interface language is widespread, but there is no java rendering framework for it. I'd say HTML+CSS+Javascript and a Servlet container is the best Java platform for GUIs today, but sadly I haven't found a platform independent way to display web pages like a desktop application.
If you use Eclipse, you can now use WindowBuilder to help you in creating Swing apps in a user-friendly visual GUI builder. It's now available as a free download, and Google has donated the Swing GUI builder framework to the Eclipse Foundation.
I'd second Thilos suggestion with javaFX.
Additionally the trend is pointing to webapps, so I think that in the long run javaFX and web based UIs will catch up to swing+swt GUIs.
I do all my swing stuff by hand and none of my application is nasty. If you do not know how to create usable and good looking UI there is no technology to help you.
The answer is surely not going to be XML. What problem are you trying to solve? You want to have reusable building blocks, and a compact way of describing them. I don't see XML helping you there.
[edit] Creating a java code equivalent of XUL would be an immense improvement on XUL.
XML makes it really, really hard to do good separation of concerns and once and only once. It is however perfect for the mongolian horde approach. You need a layer on top of swing, it only provides the building blocks.

Categories

Resources