instruction
stringlengths
33
29.4k
In the past I have used Content.Load<type>("filename"); all over the place. This quickly becomes a nightmare to manage and worse you start having multiple copies of the same asset loaded in several different places. Then I moved on to using a Resources class which basically looked like the following: public class Resou...
Does it make sense to try to offload a large nonlinear level into file-based chunks, and load those on demand? We've implemented level chunking to improve rendering performance, but still all level objects are persistent in RAM. If yes, then how do we keep the illusion of a living/changing world? Since the level is not...
I am developing a 2D game for windows phone using C# and XNA. I have a list of screens managed by an engine. each screen has a list of components like 'camera', 'skyBackground', 'landBackground', 'units' and so on. All those components inherit from an interface 'IComponent' which has the following: public interface ICo...
I have a top down 2d game where the AI spawn at the edges of the map and run towards the center. I'm using A* and a node mesh to do the pathfinding. Right now, the AI spawn at a point on the edge of the map and all take the same path which is the shortest route to the center. Now I want them to be more surprising and i...
SecondLife/Opensim uses Primitives to construct models. How it works in details is explained here. Now I have many triangles which link together. Is there any way to make them into one prim, thus reducing the number of prims?
I'm rigging up a man in 3DS Max 2012, but I'm having some envelope problems. I have this man, but I can't ever seem to catch those nodes along his inner thigh so they protrude, as you can see in the picture. I've tried adjusting the numbers in Radial Scale, Parent Overlap, Child Overlap, Strength, and Falloff, and ev...
Is it still worth it for a game developer to try and support older devices: iPhone 3G and earlier or to support older OS: iOS 3.x and earlier? Or is it recommended to make use of OpenGL ES 2.0 supported be the iPhone 3GS and above? Do you know what percentage of users still use those earlier version of devices/operatin...
Lets say you have an animation that you want to happen when firing a bullet. How would you get the bullet to show up at the end of the animation. The only thing I can figure out is to know the time length of the animation, and delay setting the bullets position and setting it active until that amount of time has pass...
How would one perform collision detection between a simple scene like the one below and a simple object like a sphere? I assume the best solution would involve convex hulls in some way but I have no idea how that works (still learning :)
I'im thinking of building a text-based browser game. A racing game.like F1 or rally. users can set-up a car. thinks like tyres, fuel, driver,brakes. every attribute gets a value. the part where i am stuck is the race. i think a race exist out of corners, straight parts, hills,... i have no idea how i can come to a so...
How do you make it easy for your artists to author content for an HDR renderer? What kinds of tools should you provide, and what workflows need to change, in going from LDR to HDR? Note that I'm not asking about the technical aspects of implementing an HDR renderer, but about best practices for creating materials and l...
I've recently started porting some old rendering demos I did to modern OpenGL. I had a debug drawing class in my old code which used immediate mode glBegin(), glEnd() etc. for rendering debug objects such as triangles, cubes and spheres etc. Originally I replaced the code in these functions with code to generate the VA...
When I'm working on a project in XNA I copy the using statements from file to file. However, on tutorials I've seen for various games, they show files that only have specific using statements used. Do the other statements cause problems in the event the program doesn't need it? I want to avoid any future problems.
Now this might sound like a silly question and I apologize if this sort of question is not suited for stackexchange. But I am genuinely wondering this, and I feel like I get alot more proffesional awnsers on here. I'm getting into game development and have only worked solo since my study is not primairly about games. ...
I am just starting to do some very very very basic game dev(in java), i'm trying to create a game of tic tac toe but i am having some trouble implementing an a computer opponent.I just wanted to know if there is anyway to do this other than check every possibility with if statements.This is my best attempt at this but ...
Further to my previous question on fixed joints, I am now going toe-to-toe with hinge joints in 2D physics. Though the answer to the previous question was excellent, I have come across a few problems in extending it to hinge joints. My approach was to extend that given here by implementing the following algorithm: Fin...
These days I am trying to design architecture of a new MMORPG mobile game for my company. This game is similar to Mafia Wars, iMobsters, or RISK. Basic idea is to prepare an army to battle your opponents (online users). Although I have previously worked on multiple mobile apps but this is something new to me. After a l...
I have made a dragging sphere which drags, problem is how can I drag it using keyboard keys , I dont want to build it again on iphone simulator after experimenting with my code. for dragging it is not accepting mouse or any keyboard keys. Is it possible ?
I have plans to write a game in Python and probably some SQL. I'm concerned about how versatile my program will be when I finish it, ideally I'd like it to run on Windows, Mac, Android, and iPhone... however I have a feeling the phones would be off-limits for this sort of thing. How would I go about writing a program t...
What are the current techniques than can be used for efficiently rendering 3D heightmap-based deformable landscapes? For example, in the non-deformable landscape problem, ROAM used to be the way to these landscapes, but as GPUs advanced it lost favour to the newer geomipmapping/clipmaps (which is not as CPU-bound; but ...
I want to use SimpleAudioEngine for the music in a cocos2d game I'm working on. When I import SimpleAudioEngine.h in my game layer I get syntax errors in CVPixelBuffer.h and CMFormatDescription.h. I've created a new clean cocos2d application and imported SimpleAudioEngine and it worked just fine, thus the error is in t...
I have experience with XNA and Unity3D. I have also built my own engine with Tao and C#. I am in last year of college and I want to make a small RTS game demo, nothing fancy I won't bother much with the art part. I will leave objects untextured, just drop some light. It is a big decision, which one to choose XNA or Uni...
A friend of mine and I are planning a game together to work on in our free time. It's not an extensive game, but it's not a simple one either. He's working on the story behind the game while I'm working on the graphics and code. I don't really know where to start with the game. We know what the basic type of game it's ...
Alright, some day in the far future I would love to independently release my own game. My question is, what is the minimum amount of familiarity I need with copyright law, software patents, and other forms of intellectual property in order to protect myself and property while not accidentally infringing upon another co...
I've got a job to make an engine and light game for canvas in HTML5. I like the things I make to be centered on the x,y positions I give it, I don't know why, it just helps me think about them clearer. I've got it set up for rectangles, all I had to do was subtract half the hieght and half the width from the x/y suppli...
I've been working on a tower-defense game for some time now, and so far I am really satisfied with the results. However, there's one thing I'd like to add. I've seen a video of GeoDefense for Windows Phone 7 here: http://www.youtube.com/watch?v=YhPr4A4LRPQ Notice how (when a unit gets killed or a projectile hits a unit...
Detecting collision with rectangular objects is quite easy. I am able to write simple tile based games. Now I want to learn to write non-tile based games in which objects may not be rectangular, for example, a mountain. Suppose I want an uneven terrain with hills and mountains how do I store the shape of the terrain? A...
I was trying to compile the Irrlicht port for Android but I continue getting errors while following these instructions. I created a jni folder inside my project folder and the contents looked like this, PROJECT/jni/Application.mk PROJECT/jni/l.sh PROJECT/jni/MakeAndroid.py Then I went into the console and navigated to...
In my game, there are plots of land with buildings (houses, resource centers). Buildings like houses have tenants, rooms, add-ons, et cetera, and there are several values that have to be simulated based on all these variables. Now, I'd like to use AndEngine for the front end stuff, and create another thread to do the s...
I'm making a tower-defense game for Windows (not phone) in XNA. I've seen this video of another tower-defense game for Windows Phone that uses particle effects, which I really like. They change color, glow and density as they move away from the explosion. Really cool stuff! http://www.youtube.com/watch?v=YhPr4A4LRPQ&hd...
I'm trying to make a clone of brick breaker, one problem that I am running in to is to do with collision. I know how to detect if a collision has happened but I do not know how to check what side of the brick is hit. Some general background from the program. all the bricks are just 2 points (x,y) a top right point and ...
I've got an audio library for Silverlight that is in need of some acceleration on slower machines. Specifically, this library makes extensive and repeated use of the FFT transform as a part of its acoustic echo cancellation and noise reduction algorithms, and I'm wondering if it would make any sense to use the GPU for ...
I created an installer for my XNA demo in the hopes that people could just download it and use it. It runs perfectly on my computer, however on others, it installs fine, but the demo doesn't run and has to close. The included dependencies are: DotNetFX35 WindowsInstaller3_1 and XnaFxRedist31 The Demo also makes use of ...
I've a class that creates a cube using VertexPositionColor and these vertices are stored in a VertexBuffer. Now i would like to dynamically change the color of my vertices. In my class i have a reference to a VertexPositionColor array wich contain all my vertices. I've wrote a SetColor function wich accept a Color in ...
Say you create a person, monster or robot, with arms, legs, head(s) ... in 3D in a game. How do you coordinate the body-part movement to achieve the fluidity of real living beings? Is there some theoretical base, or do you just try until it looks good enough? To put the question in a more precise context, I haven't got...
I have heard about Flash Builder 4.5.1. As I have understood, one can make an application using Flex with Flash Builder 4.5.1 and also export the release build for iOS, Android and Blackberry. Is it possible to include Bluetooth functionality in an application this way?
I am developing a game in android, by extending a class with view. I have integrated OpenFeint in it by studying the tutorial provided on the OpenFeint site, but I am not able to add the leaderboard feature in my app. How can I achieve it? My game class is like this public class GameActivity extends Activity { Inten...
I am in last year of college. I want to get a job in games industry as programmer but I don't want to do low-level programming. I want to do something AI and machine learning related. Am I in the wrong industry? Should I change focus to other jobs other than games industry? By low level programming I mean, for example...
I am using DirectX10, June release and I am trying to #include <DirectXCollision.h> so that I can use the bounding objects, however it does not seem to be there. Am I missing something basic?
What are various ways of handling different version clients in multiplayer games? For example, when there's an update, some games allow you to play with people who have a different version of the client. How is this handled?
I have a camera class in my code which stores two 4x4 matrices. One for the view matrix and one for the projection matrix. Originally, I had two floats in the class for pitch and yaw and these were updated based on keyboard and mouse input. Then on update I would do something like this to set the view matrix: Matrix33 ...
I've made a few games which I've actually released into the wild. There's one particular issue I run into over and over, and that's the issue of the interface/theme of the game. How can you make non-arbitrary, consistent decisions about the look-and-feel and interface of your game? For example, in version one of my Sil...
I'm currently writing an IRC bot in Ruby to play some kind of strategy game (it doesn't matter which), but I'm hesitating between several solutions to implement a phases system the "best" way. The system: The game has several days; the first day some phases occur to give the players their jobs and so on, but they never...
I was making a game and I wanted to program light sources but I don't know how to. every where I search it comes up with lightweight java. Can any one offer any help. Its a birds eye view mmorpg. Can anyone help me?
I'm well aware of how to detect if two or more 2D objects collide but I'm interested in how to decide whether to check for a collision. In previous projects, I just had every object check against every other object (I know, O(n^2) level of stupidity) and it created a less than fluid gameplay. Various forums hail the gr...
I am a C# web developer and I want to expand my skillset and have some fun while doing it. I know some of the basics of C++ and I would love to write a simple 2d game/game engine for myself using C++. What other libraries or SDKs do I need and where would I find some tutorials and informational resources to move forwar...
Currently, I create a vertex buffer in SlimDX like so: SlimDX.Direct3D11.BufferDescription Description = new SlimDX.Direct3D11.BufferDescription(); Description.BindFlags = SlimDX.Direct3D11.BindFlags.VertexBuffer; Description.CpuAccessFlags = SlimDX.Direct3D11.CpuAccessFlags.Write; Description.OptionFlags = SlimDX.Dir...
Is there such thing as an SDK or toolset that can produce Windows, Flash, and Android executables from the same source? Something like "write once, run in all three platforms?"
I have a C++ game programming book and it has a Lua section in it. I've started to read the Lua section, and it sounds interesting, but I can't determine the pros and cons of using Lua in my C++ game. The only benefit I can currently think of is that you can make some coding updates, via Lua, without having to recompil...
I have successfully created a tiled map of various textures. Right now, i had a Vector4 in my own custom Vertex declaration deciding what texture each of the tiles should be. This is working perfectly. I can have any of my four tiles on the map, and any combination of them. However, i would like to start having the til...
Note: I would like this to be specific to mobile and web games, since they have easier distribution methods than other models. Based on the examples in my interfaces question, it looks like (as expected) there's a lot of work cut out for me; there's a lot of room to improve that old, hoary chemistry game. But should I?...
What is the best opensource 3D game engine suitable for 1st person shooting game? This engine should be script-able with lua.
I have a problem with my raycasting. I have 8 cubes, that define the first level of an octree (Eg. they create bigger cube). I need to raycast them and "render" each cube. If I have only one cube, the raycasting works fine. If I use 8 cubes, I have a problem. If I move my camera, gaps between cubes start to appear. Cub...
In my players update method I calc the new world matrix then I update a boudingsphere by: MyBoundingSphere = MyBoundingSphere.Transform(World); However when the the model's World has moved vertically down MyBoundingSphere moves vertically up?! (i.e. MyBoundingSphere.Center.Y increases instead of decreases);
If I illegally index into a list in the subscribed ClientSizeChanged() method, no ArgumentOutOfRangeException is thrown. Is this normal behavior ? And if so, when should I expect this behaviour ? @ Roy T. : You're right in that it is an event which I'm subscribing to as follows : game.Window.ClientSizeChanged += new E...
I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, rectangular collisions (up, down, left, right). I have been searching for an answer on and off for months and I can't seem to fi...
I've just read about Domain models and it enlightened me since I've been developing a game that has a class which only holds data (few behaviors/methods). I assigned the job of handling these classes to the managers...and now my manager seems to look like a God object. My game object that supposed to be handling the lo...
I'm currently trying to build a Breakout clone as a first step into game development. I'm using the following collision detection code (adapted from https://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection). I have a rectangle and a circle, and the following C# code: Point cir...
I been currently involved in a game project and we reach the point we're want to added the GUI for menus and other stuff but the time that we maybe spent developing our own system could cost us a bit of time, and this is a part of the system that we don't want to lose too much time. So, we're reading about some UI Libr...
I'm fairly new to Blender. I know there is the "Transform" section in the Object menu of the Properties tab, which contains Location/Rotation/Scale of a selected object. What I'd like to know is if there is way to tell the height (Z) of an object, or just the selected face?
In my previous question, I asked about why people don't program on the GPU. Now I am learning about fluid dynamics with this article. They say that it should all be done on the GPU. The game engine that I use is Unity, and I know that shaders are run on the GPU. But is there any way to program (other than shaders) on t...
I am finishing a very basic 2D racing game with top-down perspective. I can't get the appropriate formulas to make the movement of the cars fun and addictive... Do you have tips on how to achieve that arcade feeling a lot of games have? Do you know of any guide/tutorial on this topic? Right now, these are the formulas ...
I have been looking around for clues on the subject but I'm not convinced to commit to javascript as my primary scripting language. Currently I have started with lua. But I fear it will be a limiting choice for my future projects which include web clients for my games. So basically I would like to know if you think it ...
I've got a 3ds max model and I'm trying to rig it. I followed some tutorials, but I got stuck. I've got my rotating head, and the arm that holds it and pivots up and down, but the two don't "connect" well. Here's my rigging set up: The leftmost dummy should move up and down and control the height of the miner head (the...
I have been puttering around with the fundamentals of a Java game engine, and I've reached the point where I'm ready to add in an Event Manager system. I know, in theory, what an Event Manager should do: allow objects to "register" for certain events, and whenever the Event Manager gets notified of an event, broadcast ...
I'm toying with Perlin Noise after some work with Diamond Square. I followed the implementation by Hugo Elias that basically, makes a series of functions with x,y as input to throw each coordinate value. My PHP code is here: I have two questions: How do I use the algorithm to generate a height map in an array? I did no...
I am currently developing a breakout clone and I have hit a roadblock in getting collision detection between a ball (circle) and a brick (convex polygon) working correctly. I am using a Circle-Line collision detection test where each line represents and edge on the convex polygon brick. For the majority of the time the...
Okay, So I would like my engine to detect weather or not it can use DirectX 10, if it can't it defaults to DirectX 9.0c but, the function DirectXSetupGetVersion() will only return Versions 5 through 9. Could someone point me to what could tell me the device capabilities? Thank you for your time.
I would like to know how to get a specific point on the circumference of a circle, given an angle. The diameter of the circle is 1, and the center point of the circle is { X: 0.5, Y: 0.5 }.
I'm just doing a bit of research into tech to use for a mobile multi-player game. It's more an experiment at present so for the moment, the only thing that Players need to be aware of is the other Players. If this was a typical web application and not a game It'd just have HTTP requests firing all the time -- but sinc...
I'd like to multiply a vector by -1 e.g. mul r0, r0, -1 When I try this, I get this error message: SimpleShaderA.vsh(20,17): error X2000: syntax error : unexpected integer '1l' How can I specify -1 in my (first) shader program?
I am doing a random map generator for a 4X space game. Each node in the game is place at a random (x,y) coordinate on a 2d grid. A node can have one or more bi-directional edges to another node (representing wormholes). All nodes must have at least one wormhole, and all nodes must belong to the same graph. Ideally, a w...
I am looking for any input on simulating water in 2D, against a rather large (call it) blocked/not blocked array (viewed from the side). I have come up with the following ideas: Cell Automata Do a massively parralel simulation on the CPU, using cell automata. With rules as simple as: If there is a cell open to the bot...
I have two points (A, B) and the length of d. How can I find point C?
I'm making a small spreadsheet that tracks the amount of kills my wrench's eaten over time in TF2. So far I've been manually copy pasting fields from the TF2 window, but hey, Steam does have some API I could consume, and Google Spreadsheets can consume XML too. This number I'm tracking should also be exposed by the Ge...
How does Blitz3D work? I mean internally, does it use OpenGL with basic wrappers or it using some open source 3D engine that itself wraps OpenGL?
There are several applications like Blitz3D or other kinds of game construction tools that compile scripts or other game data to a single executable file. How do they do that?
I've been programming a game using the Java library LWJGL. I've got a little problem, though. It is a 2D game, and I'm aiming for a game like the original Civilization (I quick Google of "Civilization 1" will show you what I want). So far I have been able to generate a random 64x64 tile world. Each tile is .5f in size,...
In D3D9 there were functions to deal with D3DXVECTOR3's in order to calculate dot and cross products. However these have disappeared from the math library in D3D10. I assume they must have gone somewhere? My question is where and why?
Usually I buy 3D Assets from sites like turbosquid.com or similar. My problem is that I have lately implemented glow, normal maps, specular (and specular power) maps and reflection maps and I can't find any models that use those techniques. So where can I find / buy "next gen" assets (at least models/items with a norma...
I'm trying to render text (or whatever) off screen. But I have a strange issue where the render target size matches the window size and not the render targets size. Yes, it is a contradiction! Here's the render target: And here's the code, chopped up and put together to demonstrate what's happening in one place : User...
I am in the midst of creating an FPS game using XNA. I am using the camera class from the First Person camera demo from dhpoware.com, and everything is working great. What I'd like to implement is the ability to press the right mouse click and then the view changes so that you look down the gun, like the following im...
In flash i have a class that extends movieclip and i am moving it forward, up and down, and rotating it. How can i calculate the vector that is perpendicular to this movieclip?
In my project, certain data is stored in floating point datatypes (C's native float, double). Before sending the data in a VBO to OpenGL I have to convert this data to GLfloat with some pretty silly code. float data[DATA_SIZE]; GLfloat *new_data; new_data = malloc(sizeof(data)); for (i = 0; i < DATA_SIZE; i++) new...
Recently I have returned to my childhood hobby (programming games) and found it quite enjoyable. I've been tinkering with PyGame (for Python) for a few months, made a couple of projects for educational purposes. PyGame is nice, however there is not an awful lot of commercial games using PyGame, and I'd like to invest m...
I am trying to render the visible portion of a diamond-shaped isometric map. The "world" coordinate system is a 2D Cartesian system, with the coordinates increasing diagonally (in terms of the view coordinate system) along the axes. The "view" coordinates are simply mouse offsets relative to the upper left corner of th...
How can I create 3D Model of objects with glowing edges (just like in Tron) using Blender ? Note : I am a beginner in Blender
I am designing a map game, using PHP and MYSQL. I don't know how to make the players who sign-in to the website to see other players who are also connected to the site and be able to chat with one another. I want to design the game in such a way that 2 players can play with each other and be able to send messages durin...
I am a mac developer using Unity and I hardly use a PC. When you build a Unity game for Windows, does it use Direct3D or OpenGL? P.S. I'm not sure if it's called Direct3D or DirectX
I'm looking for good algorithms for compressing textures offline (ie decompressing them at install or load time, I know about using DXT/3DC to save runtime video memory, but these create awful visual artifacts while often being larger in disk than a lossless format like JPEG-LS, even after using LZMA or something for e...
I'm currently in the process of developing a technology incubator in my region to cater to game development professionals and aspiring devs and I'm curious about what engines are best to use, with regards to flexible licensing (e.g. right now we're on a shoestring budget) and also performance/popularity and a solid com...
Major Edit I'm making a Breakout clone, and having difficulty with collision detection between a circle and line segment. Apologies, my earlier question was a result of frustration and no sleep :) Having read this post on collision detection I've re-written my collision code to the following: // Takes 2 points on a...
Having read this heated question about Unity vs. UDK vs. ID something, I'm curious to know: what the repeatedly-hit, most crippling limitation(s) of Unity? In order to keep this question non-subjective, again, I'm talking about the top repeated offender(s) of Unity are. This is something that, as a Unity user, you real...
Basically i am trying to render a model yet it seems to draw polygons that should be behind something, in front of it. So i end up seeing some faces that should be behind something, totally covering it. Bah, i suck at explaining so here's the pic: See the Railing? It should be at the front, but it's covered by the top...
In a client-server game architecture, what are the possible ways to verify that the client has not modified things like gfx assets or client side scripts? Obviously no solution is perfect, but I would love to hear some ideas. I am thinking something like an hash on all the files in the resources directory. Does that so...
I was told by a company that better than putting an installer on a CD would be allowing the user to run the demo directly from the CD. Is this even possible when the demo might require things such as the XNA framework to run? Are they actually wrong and an installer is in fact necessary for the dependencies?
I am trying to figure out how to make a background that looks 3D in a game that is 2D. Below there is a video of the game "Under The Lotus." I am trying to get a background with similar effect (it looks like a 3D environment, while the game runs basically in the X and Y axis). http://www.youtube.com/watch?v=3GsTwsx5aW...
Is there a known 'most efficient' algorithm for AABB vs Ray collision detection? I recently stumbled accross Arvo's AABB vs Sphere collision algorithm, and I am wondering if there is a similarly noteworthy algorithm for this. One must have condition for this algorithm is that I need to have the option of querying the r...
I've create a plane with a spot light shining from above onto it. The spot light projects a texture of an image onto the plane. The light shots out at an angle but the texture is projecting in a flat 2d form on the plane. I expected it to stretch out much like the advertisements you'd see drawn on the pitch during a ru...
I'm writing a Windows tool that uses XNA and allows the user to place textures on the screen. I'm using a 'camera' for the SpriteBatch used to draw the textures, e.g: Matrix matrixForSpriteBatch = Matrix.CreateTranslation( -_cameraPosition.X, -_cameraPosition.Y, 0.0f) * Matrix.CreateRotationZ(_rotation) * Matrix.Cr...