instruction
stringlengths
33
29.4k
http://pastebin.com/iw9DHf7s is code demonstrating dot product turning a turretto a target and firing. It works and chooses best angle to spin. A problem can occur when game goes faster (better computer) and that threshold no longer applies. Making the threshold bigger obviously stops the turret early. My friend mentio...
I am programming in C++ OpenGl with GLSL. Until now I have been using a data structure that is composed of std::vector filled with structures of vertexes and with their parameters (position , normal, color ...) as a global variable for all the code. My question is, as I am using VBOs for drawing - is this a good approa...
I'm using the motion API and I'm trying to figure out a control scheme for the game I'm currently developing. What I'm trying to achive is for an orienation of the device to correlate directly to a position, such that tilting the phone forward and to the left represents the top left position and back to the right would...
Here is the artifact: Here is some clarifying information: This appears only at 480 units from the origin, and seems to get worse (to a point) as I move away. All water should have sand rendered behind it, but the sand should be occluded (since I will eventually be rendering the water semi-transparently). Here is my...
I'm making my first game, it's a tower defense type of game, using Unity game engine and taking Fieldrunners as a reference. I would like to know more about the functionality behind 'Loading' scenes in games. Until now I am instantiating/creating objects at run time and I'm not facing any delay or similar issues doing ...
I am looking for a game engine for my school project on computer graphics. There are specific requirements that I do not want to implement by myself, since they are irrelevant for the grade, but relevant for the final result. So reusing other one's code is a good thing here and I am looking for an engine that supports ...
I've made a small game with UDK (Unreal Development Kit, release of December 2011 UDK Beta) and used frontend to package my game; When I install the game on the user's computer (the OS of the user is Windows XP SP3 32 bit or Windows 7 SP1 32 bit without .NET Framework), the installer program follows the steps below: i...
I am running into an issue of trying to implement an inventory system within XNA (doesn't really matter, could be any platform) but so far. Here is the issue I am trying to wrap my head around: How can I get an item from the world (think when you kill a monster it drops armor) and get it into my player's inventory? If ...
Possible Duplicate: Bukkit shoot tnt & help with vectors Hello. I want to shoot a piece of tnt from the players face and then let it explode when it hits the target block. I set it up so where the player looks and type in /tnt [power] /cannon [power] or /t [power] it will blow up at the target block: if (cmd...
I have a matrix of tiles, on some of that tiles there are objects. I want to calculate which tiles are visible to player, and which are not, and I need to do it quite efficiently (so it would compute fast enough even when I have a big matrices (100x100) and lots of objects). I tried to do it with Bresenham's line algor...
I am looking for some advice on what would be a good way for users to play Asteroids over the network. Its my first game and so far I have it working in 2D using polygons across a scrolling world in single player mode. Zoom in and out is also supported. Its not bad. I really want to develop it as a networked game as a ...
Using SDL_gfx's rotozoomSurface function to rotate a 38x58 sprite....naturally when it rotates it creates a new surface with a new size, and the rotation isn't going around the center point. I am actually having issues trying to figure out how to make it seem like its spinning around an axis... Here is the image that ...
I'm looking for a Java framework to develop 2D games on desktop and Android. I've looked at Slick and I really like the API, however the developer himself says if you want a framework for Android and desktop best go with libgdx atm. Now I'm reading up on libgdx, but I'm wondering if there are simpler alternatives for ...
So, given a sun sprite set at the horizon (x = 0, y = worldheight/2) I'm trying to devise a function to make the sun rise, then fall. The best way to do this would be the sin function, but I have no idea how to use it. if using y = sin(x), then x would have to range between 0 and pi for a full curve, while having a con...
I'm making a pong clone for Windows Phone 7 and I'd love to add a multiplayer option. I've been trying to use this Ricky Tan's tutorial: Link The problem is it is designed around the platformer example which has several classes such as Player, Level and Game whereas my game takes place in a single Game class with much ...
In my DirectX 11 project, when I have textures they have odd artifacts at the edges. I've seen it before and searched online, but I can't find any DirectX examples that I can get to work. You can see it on the skybox too. I'm assuming this is caused because the texture is too small and it's being expanded. I'm using ...
I'm trying to find some actual latency benchmarks for using WebSockets in HTML5 games. If I were to go down this route, I'd probably end up using (as you might expect) Node.js and Socket.IO. However, most search results I find tend to discuss what is possible or how it would be done. I'm more concerned about what kind ...
I am currently building an iOS MMO and I'm leaning towards using TCP as my networking protocol over the higher level HTTP (for the speed difference and the fact that it does not require the client to poll constantly for updates.) Now, through my research I know that with MMO and any client-server multiplayer games, you...
I'm using death animation for my enemies but the problem is that when enemy dies he crosses the walls/world. I want enemy/animation to be pushed back into world when he dies (animation is playing). Currently all my enemies (contains skeleton, gun mesh & enemy mesh) are rigid-bodies (kinematic) with character controller...
In the libgdx wiki, this particle editor is recommended. And this blog was helpful. But the problem is that I am not sure yet how to use it for my game. Let's say I want to have a fire-effect in my game. How can I get help for this particle editor?
I need an enemies spawning algorithm for a 2D tower defense game. I have 4 maps, each has 4 stages and each stage has 40 rounds. I need to create an algorithm which will instantiate waves, increase health and change their type in new rounds, new stages and in new maps. I need your suggestions and ideas to resolve my pr...
I was given a task to make a 3D game for Android, but since I never programmed games and opengl until now I'm totally lost on how and where to start. Right now I'm using libgdx framework to ease my development or at least I thought it would. I looked into invaders libgdx demo, but everything is so confusing and not con...
In the game I'm designing there is a blast that shoots out from an origin point towards the direction of the mouse. The width of this blast is always going to be the same. Along the bottom of the screen (what's currently) squares move about which should be effected by the blast that the player controls. Currently I am ...
I asked a partial question on stackoverflow, and then realized that this would be the place to get a better answer because this is the game dev website, and you all may know more than the programmers over at stackoverflow about this subject. So my question is: for making an online multiplayer game that runs in the brow...
I am thinking about giving a go to one of my ancient ideas for a game. The core point of this game would be the possible level of functional customization of the game environment and objects (such as modifying the behavior of a space ship weaponry). For this the game would need to be scriptable. Also I don't aim to com...
I would like to know if anyone has recommendations or experience with using an in memory data store for a real time, non-networked game. This is not necessarily for loading levels or saving data, but to be accessed within the game loop as the game is running. Pretty much everything I look at w.r.t. data stores in games...
I have been thinking about this problem. Is it possible with current technology to create a 1:1 replica of the earth in voxel based game? What's the best data structure to store this giant map? Which algorithm should be used to render this data structure in real-time? These questions make these assumptions: Each voxel...
I have a question about loading 3ds using this tutorial. I want to use more than one texture on the model (because here all the models have more than one) but it seems that this library can't do that. Do you know any other alternatives or a way to edit this existing library to reach my aim?
I have a planet rotating around its own axis (like regular planets, and Pluto) and a spaceship that can fly around in space. The idea is to lock the player (ship) in a deadzone "above" the planet and when he moves to an edge, the planet begin to rotate in the direction that the ship is traveling. I.E. not rotate the pl...
Questions: When we draw with interpolation, where should the collision detection code be? Is it worth implementing interpolation in the following situation? This is for Scrolling Asteroids. I have my game working at the moment without interpolation. It does physics updates using fixed step time deltas. The frame displa...
I really like the plants vs zombies style of animation and it doesn't look complicated yet the result is really good. I doubt it's made of sprites seeing there's a large number of animations, combinations, distortions, outfits. So how that kind of animation is done?
I'm a Flash developer, but I think it's time to think of other avenues. Ideally I want to be able to write once but be able to deploy to as many different platforms as possible, so iOS AND Android....Web AND Mobile. Are Html5 game development platforms good enough to create games that run on the web and mobile? or shou...
I'm developing a tycoon game, and with most games in the "genre", some in game things just take time. Making money, waiting for things to happen, etc. For mobile gaming (ios, android), how do I keep this entertaining. Without talking specifically about my game, there are day cycles / things that happen at certain point...
I've come across a need to position a camera for an arbitrary (unknown) scene. The camera can be updated later, but I thought I'd give it a reasonable default, and the thought crossed my mind that there may be a decent "standard" for this. At the very least, a given modeling program (Maya, 3dsMax, blender...) ships wit...
I'm looking for a tool or script that takes a 3D object (any format) and makes multiple renders of it automatically (using a raytracer or other high-quality offline renderer). It would then save the output as a series of PNG files. Example: let me render a car from angles 0,90,180,270 and save the images to car0.png, c...
I'm using to types of vertices. For the triangles: 0 Vector3 Position, 12 Color Color, 16 Vector3 Normal For the lines: 0 Vector3 Position, 12 Color Color I setup a vertex buffer for each type, and adding them to the GraphicsDevice using VertexBufferBindings. My problem is that I'm only able to draw vertices from...
I have got some problem implementing bullet physics into my opengl game. The thing is that it doesn't want to update my translatef value continously but only at the end. The code for bullet looks like this: void CGL::initPhysics( void ) { broadphase = new btDbvtBroadphase(); collisionConfiguration = new btDefaultCollis...
I remember that almost every single game in the early 2000s had at least a few amusing glitches, mostly related to animations, that often produced funny situations. I also remember that game magazines used to dedicate a section with the funniest screenshots people sent in. As an example, I was just playing Far Cry from...
What good free and widely used tools are there for editing 2D skeletal animations? Preferably, one that allows me to write custom animation exporters. One pretty good indie tool that I know of Demina, but it's not ideal. It doesn't allow you to export the data as you want (although, it is open source, so you can change...
I'm doing a web game startup with one other person. We support ourselves with contract programming. I'm considering attending GDC for the first time, but we're really tight on cash. Money spent on passes and plane tickets slows our startup's growth. Some say GDC is a good way to meet clients, but fortunately we have pl...
What are good free and widely used tools for editing 2D sprite-based game levels? I'm looking for one that allows exporting data to a custom format. One that I know of is Blender — a 3D tool, primarily, but can be used for 2D art as well — which also supports Python scripts for exporting data.
I have got stupid and annoying problem in my app. I am using bullet physics and I've started with hello world example on wiki: http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World There is someting like this: btDefaultMotionState* fallMotionState = new btDefaultMotionState(btTransform(btQuaternion...
My question is related in particular to achieving the effects of collision in game engine, how is this done? I have searched a bit, read from the internet and went through a few tutorials, and saw that one way to create one of the effects, explosion, or something breaking is to create the model in pieces, and apply for...
I need to record my wp7 game gameplay like on Hot Apps from channel 9 http://channel9.msdn.com/Shows/Hot-Apps/Hot-Apps-Minesweeper-Cheezia-Interior-Design-Talking-Alien-Zombie-Squish. My current game is written on Silverlight, but I will have XNA games latter as well, so I need some solution which will work for both t...
here is the world map (randomly generated) for a game I'm making: The green rectangle corresponds to the size of one screen. Each pixel represents 3x3 tiles in my game, this makes the whole map be roughly 7,9 km² (2,3 x 2,3). How can I assess if the game is too big or too small?
I'm trying to implement a boost pad in my XNA game using the Farseer Physics Engine. (This question applies to Box2D too, I would be happy to port working Box2D code to C#.) By "boost pad", I mean an object that can apply a force to the player that makes him go faster than he usually can under normal circumstances. The...
Possible Duplicate: When to roll your own game engine? I've been interested in writting games for a while, and now that I have acquired a bit of experience in programming, I feel like I could step up to making a little more complicated things. I've had some fun with SFML but since now I only had the basic classes I ...
I'm developing an XNA Game. Basically, I have a first person camera. What I want to do is get the position of an avatar's head. The reason I want to do that is because I want the camera to be on the avatar's head thus, giving it a real life view (you can see the hands and that type of stuff.
My team is planning to create a simulation game using Javascript, CodeIgniter and MySQL for the backend. It will be mostly click based, ie: There will be buttons for activities like Eat, Play, Study, etc, and in the game environment, one day will contain 3 phases, day, noon, night . And for each phase, users can pick b...
I'm trying to figure out the basics of C64 game development past BASIC, and I could use some advice on something very basic, but important: What is all that stuff on the screen actually, and how to draw it? Take a look at Katakis/Denaris: There are at least 9 different things on the screen: The Score bar, with differ...
Below is how far I've got. I just made a simple block with user primitives to test it. But I haven't found a way to crop the spritesheet. textureLava = frames[activeFrame]; This line is how I want it but off course this doesn't work. Is there a way to crop this spritesheet or is there another way to animate the textu...
assuming I want my game to have a Cel-shaded look. There are plenty of tutorials how to implement Cel-shading in hlsl f.e. But what is the point? If I am creating my assets with Blender or 3d-max I have a lot of possibilities to add materials and shaders in the modeling software. So why write shaders?
I have got some problem in my OpenGL game. I am using bullet physics and I want to achive quite simple effect - I want one object (a sphere) to roll and hit another (box) which will fall down. I have got almost everything but still I have got some errors. When the box is hit it is rotating almost how I would like to. W...
What Im trying to do is pretty simple, offset the rendering position of my image when scaled up/down. I honestly can't remember how to-do this :( if (newAnim.texture != null) { // Set Source Rectangle sourceRect.X = newAnim.imageRectArray[newAnim.CurrentFrame].X; sourceRect.Y = newAnim.imageRectArray[newAni...
I've been learning Blender and have made some decent progress. I've made some neat models, but so far, they haven't been textured. I understand how to unwrap a model so as to get the UV coordinates, but how do I actually create a texture to fit this coordinates? I've looked around and so far, it seems like a lot of peo...
In my Minecraft-clone style game, blocks are textured with a border that is lighter then the block color. See picture below: To achieve this effect without the textures being blurry I use this code: glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); Without setting the MAG_FILTER to GL_NEAREST, it loo...
I created a human model in Blender, exported the vertices and indices into a JSON file and render the model in a browser using WebGL. Now I created a walk and jump animation in Blender and would like to do the same with WebGL. I saw examples that use a list of vertices for every frame of the animation. Is this the way ...
I have a Vector3 represents an Orientation in 3D , how to convert it to the corresponding Quaternion ? Is there any quick way ? EDIT : I want to add an angular velocity vector to the Orientation Quaternion of the body
I have a simple question about sprite swinging weapons. I am making an RPG and would like something other than stabby-swords, so why not swinging swords? I have a bounding rectangle for them, and the player equips them. Great, but I cannot grasp around my head how to swing both the sprite AND the bounding box (in XNA)....
I am working on a game in XNA 4.0 that has been entirely in 3D so far but now I want to incorporate a HUD. I have tried doing a simple test using spriteBatch as such: spriteBatch.Begin(); spriteBatch.Draw(Player.Texture, new Rectangle(0, GameConstants.GraphicsDevice.Viewport.Height - 50, 50, 50), Color.White); spriteBa...
I have a Surfaceview thread and an off canvas texture bitmap that is being generated (changed), first row (line), every frame and then copied one position (line) down on regular surfaceview bitmap to make a scrolling effect, and I then continue to draw other things on top of that. Well that is what I really want, howev...
I am creating a game in Android and eventually I am going to outsource the sound effects. I have a few place holder sounds for testing and I have noticed a problem. I have an OGG sound file which plays correctly through the emulator/headphones but when I put it on my phone it doesn't play. Putting my ear right up to ...
We have lots of small BMP files which I think would be easier to copy if we had them combined in a big TAR/ZIP/whatever. What is the state of the art at shipping game graphics? We are using C# and are aware of zlib. Just brainstorming to see if there are any other solutions better than zlib.
I want to learn C++ for game development. Does anyone know a good way to learn this? It can be with books, tutorials, anything. I would also like to know what is a good engine to start with? thanks you :)
I'm trying to learn graphics programming and DirectX11. I'm trying to learn how to minimize CPU-GPU transfer and graphics programming in general. I have a question that I have been unable to answer myself from online resources: Which of the D3D methods actually sends the data to the GPU(and, equivalently, for a stati...
Dear Fellow Game Developers i am newbie to Android Game Development,i like to know how we can develop a sprite rotate in circle on android,with help of libgdx, i do have a image in assets folder,cant load it in emulator,following code is using to load image in texture texture = new Texture(Gdx.files.internal("132560...
got another question here. Its not about actually writing/reading files in XML, i already know how to-do this. But rather something that has bugged me for awhile. Ok, so when i write out my files, they look like this: <?xml version="1.0" encoding="utf-8"?> <XnaContent> <Asset Type="ProjectWitch.Animation"> <Fil...
I wrote a kids' picture book that I want to make into an iPad app and iPhone app. (More of a story than a game, but same principles, I guess.) Here's a sample page: https://img.skitch.com/20120108-bqusir4xt3hhxx5fufhh7pw4wy.jpg (There are words on each page -- I've just scrubbed them out on the image for this example.)...
I'm writing my own level editor and recently got the exporter working so now I'm working on the importer. My save file structure looks essentially like this: [ObjectType] Property=Value ContentProperty:ContentType=ContentName [/ObjectType] The problem is in loading the content. I'm trying to find out how to lo...
I am a total beginner in C++ and programming generaly. I have watched a couple hours of C++ tutorials and read a lot about it (Can anyone recommend some tutorials?), but what I've come across and couldn't understand was Libraries. I want to develop games in C++ (I think, it seems the most interesting at the moment). I ...
I'm currently having trouble implementing loading content with the content pipeline into my WinForm application. I'm using the "WinForms Series 1: Graphics Device" sample provided by microsoft. By simply creating a project, copying over the classes, creating a both content projects like in the sample worked all fine. B...
Can you give me code if some knows code?it is too important for me
In my code, I just have a Level class right now in the main game loop that just blits a background and spawns some enemies for testing purposes...But I can't figure out how to go about implementing multiple levels and level progression. What is the best way to manage multiple levels and level progression in a game? I'...
I am creating a cow out of primitive shapes, and am using the minecraft cow texture as a placeholder. To create the primitive model I have created a 'model' class and created a sub class 'ModelCow' which inherits from the Model class. Each model contains a List of the component class which is like a sub part of the mod...
I'm creating an app and I'm trying to make it so I can drag a sprite (with a second sprite on top) around the screen, but if I just tap the sprite some other method should get called. I got the dragging working fine when I touch the edge of my sprite, but when I try to drag from the middle of the sprite (where the seco...
Alright, been working on setting up my first deferred rendering attempt using a light prepass technique in Direct3D 11. Anywho, I've been having problems understanding and using render targets. Never really had to do much of anything with them in my previous forward rendering approaches. I'm pretty sure I'm correctly i...
I'm working on a 2D tile-based game. I'm trying to calculate FOV and I've implemented walls so they don't take up an entire tile. Instead, they just take up a side of each tile. Similar to: class Tile { bool northWall; bool westWall; } Most of the algorithms I've been looking at expect walls to take up a full ...
I'm appealing to people's psychic debugging skills: I have an OpenGL app that uses shaders and attributes in uploaded VBOs exclusively. It runs fine on the desktop (Linux with integrated Intel card). It compiles for and runs on Chrome NaCL, which is OpenGLES 2.0. It does not draw anything, however (Vista, an ATI card)...
I am creating a minecraft like terrain engine thing in XNA and C#, and I am trying to create a item/block selector tool. The thing is I would like to have 3D objects on the tool. So I thought for the 3D objects to not move where the camera rotates/moves I would have to use pretransformed coordinates. Is that true? Also...
I've decided to resurrect an old game idea I had years ago. I currently have zero experience with programming, but I'm going to begin studying either C#, Python or both in the near future. The issue I'm currently facing is that what I plan on making is an isometric Metroidvania-type game, similar to that old GBA title ...
I have a 2D game written in XNA, and I've been trying to fine-tune my collision resolution. All of my game objects are squares, which means detecting a collision is easy - use the position and the size of each entity (which is already known) to craft a corresponding Rectangle, then compare the two with Rectangle.Inters...
In the game of Scopa, at the player's turn, there could be anywhere from 0 to 39 cards on the table (although 10+ is an extreme). I'm trying to figure out the best way to figure out possibilities for the player to pick up cards off the table. Also, in Scopa, you can only pickup cards off the table if there's 1+ cards o...
I have been learning game development, using C++ and OpenGL, for about 4-5 months. Before that I used to program in C# and the .NET platform(about a year). So, I consider myself new to game engineering and software development as whole. Recently I read about SIMD math. I found it interesting and started wondering if i...
Probably everyone is familiar with all kinds of visual node based programming tools like HLSL editor in Visual Studio 2011 or UDK engine Kismet/Material editors. My point of interest are the connectors between the nodes. Basically those are implementation of Bezier Curve algorithms. Those are not hard to put into code....
I've read this one, but I need more info: rotating an object from sourceAngle to destAngle, both 0-359, clockwise or counter clockwise? I have a ball. The user is able to drag the ball in any direction clockwise/anticlockwise around a circle. I need to know whether or not the ball was dragged clockwise or anticlockwise...
I'm writing an OpenGL app with Java. I need to do some math for camera and frustum culling (for AABB). Could you suggest a simple and fast Java math library for that?
So I'v been hobby programming games for a few years now but never released anything. This year I was thinking about deepening my knowledge of the industry and doing some networking buy going to some trade shows and maybe taking part in a contest. My first instinct was try E3 but that is not open to the public and is i...
I am pretty new in game development - on Android platform and thinking about one-man game development. I know I can't professionally do everything such as graphics, sounds, and music but I think I can worry about them later once I finish its coding. My current road block is setting up game design process. I've read som...
I am thinking of writing myself a simple 2D game. It will not shine with perfect graphics or gameplay at first, but I'd consider it my first step in PC game development. So, imagine such simple sprite-based 2D game (like Heroes IV or Startcraft BroodWar). I want the gameplay to support day/night with the according ligh...
Given a set of playing cards (rectangle images with a width and height) how can I rotate and position each one so that they appear in a 'fan' pattern, much like you would hold a hand of cards in real life. What math is needed to do this? UPDATE Here is the final, in browser implementation in JavaScript: https://cosmicr...
I've made a fair number of 2D games (and actually completed/released a few of them). I'm hesitant to move into the 3D realm, because of the order of magnitude (everything takes ~10x more work). To get started, I was thinking about picking something and modding it. What's a good, "easily" moddable game? By easily, I rea...
I am using PGELua for the PlaystationPortable. I would just like to know how to make a 2D sprite move in the direction that the sprite is facing. When the sprite is blitted to the screen it should be heading down the y axis (like it's moving up the screen) but it doesn't appear to be working that way. As far as I am a...
I heard that there was a faster method of displaying vertices, rather than recreating the GL_TRIANGLES, each time the scene is drawn. I thought I read somewhere that this method was obselete. Why would the OpenGL group remove something that was faster? Even if it is obselete, how would I go about implementing this?
While looking for examples of RPG experience formulas I came across this one How to create adjustable formula for RPG level up requirements?, and I would really like to figure it out because I don't seem to get the same results. I'm trying to understand the maths behind it because actually we are using UDK and Unreal s...
I really couldn't find a correct answer while scowering all the forums for Noise Generation. My goal is simple, I really want to have two distinct layers for my terrain, a white layer representing air, and a black layer representing earth. An algorithm will pick up from there. Most noise I found generated "Cloudy" tex...
On this map, the "mainland" is all the land that can be connected to the center of the map in the four cardinal directions (north, south, east, west -- not diagonally). I would like to detect the mainland and fill the holes in it. I thought of three things: Search in every non-water (dark cells) cell if can be connec...
I've been using XNA for a while but recently I've needed to write a content extension library which I haven't done before. I need to import a TextureAtlas class from a file that is exported by a tool I wrote. The output of my editor is a serialized XML file that contains a list of all StaticImages and Animations in the...
I'm looking into adapting the classic "helicopter" game (i.e. http://www.addictinggames.com/helicopter.html), but I haven't yet figured out how to create the walls-generation engine. Any pointers into the pseudocode? I'm not so interested in the objects in the middle- only the methodology for generating the sides in a ...
I have implemented functions that can draw any polygonal shape, however I have been unable to generate a smooth shape that mimics the rounded edges of a lake. I tried generating two circles and joining the edges but there is not enough variation or smoothness to it. Does anyone have any pointers or ideas that could ge...
What technologies are used to develop games for tablets and iPhones? Would Flash be commonly used? Is HTML5 capable of animation and interactivity, or would a game file simply be placed within HTML5 code? Is Flash and HTML5, and then wrapping the game for different phone/tablet operating systems a common combination?...