instruction
stringlengths
33
29.4k
Okay so I am working on a game engine and this was my previous game loop: Game::Run() { While(!m_GameDone) Client.Update(); LocalServer.Update(); } but what I want to do is: Game:Run() { ClientThread = new CThread(...); ServerThread = new CThread(...); ClientThread.StartTask(Client::Run...
In my XNA program, I am trying to swing a sword. The sword starts at an angle of 180 degrees, then rotates (clockwise) to an angle of 90 degrees. The Rectangle struct that XNA provides, Rectangle mAttackBox = new Rectangle(int x, int y, int width, int height); However, this struct has two problems: Holds position and...
I heard that X360 homebrews are not allowed to be started from DVDs; however, they can be downloaded from PC or via live and started. The question is: it is disabled to access DVD drive at all? I want to access data tracks, without using any (theoretically prohibited) media APIs for playbacks; also I don't want to run ...
I am working on a 2D side-scroller using Farseer Physics Engine v3.3.1. In order to create a realistic physical skeleton for the player, I am using a method similar to the one explained here (See "Texture to polygon" section). Below is my code for creating the player body: uint[] data = new uint[Source.Width * Source.H...
Is there a source (or perhaps several) presenting how was the world game market segmented in 2011 (or does anybody know themselves)? For example: How many casual gamers there are? What is the total business, of which how much in virtual item sales? How many console gamers there are? How much is spent in hardware, how ...
Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player is in different states (I.e. standing, walking, jumping, etc). After reading this answer, I changed my approach to the f...
I am Rendering to a SurfaceFormat.Color. (R8G8B8A8) The alpha of this format has 8 bits and I want to be able to use those 8 bits as a bit field. For example, in one pass of my render, I want to save a bit value like 1 or 4 passing => 00000001 = 1 or 00000010 = 4 .... The problem is that the output data of my pixel sh...
Ive been developing an RPG for sometime, and its far enough now where I need to get some formulas down for attacking and whatnot. What Im looking to understand is a basic hit and miss formula based on dexterity or another stat. If someone can give me a basic framework to modify and extend, or helpful pointers, Id be ap...
I've decided that it's best to start using vectors in my games instead of the xPos += xSpeed and yPos += ySpeed approach. I'm posting some of the code from my basic model class which handles movement logic in my game so that someone can tell me if I am using vectors correctly. I have a position, direction, acceleration...
I have a mouse-based game that I'm trying to get to work nicely with the Xbox gamepad. My major issue is trying to get the cursor to move smoothly like it does with the mouse. Using GamePadDeadZone.IndependentAxes makes it hard to move at slight angles, so I switched to GamePadDeadZone.Circular. It turns out that t...
I started learning some Android development and one of the first things I thought I could make is a simple game. However, I'm faced with one difficult question right off the bat. Should I use OpenGL ES 1.0 or 2.0? The game I have envisioned will be pretty simple graphically, utilizing 2D(tiled top-down type graphics) ...
I've finally gotten this laser thing to work for my Space Shooter, and so far I've come across a slight problem. I've gotten the laser to position itself at the starting position correctly and move vertically perfectly. Anyway, whenever I hit the space-bar (which is the controls for shooting), it shoots the bullet/lase...
I have objects in my game that move faster at 45 degrees then at 90 degrees. Each object has: Point (x,y) position Vector2D (x,y) direction Int speed And what I do during an update, is that a new position is calculated with: position.x += direction.x * speed position.y += direction.y * speed How do I correct this so...
Just found a related topic but I have different/extended questions I was wondering how the implement the drop system. I have to start designing the DB model for this so I was wondering whether what I am thinking is a good practice or not. My game is like "City building" kind of browser based game (Flex/Flash app) with ...
I want to teach game development to kids as part of a course (year-long) involving Ruby. Unfortunately it looks like the game development kits available in Ruby (even in the form of bindings) are pretty limited. Is the best solution to go with JRuby and use jMonkeyEngine through the JVM? I'd love to have the kids pla...
I'm currently creating a game which should be multiplayer (client-server-client), but I'm stuck. I have been doing crazy things like building a text chain like string networkMessage = userHash+" "+userX+" "+userY+" "+userRotation; but it looks crazy and parsing is also bad string[] pieces = networkMessage.Split(' ');...
I have a kind of broad question to ask but I have to start some where so.....What is the best way to handle onscreen clicks for moving objects being drawn on a canvas in a view. Im registering the screen clicks just fine and Im able to get the x and y but when it comes to matching it to an object on screen Im at a loss...
So this is how I understand it: An artist models the thing in Zbrush or Mudbox. It now has 10+ million polygon. He exports it in Zbrush as a normal map + low poly model. (this works?) The model now has ~20-30k polygons? Now the artist imports the low poly model into 3dsmax or Maya, applies the normal map somehow as wel...
From a game I developed years ago, I still have character models that my former 3D engine designer created and that I'd like to reuse in a Windows Phone project now. However, the files are in DirectX format (.x) containing keyframe animation only. No bones. No skeleton. There are a lot of animation keys defined on seve...
OK, I added a loading screen to my game, and in order for the game able to update and show a loading screen and load stuff in the background I came to the concludsion that I needed to host the loading function on a thread. When I did this, the loading times doubled, if not tripled in length, can anyone thing why this i...
I'm currently stuck with my game, which is from the top perspective. I'm currently using these sprites for player: (using the second at the top): And here's what I use for my gun My problem is that I am not sure how to calculate origin & position to make sure that gun is always in player's hands. This is my code for...
I'm running into trouble trying to figure out the best way to draw textures to the screen using Directx 11.1 (for Metro apps). In XNA, I used SpriteBatch. Is there something partially comperable? In the Win8 SDK examples, they used WIC and Bitmap, although it suggests that that is not the best way to draw 2D graphics w...
Possible Duplicate: Any interesting thesis topic? I just wanna know what are the points of research in nowadays games. As I am Teacher Assistant and I must make a master thesis and I wanted to make the Thesis about games and contribution to game society the problem that all my faculty stuff are from old era where wo...
What do I do after the bounding box test against a tile to determine whether there is a real collision against the contents of that tile? And if there is, how should I move the object in response to that collision? I have a small object, and test for collisions against the tiles that each corner of it is on. Here's my...
I want to use a shader just for learning purposes but I have a few questions about it. I have the following code: Vertext shader: const float Eta = 0.66; // Ratio of indices of refraction const float FresnelPower = 5.0; const float F = ((1.0-Eta) * (1.0-Eta)) / ((1.0+Eta) * (1.0+Eta)); varying vec3 Reflec...
Do any games use the GPU for more game tasks than just rendering, as a way to reduce the game's load on the CPU? I'm most interested in games which use either Valve's Source engine or the UDK. Is it possible/effective to even do such a thing?
If I have two models, for example: some character, and a bow, how do I work with them together in 3DS Max to animate them both (for example, when the character shoots an arrow with his bow, the characters pulls his hand out, the bow is scratching etc). Also, any guidelines on how to port custom weapon models to UDK?
I've got a virtual clock. The clock consists of the actual clock sprite, and a hand to go over it. I'm able to set how long the clock duration is. Say I set it to: 5 seconds. While the clock time is going, it will eventually stop until it reaches 5 seconds. Until it has reached 5 seconds, the hand will start rotating. ...
I have a Windows Forms application that uses a custom Graphics Device control based on Microsoft's "WinForms Series 1: Graphics Device" sample. The application makes use of a single model (the spaceship model included with the second sample) and its associated texture. My main project includes a reference to an XNA Gam...
Alright, so I'm working on a space game and well, I want it to have a lot of space! So I need a large coordinate system and for my rendering pipeline to not suffer from "vertex jittering" due to floating point rounding errors introduced in the world to view space matrix transformation. So far I'm having some luck with ...
I'm working on a puzzle game, I've implemented a sprite class that uses an array of images and cycle through the array to draw each frame as required. This works fine! Here's the original code: String number; Image sprite; ArrayList <ImageIcon> spriteAnimation = new ArrayList(); int _imageCount = 0; ...
I'm currently doing research into building my own voxel engine and found a lot of articles mentioning SVOs as the best mechanism. I just wanted to know that I understood the algorithm correctly, before I implement it. I read my data into an octree on the CPU, maintained through standard node->children constructs. With ...
I have a sprite with an UpdateHandler that can change it's position every 0.1 seconds. My Question is , given the Sprites current position, how can I move it to another position(like from 10,10 to 250,250). I found out the rotation angle for my sprite like this: double alfa = (float) Math.atan2(endY - startY, endX - st...
I want to create the illusion that a man is running down a long road i.e. this pic http://camlinecambridgelimited.web.officelive.com/images/road%20graphic1.jpg If you have played Temple Run on the iPhone, it's the same principle, but instead of a temple it's a normal road. I want to know how this is implemented. For e...
I'm just starting out with OpenGL on Linux. In order to write future-proof code, I explicitly wrote code for OpenGL 4.0 Core Profile in the first place, thus the shaders are GLSL 4.0. That worked fine on a recent notebook with an AMD graphics card using the fglrx driver, which supports OpenGL 4.0. I then tried to run t...
I'm trying to convert the following code to Java: glVertexPointer( 3, GL_FLOAT, 0, &(mesh.m_PositionBuffer[0]) ); Where mesh::mPositionBuffer is std::vector<glm::vec3>; How would I make a similar call to glVertexPointer with a first index to the position buffer?
I've found that after resuming my game the whole engine is reloaded and application is reinitialized. I want to save engine state and in "onResume," resume the game process from where it left off. I've tried to save the engine (mEngine) and then after resume the game in "onLoadEngine" return saved engine. I think it is...
In XNA, I have an axis-aligned BoundingBox representing the object's hit box, and a Vector3 representing the object's velocity. I also have a stationary 1x1x1 axis-aligned BoundingBox representing a voxel. Using object.box.intersects(voxel.box), I can tell that they intersect. However, I do not know which side of the v...
I am trying to find a good way to handle ball/paddle collisions/reflections in Pong. I've tried the "naive" approach of just checking x and y coordinates against each other, figuring out where the ball hits on the paddle and how to change reflection, etc, but it seems so tedious to do it this way. I feel like I have to...
I'm really interested in making a new application for iPhone, and I have some experience in objective-c. My main problem is the visual part. I want to have graphics like in Spy Mouse. Could this be achieved using simple 2D graphics? Or would I need to use 3D, and just show it from this perspective?
Im trying to create a car game in c sharp! Im now trying to figure out a way to get some sounds into the game! For example, the acceleration sound of the car. I recently tried to add a 5 second-sound of a real car accelerating, but I don't think its the right way to do it. Because then i have to start from the beginnin...
I am writing a simple BVH parser in C# using the XNA framework. At the moment I have managed to parse in all the data and my goal is to find out the global coordinates of all the joints in the skeleton. The problem I am encountering is that the bones don't seem to take into account the rotation of its parents. For ins...
Other than the doom3 mods, is it possible for example to run Quake 4 or Prey using the game data? Let's say that I purchase Quake 4 or Prey (or any other idTech 4 game) can I just point to the game data path and run it with the source code? Is there any modification needed? If so, what is it?
Using the following setting for the OpenGL particle effect: SRC: GL_SRC_ALPHA DST: GL_ONE Creates an additive blend, which looks spectacular on a black background but terrible on brighter colours, as it begines to fade to white. I then used alpha blending: SRC: GL_SRC_ALPHA DST: GL_ONE_MINUS_SRC_ALPHA This allows oth...
Is there a decent Effect file editor plugin for Visual Studio? I'm getting slightly frustrated with constantly copying and pasting from FX Composer.
well i'm just wondering on the best way to go about create some form of "Lightning" effect to be used in a game, so for example: -In my game, i would like to have this effect in the menus and in-game in some form of random weather system perhaps. Just wondering on the methods available? I did read this blog post: http...
How can I calculate the angle of rotation/tilt of an arrow in 3D? When I say angle I mean the angle the arrow takes when it flies through the projectile path. I am using logic given in the below link to calculate the location in the 3D space http://babek.info/libertybasicfiles/lbnews/nl130/proj3d.htm and also OpenGL fo...
What model extensions are valid in XNA? I know it supports .fbx, for example.
I'll start by saying that I am fully aware that this question might seem subjective at first, but I'll try and provide a specific test case scenario for it to be a clear question about validating the data received from 2 multiplayer game clients. Scenario Imagine we have a multi-player Tower Defense (TD) game. And let'...
Background: I have extensive development background, but the last time I coded a game was many years ago. My Javascript skills are quite limited, and I intend to improve them by building a simple game — Tetris, Pac-man, or something of that complexity level. Question: It seems to me that a fundamental choice I need to ...
I've got a basic textured quad forming a plane. When I move the camera or rotate the plane to see the back of it, there is no texture there. The effect I want is as if the plane were a clear piece of glass, so that I'd be seeing the texture from through the other side. I was hoping this was going to happen automagicall...
In XNA there is only one Matrix class which is actually 4x4 matrix. How to use it to represent a 3x3 matrix? I am trying to represent the inertia tensor of a body which is a 3x3 matrix, so I have data for only a 3x3 matrix. How can I store that in a 4x4 matrix and still have operations on it be valid?
I think that this question is very similar to this one, but I'm not sure if the answers are universal. So, my goal is: Place two sprites in fixed position, for example player and his eyes Make sure that whenever the player rotates, eyes sprite rotates too and gets to the same relative position from the body (so eyes ...
I'm developing with LWJGL and Java on a Windows 7 laptop. I've successfully set up saving to the %appdata%\gamename\saves\ or long form c:\users\user\appdata\roaming\gamename\saves\ folder by using File dir = new File(System.getenv("APPDATA") + "\\gamename\\saves\\");. I have hobbyist level experience with Linux, and z...
I have found this post explaining about how to get the size of the Window, but for whatever reason I'm having issues getting it to work inside of a Singleton class that I'm made to manage a set of Objects. Anyone have any examples of getting these values from inside of a singleton? EDIT: Just in case the question get...
I just had a quick question and wanted everyone's opinions. I'm making a 2D demo game for a resume which I want to post online. I'm applying as a programmer position so I don't really have my own art. I am planning on using sprite sheets and tile sets from other games in order to create just one or two levels on my dem...
I am doing a 2D sprite based game in XNA for WP7, The game logic is simple, you start at some point, you want to avoid obstacles and reach a certain goal. obviously I need to make many levels for the game to be challenging and funny. I am considering making a level editor for my game where I can be able to design the l...
We are trying to export a model and animation from Maya into Unity3d. In Maya, the model is anchored (pivot point) at the feet (and the body moves up and down). However after we have performed the FBX export, and imported the file into Unity the model is now appears to be anchored by the waist/head and the feet move. T...
I create a box with a material and set that material to be wire framed. Box b1 = new Box(new Vector3f(1.0f, -2.0f, 1.0f), 1.0f, 1.0f, 1.0f); Geometry geom1 = new Geometry("Box", b1); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat1.getAdditionalRenderState().setWireframe(true); mat1...
I would like to know if any license is required to use Fifa registered team names and player names in paid or free games (e.g. Spanish League teams, Messi, Cristiano Ronaldo names etc). I'm currently developing an interactive soccer game for mobile platforms (iOs and Android specifically) and I was wondering if it ther...
Alright, this is semi-related to my last question here So I've got an really big coordinate system and need to handle rendering large astral bodies from extreme distances. My current approach involves different rendering passes based on the distance of the object. The extremely far objects are simply rendered first wit...
Right now I have spaceship orbiting a small planet. I'm trying to make an effective control system for that spaceship, but it always end up spinning out of control. After spinning the ship to change direction, the thrusters thrust the wrong way. Normal airplane controls don't work, since the ship is able to leave the a...
Call of Duty games all have the core functionality of any FPS (walking around, killing, dying and repeat). Layered on top are various stuff. Of interest to me is during pre-game when you pick your perks. These perks can have very different effects and targets. Some affect walking speed and persist throughout the game, ...
I've been trying so long to use this modified version of GLEED2D that includes WP7 support, I'm stuck into loading the level into my game, now my Game1.cs class has the following: protected override void Initialize() { Stream stream = TitleContainer.OpenStream("Content/leveltest.xml"); XElemen...
I have a UIImageView called hitBox, and another image called mainSprite. So what I want to do is when an IBAction is pressed, it will move hitBox to above mainSprite. I don't know if this is syntax but this is what I know moves things on the screen. hitBox.center = CGPointMake(x coordinate, y coordinate); I just want ...
I've been playing around with trying to create some kind of top down racer but I'm having trouble getting the car to turn properly. At the moment this is the code I have to update the position of the car: var power; if (keyboard.upKeyDown) { power = 1; } else { power = 0; } if (keyboard.lef...
Is there a game engine that does not use a graphics API such as OpenGL or DX? I want a simple 2D game engine for use in my simple game console.
So a week ago or so i asked this question: A few queries about my Map Data (& ideas of improvement, seconded opinion required) And the advice in the comment was to ask them as 3 separate questions. So I' going to focus on map loading, and my concerns. So recently i have been working on a new map editor, mainly creati...
I've been trying to use this modified version of GLEED2D that includes WP7 support, The progress so far, is I've been able to load the level XML file to the project and read it successfully thanks to This answer I got in touch with the author of the modified version, he added the answer to the wiki The problem now is I...
Suppose you have a simple state machine for a game character with two states: StandingIdle Walking In the update logic for the StandingIdle state you have (pseudo code): if input received setState(Walking) In the Walking state you have: intendedLocation = calculate new location based on current heading and speed...
Here are two different pieces of code This is what I started with Vector2 hold = Vector2.Transform(pos1, mat1); Matrix inv = Matrix.Invert(mat2); Vector2 pos2 = Vector2.Transform(hold, inv); And this is what i'm told is the simplified version Matrix matrix1to2 = mat1 * Matrix.Invert(mat2); Vector2 pos2 = Vector2.Trans...
I decided to learn to program in DirectX yesterday, and, not being a huge C++ fanatic, went looking for a .Net wrapper. After reading about SlimDX and SharpDX, I decided I liked what the SharpDX people were doing and began trying to use it. Although they have a huge number of samples that are really nice, I had troubl...
I am using this code in Update method in XNA RenderControl in Windows Forms: ... Mouse.WindowHandle = renderControl1.Handle; MouseState stat=Mouse.GetState(); ... Everything works fine but when I want to record it with Fraps I get this result: http://www.youtube.com/watch?v=oDmzAIx_wU0 mouse position is moved but in s...
Possible Duplicate: How closely can a game resemble another game without legal problems I'm going to make a game in the form of a 100% free Android phone app that will be basically a clone of an old arcade style NES game, but with a few modifications to make it better. Now the game I am inspired by was released in 1...
There are a few sound effects in my game that sound a bit piercing over earbuds but OK when played through the iPhone speaker. Also sound levels seem lower on older hardware. Is there some objective way to be sure my sounds are loud enough yet safe? Notes: I made my music with GarageBand for iPad. The output was very h...
Is there a common way to implement a character following path that is issued and replaced in real time? For example: the character follows a path issued, and while it's on that path, if a new path is issued, the character abandons the existing one and follows the new path from where it is currently located. Here's a m...
I'm a beginner both in game developping and programming. I'm trying to learn some principle in the building of a game engine. I want to create a simple game, I'm at the point where I'm trying to implement the game engine. So I thought my game engine should control this things: - Moving the objects in the scene - Chec...
I'd like to draw a line in 3D space that is always exactly one pixel wide on screen, no matter how far away from the camera it is. (And the same for single points too). Any hints on how I could do that?
I just added this: _spriteBatch.Begin(); _spriteBatch.End(); to my app and was greatly confused by the fact that this causes pretty much everything else (all of my 3D objects, that is) to be drawn incorrectly. After the code above has executed, no Z-buffering seems to take place, but instead objects are just drawn in ...
For an engine I'm developing I've decided to allow users to set up multiple windows showing differing views of the same "world." This is being developed using OpenGL (hopefully aiming for 3.2 core eventually if that affects the ansmer) and SDL 1.3. The basic structure I've got set up is: class Window { SDL_Window...
I'm creating a 2D maze game in Python. When I collide with the walls, the user can go through them but I want to be able to block him from doing that. How do I do this? Would I use an array? I have created an outer wall before in another game, but that was just setting the bounds in the user class.
I want to generate a 3-dimensional race track around a spline that describes its shape. Here's an illustrative video. The track should be an endless tunnel that sweeps along a 3D spline, with some obstacles thrown in. My best idea so far has been to loft a circle shape along the spline. I would also like some pointer...
How do you create a good metal shader? For different metals and say more or less eroded / rusty and so on. I know that one difference from ordinary materials is that metal should 'colour' the specular light but when I do that with gold for example it just looks "yellow", not metallic at all. Any help appreciated!
How can I draw blurred models/images in 3d space like here:
Say we have a player who's walking around in first person perspective. He would like to walk forward, but that would put him inside an object, and that's no good. Right now what I do is... (pseudocode follows) class Player(whatever): def __move_by(this, displacement): for object in scene: if(object.hitbox....
(Unfortunately couldn't find the answer myself) Does a neat way to cache the geometry shader results in Direct3D10 or OpenGL exist? (preferably Direct3D10). I'm building my geometry based on texture sampling and I want to do it only once. So, when the first frame of the scene is rendered, this geometry is build and I w...
Given two games with very similar names: Alien Shooter II - Vengeance Alien Shooter: Vengeance Is there some place that I can go to get an ID or the 'canonical' name for these games? I suspect that they are the same game, but it's very hard to say for certain.
I'm writing my own game engine for learning purposes and was wondering about common ways to handle collision callbacks/responses. I'm NOT looking for ways to resolve collisions (no math needed here), I just want to know how systems are commonly set up to respond to one another. For example, what I have designed now is ...
I have a single point light-source which is a flaming torch. I compute the distance from the light accurately. I am not trying to have a particularly realistic torch effect, but I will be moving the light-source slightly each frame and perhaps introducing a slight flicker in strength. I want near the light to be white...
I've been entertaining myself lately by programming a simple text-based adventure game, and I'm stuck on what seems like a very simple design issue. To give a brief overview: the game is broken down into Room objects. Each Room has a list of Entity objects that are in that room. Each Entity has an event state, which is...
The problem is as follows: Think 2D Zelda (Links Awakening, A Link to the Past) style movement where you can run into walls from any of the four cardinal directions, or basically up, down, left, and right. The difference between my movement and these games is I want to allow for diagonal movement as well. When the play...
I'm making a sky gradient in OpenGL by drawing with glColorPointer and glDrawArrays. I would like to be able to change the sky colour from morning to daytime to evening etc. I can either: Make a number of sprites and fade them in with my framework Somehow tween the color vector in openGL over time and use a single spr...
Recently I downloaded a game off pydev and the imports for it look like this below. import pygame from pygame.locals import * However I have only ever created games by calling the in this way. import pygame import player import enemy I have called in the class one by one. What does the lines of code at the top do? do...
I am creating a 3d game ( a car racing game) using opengl ES. i know the rendering concept and also using a physics engine for all the physics stuff. All modeling is done using 3d modeling softwares. Now my question how to do the special effects within a game. For example like when a car collides and toggle how to slow...
I want to develop a simple multi-Activity Android game using Marmalade SDK. I looked at the SDK samples and found that most of them are a single view (Android Activity) apps. The Navigation model in Android is a stack-like model where views are pushed and popped. I can't find whether Marmalade has a similar model or it...
I am making a TD game in unity, Initially I made all of my enemy movements frame rate dependent say: I had a grid point1 at -22.65 and other at -21.1, diagrammatically: (-22.65) _________(-21.1)_______(-21.1+1.55) ...... so the distance on x axis between two points is 1.55, divided it by 25 jumps with each enemy jump o...
I have a lot of AABB bouncing on the screen. Doing collision/response between 2 AABB is fairly easy, but how do you handle this when you can be pulling AABB's apart but making them getting into another AABB? I mean something like this scenario: We have 3 AABBs. We check if first one collides with the other two. No col...
I am using PhysX Version 3.0.2 in the simulation package I'm working on, and I've encountered some bizarre behavior with the capsule character controller. When I set the controller's height and radius to the appropriate values (r = 0.25, h = 1.86)it behaves correctly (moving along the ground, colliding with other objec...
I've been fighting with XNA ContentManager and memory allocations for some weeks because I'm trying to port my game from XNA (Windows) to ExEn / Monotouch (iphone). The problem is that after playing a few levels, my game exits unexpectedly on a real iPhone device (not simulator). Profiling memory usage on Windows with ...
I've just downloaded Gamestate code from create.msdn.com, and as you can see from the image below: The result is less smooth then the image imported to visual studio, how do I increase the quality?