Finding the right tools for programming a futuristic-styled UI project - c++

I've always been inspired by dynamic, futuristic-like user interfaces. The best I can describe is a graphic interface such as in the latest Iron Man movies.
Although I wouldn't build a full blown application, I would like to make little snipplets of animations that I plan to make interactive. And maybe put them together someday to make something bigger. Admittedly, I will use for audio manipulation in the future but anyway, that's not the point since it's the animations/graphics I'm unsure of.
I know it's possible to make those kind of animations in Adobe After Effects. I'm just having a hard time thinking of the processes (artistically and programmability) to proceed.
While researching on this on my own I have acquired basic experience with OGRE 3D and Blender. I've imported and compiled meshes on OGRE, have been able to do basic things like move the meshes around which is about it.
I'm beginning to think I may be approaching this the wrong way and there are better tools or if 3D is overkill for those kind of animations when 2D would suffice and maybe provide a smoother experience.
I'm having trouble understanding the process and am wondering two things:
1.)The main thing I'm having trouble understanding is how to get still graphics to make animations? Do the meshes keep the timeline from a program like Blender then a graphics engine like OGRE reads the timeline and plays them?
Most importantly:
2.)Do I even need graphics (meshes)? Most of the interface are thin-border boxes, text and shapes of transparent LED-like colors that can move around dynamically to make that futuristic effect.
Please share your opinions, suggestions and anything you think might help me accomplish to develop those kinds of sexy eye candy! Thanks.

When you look at awesome futuristic UIs in movies, they are usually made of
basic primitives
desaturated colors, and/or one color tone
transparency
a cool font or two
high-tech text, graphs or similar
simple animations to make things look "alive", blinking lights/text and similar
a touch interface, of course
Maybe you can't do a lot about the touch interface, but the rest is really not hard graphics wise, it's a matter of carefully crafted artwork and combining simple elements in a cool way.
Also I would look into Adobe Photoshop and fancy texturing rather than Blender and fancy modelling, as you are looking for a fancy 2D UI, and detailed 3D models will not be that important. Playing around in photoshop (well, or GIMP if you want a free alternative) can help you develop your art skills, and help you get that high-tech, sci-fi look on a 2D surface.
You know, I would go as far as to suggest making some sci-fi wallpapers in the style you are after before trying to solve this problem in code. I think you will find that photo manipulation skills and an eye for art will help you here. And for gods sake, look at those movies (Iron Man, Minority Report etc.) that have those UIs you are aiming at, and analyze what exactly they are. Decompose them like I did in the list above.
As for the "which tools should I use?", I say the answer to that is fairly simple:
OpenGL
Photoshop (or GIMP if you are a starving student etc.)
A compiler & toolchain
A code editor/IDE
A cup
I see this is tagged C++, which is an excellent choice of programming language if I may say so.
Ogre is a full blown 3D engine, which is fine, but not exactly targeted at what you want to use it for. You might find that you struggle to get what you want done (disclaimer: I have not tried this in Ogre, and it might work well for this. Then again, when did you last see Ogre used in an audio manipulation program?). My advice is to learn good, simple OpenGL. That would give you complete power over your UI, not get in your way or limit you in any way. It is also cross platform, well documented, and used by tons of developers all over the world (also for audio manipulation applications). I can't see how you could possibly go wrong with it. The fun part is that it probably won't take you long to get advanced enough in it to start developing some pretty nice UIs. As I mentioned, it's more of an art problem than a coding problem.
The cup is for the coffee, by the way. :)

The easiest and most efficient way is to keep track of all your graphics data (meshes, animations, effects) in "media files" and load & play them in runtime. Though you'll be able to easily change your game without changing the code.
For example, you have a Diablo-like game and you wanna turn it to the future-style. You just need to rewrite some player and AI scripts and modify meshes/effects/sounds/animations. But if you've done those via code - it will be a new game from scratch.

I would suggest Ogre, but you already used that, so by my opinion, you are on the right track.
Look up 'billboards' in Ogre documentation, re: LED and 2D stuff.

Related

OpenGL text rendering methods and trade-offs

Background
I work on the game Bitfighter. We're still compatible with OpenGL 1.1 and compile for OSX, Windows, and Linux.
We use vector graphics for everything, including text rendering and manipulation. We use a slightly-modified variation of 'FontStrokeRoman' from GLUT, which is just a bunch of static lines. We like this as it seems to perform very well, easy to rotate/scale/manipulate. We also allow for in-game chat so text is drawn on the fly.
Problem
We want to use more/different fonts.
We've found several other fonts we like, but they are all TTF-type fonts that are built as polygons (with curves, etc.) instead of strokes or spines. This brings up a few problems:
We'd have to use textures (which we've avoided so far in the game)
They're not easily resizable/rotatable/etc.
Performance is significantly less (theoretically?)
We've experimented with converting the TTF fonts to polygon point arrays and then triangulating the fill. This however has been difficult to render nicely - pixel hinting/anti-aliasing seems difficult to do in this case.
We've even experimented with skeletonize-ing the polygon fonts using libraries like 'campskeleton', so we can output a vector-stroke font (with not much success that looks good).
What should we do?
I know this question is somewhat general. We want to keep performance and text manipulation abilities but be able to use better fonts. I am open to any suggestion in any direction.
Some solutions could be answers to the following:
How do we properly anti-alias polygon-based text and still keep performance?
Do textures really perform worse than static point arrays? Maybe I have a faulty assumption
Can textured fonts be resized/rotated in a fast manner?
Something entirely different?
After some convincing (thanks Serge) and trying out several of the suggestions here (including FTGL that uses freetype), we have settled on:
Font-Stash which uses stb_truetype
This seemed perfect for our game. Rendering performance was comparable to the vector-based stroke font we used - textured quads really are not that slow, once generated, and the caching from Font-Stash helps immensely. Also, the use of stb_truetype allowed us to not require another dependency in the game across all platforms.
For what its worth, this solution was roughly an order of magnitude faster than using FTGL for true-type fonts, probably because of the caching.
Thanks for the suggestions and pointers.
Update
The Font-Stash link above was a fork of the original here. The original has since been updated, has added some of the features that the fork, and can allow different rendering back-ends.
I'm no OpenGL expert, or graphical expert in general.
And, really, Raptor, I -hate- to be the guy that says this, because I know how you feel right now.
I really hate to say it, but honestly, I'd just give TTF fonts a shot, using their textures and polygons as they were intended. I doubt that such a usage would truly be detrimental towards your performance these days. It would likely be more valuable to save time to use them as is, rather than spending time to experiment around for some clever solution that more fits your desires.
I doubt that text drawing using polygons/textures would be detrimental, whatsoever, to you performance. This especially applies for today's computers. How many years back, technologically, do you intend on supporting with your application? Or perhaps you wish to run it on the Raspberry PI as well? Or other mobile platforms that do not have high graphical capabilities? Support of any of these could, perhaps, invalidate my claims.
But, like I said, I really hate to be the guy that suggests you to trudge forward as is. Because, I've been there, asking for performance advice (sometimes over even tinier things) and just groaning when someone says 'forget about it, the compiler will handle it' or 'computers are so advanced you shouldn't worry about it'. I honestly hope that someone else comes in with experience, and a good answer for you. However, if not, I just want let you know: I cannot foresee the possibility that using TTF, as it was intended, would be detrimental whatsoever to your gameplay performance.
Did you try outline glyph decomposition using freetype FT_Outline_Decompose ?
Freetype is the tool of choice for font rendering and glyph outlines extraction. Hinting is supported and rendering modes allows you to specify that you want antialiazing, hinting, monochrome targets etc.
Freetype also has a built in glyph/bitmaps cache mechanism which may be useful.
Note : OGFLT seems to bridge the gap between freetype and opengl although I never has the chance to use it

C++ using animations from Flash or similar

I want to program a game, and I want to do it in C++, because everyone seems to agree this is the best way to program a game. What I really want, though, is the ability to animate something, swap images around during runtime, and retain the animation. Also, the ability to pin graphics to certain parts of other graphics, or group graphics together. I know for sure Actionscript and Flash can do both of these. It's especially easy in Flash because I can visually see the animation and swap symbols via Actionscript to change it to what I want at whichever frame I want. Now, I know that it's fairly simple to swap images during runtime in C++ as well, but in C++, (from my understanding) I would have to animate via code and I would have to manually move each graphic separately for the graphics to stay together. Is there's a way where I can animate in Flash, then use those animations and swap images in C++? Or, if there's some other way to accomplish the same thing, without using Flash? (don't mind using bitmaps)
I think maybe you should just program your game in Flash and ActionScript, if you're already experienced with those tools and your game can fit in them. Programming a game in C++ is a difficult and complex task, necessary for difficult and complex games but often overkill for simple and fun design. If you just want to design games, go with the simplest tool that lets you make your prototype!
If your game is too big to implement in Flash, consider using XNA, or a prebuilt game engine such as Ogre or Unity. XNA is in C♯ but even that is good enough for any game that a one-man team could build.
Scaleform lets you embed Flash in a C++/DirectX game, but as you can see it is rather complicated to employ. We have one engineer and three artists dedicated full-time to Scaleform UI on our project, to give a sense of how much work it is.

The simpliest way to visualize - easy-use graphics. Which languages and lib?

I'm going to develop math model of trafics simulation and will need to somehow vizualise it. The model will be in C++
I'd like someone to recommend me how can I visualise the result data file - e.g. paint cars, road etc. Language choose is not important but should be easy enough to go into.
os: Win32
UPD:
It'd better be the 2D not 3D
but actually - doesn't matter
Best quality and most general software I've seen is Graphviz.
http://www.graphviz.org/
I've heard lots of good things about VTK (not yet had the occasion to use it myself).
The Wiki contains lots of C++ examples.
Although I do not know how (or even if) it interfaces with C++ you may be interested in processing to quickly build visualizations.
If you want more 2D than 3D and if you know C++, then using Qt and notably its Qt Graphics View framework could be ok.

Creating effects in 3D game from scratch, using c++ and DirectX

So the title says it. I couldn't find any info on how actualy build effects into 3D game. I'll maybe stick to some engine later, but for understanding of this whole thing I would need to try it on my own for this time. I found a few about particle systems which may be the right way but any other connection between DirectX and particle systems on google gave results as 3DSmax and etc.
So I would be thankful if you would point me on some tutorials for this, or explaining it...
Last possibilitie would be pointing me on some simple engine focused on this thing (I don't really want to fight through tons of code and understanding how this engine works, I just need to see how they implement this FX stuff).
Thanks
PS: the other possibilitie would be if you know about good book discusing this. It can be more complex but apart from tutorial, books are usually wrote more basicly so this would be also nice way to go
First of all: particle effects are just one kind of effects, it's better you specify the word particle engine :p.
Secondly: search int he articles of Gamedev, it's really the best resource if you want things like this. You can find lots of articles and even better, tons of links, and useful information on the discussion boards. Two articles I can link to is the NeHe lesson about particles in OpenGL, it's not directx but NeHe tutorials for OpenGL are very good. I also found one for directx8 and VB (so a little bit older).
Keep in mind though that a particle engine is often a huge performance hit if you can't optimize it yourself, so try to look at open source game engines (e.g. OGRE) on how they implement it or even better, specific particle engines.
So I would be thankful if you would point me on some tutorials for this
You need to download microsoft DirectX SDK.
In addition to it, you should try NVidia SDK.
You may also try ATI SDK. Study them all.
In addition to them... there are couple of books on OpenGL: "Red Book", "Blue Book", Orange Book . "Computer graphics using OpenGL" by Francis Hill is also a very good one.
Get this info, and start reading.
how actualy build effects into 3D game
This question is too broad. There are lighting effects, particle systems, post-processing effects, physics (which are also effects), and even character animation is an effect. It is unclear what kind of effects you are talking about.
What do you think is better DirectX or OpenGL.
They are more or less equal. You can do same things in both of them. Try both and pick one you liked more. OpenGL is better for playing around and experimenting (because you can easily draw triangle without messing with hardware buffers), available on larger selection of platforms, plus GLSL is better than HLSL (because it doesn't "compile into assembly"). DirectX is geared towards performance from the beginning, available on XBox360, and 9th version was actually good. openGL is more "abstract" and DirectX is closer to hardware.
If you could use the factors as simplicity, area of usage, performance, number of examples and resources etc
If you want simplicity, you should forget about making game engine. You'll have to learn quite a lot of things if you want to deal with 3D.
Both DirectX and OpenGL are used for making 3d-related products.
You can get good performance with both DirectX and OpenGL, and get poor performance if you don't know what you're doing.
Both DirectX and OpenGL have insane amount of examples and books - just search for it. They weren't made yesterday, so enough information is already available.
You need to select goal, select platform, select your API, research available technologies, and start writing code. Wondering "which one is better" is a waste of time. 3D knowledge and algorithm are equally applicable to both APIs.
OpenGL is the best bet to learn I feel. Glut is available free of cost and has all the functions you need to implement a particle engine. Plus theres loads of sample code online. I like the way functions are . Easy to remember and use logically
The best books for learning D3D9.0c/D3D10 are by Frank Luna. Just put him in to amazon or google and you'll get results. He teaches how to build a fully-fledged game engine from scratch.

I want to make a simple 3D game using openGL, where should I start?

I find that I learn best by example. Is there a good website or codebase that shows how event handling, collision detection, modeling, and basic 3D drawing works?
The game I'm trying to begin with is a simple racing game where the user controls a small space ship and navigates through channels, asteroid fields, space colonies, and various other obstacles (I know, real original). Movement is in 3 dimensions. The game should know when the shuttle hit an obstacle. There are defined tracks as there are in most racing games (circuits and linear paths).
Pressing the arrow keys should cause the direction vector to rotate appropriately. Also, the ship should use something like an afterburner when the user presses the space bar, for example. Movement up and down is also an option.
If you want to learn OpenGL, I recommend starting with "OpenGL Red Book", and then looking at NeHe's samples. Red Book is free at least in online HTML format, there are also downloadable PDFs around.
However, Red Book and NeHe will teach you mostly how to use OpenGL; writing games is art, and there's far too much to explain, far too much to learn, and far too much to read about it. Here's just a tip.
This is basic structure of most games. Hopefully it helps with basics. Of course it's not a full game, won't run, and greatly depends on how you do things, but it should give you a basic idea.
void update(float k)
{
// k == time in seconds since last update; e.g. 0.02
ship.y += ship.speed_y*k;
}
int main()
{
while(1)
{
if(hasEvents())
{
event_t evt;
getEvent(&evt);
if (evt.type == keypress && evt.key==down)
{
ship.speed_y=1;
}
}
paint();
new_ticks = get_ticks();
update((new_ticks - old_ticks)/1000.);
old_ticks = new_ticks;
}
}
Not knowing your initial skill level I suggest you taking a look at Ogre3D. It is a complete 3D-rendering engine that has really clean interface to work with, easy to extend and best of all, it's quite multiplatform working on Windows, Linux and Mac OS X. The examples and tutorials provided are pretty self-explaining.
If you want to write your own OpenGL-only engine completely from scratch, Ogre3D may not be the path to follow...
A couple of notes, some of which have already been stated:
The OpenGL Redbook. An excellent place to start. The book has seen several revisions, so the free online version is a bit dated by comparison.
GameDev.net. They are a wonderful resource for developers of all experience, and they have a lot of talented people on the forums. They have answered the question, "I want to make a game, where do I start?" many, many times.
I do not recommend NeHe. I find that the tutorials there, more often than not, confuse a neophyte. The tutorials show "how", but do very little to explain the crucial why.
Game development is a huge multifaceted discipline. It's challenging even if you have very solid math and programming skills.
Two pieces of advice:
Start small. Start small. Start small. You might think your goal is pretty modest, but it will involve a great deal more than you imagine.
Avoid the temptation to cut and paste example code. You will cheat yourself out of crucial understanding.
NeHe
This site helped more then anything when I was learning opengl.
I must give a warning for using nehe because many people have recommended it.(don't have an account to make comments, sorry)
Mainly because it only shows how to do things with the fixed pipeline instead of shaders. The first couple of tutorials might be ok the get a kickstart of how to get something on the screen. But don't waste your time with for example learning how to activate alpha blending and setting up lighting for the fixed pipeline, because if you want to do something that doesn't look like a game from 1999 you will have to relearn how to do all that stuff again but with shaders. Better to learn the new way from the beginning imo.
Firstly, I don't recommend using OpenGL for your first game, especially if you've never programmed before. You should strongly consider the newer and easier methods like XNA with C#.
Secondly, like OpenGL, XNA also has a large number of tutorials on the Internet, which I believe you will find very helpful.
If you've never done programming before, I recommend as a starting project, you should try creating a very simple game like Pong, or Tic Tac Toe. I think you will get a good feel of game development in general. From there, you can start on your actual project from the experience you've gained by creating Pong.
Lastly, the main piece of advice I can give you as you adventure on your quest is to never give up no matter what obstacles you face in creating your game.
Good Luck! ^^
I've no idea how much game programming experience you have, but I'd start with something a bit more limited.
Start with a 2d tile-based game (Sokoban etc) - they're relatively easy to write - something where the objects are always exactly on a tile, that makes things pretty trivial.
Once you've got the principles of that, game loop, timing, processing user input, data model, renderer etc, then you can do something more involved.
Then you can try something like "Asteroids" which is going to need some 2d vector maths, modelling intertia (i.e. integration) possibly a bit of trig. and a non-tile based collision system.
Once you've got that licked, then you can try something 3d - which makes things more complicated again, maths-wise.
I would look around on www.gamedev.net, it contains some excellent tutorials for beginners and in the forums you'll find a great deal of information on any subject related to games programming.
First, you should think about the structure of your code. Every game ever has some variation of the following:
int main()
{
Screen::Init();
Game::Init();
while (Game::isrunning)
{
Game::Update();
Screen::Render();
}
Game::Shutdown();
return 0;
}
The rest just becomes an implementation detail. Try looking at SDL, it handles a lot of the nasty things of Windows programming (initializing a window, loading OpenGL, etc.) so you can focus on writing your game.
Yes, look up tutorials online. Yes, hang out at GameDev.net. Yes, NeHe is confusing and specialized.
For OpenGL, I would combine the OpenGL SuperBible's ability to make one aware of the context and possibilities of OpenGL with a good old-fashioned Google search.
It also helps to know someone who can help you out from time to time. GameDev.net has chatrooms and the people are friendly.
If you want opengl but with the simplicity of python - which could be nice to understand the principle of the API at first - check out the wrappers : http://pyopengl.sourceforge.net/
They are compatible with the latest version of opengl and their development is quite active.