instruction
stringlengths
33
29.4k
I am very new to game development, but not to programming. I am (again) playing around with a Pong type game using JavaScript's canvas element. I have created a Paddle object which has the following properties... width height x y colour I also have a Pong object which has properties such as... width height backgroun...
I have a very simple game: 2 players (one human and a computer) and both have 1000 tokens. They must build an army. Depending on the type of soldier, it cost from 10 to 100 token to train one. Eventually I want them to attack the each other. What would be the AI to use in that case? Is there any example around that I c...
I have a Direct3D9 application that is rendering ID3DXSprites. The problem I am experiencing is best described in this situation: I have a texture that is totally opaque. On top of it I draw a rectangle filled with solid color and alpha of 128. On top of the rectangle I have a text that is totally opaque. I draw all of...
I am using assimp to load 3d model data. I have noticed that each loaded model is made up of different meshes. I was wondering should each mesh have it's own vertex/index buffer or should there just be one for the whole model? From looking through the index data that is loaded it seems to suggest that I will need a ver...
I just want to ask the question above ^. I want to learn C++ language. Someday i want to develop Game Application in c++ and I think it is so difficult for me to achieve that but im willing to learn and achieve that goals for may personal satisfaction and also for my CV as well. Can you give me a guidelines on how to a...
[Edit: I found an answer - see below] I have a 3D game world on an iPhone (limited graphics speed), and I'm already regulating whether I draw each shape on the screen based on it's size and distance from the camera. Something like... if (how_big_it_looks_from_the_camera > constant) then draw What I want to do now is a...
I want to implement something like this to create a heightmap: 'Place a group of coordinates evenly across a map, and give them height values within a certain range. Repeatedly create coordinates between all of those coordinates, setting their height by deriving a value that was a mean value of all the surrounding coor...
I've always wondered to what extent object orientation is used by videogames, especially huge 3D projects. I reckon it would be cool that both troll and werewolf inherited its attributes from enemy and overwrote some of them. But maybe classes are too heavy to be practical, I don't know...
The output from the pixel shader in Direct3D is four floats, normalized 0-1 for each channel (RGBA). But what happens if these floats haven't been normalized correctly and are above 1?
Is it possible to detect when an object and a bitmap collide. I have an arraylist of sprites that I am shooting with an image. I tried using this method here but as soon as the bitmap appears the sprite disappears, this is in the Sprite class: public boolean isCollision(Bitmap other) { if(other.getWidth() > x &...
In the Esenthel engine, you can easily add an object like a button to your GUI class with Gui += buttonInstance.create("click on me"), but I'm just wondering how can you remove an on object from from GUI members. As far as I have found, there is no such a method as removeChild or getChildren, or anything similar.
I am simulating explosions in a 2D maze game. If an explosion occurs in an open area, it covers a circular region (this is the easy bit.) However if an explosion occurs in a narrow passage (i.e narrower than the blast range) then it should be "compressed", so that it goes further and also it should go around corners. U...
If I embed the V8 JavaScript Engine in my game is it still possible to distribute it in the Mac App Store?
This is something I've been wondering for quite a while. When building games that exist out of multiple levels (platformers, shmups etc) what is the prefered method to switch between the levels? Let's say we have a level class that does the following: Load data for the level design (tiles), enemies, graphics etc. Set...
I need to simulate my background scrolling but I want to avoid moving my actual image control. Instead, I'd like to use a WriteableBitmap and use a blitting method. What would be the way to simulate an image scrolling upwards? I've tried various things buy I can't seem to get my head around the logic: //X pos, Y pos, ...
A lot of games start with their intros and vendor videos, and then show a "Press Start" screen before the actual main menu. I never quite figures out the purpose of this. Why not go to the main menu directly? The only possible explanation that made sense to me is that when multiple controllers are connected it allows t...
I am trying to animate a specific tile in my 2d Array, using blitting. The animation consists of three different 16x16 sprites in a tilesheet. Now that works perfect with the code below. BUT it's causing memory leakage. Every second the FlashPlayer is taking up +140 kb more in memory. What part of the following code co...
I am writing some UI stuff for my games in C++. Basically its a very common problem, but I dont know the best answer yet. Suppose inside my UI Library I have a view class which renders 2D/3D scene. This view can contain many subviews. I needs a container which allows me to iterate over these views fast and also insert/...
I have been wondering whether using SpriteBatch is the best option. Obviously for prototyping or small games it works well. However, I've been wanting to apply techniques such as shaders and lighting to my game. I know you can use shaders to some extent with SpriteSortMode.Immediate, but I'm not sure if you lose power ...
I have been searching google, Apache Docs*, and FlashPunk forums looking for an answer to this: I cannot get Ant/Flex to find and compile the FlashPunk libraries. Here is my build.xml. <project> <!-- Flex SDK Properties --> <property name="FLEX_HOME" value="/opt/flex"/> <property name="MXMLC.JAR" value="${FLEX_HOME}/li...
In various math libraries developed for game engines, I see 2x2 and 3x3 square matrices having this function (along with some helper functions). I tried to find information regarding it but did not come across game specific material (wikipedia entry is quite heavy and does not relate to games). It would be great if in ...
In XNA, the system calls update and draw function with the time information. This contains information such as how much time has passed since last update was called. This makes easy to integrate time and do animation calculation accordingly. But I dont see any such mechanism in openGL. I see openGL requires programmers...
I'm trying to picking some object with rayTest method of BulletPhysics. The problem is my stage is surrounded with walls (btStaticPlane) and the target objects (btSphereShape) are in there. And I'm trying to pick with a line from the outside of the surrounding box. So I have to exclude the planes from rayTest. How can ...
I'm curious- what operations are there in Direct3D that aren't controlled directly through shader, or directly to do with shader manipulation- i.e., that occur behind the scenes. So far, I've got just pixel interpolation.
I'm going through the wildbunny blog to learn about collision detection. I'm confused about how the vectors he's talking about come into play. Here's the part that confuses me: p = ||A-B|| – (r1+r2) The two spheres are penetrating by distance p. We would also like the penetration vector so that we can correct t...
I need to draw contour around 2d objects in 3d space. I tried drawing lines around object(+points to fill the gap), but due to line width, some part of it(~50%) was covering object. I tried to use stencil buffer, to eliminate this problem, but I got sth like this(contour is green): http://goo.gl/OI5uc (sorry I can't po...
I have a basic 2D tower defense game in C++. Each map is a separate class which inherits from GameState. The map delegates the logic and drawing code to each object in the game and sets data such as the map path. In pseudo-code the logic section might look something like this: update(): for each creep in creeps: ...
I’m learning Java at the minute (first language), and as a project I’m looking at developing a simple puzzle game. My question relates to the methods within a class. I have my Block type class; it has its many attributes, set methods, get methods and just plain methods. There are quite a few. Then I have my main board...
which one has more potential customers, easier API, and wider feature list? i'm going to develop implement one of those two for highscore recording in my game which ones gives more advantages? and by the way I might be going to port my game to android, so if you know any thing that can help me not to rewrite my code (f...
The extended version of the question is: what is the typical career paths that a developer without specific experience in game development should take if he/she wishes to work in the game development industry? In other words, what are the positions such a programmer might aspire to get hired for, in the game industry? ...
I was wondering if anyone could point me to any resources and/or explain how to properly simulate a 2D rope from a top down perspective? I found a game that has the exact mechanic I'm looking for... http://www.newgrounds.com/portal/view/300760 Play at least one level to get an idea of what I mean.
As a summer project I decided it would be fun to make a Flash game. Right now I'm going for something like the look of Terraria. It's been a lot of fun, but today I've hit a snag. I need a way to generate my worlds. I've read up Perlin noise as a possibility, but I my attempts have given me sporadic looking results...
I would like to know how to leave a fading texture/material trail in udk. For example (I'm not sure if there is a special name for this effect): A character may leave footprints that fade after x number of seconds Or, a tank may leave a tracks trail as in Civilization IV. Here is another example of this type of ef...
I'm working on an isometric 2D game with moderate-scale multiplayer, approximately 20-30 players connected at once to a persistent server. I've had some difficulty getting a good movement prediction implementation in place. Physics/Movement The game doesn't have a true physics implementation, but uses the basic princip...
Hi so i've recently learned the SFML graphics library and would like to use or make a non-rigid body 2D physics system to use with it. I have three questions: The definition of rigid body in Box2d is A chunk of matter that is so strong that the distance between any two bits of matter on the chunk is completely c...
Okay so, I noticed when you rotate around an axis, say you do this: glRotatef(90.0f, 1.0f, 0.0f, 0.0f); That will rotate things 90 degrees around the x-axis. However, it also sort of rotates the y and z axes as well. So now the y-axis is pointing in and out of the screen, instead of up and down. So when I try to do st...
I have a finished Flash game which is rendered using the built-in display tree, i.e. Bitmaps contained in Sprites (and a text here and there, few vector graphics, and one bitmap-filled shape). For extra performance, I'd like it to use Molehill for rendering, but that's not possible out of the box. What's the easiest wa...
The XBLIG submission check-list asks to ensure all gameplay-critical graphics be visible in the 'TitleSafeArea'. I've received a bug report during play-testing that says parts of my scrolling 2D map are only half-visible (chopped off from the left of the screen). I've tested the game on a 47" TV and a 19" VGA monitor a...
hey so I've decided to Code my own 2D soft-body physics engine in C++ since apparently none exist and I'm starting only with a general idea/understanding on how physics work and could be simulated: by giving points and connections between points properties such as elasticity, density, mass, shape retention, friction,...
I'm working on a minimal game engine for my next game. I'm using the delta update method like shown: void update(double delta) { // Update code that uses `delta` goes here } I have a deep hierarchy of updatable objects, with a root updatable that contains several updatables, each of which contains more updatables,...
As most of game programming is done - I read on this very site - in C/C++ I was wondering if there is any learning/studying material for C/C++ that would target specifically game programming. I am not looking for material about "developing games" or "software architecture for games", but rather for material that uses "...
I've written a fairly robust rendering engine using OpenGL ES 1.1 (fixed-function.) I've been looking into revamping the engine to use OpenGL ES 2.0, which necessitates that I use shaders. I've been absorbing information all day long and still have some questions. Firstly, lighting. The fixed-function pipeline is guara...
I am working on an isometric grid based game and im having an issue trying to link a mouse click from the user to a tile. I have been able to split the problem into 2 parts : Finding a rectangle that surrounds a tile (which I have been able to do) Figuring out from the rectangle which tile the click landed in (has got...
What's the best way to handle game states / screens? My problem is this: PlayGameScreen adds a new InventoryGameScreen to the game during it's update. This immediately adds InventoryGameScreen to the array of GameScreens. That's throwing an exception when iterating over the array that the contents of the array have ...
Has anyone yet prototyped a game in both Unity3D and UDK? If so, which features made prototyping the game easier or more difficult in each toolkit? Was one prototype demonstrably better than the other (given the same starting assets)? I'm looking for specific answers with regard to using the toolkit features, not a com...
I have Photoshop experience and a bit of drawing experience, and am looking to learn how to create sprites like this: http://www.lostgarden.com/2009/03/dancs-miraculously-flexible-game.html Any tips on what app(s) to use and any reading material/online tutorials to get started? Thanks!
I am working on a game that needs a level that is completely generated. Currently my approach is to draw textures for the levels pixel by pixel during the game (in XNA with SpriteBatch). This is too intensive unfortunately. The game has frame drops even when I only draw 1 level texture each draw cycle. Here is an examp...
I have an idea for a game like theme park but don't know how simulation games are made. I am not on my first game so I would appreciate constructive answers instead of "its hard, don't do it". What I want is to know how simulation game mechanics are put together. I figure it would be heaver on the AI than normal games...
How can I calculate the position of an object after "firing" it from a fixed point? I am to create a small game - most likely with canvas (pure HTML, JS based) or Adobe Flash - in which the player fires objects at other obstacles in order to clear them.
I need to write a server for an action game, which needs fast communication with the client. There will only be one server, and I'll split the world in zones. The client will be written in Java using jMonkeyEngine and in my opinion I should write the server in Java as well. I don't want to implement any low-level featu...
I finally found Railgun Ruby on the web and installed it. But I cannot find any documentations. Does anyone have played around with it? Does anyone still have a good documentation about it? I'd like to have a look at what it can do. Thanks. Yours, Joern.
I have created a random height map and now i want to create rivers. I've made an algorithm based on a* to make rivers flow from peaks to sea and now i'm in the quest of figuring out an elegant algorithm to render them. It's a 2D, square, mapgrid. The cells which the river pases has a simple integer value with this form...
How do I get the distance between 2 points on an isometric grid? I'm creating a facebook isometric game (in as3), and when I move around a particular type of building, I need to know if it comes within range of another type of structure, for example a tree. I tried taking the grid x,y points for both items, and calcula...
What's the correct technique for getting smooth sprite translations with XNA? I've been developing the WP7 version of an app for a startup, so when we heard Angry Birds got ported today we wanted to check it out and compare. Angry Birds on WP7 had the sub-pixel blur problem with the bird sprites, whereas iPhone, Androi...
I'm developing a classical 2d RPG (in a similar vein to final fantasy) and I was wondering if anyone had some advice on how to do damage formulas/links to resources/examples? I'll explain my current setup. Hopefully I'm not overdoing it with this question, and I apologize if my questions is too large/broad My Character...
I'm trying to understand how to use the XNA XML content importer to instantiate non-trivial objects that are more than a collection of basic properties (e.g., a class that inherits from DrawableGameObject or GameObject and requires other things to be passed into its constructor). Is it possible to pass existing externa...
Two things I'm quite confused about. 1) OpenGL ES 2.0 creates primitives before the vertex shader is invoked. Why, then, does it not automatically provide the vertex shader the position of the vertex? 2) OpenGL ES 2.0 supports glDrawElements(), but it does not support glEnableClientState() or GL_VERTEX_ARRAY, so how ca...
I'm developing a game using Box2D (javascript implementation - Box2DWeb), and I would like to know how I can pan the debug draw. I know the usual answer is - don't use debug draw, it's just for debugging. I'm not, however not all my objects are on the same screen, and i'd like to see where they are in the physics repre...
Would it be much more work to create a 3D game on a planet rather than on a flat plane? What engines would support this and what techniques would I use? An example would be a small sphere the player could walk around to get back where they started.
I would very much like to build a game that is known as 'Unblock' or 'Yellow Out'. It is a puzzle game in which the task is to move a car out of a parking space by moving other cars in certain directions. These are links where the game can be played: Yellow Out Unblock My questions concerning this game are: Is this ...
I'm currently working on A* pathfinding on a grid and I'm looking to smooth the generated path, while also considering the extent of the character moving along it. I'm using a grid for the pathfinding, however character movement is free roaming, not strict tile to tile movement. To achieve a smoother, more efficient pa...
is there any difference between diffuse texture which used in diffuse lighting and ambient occlusion map, or this is the same texture just different naming, because i see it mostly it looked the same?
I was thinking about effects in games the other day and I was reminded of the Gasmask effect from Metro 2033. Once you put the gasmask on it blurred a bit in the corners and could ice up and even get cracked. I assume that something like that is done using a shader. I have been experimenting a bit with game development...
I am having trouble with collision detection part of the game. I am using touch events to fire the gun as you will see in the video. Note, the android icon is a temporary graphic for the bullets When ever the user touches (represented by clicks in the video)the bullet appears and kills random sprites. As you can see ...
I am referring to this fireball game. The ball will collide with background, which is in polygon form. I was wondering, how I can match my polygon data structure with the background image. Say, I had requested artist to draw me a polygon background. Then, how I can generate a polygon data structure to describe the poly...
In the 3d fps in java I'm working on, I need a bullet to be fired and to tell if it hit someone. All visual objects in the game are defined through OpenGL, so the object it can be colliding with can be any drawable polygon (although they will most likely be triangles and rectangles anyways). The bullet is not an obje...
A while ago I asked how to determine when a face is overlapping another. The advice was to use a Z-buffer. However, I cannot use a Z-buffer in my current project and hence I would like to use the Painter's algorithm. I have no good clue as to when a surface is behind or in front of another, though. I've tried numerous ...
I am beginner in android game development. I want my game to run only in landscape fullscreen mode (currently I have Optimus 2X with resolution 800x480 in landscape), and I don't know how to set it. I found the fullscreen mode settings, and tried some landscape mod (set orientation:landscape in AndroidManifest), but th...
How could you program a 2D boids simulation in such a way that it could use processing power from different sources (clusters, gpu). In the above example, the non-coloured particles move around until they cluster (yellow) and stop moving. The problem is that all the entities could potentially interact with each othe...
I have a sizable game engine and I'd like a feature for finding the nearest of a list of points. I could simply use the Pythagorean theorem to find each distance and choose the minimum one, but that requires iterating through all of them. I also have a collision system, where essentially I turn objects into smaller obj...
I'm making a 2D game that ends up being too dark on some laptops, so I figured I'd use a shader so people could brighten it up if need be. Unfortunately, once I got it in there nothing would fade in or out, they'd just pop in and out. Here's my FX file float intensity; sampler TextureSampler : register(s0); float4...
I'm working on a game where some in-game events need to happen once in a while. A nice example would be a tutorial. You start the game, and at several points in the game an event occurs: You encounter your first enemy, the game pauses and you receive an explanation on how to kill it. You killed the first enemy, you re...
In the menu system for our game (selecting levels, options, etc.), the player presses the a button on the gamepad to go to the next screen. I coded the menu system to wait until the button is released before taking any action (i.e., displaying the next screen). Some recent playtest feedback suggested that we do it the ...
As an exercise in trying to learn 3D math, I've been experimenting with hit-testing by casting a ray from 2D screen space into 3D world space. My first attempt was as follows: Matrix m = Matrix.Invert( this.scene.Camera.ViewMatrix * this.scene.Camera.ProjectionMatrix * homogeneousToViewportTransform()); Vec...
I've been using XNA to learn game programming for some time, and I'm interested in moving to Android. Having said that; the learning curve to get started seems to have ramped up exponentially. I have a working knowledge of Java (started with it before learning C#). Is there an intermediate step I should take in orde...
first I’m not programmer, I’ve been using a popular game for some time and I think it would make a great medium for machinima. Problem is that it’s a top down view startegy game and it doesn’t give control of the camera other than pan map with arrow keys, drag with left mouse and zoom on cursor with mouse wheel. I’ve ...
I have a number of tiles as standalone files that I would like to stitch together into a single tileset. Are there any tools that can quickly do this?
I am looking for character animation library which can be included in my game engine. I prefer FOSS but, paid is good if it's price is reasonable. So, far what Ive found is Cal3d. Can anyone tell, what are the other options? I am also interested in Havok Animation which comes in the free bundle of Havok. Any thoughts a...
I already know how to write games in C#, and I've learned the concepts behind network game programming, and created a working multiplayer game that works over LAN. As an example, somebody runs the game server, which keeps track of the position of... say, a ball. Every so often, the server sends the current location an...
I've got a timer in my game which is supposed to set off a Boolean back to false after a certain amount of time has passed it just doesn't seem to work despite me trying to debug the issue, although setting off the timer works perfectly fine. Any help with this would be much appreciated for (int i = 0; i < cameras.Cou...
So I'm trying to start a C++, OpenGL project on Visual Studio 2010, and I have put glut.h and glut32.dll in the project directory, along with the glut.dll and glut32.lib files in a folder named "glut" in the project directory. I have also gone to "Porject Properties -> Linker -> Input -> Additional dependencies" and I ...
I'm trying to make my character move around a tile map with collisions. Everything works fine except for one thing. I show you a picture with the problem: https://i.stack.imgur.com/ZWI7x.jpg That is, when I reach a tile above then I can not move anywhere. If you come from the left, I can not move either up or down. If ...
I've just finished an XNA game for the Windows Phone 7 and XBLIG. At the moment, the game is a 'lite' version, so is free, but the next version will have a small price-tag. I also did a Windows version. Where's the best place to publish it?
What are the best practices for playing sounds in iPhone games? Specifically, what are the best practices while playing sounds simultaneously without affecting other processing much. Is there any recommendation about how sound files must be made to suit the processing?
I'm making a multiplayer mode for a game I developed, and it works over UDP. What I need now is a server to let a player know another player, and send each one the other's IP. I own a VPS that I'm currently using to host a few websites, so I guess I can use it for this purpose too. I would choose Python as a language t...
I'd like to know if someone has found a way to build a component-based entity system in their game(s) without using IDs. I find that IDs tend to do away with one of the major (possible) advantages of OOP: not having to be aware of the type of a certain object.
I want hook all OpenGL games/applications. I want load my library only if application actually use OpenGL. Something like Direct3DCreate9 for Direct3D 9 or CreateDXGIFactory for Direct3D 10/11. I thought this function wglDescribePixelFormat, but some app's/games not use it.
The Aves game engine made a splash last spring/summer, with very impressive demo videos. I went back to check on them, and it looks like their site has long since died. Google also doesn't seem to know anything new about them. Where can I find news about Aves? Is the project dead?
How can I disable or enable multi-sampling live while the program is rendering? I tried this. public override void Draw(GameTime gameTime) { GraphicsDevice.PresentationParameters.MultiSampleCount = 0; ... draw stuff ... } But it doesn't disable the multisampling while drawing, because se...
Is it legal to use car manufacturers' names in a game? For example: to describe Audi's quattro drive system? to display a rendering of an Audi? to include a photo (to which I have rights) of an Audi?
Is there a de facto format for exporting a 3D model from modeling software to a game engine? I know it varies by engine and situation, but what is the general idea that comes to a skilled game developers mind when this question comes up? In my mind obj format comes up, but it doesn't support animation. So, what could ...
Alright, I'm currently making the transition from DirectX 10 to DirectX 11 (with very little help from the MSDN documention) and recently ran into a snag with updating a shader's constant buffer. My application at the moment simply draws a rectangle in screen space and I've attached a float to the pixel shader so that ...
I'm trying to find a good solution for a bullet to hit the enemy. The game is 2D tower defense, the tower is supposed to shoot a bullet and hit the enemy guaranteed. I tried this solution - http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/ The link mentioned to subtract the bullet's origin and ...
I have been looking around for information about this topic but not found what i need. Here is the scenario, i am planning a card based game (cocos2d) where the idea is that up to four players should be able to play. One player will hand out the cards to all four and then they play. Next round the next player should d...
I'm trying, for many days, to get the Matrix or the Vector3 of my 3D model, I don't want to use the World matrix because I need first to idenfy the axes of my object for animation (= rotation of a second object around my first object). If you have an idea or a tutorial for this ? Many thanks, Jeangil
This is not about animating individual characters or elements, I'm happy with spritesheets for that. What I'm looking for is the animation of elements on screen. For example my game starts and the logo comes in flying from a random direction, then rotates or something and stops in one position, then a game character (...
Anyone have any experience with this? This hasn't been refereed as mush as it 'looks/sound' like. https://www.marekknows.com/ Among many other products, the site provides game engine development video, which is around 45hours long. Starting from context creation, model loading, scene graph, animation. But it looks like...
I have a problem with AABB collision resolution. I resolve AABB intersection by resolving the X axis first, then the Y axis. This is done to prevent this bug: https://i.stack.imgur.com/NLg4j.png The current method works fine when an object moves into the player and the player has to be pushed horizontally. As you c...
A friend of mine is asking me to help out on a project of his, I have done a small amount of game development before, but mainly do application and enterprise development these days. He is asking me to look into some of the networking part of his game. I know that a huge part of this is going to involve reporting/analy...
I would like to ask the following regarding developing Tetris- and Angry Birds-like 2D games for Android: Is Java the official development language for Android? What free or commercial Android development environments (like Xcode is for iOS) are available? What open source game development engines, like cocos2D, are a...