instruction
stringlengths
33
29.4k
I've been working on a 2D game for the iPhone and learning a lot about game design in the process. I've looked at some of the most popular games for the iPhone ( angry birds, cut the rope, doodle jump, tiny wings, etc..) and have noticed that they're all 2D. Now I understand that some graphics knowledge is needed to cr...
The hemicube algorithm renders the scene to 5 sides of a half-cube, from the perspective of each polygon. Assume you place the hemicube around me and render to the 5 sides. The idea is, we can see exactly how much of each other polygon in the scene I see, and so determine the amount of light I receive from those respe...
anyone can share a link for a tutorial or article about optimizing A* for horizontal / vertical movement (no diagonal). Is not as easy as change the G values to 10 everytime. Thanks
The game I've been working on uses opengl/sfml for graphics. I'm currently working on the interface and I've found determining all the proper offsets/positioning etc. to be a pain. To make it configurable, I'll likely end up parsing a making a bunch of xml files to parse that tell my program what images to use/where to...
I'm working on a SpaceWar-esque project to get comfortable with XNA. I have a Ship DrawableGameComponent and a Bullet DrawableGameComponent. The player's Ship is created at the start of the game, and the Bullets are created for each Ship as part of its constructor. In my Ship constructor, I have the following code: for...
After cocos2d, I'm looking at box2d... And I have some questions: I was wondering how to cut a body into pieces. How do I determine the intersection point of the body with the cut line? Create a new body in some "update_body_method"? On the second question I have answer, for example between two points create vector f...
Hey i'm trying to make a class called BodyRep Which is supposed to use SFML too sync a graphical representation and Box2D Bodies orientation/location. To do this i plan to ovveride some Box2D function so that it does it's original steps, plus one extra: to update the graphical representaions orientation based on the n...
I'm writing a 2D snake-like game for android (Hungry Birds, already in the market), and now I'm wondering if I should port it to OpenGL so that the performance can stay stable while I continuously add additional features to it. I'm still an apprentice (17yo), so I don't know any "complicated" math yet (matrix transform...
I would like to identify the name of a certain gameplay mechanism. It is fairly commonly seen but probably best illustrated with card games: A game played with a pack of cards usually has card values ordered in the following way: A > K > Q > J > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3 > 2 Sometimes the lowest-ranked card (in t...
I have a Dance Pad and I want use it in XNA as a controller. It has a USB connection. Can someone help me?
My 2D isometric game uses a hexagonal grid map. In reference to the image below, how do I rotate the light blue hexagon structures by 60 degrees around the pink hexagons? EDIT: Main hex is (0,0). Other hexes are children, count of them is fixed. I'm going to define only one position (in this case its right) and calcu...
I want to implement deformation of plastic material, like plasticine for example. Where should I start to study? What technique should I use? Thank you for any advice. EDIT I want to use it in real-time in kind of a 3D game, not a physics simulation. When I "push" on the plasticine, it is expected to spill. I want to r...
What is the best cross-platform game engine, being the most commercially supported, there is for free available for development on Linux? I'm planning on creating multiple, non-commercial, fps games to gain real industry experience in C++ game development.
I'm working on my combo system and I keep getting this weird problem. It's a pretty basic setup: when the player hits the attack button it changes the character's current action to "attack", if the player hits an enemy then an int (f) is set to the next combo number, after the attack finishes the character's current ac...
I'm learning OpenGL and really like to know how the interaction with the Graphics card will be. I feel understanding how it was implemented in the Graphics driver, will let me know complete internals of the opengl(With this I can know what stages/factors influence my decisions regarding performance in opengl). Are ther...
I was wondering how to implement time travel into a game. Nothing super complex, just time-reversal like what's in Braid, where the user can rewind/fast forward time by 30 seconds or whatever. I searched around the web a lot, but my results usually referred to using time as in like "it's 3:00" or a timer and such. The ...
I want to animate Model1 (an aicraft) and I want an object, Model2 (a sphere), to follow it in translation and rotation, as it is a part of this aircraft. With the following code (I use one or two tutorials to write it) everything seems good when you just change just one angle at the time. The sphere gently follows the...
I'm looking for high quality original 2D sprite collections which are animated where appropriate. (IE not simply collections I can buy, we want original work). I've had a look online but am struggling to find out where I can hire such people! Where do I find such people? How much should I expect to pay?
I'm implementing non-projective decals. As described in many places (ie: lengyel in the gpg2) I first need to detect all triangles that lie within some sort of frustum. Besides obvious brute-force solutions (ie: checking each triangle), what are better ways to generally search triangles in a mesh? One solution i can th...
In my simple game I use boundingBox for pick coins and other stuff, but I need use irregular area detection of Sprite(with out Alpha)... There is alternative to boundingBox? Here is code: -(void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event { CGPoint location = [touch locationInView:[touch view]]; CGPoint po...
I am developing a simple graphical game for Android (Java and OpenGL ES). There is no high-end graphics involved, basically a few (less than 10) sprites and some (about 10) dynamically drawn primitives. The performance of the game is quite fine, I get about 50-60 FPS on my HTC Desire. However, there is one specific per...
What is the best general approach to implement scrolling for a 2D tile based game? I need to scroll the map with a constant speed, lets say 2 pixels every frame (like in a top down shooter). The tiles are 32x32 and the map is quite big, lets say 10 x 300. There are 2 layers: - first is the background layer - second i...
I want to create a map similar to how Mincraft and other related games do. I just haven't the faintest clue on how to do so. Can anyone point me to a decent tutorial or give me a decent run through? I program in java and use openGL.
In software, at runtime, (C++ if it matters), is there a way to find out the maximum level of anisotropic filtering supported by the graphics card?
First of all I have Xcode 4 installed in Mac OS X Snow Leopard 10.6.8. I have downloaded the Quake 3 source code 1.32b release but I can't open the Xcode project that is inside the /macosx folder since it is in the old .pbproj format and therefore it throws an "incompatible version" error. Has anyone been able to conve...
I'm trying to create a simple topdown game, in which you control the player by WASD keys and use mouse to aim and shoot. So far, I have a player moving and firing, but I think there is something wrong with the shooting. Accuracy gets lower as the mouse cursor move away from the player. Please try the following SWF to s...
This is a general question which aim is to allow me to start digging on the subject by myself. As I noticed the general opinion is that scene graphs are good for describing the scene in a level editor (or any editor that the game is using), but the game itself should use some sort of optimized data structure internally...
I am working on translating an old RTS game engine I wrote from DirectX9 to XNA. My old models didn't have animation & are an old format, so I'm trying with an FBX file. I temporarily "borrowed" a model from League of Legends just to test if my rendering is working correctly. I imported the mesh/bones/skin/animation in...
I have a point & click type interface on a client, which runs an A* on the server, for path-finding. The game is controlled like an RTS, but the world is persistent, so players should be able to join/leave at any time, and there will only be 30 or so units at most on the screen. What is the best way to synchronize the ...
Games like Super Metroid and Aquaria present the terrain with the other facing parts having rocks and stuff while deeper behind them (i.e. underground) there's different detail or just black. I would like to do something similar using polygons. Terrain is created in my current level as a set of overlapping square box...
What would be better for PC (Windows, Linux, Mac) games? I know Java is more mature/older and has a giant user base, but I see C# (Mono) slowly rising and showing that it has a growing user base as well. I've seen lots of games written in Java like Minecraft, Runescape etc. (Haven't really seen any popular C# games!) B...
I need to render certain scenes and read the whole image back in main memory for further processing which is not suitable for rewriting into shaders of CUDA, and saving to disk. I've search for this and it seems that most video cards will accelerate the rendering but the read-back will be very slow. After a bit of rese...
I am very new to game programming. I am currently studying Java (Android mainly) and I know what it takes to make a game, as well as how to render it via OpenGL. Finding some others at nearly my level I think would motivate me more and give me some experience to working with others. Do you know a good place to find som...
What is the term for this: A game that used to cost money, but is so old that it is now available for free (though not always open-sourced).
I am not a game developer by trade but am working on a card game (that is real time, not turn based). I was wondering what the common mistakes are that people make when new to this sort of development so that I can avoid them!
I have done multi-pass rendering, before, and understand how it works. I made a simple example, which rendered a basic scene with shadows. This was all part of one file. Now, I am trying to figure out is how to put it into my game engine. Currently, my game engine uses a single pass. It is in a hierarchical structure, ...
I have a simple question. For people that know and built ogre3D from source as a Static library, what is the order of which the libraries should be linked? The libraries I need to be organized are: Ogre Plugins 'libOgreMain.a' Ogre RenderSystems Boost(version 1.47)link Ogre's Dependencies The reason I'm asking is bec...
Imagine a Sims-like 2D game for a touch based mobile phone where one can interact with virtually any object in the scene. How can I efficiently detect which object is being touched by the player? In my short experience, looping through all the visible objects in the scene and checking if they're touched has so far done...
Is it possible to use Java as a scripting language for a C++ engine/game? I understand that you need to make a binding to the interpreter, but I haven't seen any around.
Okay, so I am using C++ with OpenGL, and I am going to create a loader to load in textures for my 3D game. (But the textures are 2D). I want the option of transparency, even if I decide not to use it. I need decent quality, although it doesn't have to be top notch. What do you guys suggest for format (PNG, TGA, etc.). ...
In Maya I use fur to create plants. In my game I want to render these plants with cel shading. I use Wavefront .obj as a file format in my game for the models, but it doesn't seem to include the fur. Is there a way to export the fur (as vertices) with the model into the obj file? Generating the fur at runtime is a bit ...
I'm just starting to look into creating Source mods for HL2 and I'm a little bit confused. I've gone through some tutorials on level creating to get the basics and it seems to me that it's all that really goes into the creation of a mod. I know I'm wrong so could someone please explain to me where the programming comes...
What would be a easy/fast language that would be good for an Indie developer for a FPS? Java? C#? C++? C? Anything else that would be good? Edit: (Platforms: Linux, Mac, Windows)
I've been looking for articles or tutorials on this and I can't seem to find any, so I thought I'd ask here. I've created a bullet class in my game that is added and removed through a list. If I'm going to make these bullets work the way I want them to I need to be able to do two things: One, I need to check if the bul...
My question sounds pretty simple but awfully, I couldn't find much information on the internet. How can I draw a circle in my FlxSprite? I couldn't find much information about drawing geometric objects or the usage of classic graphics API in Flixel.
I'm making a little dungeon crawler in space, and I'd like to hear some advice on how to make the backend of the engine nicer. Basically, currently everything is based on a crapload of managers: BackgroundManager: has AddBackground(image, parallax) method for making cool background effects. ConfigManager: reads/makes ...
I've started down a line of art asset development that will allow me to (hopefully) reuse and improve assets for several games. But how do I go about storing and finding them? Let's say for example I decide to focus on RPGs for ~2 years. I would create items, monsters, etc. and store them somewhere. How would I catego...
This is a really cool demo of a Canvas Doom Engine made back in 2006: http://canvex.lazyilluminati.com/84/play.xhtml Here is the e1m1 map in JSON format: http://canvex.lazyilluminati.com/84/map1.js Does anyone know of the tool used to convert Doom maps into JSON? I can't imagine this was done by hand :)
I am a systems administrator and for many years I worked with *nix servers. My main experience programming is with Perl and shell scripting, but in my new job I've been told to learn Java and well... I'm not even interested in it. But what I am interested in is in game development, so while I don't have any interest in...
I am trying to create an isometric game using HTML5 canvas, but don't know how to convert HTML5 canvas screen coordinates to isometric coordinates. My code now is: var mouseX = 0; var mouseY = 0; function mouseCheck(event) { mouseX = event.pageX; mouseY = event.pageY; } which gives me canvas coordinates. But h...
I've tried everything I can think of, but I cannot get a constant buffer to update a variable in my shader in DirectX 11. I followed the examples on msdn. I read and re-read the articles on constant buffers. I even followed the nearly identical thread on this site. But for some reason I simply cannot get this to work. ...
How're you supposed to use vertex buffers? Say you have 500 distinct deformable shapes/models in the world (ie you want to be able to change/delete vertices from the models somewhat arbitraily as the game progresses). The requires you refresh the vertex buffers in the frames the model has become dirty, at least. So ho...
I'm trying to make a GUI library with SFML, and everything's done except for one problem: making the interface stay still even when the camera moves or zooms in and out. This would be easy to fix if zooming wasn't possible, but zooming out means having to scale the contents of the interface up so it doesn't shrink, whi...
When I provide the following struct definition in linked frag and vert shaders, my phone (Samsung Vibrant / Android 2.2) complains that the definition differs. struct Light { mediump vec3 _position; lowp vec4 _ambient; lowp vec4 _diffuse; lowp vec4 _specular; bool _isDirectional; mediump vec3 _a...
I'm trying to implement a 3D camera of the "Orbit around the origin" variety in a game engine I'm developing in order to learn about 3D graphics and game programming. I have a basic handle on the required math, and have implemented my own crude 3D math library and matrix stack (functionally similar to the one in OpenGL...
Enemies in this game take cover. AFAIK HL uses some logical decisions for enemy to start searching for cover and to abandon cover, and I am able so far to find them; but how does he find a cover place? I know HL has waypoints. I can only guess/speculate how they find cover point. They might search for nearest waypoint ...
It is very similar to this question: https://gamedev.stackexchange.com/questions/3789/famous-games-written-in-java Does anyone know of any popular or famous games only written in C?
I'm currently working on an isometric game using the Microsoft XNA Framework. I'm looking of resources that would be of use for making this a successful project, such as isometric engines, physics engines, sprite engines(for isometric games), event handlers for ... Any input would be greatly appreciated.
I'm making a 3D first person game. Should I give each character its own VBO or should I batch all characters into a single VBO? What are the pros/cons?
I've recently begun working on a tile-based tactical game, and I have questions regarding a couple of key moments. Is it feasible to organize the tilemap as an array of containers, which can hold the game objects? What are the pros and cons of such an approach? Should I make a single container class for all the game ob...
I am working on a large scale real-time strategy game - ideally with thousands of units active at once - but I am having trouble managing all of the units at once without it becoming astonishingly slow. The problem is that it takes a while to update the positions and states of everything each time step. Do you know any...
(This is not game programming per se, but I'm certain if I asked this on SO I'd get told not to prematurely optimize, even though history tells us every large game ends up worrying about these things.) Is there a document anywhere that summarizes the differences in performance, and particularly memory usage, between di...
I asked this on StackOverflow, but it might make more sense here: Has anyone implemented deferred rendering/shading under OpenGL ES 2.0? It doesn't support MRTs, so with only one color buffer, it's not something that can be implemented in the "usual" manner. Specifically, I'm exploring on iPad, iPhone4 (maaaybe iPhone ...
Short version Is there a design pattern for distributing vehicle labels in a non-overlapping fashion, placing them as close as possible to the vehicle they refer to? If not, is any of the method I suggest viable? How would you implement this yourself? Extended version In the game I'm writing I have a bird-eye vision ...
I'm trying to get a basic shader to work in XNA. I pass in a bool value called "TextureEnabled" to indicate whether or not it should expect some UV texture coordinates. But regardless of what I pass, it is always expecting the UV value, and it throws and InvalidOperationException -"TextureCoordinate0 is missing": Verte...
I'm writing a platform game which uses SDL for the main graphics code. There is a chance that I may be using OpenGL for the rendering at a later stage, so answers could relate to either. I'm needing a good method to include vector animations (such as a starting video) within the game. Being a platform game, I would pre...
I am learning OpenGL ES and I have setup the environment. I believe the best way to learn things is to grab a dummy project and start working on it. So what I plan to do is... Flare on a parachute http://goo.gl/8vN4R Now I want this parachute to be created in OpenGL ES with sparkling effect at its tip. The sparkling ef...
I have a number of questions relating to using a 2D physics engine in a platform game, but one main one that I'm grappling with at the moment. I managed to somewhat integrate the Physics2D.Net engine into a Scrolling Game Development Kit 2 project. I'm very pleased with the performance and the realism of the physics....
I originally posted this question on stack overflow, but realised it might be better here. The original question can be found here I'm using SlimDX, targeting DirectX 11 with shader model 4. I have a pixel shader "preProc" which processes my vertices and saves three textures of data. One for per-pixel normals, one for ...
I am developing a simple game engine (in C#, if it matters), and I can't think of a decent enough way to implement scripting in terms of architecture. It's a simple turn-based strategy with custom, logic-independent animations for battles. It has a global architecture layer for system/low-level stuff and, most importan...
(originally posted this on regular stack overflow, somebody pointed this forum out :-) ) Hi there, I'm implementing a physics engine for the simulation of worm-like creatures. Problem is, is that they're able to swim over each other and occupy the same point in space. So you have some idea of the environment, I provide...
I am having a bit of a tooling problem...and I am unsure of how to solve it. I am currently using PyGame to try and write a simple Minesweeper clone, except my sprites that I made are hexagon based and therefore have diagonal lines. I drew up a nice, clean, crisp vector sprite set which looks very nice in Inkscape, how...
Presumably a development machine for sure, but would it contain any sort of editor (of any kind)? Or are there any editors in existence that work with the SDK that are commercially available?
Possible Duplicates: Game programming books that don't teach programming? Must read game development books Does anyone know any good language independent game programming books? I don't currently know anything about game programming or practices - any good books on stuff like: scene-graphs, handling sprites, layers,...
I'm writing a component-based entity system and one of the components is the entity's state, which dictates how it reacts to game events. In case anyone has experience with implementing states, how granular should they be? To give you an idea about how granular they are in my case, I have a WalkingLeft state and a Wal...
In XNA, the spritefont technology is horrible. Nuclex does the job so much better, but I don't want to have any external references, and I'm nearly done with my game. When using fonts like Sansation or Quicksand, it looks terrible in smaller sizes of the fonts. It's so bad! Is there a known workaround for this? I tried...
I have coded myself a OpenGL BSP viewer for an old game format. It is very similar to the Quake 3 file format. Because my interest is developing graphics engines, I want to be developing while looking at using current technology. So I turn to you, the experts on the subject for direction of what to focus on. I would li...
So I love javascript as a language and how it is able to be run anywhere. I'm gonna enumerate my concerns: Does it make sense to make money from javascript? I mean, the second I publish my game online, people can download it, and post it on their own site and put their own ads into the game. There are rumors that Faceb...
Sfxr (and also Bfxr) is a great tool for generating sound-effects for games. Is there something like this for speech synthesis? Not every game development tool and platform has a speech synthesis engine, and it would be great to at least get some decent-sounding placeholders in place to see how the usability/experience...
I've been using box2D for a few months, but I now badly need a physics library which can use boolean shapes (ie; cutting a circle out of a square) and/or curved surfaces. Does anyone have any suggestions? Edit: Language is c++
When my data (vertices, textures, et cetera) is purged from VRAM, how I can know that?
I have computed the four corners of the viewable bit of 2d map in my 3d view. So I know the trapezoid that is visible, and I want to 'visit' these tiles in my map. So my algorithm is basically a convex polygon scanline fill, specifically with four points. However, I have trouble finding simple sample code to borrow; a...
Possible Duplicate: How do I detect ledges? I'm working on a 2D platformer using XNA and Farseer. I would like the player's character to be able to grab and climb up ledges. Detecting a collision between the player and the side of a wall is simple enough with the OnCollision delegate, but I have to admit I'm a bit s...
Is it possible to use OpenGL purely with C instead of C++? I am wanting to make sure there won't be any problems with my using C and not C++. OpenGL does not depend on any C++ libraries right?
What should I use to handle input? I am wanting to use OpenGL so that my games are cross platform. DirectX provides input libraries, and OpenGL does not. Because my games need to be cross platform, I cannot use DirectX's libraries. What should I do, or what is the common solution to this type of problem?
I want to use Python as a scripting language for my game, can I use it purely with C (not C++)? It is important to me that I not use C++, and purely use C instead.
A tutorial that I have followed had me collect and blit all of my sprites with the following lines: allsprites = pygame.sprite.RenderPlain((l_sprites)) allsprites.draw() At the moment, this is fine for me, as all of my sprites make use of the same base image. However, I find myself in need of having various sprites an...
I was thinking about how to organize the stage about getting informed about whatever game is needed to develop, what would others do. For example, if I wanted to develop a game about car racing, I should figure out all the factors during the race, from the car factor to the pilots, etc., environmental factors like weat...
What is the proper way to pay your team for a game development project? For example, how would you pay to a graphics artists or a musician for their work, especially in the context of today's app marketplaces like the Apple App Store or the Android Market? It is better to pay in advance, or to share the incomes proport...
After spending time today to jot down some notes regarding the implementation of walls into my tile-based game, I've suddenly realized it's not going to be as simple as I imagined before. While the current stage of my work is not even close to actually making the wall-related code, I've come up with three different way...
I'm trying to learn how to use VertexBuffers in XNA 4.0. I can render wireframe shapes and I can render textured shapes. However, I'm having some trouble rendering them both at once. I'm initializing the buffers like this: vertexBuffer1 = new VertexBuffer(graphics.GraphicsDevice, vertexDeclarationWireframe, numPoints...
I'm starting development on a 2D overhead RPG game, and am wondering what the best approach for handling weapon collision and dealing damage to enemies is. I'm currently using a basic Entity/Component structure for my game objects. I have a CharacterEntity, that has an EquipableEntity data member. The CharacterEntity...
I convert the image into texture in a thread using the following line of code to reduce the image to texture converting time. [[CCTextureCache sharedTextureCache] addImage:@"imageName"]; But when i retrieve this image from cache i am getting a blank image. If i am calling the above line of code in main thread i am gett...
This is cross-posted from StackOverflow, please feel free to answer there too: I'm working on a real-time isometric RPG in python, and wish to target mobile devices as a platform. The main area where I'm having difficulties is with my pathfinding. I have tried a few algorithms including A* and a few tweaks to better fi...
I'm using vertex array to draw 2d geometry, but I can't achieve smoothness. This is the code I'm using: glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColorPointer(4, GL_UNSIGNED_BYTE, 0, shared_colors); glVertexPointe...
Consider A* searching on a tile based map. A straight forward code would be: If there is an unit inside that cell, then it is unreachable, this is ok. But there is map resolution issue. When I look into Warcraft 3, there monsters and structures does have different radius, and you can walk very close, which is more like...
I'm blanking on this one. I can anchor stuff on edges of course, that would make my UI resolution independent...until it changes so much that the graphics are too small. How do I scale appropriately whenever needed? How do I keep my graphics at the right proportion while scaling? I don't want them stretched if the reso...
I need to write a program that will solve maze. Maze has graph structure, where each node - some room, and edges - exits to other rooms: Specification: We start from a random room. Maze has dead-ends, 0 or few exits. We don't know anything about all maze, only the number of current room and list of doors from it. Whe...
I want to make an Event scheduler for my Game, I basically want to be able to schedule the triggering of a Game Event. This can be a one time trigger, or a periodic trigger (trigger event "E_BIG_EXPLOSION" on a 5 seconds basis...). It is tempting to think that this may be a good place to use a Singleton, but singletons...
I ask this because I'm curious to know from people who actually support themselves by making games, if their project management skills contribute to determining the success of a project? I also have this feeling for some reason that having too much project management can strangle the creative process. Maybe there is a ...