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.
Related
I have a tetris game programmed in JavaFX. I want to translate it into C++ to learn C++. What can I use in C++ to display the graphics and time the game loop, the way I did with JavaFX and the AnimationTimer class?
C++ really doesn't have any in-built compatibility for graphics. You need to learn an API.
Looking at JavaFX it seems to be a 3D rendering library. So this really is determined by how deep you want to go.
If you want to learn the baseline, engine design, etc. you could learn OpenGL directly which would teach you the nitty gritty of how all 3D graphics work and SDL2 http://wiki.libsdl.org/FrontPage for the OS interop. Timing the game loop can be done easily with the std::chrono classes.
If you want something slightly higher level where things like lights and such are already built for you I'd consider working with an existing framework that will give you practical experience towards game development. Most of these use scripting languages like C#, Lua, etc. Unity C# is great for something like this. Unreal Engine 4 has C++ bindings if C++ is the main consideration, but it is a bit heavy for such a small game but most game engines only use C++ for their optimized low level frameworks with scripting engines hooked on to them for ease of development while maintaining near optimal performance.
Ogre is another option for C++ open source engine that has a lot of documentation. http://www.ogre3d.org/ Which could be a happy medium between the 2.
If you don't care about 3D graphics and just want rectangles / images in your game something like QT could work well also, but that is a GUI framework more than it is a game engine which if all you are wanting is something like Tetris is fine.
I want to manually draw the graphics, what that mean is without using any library or frame work like QT, directX , whindow.h .... like giving command to every pixels on the screen to show some specific color at different time. Every body gives tutorials on based on these library or whatever they are called. What i want is to make my own GUI. As far as I could think it is going to be very complicated, hard to learn and to understand, messy and a lot of time consuming, but I am ready for that. I need some resources to understand that.
and Yes i know C++ so it would better if I had to work with this language but I will learn other language if it is required, just i want to know which language i should learn.
In the old days, you could write directly to video memory with no help from the operating system/ROM. Today, on current hardware, you have to go through the operating system in order to write to the screen. That means using a separate library (like Qt) or using the OS features (windows.h). You could use directX or something and get more raw access to video memory, but that is still using a library/framework.
If you want with C++ and native Windows API (without DirectX) , you should use GDI(Microsoft Graphics device interface) + MFC(Microsoft Foundation Classes) this is a classic implementation of Windows GUI, If you want complicated graphics with shaders you need DirectX/OpenGL without hesitation. meanwhile if you want higher programming framework you can use C#(CSHARP) or Java.
I'd like to ask you if it's worth it to use the TDD concept while creating a 3D game in C++ with Ogre? I know I can use it while creating my algorithms (like path-finding, AI, paging, etc.) and the game logic, but can it be used to test the drawing side? I mean if the proper objects are drawn, if the proper animation is set & used and a lot of other "things" that I don't want to enumerate.
I've been searching about it for days but I haven't found the answer that I can accept.
Basically which part of game development should be done with TDD and which part not? Does 3D game development need TDD?
Ogre uses so many Singletons and other global state, I find it difficult to see how you could implement meaningful tests for it- even ignoring the difficulty of testing the accuracy of a rendered image.
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.
I want to make some simple 2d games/clones (for Mac), but I have a few questions:
Should I use Quartz 2d or OpenGL (I don't plan to try 3d anytime soon)
There seems to be a lot of typedef'd things like CGFloat/GLfloat, which should I use?
Should I use Objective-C for the game too (classes) or just C? (I assume I'll use Objective-C and Cocoa for window and views.)
Is it fine to redraw the entire view each time? I don't really understand how the NSView's -drawRect dirtyRect parameter works, how does it know what I want to update?
Are there any good tutorials for this?
Thanks.
Quartz or Core Animation vs. OpenGL really depends what you're trying to do. If you want simple drawing and animation, use Quartz or CA. If you want fast/powerful games, use OpenGL. Eventually I'd suggest learning both.
For the typedef'd things, use whichever is meant for the specific system you're using. For Quartz/CA/CG, use CGFloat. For OpenGL, use GLfloat.
Objective-C vs. C also depends on the speed you want. Objective-C adds a little bit of overhead but will (obviously) let you create much more object-oriented games. I'd suggest using Objective-C if you use Quartz and Core Animation, and either Obj-C or C if using OpenGL. However, if you're doing this on a Mac (e.g. not for iPhone), you probably won't see much difference unless you're doing complex fast drawing.
I'm not entirely sure about drawRect, but this question has some information which may answer that question for you.
For an intro to Quartz, I'd recommend this tutorial, and I've always heard the NeHe tutorials recommended for OpenGL.
If you use SDL with either Cairo or OpenGL, you get virtually the same programming model, but you get cross platform compatibility virtually for free. You should even be able to continue using objective C for the bulk of the game, if you want.
How graphically intensive do you want to get? Cairo will probably be easier to just get going with for 2D.