instruction
stringlengths
33
29.4k
I am using C# and XNA. My current algorithm for lighting is a recursive method. However, it is expensive, to the point where one 8x128x8 chunk calculated every 5 seconds. Are there other lighting methods that will make variable-darkness shadows? Or is the recursive method good, and maybe I am just doing it wrong? ...
I have an entity in 2D space moving around, lerping between waypoints. I would like to make the entity rotate around its own origin to face the current direction that it is going, I.E. towards the next waypoint in the list. In case the waypoint movement code is needed, I'm using the following (this is contained inside ...
My game has a day-time association with the scene, that the morning light will be different from the afternoon and the night. But I don't know how to make this difference. Here is an example in Pokemon game: I have an idea that put a layer on the top of the game with the transparency about 10 - 20%, and change its co...
I'm still in high school, and I've been playing games for 12 years, and I've always wanted to eventually learn level development and design, and programming. However I'm no good at art and as of now have absolutely no education what-so-ever about either of these things. I was wondering which fields of study should I br...
I am working on a smooth terrain generation algorithm in C# and using XNA to display the data. I am making it so it creates a new point halfway between each point per iteration, at a random height between the two. This works OK, and I am getting the current result, randomly placed points. Now what I want to do is turn...
Is there a free and unlimited open source 3D engine for Android? Something that is a direct, thin layer to the NDK? I have only found two engines: Unity and Shiva 3D. But no free or open source ones.
I am working on a brick breaker style game (i.e., like Arkanoid) in C#/XNA. As I add more features such as powerups, special brick types, etc I am running into problems figuring out how the whole game should be structured. For instance, I have a static CollisionManager class that my ball objects call each update to che...
In my game there is a large 2D map of various objects. Example. As you see, upon creation objects of the same type (trees for example) are placed correctly, but objects of another type (enemies) are placed on top of the no matter the position. Now, how can I arrange that everything is drawn according to it's position? ...
I'd like to write a small physics game by using ActionScript, but do not want to write my own physics engine. Does anyone know a ready-to-use 2D soft-body physics engine with a Flash port?
Let's assume we have a game where the code is GPL-licensed, and all the resources (like music, textures, etc.) are licensed under the CC-BY-SA license. Now, the first issue would be that the GPL is not compatible with the CC-BY-SA, but since it only applies when actually linking code, it's okay in this case. Am I right...
I am making an overly simplified version of a stock simulator game, because I: am fascinated with how the stock market works learn better & faster from a project like this, rather than text-books Before writing any actual code, I started making an Excel spreadsheet to simulate the fluctuations of 1 company's stock ba...
I am making a side-scrolling platformer game in Flash (Actionscript 3.0). I have made lots of progress lately, but I have come across a new problem. I will give some background first. My game level's terrain (or 'floor') is referenced by a MovieClip variable called 'floor.' My desire is to have the Player and enemy cha...
I'm doing some research on geometry shaders and am having problems finding code examples/tutorials that does not use one of the extensions introduced before it was core functionality of OpenGL 3.2. I'm looking for more modern approaches that doesn't use an extension. Can anyone point me in the right direction? I've ...
So I'm writing a Chess matchmaking system based on a Lobby view with gaming rooms, general chat etc. So far I have a working prototype but I have big doubts regarding some things I did with the server. Writing a gaming lobby server is a new programming experience to me and so I don't have a clear nor precise programmin...
Can you help me choosing the right tools for this project? It's a 3d browser based multiplayer online fighting game. A few 3d functions are necessary for positioning, but no heavy rendering will happen. It needs very low ping rates, though, as it will be very dynamic. HTML5 + three.js + some networking lib seems like a...
Is there a name for this technique where when instead of rendering certain polygons, you just calculate a few key points and do the drawings in 2d? For instance, instead of rendering a sphere, you just calculate its central vector and draw a 2d circle? And what are the situations one can benefit from it?
Are there techniques for simulation of cloth and hair in an efficient (in other words, not too CPU-intensive) manner? I only need to calculate the key points as the drawing will be done in 2D.
I am developing a multiplayer game, similar to Castle Crashers. This is the first multiplayer game I do so, before starting to code, I am trying to learn what's the best way to do it. I found some documents explaining how some old FPS (Half Life, Quake) work but I can't found anything newer or more similar to the game ...
I am creating a game using C#, GDI+ and Raster images (2D images). For performance sake, I believe that I should have the game change the user's resolution to 800 x 600 and run the game in that setting. However, the graphics look distorted in a wide screen since the aspect ratio for 800 x 600 is different than from a...
I'm putting together a simple hex map to use within an HTML5 / Canvas / JS game and before I get round to sorting any custom graphics, I was wondering if anybody knew how to make the pink/magenta backgrounds transparent so that I can overlap my tiles? Cheers!
I'm familiar with quaternions... have used them in the past to model arbitrary rotations in 3D, as for a plane flying around with full pitch/yaw/roll freedom. Works great. Now I'm working on a 3D puzzle where the rotation is "quantized": all rotations are whole multiples of 90 degrees. I could use quaternions, but it s...
I am experienced with traditional JS and HTML but new to HTML5. I want to develop games in HTML5 so that it can work on all devices and browsers, including IE. Additionally, I require the following features: Physics Engine Animation Some AI Vector drawing and manipulation Better user/player controls, et cetera I know...
If you use triangle_adjacency as the input type of a geometry shader, do you need to do something on the client side besides make the primitive mode triangle_adjacency? Basically what I'm asking do you need to do anything in your application to make the adjacency information available to the geometry shader besides set...
I would like to create or use an existing JavaScript engine to build a game in the spirit of Dungeon Hack, Eye of the Beholder and older Might & Magic games. Going off my memory playing these games there could be 6 different bitmaps to each cube, and each side may have an additional decoration or other game object over...
I am using DrawIndexedPrimitives() for drawing a loaded 3D model by drawing each mesh part, but this process makes my application very slow. This is perhaps because of a very large number of vertex/index buffer data created in video memory. That is why I am looking for a way to use the same method for each model mesh ...
I've been trying to get a simple Hello World working with ClanLib using CDT (Eclipse), but I'm just not getting it configured properly. First, from the command line, I'm able to get it to run using this command: g++ -o mygame mygame.cpp `pkg-config --cflags --libs clanCore-2.3 clanDisplay-2.3 clanGL-2.3 clanGL1-2.3 cla...
I'm interested in creating a retro look for a game, and I'm currently in the process of deciding just how retro (which generation/console). What would make it easier would be if there was some sort of wiki/document on the limitations of each console, such as maximum number of colours total, maximum per sprite, number o...
I really don't want to be boring, I searched a lot but didn't found a focused answer to this question. I wanted to focus on the role of C++ in graphics programming. Can somebody explain, which are most likely/ most often used C++ features (such as data structures), which are used in graphics programming? I am suppo...
I want to model simple lottery machine, it has got a bottom blower. Do you know how can I get force applied to object above blower by air from blower, or equations to model this behavior? Red arrow is blower "wind"
I've recently decided to revamp my game architecture to get rid of deep class hierarchies and replace them with configurable components. The first hierarchy I'm replacing is the Item hierarchy and I would like some advice to know if I'm on the right track. Previously, I had a hierarchy that went something like this: It...
I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, that you rotate about a point; you say you rotate about an axis. So I'm visualizing it as rotating about a vector whose t...
Let's say you have a team building a decent game and all is well technically and people-wise. You feel pretty sure you'll get to a product that can be sold. How does an indie studio (with good practices in this domain) typically manage the IP, esp. trademarking and copyrighting? When's the right time to do this, early ...
I am using AndEngine to create a 2D Game for Android platform using Java and AndEngine. I have learned how to use Tiled editor to create tiled maps. The only problem I am having is that I don't know how to place an object such as a character on the ground, and have it count as the ground. How do I go about doing this o...
http://vimeo.com/2461697 Hi everyone, I'm trying to create an effect like this, the underwater effect (water distortion). I've looked around and I've seen references to "water caustics" but I'm not sure how to create this in Cocos2d or if it's done with obj-c only. Thanks.
About These are actually two questions in one. First of all I am looking for a way to efficiently store large amounts of tile data. The other aspect deals with querying the data set and displaying tiles. Let me give you some background first. We are making a browser based multiplayer tycoon game using the CraftyJS libr...
Real-time, high-resolution voxel raycasters tend to use one of the following optimising data structures in order to achieve interactive frame rates. What are the pros and cons to these, and what other approaches are you aware of? Octrees KD-Trees Uniform 2D grid with run-length encodings for 3rd dimension (as used in ...
Am considering porting over from XNA to the Stage3D API's (Molehill). So as a performance examination I've implemented sprite-batching, but the performance is not all that great, while with XNA i can easily draw up to 500 000 quads but with my Molehill implementation i can draw around a measly 1000 quads and while a ra...
I am looking for literature - or a simple explanation - on how the Farseer (and for that reason, the Box2D) collision detection system works - specifically the logic that comes after the broadphase culling: What data structure does it use? How does it use that data structure to determine if a collision has occurred? H...
I am trying to draw the 2D graphics (like line, polyline, polygon etc.) using Direct3D for drawing I am using LINE_LIST. Now I want to make the lines thicker and apply patterns to the line as described here. I am able to draw the thick lines using a geometry shader to draw a quad but to apply patterns I need to write a...
I am a developer and when I think about the creation of art assets I am a little lost. My idea is to create concept art first to get my thoughts into real images and after that start creating the backgrounds, sprites, menus, etc. It sounds simple written like this and I expect lots of inner work, but is there a more fo...
I was looking around at this site about eight months ago and wish I saved the location of this topic but I was wondering the different map rendering styles that you can do in XNA. The one style I looked at was using a text file to pull characters like "X" would be a monster and "O" would be the player. Is there anoth...
I'm from Brazil, and I want to take a short course on game programming, 2 months at most, in a country that lectures are given in english. I'm almost a BSc in Computer Science alredy. Can you tell me what you think about this courses? What are some good courses in that format?
I'm creating a game in jQuery, where I use about 10000 32x32 tiles. Until now, I have been using them all separately (no sprite sheet). An average map uses about 2000 tiles (sometimes re-used PNG's but all separate divs) and the performance ranges from stable (Chrome) to a bit laggy (Firefox). Each of these divs are po...
Using socket.io, I have a communication similar to that of other MMORPGs, a steady connection with messages. In my design so far, the client sends the player's position and animation frame with every update frame. When the server gets that message, it broadcasts it to all the clients, which will then move the graphic a...
In online games, people prefer to log on and off whenever they want. Usually, their game achievements are seamlessly saved, on the server. That is not that difficult to achieve, but I am wondering how can be done in an efficient way that makes sense and will scale. Does it make sense to save the player's coordinates an...
How would you go about determining a players position server side based off player input? The Setup: Player sends packet to server containing the command and view angles. Server takes the direction and multiplies it by speed. Say a player is going up a hill. How would the server make the players position reflect that ...
How would I go about creating NPC Events/Scenes? For example, any RPG will have a ton of different in-game cut scenes where you can express a story line. What I have thought of so far is having different triggers and a number indicating the state of the story the player is at. When the player hits one of these triggers...
I'm building a Javascript + canvas game which is essentially a platformer. I have the player all set up and he's running, jumping and falling, but I'm having trouble with the collision detection between the player and blocks (the blocks will essentially be the platforms that the player moves on). The blocks are stored ...
I have a camera class, that is suppose to chase my player, which works, but its really really slow. It only has this line of code, which makes sense to me, player moves, camera moves. Any idea of why my game runs slower. void Update() { transform.position= new Vector3(player.transform.position.x, player.tran...
I'm wondering if it's possible to use or hack Bullet 3d Physics (or another free 3D physics engine) so that I don't need to "import" my static geometry into Bullet - instead I want to do it the other way, so Bullet uses some sort of callback system to check geometry properties of my mesh/polygons. Sort of like that Bul...
Is anyone aware of any example photo hunt/hidden object games either in HTML and Javascript or flash if necessary? I am having trouble finding one, I may be using the wrong words to search. Photo hunt being like the wheres wally/waldo books where you look for wally in a complex image until you find him. So if it were p...
I'm using XNA 4.0. How can I load and save settings when on the Xbox? And can I write to and read from files?
I have been having great fun playing Battlefield, and am blown away by how it all looks and sounds. I was just wondering what a game engine starts life as. At what point of writing code does it finally do something, and what did it do before it started rendering all the textures, light and particles, perfectly? Are the...
Had been any efforts made to stream real-time sound from the microphone (user's voice) into the game currently played? This way you could hear echo of your own voice when you walked into enclosed space, strong or faint voices in a multiplayer game depending on distances between players, ...
I wanna draw a line between two moving objects I can't use: cDrawLine(startPointCG, endPointCG); because the line must have a length. So I'm trying to measure the angle between those two points and then trace a line from start point towards that angle. Something like this: CGPoint endPoint = CGPointMake(startX + cos(...
I need a C/C++ engine that should be really cross platform (or at least windows, android, and iphone). The 2d engine should be written in C or (better) C++, should permit the rendering of animated sprites, permit transparency, collisions (but I can integrate box2d for that), rotations (eventually with opengl support to...
I am rotating a group of sprites in XNA, which I developed with the help of the following example: http://msdn.microsoft.com/en-us/library/bb194912%28v=xnagamestudio.10%29.aspx It all works very well, however, the rotations rely on a point of origin, which it will rotate around. The problem is that I do not know how ...
I've got a bunch of objects of varying size and velocity which gravitate towards each other. On every update, I have to go over every object and add up the forces due to gravity of every other object. It doesn't scale very well, is one of two big bottlenecks I've found in my game, and I'm not sure what to do to improve...
I'm looking to find some software options on OS X that are geared toward writing game scripts. Features like the ability to craft dialogue trees and other non-linear script formats would be appreciated. I own Celtx and love its ability to store character information along with various other media assets, but it's very ...
I'm looking for the safest way to archive and store a GKScore that needs to be re-submitted to Game Center (say, because the user didn't have a network connection at the time the score was earned). I would like to archive the GKScore instance in case the app is terminated before it can be successfully re-submitted to ...
Possible Duplicate: Legal issues for a “fangame” of a commercial franchise? For example, some of you may have seen Portal: The Flash Version. I was wondering what the legal background on this kind of stuff is, for example what legal things I'm supposed to say, give credit to the original's creators and all. Obviousl...
I am using multithreading in my XNA application and run my update logic s in a update thread(witch is a worker thread) and rendring is being done by main thread, now the problem is updation is required there on keyboard event, and key Board handling can be done only in main thread. Note that my application was single t...
I have trouble coming up with a system of assigning a rating to player's performance. Well, technically there is is a trivial rating system, but I don't like it because it would mean assigning negative scores, which I think most players will be discouraged by. The problem is that I only know the ideal number of actio...
As an independent developer, I would like to know what platforms I can use to reach what consoles, and under what prices. I'm assuming a small team (1-3 people) and low or non-existent budget (under $1000). For the purpose of this question, a "console" is "anything other than a PC." So this includes mobiles phones and ...
UPDATE The error here was a pretty simple one. I have missed a radian to degrees conversion. No need to read the whole thing if you have some other problem. I looked at several tutorials about this and when I thought I understood I tried to implement a quaternion based camera. The problem is it doesn't work correctly, ...
I'm currently building a top down 2D tile based game using OpenGL. There are three tile layers, the background layer, player/sprite layer & foreground layer. The foreground layer is pretty much used to place translucent tiles that give the impression of a shadow when blended over the two underlying layers. The problem ...
Another developer and I have begun to experiment with the Unreal Development Kit and have installed the UDK to our local computers. He's been toying around and experimenting and has some basic code and assets already developed. We want to set up a VCS repository so we can collaborate on development of a UDK project. So...
I was reading chapter 4 of the Arcsyntesis OpenGL tutorial when I came across this line in the GLSL shader. vec4 cameraPos = position + vec4(offset.x, offset.y, 0.0, 0.0); About it, the tutorial says The first statement simply applies the offset to get the camera space positions of the vertices. I understand what c...
I work on a strategy game, where the player occasionally has to transform ordinary citizens into the so called "leaders". Leaders are temporary units, which the player can control directly, in order to interact with the other citizens. After some time, the leader gets transformed back to a normal citizen. My question i...
I'm looking for pseudo-code examples of the A* pathfinding algorithm that actually works. I tried plenty of different ones where it's not really clear how to implement them at all times. Keep in mind that I'm a newbie, so if everything could be detailed, that'd be great.
.VXL .VOX .KVX .KV6 .V3A .V3B I am trying to decide whether it's worth going with any of the above, or some other, or if I should roll my own. The deciding factors in order of importance are: Animation support (I am aware this is a difficult aspect when it comes to voxels), using voxel deltas or numerical transform ...
I have some text in a spritefont and I need to know the height in pixels. I would have thought that MeasureString() would get me close to it, but it seems to just be about length.
In my game, I deal with a lot of units. Every unit implements a state machine, and changes states quite often. As a result, I'd like to keep my states as singletons, since I want to avoid the creation of one and the same state over and over again. This works quite OK for most case, except when I need to introduce some...
I'm developing an engine in XNA and would like to have two different ContentManagers: one for the game (sprites, sounds, etc.) and one for the engine (shaders, dlls, etc.) Right now, I have this: using Microsoft.Xna.Framework; .... public class Engine { public ContentManager GameContent; public ContentManager E...
I'm doing a android game project that has a character that can do basic movements like step, turn left, turn right, raise left arm etc. When combining those moves together, the character can do some complicated movements like a dance routine or so. I'm banging my head to figure out what to do about the graphics. I can ...
I've read a couple posts on the subject and it sounds hairy. But I think people are talking about using STL containers for Objective-C objects. I'm using pure C++.
Trying to write a basic script to attach to the player on Unity 3D, I want them to move forward automatically. I'm guessing that will be part of the Update function and using transform, but that's about as far as I get. I'm assuming it's a Transform.translate function too, but not sure what parameters to use to move fo...
I'm trying to figure out how to render my scene to a cube map. I've been stuck on this for a bit and figured I would ask you guys for some help. I'm new to OpenGL and this is the first time I'm using a FBO. I currently have a working example of using a cubemap bmp file, and the samplerCube sample type in the fragment s...
I have a line ahead of my moving object to serve as a raycast and its aligned with the object's movement direction. But I want also some extra lines according to an angle related to the 'head' of the moving object. This position is always changing; I also have a velocity vector to see the direction of the object as wel...
I've recently implemented slope collision detection for my project. The issue I'm having is that the character occasionally passes through the line. This usually occurs when the characters MoveAcceleration is increased from 5000 to 8000 via a game mechanic. I was wondering if there is a way to make the line collision ...
I asked a question about implementing components here: Am I on the right track with this component architecture? But I had more questions I'd like to ask. What's the best way to actually enforce the effects of components? For instance, I have an item object, and an optional HealingComponent. The HealingComponent allo...
What special requirements are there for making game art that supports High Definition? Does it require big changes in the way you model or texture your game objects? For instance, do models need really high resolution textures to support HD? If so, how high? And do you have to have a particular game engine that support...
I need method or group of them to send signals to any application (browsers, games, et cetera) about mouse movement or key input. I can easly retrieve an IntPtr to any process, but I don't know what library or function I must use next. I know only about SendMessage/PostMessage functions from user32.dll, but these fu...
The C++ engine I'm working on currently is split up into several large threads- Generation (for creating my procedural content), Gameplay (for AI, scripts, simulation), Physics, and Rendering. The threads communicate with one another through small message objects, which pass from thread to thread. Before stepping, a th...
I'm a web developer looking into game development as a hobby for fun and the challenge. I have just started learning blender 2.6. I am currently doing a tutorial at http://cgcookie.com/blender/2010/12/22/modeling-a-building/ at around 9:30 after making loop cuts he scales a column. I cant get the same selection as he d...
I'm new to Nifty GUI, so I'm following a tutorial here for making popups. For now, I'm just trying to get a very basic "test" popup to show, but I get multiple errors and none of them make much sense. To show a popup, I believe it is necessary to first have a Nifty Screen already showing, which I do. So here is the Scr...
Assume a Direct3D9-based 2D game, high resolution, very busy. Performance critical. A particle system has 2,000 particles. They are scattered throughout the world with only a subset visible on screen at any time. Thus the global array of particles contains a lot of particles that won't be rendered this frame. Obviously...
After reading documentation and tutorials about fmod I still have a question about frequency ranges. I've found how to get a frequency range using low and high pass DSP at the same time on the main channel, but I can't find how to get several ranges at the same time. For example I want, for a specific phase of my game...
I was hoping if you could help me out here. I'm developing a 3d table tennis game, and got the collision detection working perfectly when the ball hits the racket. However, now I would like the ball to move depending on where it hit the racket (example if it hit the far left side, it goes to the left etc..) Heres the c...
I know HTML5 is great for web games, but I don't really know if it's possible to develop online games with multiple users, keeping everybody synchronized and handling logins, et cetera. Is it possible to do this?
I'm searching a 3D physics / transforms animation editor. It should be able to import 3D meshes from OBJ or FBX, then it should be able to animate transforms. I need such a tool for my 3D games, where many dynamic and inorganic elements appear, like doors, traps, robots, lifts, and so on. Where I can find such a tool? ...
I'm a beginner programmer and I'm creating a project which allows me to walk around rooms via a first person camera. So far, I have the buildings drawn and on, but now I'm stuck and don't know how to make a first-person camera to allow me to walk around. Could anyone point me towards a camera class I could use, or som...
I want to change color of individual model in my game. But when I use effect.DiffuseColor = newColor then all of models which were loaded from same model file change color too. How can I do ?
Aimed at the professionals who are there in the industry, what is the game development market shifting towards? Web-based or Mobile or Consoles/PCs. I have developed a decent knowledge of JavaScript and html5, so I want to know if this is entirely useful(on a game development perspective) or maybe I should learn some o...
I want to develop simple RPG with ray casting rendering. I chose SDL for graphics and input. The problem is there is no native line drawing in it, which I need to start prototyping a ray casting engine. I know about SDL_gfx, which can do this, but I am asking if there is any alternative to SDL with primitives drawing f...
How can I load 15-20 sprites in Cocos2D at the same point (ccp(20,20), which is an alias for CGPointMake) using NSArray? This is what I'm doing now, and it doesn't work: int i,endvalue=3; NSMutableArray *levelStar = [ [NSMutableArray alloc] initWithCapacity:9 ]; for(i=1;i<=endvalue;i++) { CCSprite *star = [CCSprite...
I have a problem which I am struggling to solve. I have a large map of around 100x100 tiles which form an isometric map. The user is able to move the map around by dragging the mouse. I am trying to optimize my game only to draw the visible tiles. So far my code is like this. It appears to be ok in the x direction, but...
I was reading this answer on the type of math a game developer should know and this part really stood out at me: How do I move my game object? The novice might say: "I know! I'll just do:" object.position.x++. That is how I would think to do it so I guess that shows my skill level. At least for the types of 2D side-s...
I'm practicing some simple techniques with Java swing games, to learn the basics. Right now I'm practicing how to move a sprite... but it's not working! whhyyyy Here is what I've come up with so far (Main class): public class GraphicsPracticeDrawing extends JPanel implements Runnable{ private CoinSprite coin2; private...
I am sorry, because I know, that this question came up before, but that thread doesn't help me so I decided to aks my own question. My problem is the following: I have a XML-file with the following content: <?xml version="1.0" encoding="utf-8" ?> <XnaContent xmlns:Generic="System.Collections.Generic"> <Asset Type="Syst...