instruction
stringlengths
33
29.4k
So I'm writing a game (or toy, rather), which involves manipulating a 3d object with the mouse. I'm trying to get the most intuitive control that I can. I've implemented the "Arc Ball" mouse control. I'm happy with how it "feels", except for when I drag the mouse outside the range of the virtual ball. Currently when th...
So I was thinking about how monolithic my classes get a lot of the time. For example, in the Character class's Jump method, one may have a reference to a sound effect object and play that. By itself that is fine but when physics, animation, collision, etc. are taken into account, the Jump method gets huge and the Chara...
Every 5-10 minutes there's a noticeable frame-rate hiccup in my game. Other than that my game runs very smoothly - again it's just one quick little jump every 5-10 minutes. Is this something I need to iron out or is it not a big deal? How can I find what's causing this glitch? Is there a specific instrument I should us...
Does the physics.addBody() only work with Circles and Rectangles? Or is it possible to physics.addBody() on vector shapes or sprites or with masks or something?
I've just gotten a triangle collision object in using the Separate Axis Theorem, the triangle has a 45 degree slope and resloves collision detection via the projection method. The actual collision detection works fine, but I'm having an issue where the character keeps slipping down the slope when he runs up or goes dow...
I'm making a very basic online RPG (2d, and instead of sprites I use characters, like a roguelike) and I still haven't figured out how to store and retrieve maps. Until now I used a text file that are stored on the server. Should I store the map in the database and retrieve it as the player moves around? For example, i...
We are going to use TexturePacker to create our texture atlases for a Moai-based game. I'm wondering what the correct texture format and image format is to use specifically for Moai. Should I just use png and RGBA4444 or can you use pvr and PVRTC4? PVRTC4 format seems to create a texture that indicates less RAM usage b...
I'm making a video where I want to show a few scenarios of a game in 3d: It has some objects with simple shapes - stairs, walls, barrels. So all I have to do is to model those simple objects and apply the proper textures on the right faces. I have never learned a 3d modelling software so I would like to know, what of t...
I'm trying to follow along with the gltut tutorials and for some reason when I call GLDrawArrays my program segmentation faults. I've been looking at the state of my application with the Mac OpenGL Profiler and Googling and I can't seem to figure out why it isn't working. I may have missed setting some OpenGL state som...
I'd like to get into online games programming. I thought that as a start i'd be a good idea to implement an online database that would store the progress and score for a game i have made, i'll probably want to implement an account system too. My issue is, i can't see to be able to ask google the right question. I don't...
I live in a pretty high-income community where teachers and parents tell you that if you ever hope to have a good income, you have to go to a good, selective college. However I'm one of the few kids at my school who has developed a love for programming software (and games on occasion), and I've never had a teacher that...
I'm creating a top down 2D RTS game for educational purposes. Currently, I'm really just copying Starcraft's design/ideas. I've decided I should probably implement Fog Of War too. My expectations: Areas currently explored (units are there) should be lit up. Areas previsouly explored (units were there) should be dark...
I am just making a simple editor for a project I am working on and as part of this I need to add a few different MDI forms within a larger container form. Now the XNA (4.0) example Windows Forms projects use a shared graphics device for all controls, however I was assuming I would have a graphics device per control (as...
I am making a 2D graphics library in Python designed to make 2D easy and fast. Internally it uses OpenGL. The library does cover a bit more then a graphics library, it also includes windowing and sound (and all necessary features to get working, like texture loading). I've got a good beginning working with good perform...
i have a modelmesh that has a image on it. When i draw the modelmesh i get the image but i also get a black bacground. The image is png and transparent and is added in 3ds max(i don't give it coordinates to be drawn, it sits on the modelmesh). How can i make the black background transparent? Here is my drawing code: ...
Let's say in a deferred renderer when building your G-Buffer you're going to render texture color, normals, depth and whatever else to your multiple render targets at once. Now if you want to have a gamma-correct rendering pipeline and you use regular sRGB textures as well as rendertargets, you'll need to apply some co...
I'm trying to create a pseudo turn based battle system in the Unreal Engine (think Final Fantasy style). I'm trying to avoid the Enemies and the players attacking while another animation is in progress. I thought the most simple solution is to have a flag somewhere that the player controllers check before starting an a...
Quick question to those that have used the Unreal 3 Engine for development. (Not the UDK). How much work would it take to take a game made on/for Windows and output a working build on another platform? Is it as simple as "File -> Export -> PS3" (or similar) or is there much programming involved?
Hi I want to make a pause and credits screen for an android game with libgdx the idea I have is creating a new screen like a popup that pauses the background screen and then, I can render the screen I want to show. Please give me some info or ideas for this.
For Android, let's say you have a image of a map that you draw inside your view. On this map there are many, many "hot spot" locations where you want your user to be able to select. Given that there are so many, you want to give the user the ability to zoom the image, and since it can be zoomed, they need the ability t...
There are a lot of articles about how to save a state of a game and they are pretty good. But I have one conceptual misunderstanding where should I save the state? My game has number of screens and pair of them are MainMenuScreen and MainSceneScreen these are inherited from Screen class. MainMenuScreen is shown at star...
I'm just getting started with the UDK, with experience in Unity, and would like a good tutorial series about getting to know my way around the basics of level design and a touch on programming. I have found some basic tutorials on level creation, but they are pretty old, and would like to know more. Thank you!
I am working on a tile based game in Java. I have a 2D array of tiles (JComponents) in a GridLayout, this is fine for creating the world (I think), but I am stumped at how to move the sprite smoothly between tiles. Currently, each JComponent tile draws the world and the sprite in accordance with booleans representing s...
Okay so this is kind of weird, I have some code that creates particle.cs instances public void AddParticle() { for (int i = 0; i < Density; i++) { particle = new Particle(); Randomnum = new Random(); Direction = Randomnum.Next(360); InitialVel = AngleToVector(Directi...
I started a tutorial for java's slick 2d library, called SlickBlocks which is essentally a tetris clone. The problem is I have followed and typed in the code examples to the dot, yet when I run it I get the exception: Exception in thread "main" java.lang.RuntimeException: Resource not found: testdata/alphamap.png. I ju...
As I know Android is running on Java VM on top of Linux kernel. These so many layers may lower down the performance (FPS,etc.). Is Android still good for game development then?
I have been reading a lot of different shaders and some have the preference of: sampler depthSampler : register(s1); Whilst others take the longer route: texture depthMap; sampler depthSampler = sampler_state { // etc. }; Is there any real difference between the two? Does one perform faster than the other?
I'm trying to get the depth buffer for my 2D game working by offsetting the z value of the rectangles. For some reason, my depth buffer is coming back empty. The value is always 0. I'm assuiming there is something wrong with how I attach the depth buffer to the FBO? But I've looked over that code many times and don't s...
I've noticed that when driving at night, when the road surface is dry, my headlights appear to illuminate much further than when the road surface is wet. I presume that this is due to the differences in how my headlights is being reflected under wet and dry conditions. In dry conditions, my headlight will reflect in a ...
I have been looking at the following question:- Tile coordinates and am thinking of using this for collision detection in my tile game. The set up in my game is similar to this, in that there is a grid of tiles, and the sprite will move to (x,y) coordinates. However, if I were to have an object such as a box in my wor...
Possible Duplicate: How can I get involved with open source game projects? I am trying to get involved in working on an open sourced basic game, but I've never attempted this before. I haven't the slightest clue how to go about this, what I should know (not programming-wise, just in general) and such... Not sure if ...
We need something where we can check files out, edit them, check them back in and then build from the them. Something like Google Docs where we can edit the same code at the same time would be a ideal. We are both using Visual Studio 2010.
A brief rundown of the hierarchy of the game data objects: Configuration - loaded from XML files, has Descriptors, among other things Atlas - has a Configuration, has a CreatureInstance(represents the player's creature instance), is an associative array of AtlasColumns AtlasColumn - has an Atlas(parent), is an associat...
I read this tutorial http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2/Camera_delay.php but i didnot unsterstand it. Is there another way to delay the camera position movement without this Quaternion and the "up position"? Basically i want the camera move slowly to another location, and i tried this: view...
I've been struggling with this for a while. I have been trying to create a bullet pool class for a game I have made that doesn't cause a significant fps drop. I have tried creating a bullet pool and have also tried dynamically creating and deleting bullets, both of which drop the fps of the game around 10-15. I ran...
I'm trying to make a game that uses Farseer physics engine as its main collision detection engine. I have a 2d circle body object that has a matching fixture (I used the CreatCircle method. I did not create the fixtures and bodies separate). When IsSensor is set to false, objects collide with this circle and bounce off...
GL_ONE, GL_ONE This makes the flamingoes transparent on: http://www.andersriggelsen.dk/glblendfunc.php but not in cocos2d using: sprite.blendFunc = (ccBlendFunc){GL_ONE, GL_ONE} How can I achieve a similar effect in cocos2d? Thank you.
I'm trying to figure out the best way to programmatically represent terrain in my game. I've been considering using a heightmap (or grid of evenly spaced vertices) to represent the surface of the terrain and a splatmap to allow smooth texturing. This would work for totally smooth terrain, but the problem is how to repr...
I'm thinking of making a game that requires two mice to play. It needs to register the movements separately from one another. Is this possible? Or does the Windows architecture not allow for such things?
I have an octree, with a high poly rabbit inside it, and a 12 polygon platform. The deal is this. You're shooting a ray at the rabbit. He of course dodges (or you miss). The yellow beam is your death laser. The "candidate" triangles that are selected due to the parts of the octree you hit are shown in purple. So cl...
I am currently developing a 2D Blockdude clone for learning purposes and am wondering about storing character state in the game. For example, the character can be facing either right or left. What are some common ways of handling character state? Unfortunately, the question is so broad none of my searches have come up ...
Writing my game in libgdx, I arrived at the point when I need to save the player stats and the info of the levels. However, in libgdx it's not allowed to write the file inside folder of the application, only external (on the SD) is allowed. The point is that I don't want the file to be seen by anyone, or if they can se...
I want to create a game, where the world is loaded from an image file, much like Paradox Interactive does it for their games. If I have this image: Then the red, green, blue, cyan, magenta, white, black and grey should be different provinces. I know how to loop through them, and check if it's a new province, the probl...
How can I make a callback from libgdx to an Android method? I want to use the method to overwrite a file in the internal memory.
Beginner question. Synopsis: my water effects does something that causes the drawing of my sky sphere to throw an exeption when run in full screen. The exception is: XNA Framework HiDef profile requires TextureFilter to be Point when using texture format Vector4. This happens both when I start in full screen direct...
I am searching for a way to create and integrate cinematic in a simple 2D game with XNA for Windows Phone. I don't know if the best way is to create an animation with sprite and commonly process to animate them... or Is it possible to create the animation with an external tool and read it from the code. Thanks for your...
Just as I was told here, I need to make some kind of communication between objects in my game. Mainly, for achievements. How do I do this? My idea was to make every object have an array attached to itself called "messages", and then, when something happens, a message gets pushed there. At the end, I would have a big lo...
What is the best practice to use when events happen in a game? For example: You have a sensor. When a particular game actor is near that sensor, a sound must be played and a door must be closed. When a collision between characters A with animation i and character B with animation j happens, a special graphical effect,...
i want to animation the transition between game screens , in my game loop i have a function called getCurrentScreen() which returns a Screen object this Screen Class has a function called present() this function draw on the framebuffer , when i want to change to another screen i call setCurrentScreen(Screen) , so it w...
I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am having trouble figuring out which side of the rectangle B took the hit? Any ideas? Thanks!
As Lego (the old blocks not the 'new' hi-teck stuff) are now in the public domain, can I make a game where the graphics are made out of lego blocks? Well, I can, but is it legal?
Recently I started designing a particle system for a game I develop. But I have some issues with it. I mean, it works but I have a feeling that my design isn't good enough. So, basically I have a Particle class which contains the particle's vars and couple of functions: class OBJECTATTRIBUTE_API Particle { protected: ...
I have three UIImageViews. enemy1, enemy1AggroBox and mainSprite. What I want to do is when mainSprite and enemy1AggroBox interect, I want enemy1 to start moving towards mainSprite. Basically creating aggro for a game. if(CGRectIntersectsRect(mainSprite.frame, enemy1AggroBox.frame)){ //Code here// } My plan would be ...
I've been tasked with building a real time "full screen" demo to run on a 5x2 array of 60+ inch LED TVs: or, in other words, a 20 megapixel display. We've got a machine built that can run a single Win7 desktop spread across the displays at full resolution, and some pretty decent video cards. My question is: aside from...
I have made a type to shoot game using HTML5, Javascript and Ruby on Rails. Here is the link for the game Tweetraitor I wanted to make a loader for resources (sounds, images) when the game starts. Currently when the game starts the background image takes time to load and it does not look good. This loader should load a...
I've been working on application development with a lot of "retained" GUI systems (below more about what I mean by that) like MFC, QT, Forms, SWING and several web-GUI frameworks some years ago. I always found the concepts of most GUI systems overly complicated and clumsy. The amount of callback events, listeners, data...
So i've been working on a multiplayer game for a bit; it's a co-op action RPG with real-time combat. If you've seen or played TERA, I'd say it's comparable to that, but not an MMO, heh. I'm currently handling the AI units authoritatively, the server calculates their pathing, movement, and pursue/attack logic, and syncs...
I'm trying to get an understanding for the Box2D/Farseer physics engine by implementing a small air hockey simulation. There, I have the problem that the CPU player attacks the puck, kicks it, but also gets kicked back due to restitution. I would like the CPU player's mallet to be pinned to where it currently is; being...
I recently downloaded the JBox2D but how do I set this up? It's jbox2d-2.1.2.2. All I can see is a bunch of code and folders.
How do you handle the separation of animation from the world state within a turn based game? I'm working on a 2D grid based game currently. The below code is simplified to better explain. When an actor moves, I want to pause the flow of turns while the creature animates and moves to the new position. Otherwise, the scr...
When trying to program hostile AI units for a war strategy game using pathfinder methods, do programmers ever have one algorithm for the unit to move and a separate algorithm for the unit to actively listen for nearby objectives (e.g. opposing warriors, power ups, opposing team's fortress, treasure, etc)? Any insights ...
Here's the situation. My brother, a freshman in high school, isn't doing too well in geometry. Partially because he doesn't do half the work, but partially because he seems to have genuine difficulty with the material. So then I thought, since geometry is so useful in game dev, why not get him a book that presents g...
I am making an iOS game for a project at school. It is going to be a tiny bit like Fruit Ninja, as in it will have different things on the screen, and when you hit them, they die, and you get points. The trouble is that unlike Fruit Ninja, my game will have different types of sprites, all doing different things (moving...
I was looking for some inspration for my Voxel based game I am writting and came across this: http://www.youtube.com/watch?v=rL8zDgTlXso. I would like to know how to go about (or preferably source examples) of how I would do that, in real time, and infinitley. In addition to that I was wondering how I would do this wit...
I've been reading up on particle systems amongst other stuff and one interesting approach uses rendertargets to store a particle's position, velocity, lifetime, etc. A pretty neat summary is given here, for example. However, I'm wondering how to effectively use such a system? How would you create new particles, upload ...
I'm working on a turned based multiplayer android game with a friend. I started working on the game server and client using socket programming. I found a few tutorials on how to implement a basic chat on android and I started extending that example to suit my needs. Basically the game is really simple and the communica...
I've got two List: BasicModels: As Content has to be loaded at the start of the game I instanciate and load all models into this list. ModelsOnScreen: Every time when a Model is added to the screen I take the corresponding object out of BasicModels and put it into ModelsOnScreen. At the same time I write the ID of the...
Alright, I'm sure there has to be a simple way to do this but it eludes me at the moment. I want to be able to generate random points on the surface of a quadrilateral in 3D space. (Defined simply as four points) What is the best way to go about doing this? If the quad is a rectangle, this is trivial to do with random ...
I have two UIImageViews. mainSprite, and enemy1. And I have a method that makes enemy1 start moving towards mainSprite. So here's that method. -(void)enemy1Aggro{ if (CGRectIntersectsRect(mainSprite.frame, enemy1Aggro.frame)) { if (mainSprite.center.x > enemy1.center.x) { enemy1.center = CGPointMake(enemy1....
I'm making an Arkanoid or Brick Breaker game, but I got confused when I wanted to implement power-ups. The idea is that when you destroy a brick, a powerup-block falls down, and if you catch it you'll get the powerup. -for example: Wider Paddle (change dimensions of the quad) Change ball speed (variable) Ball goe...
I noticed that when writing a camera for my 2D game that the camera rotational value of -6 and 6 is equivalent to 0. That is, -6 = -12 = -18 = -24 = 6 = 12 = 18 = 24. I was wondering if it was considered good practice to always keep the rotational value between -6 and 6, like so: public float Rotation { ...
So I created a nice little isometric tile engine and I have it so that when you scroll with the mouse it changes a variable called scale. Scale is a float and gets passed through the spritebatch.draw() function. I apply scale to all of the math I do when generating the positions of the tiles. The problem I am having is...
I'm still somewhat new to "proper" design, but I'm trying to keep with it as much as possible. I thought I was OK but I've run across a slight dilemma: how should I be implementing the actual drawing and updating of entities? For example, in my project I have a TextBox class. The 'easy' way, and the way that I usually...
I have an idea on a game and planning on developing a 2D game using XNA for Windows Phone 7. I've started off today by free hand drawing some concept art of what I want some of the characters to looks like. Now the problem is taking those concepts and putting them in digital form. The first thing I realized I reall...
There are plenty of articles about open world game design and writing plots. But have you guys come across articles or blog entries about designing an engaging plot in an open world game? What i mean by this? In TES:Morrowind you're introduced to mechanics and are given the "main quest" within the first 5 minutes and t...
I'm planning to make a simple, HTML5 game, that would use some elements of the Half Life universe. Basically, it would be a 2D Portal clone, but it would have it's own story, and portals would be different, along with the mechanics of making and using them. Also, how far can I go with this? If possible, I'd like to hav...
I'm trying to create an explosion at the point that two entities collide, but whenever explosion.Activate() is called, it causes an InvalidCastException to be thrown in Raycast(), on the line that returns the callback. return callback(fixture, point, output.Normal, fraction); Is this a bug in Farseer, or am I doing so...
I've been programming for a while, and I'm concurrently learning how to make a basic game and slimdx, and wanted to talk to someone to hopefully get a few pointers. I've read that Tetris is the "Hello, world" of game programming, which made sense to me, so I decided to give it a shot. I've been able to code up a basic...
In AndEngine, many times we create a TextureRegion for our sprite. We can move this region around the scene but when I connect that region to a physics body I end up being able to use either one to move around. My question is, which one do I move around. Should I use the physics body's position or the Texture?
i'm new to game developement and i want to fill the missing spots in the proccess of creating games for PC. my intentions are for first person action games like "return to castle wolfenstein", "hitman" or "call of duty" series. i've done some interior designs in autodesk 3ds max and also wrote web/windows programs in c...
Alright, let me start off by saying this: I've seen multiple threads comparing creating custom game engines to already created game engines such as Unity3D or UDK, but none of the threads I've found have discussed this issue in terms of pure learning purposes. Instead, they've discussed the advantages and disadvantages...
I've always wanted to make a video game that criticises pokemon. I want to know if I could use pokemon as the characters in the game without running into copy right laws. The game itself will have nothing to do with the normal purpose of pokemon but at one point also mimics pokemon mystery dungeon a little. that point ...
I believe the best way to manage item data would be to use xml? For spells would the best option be to create a class (EG Fireball) and define all of the parameters inside of that class? Like Initilize Update and Draw? Then have a class called ParticleEngine and define Inside of fireball the type of particles to use? ...
I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its bounds. However, I'm a bit confused on how to do the same for rotation. Currently I allow rotating of the camera's Z-ax...
Some background: I want to start developing games, and taking some of the advice given in this site, I've started with something simple and familiar, such as pong, tetris, etc. I want to take as much time as needed to make sure that I have the basics right before moving on to something bigger. I have medium programming...
I'm trying to write(in c++ using sdl) a mario like game as in a tile based world with by pixel movement for the character and I've run into some problems I cannot seem to find the source of: 1.The player won't collide with the walls. 2.when moving through open space the player sometimes stops moving and then becomes un...
Before I start making a game, I'm trying to figure out how I will manage things. One of the first things I'm not sure about is how to manage entities (enemy, player, projectile...) I'm going to be using either C, C++, Java, or C# One of the ideas I have is to use one array for projectiles and one for enemies. Each ti...
I am making a study for a research project that involves measuring the performance and quality impact of rendering 3d games using a software rasterizer (like WARP). I wonder if there is a way to force games to use WARP. Maybe something easier would be to just use games that support using warp or the reference rasteriz...
I would like to know the best or most efficient way to test for 2D collision. I am currently using AABBs, but the problem with this, is that your objects will be hitting things when they shouldn't. On top of this, AABBs cannot be rotated. I was considering using per pixel collision, but I feel that it would lag on larg...
Currently I have something like this: public bool IsLeftMouseButtonDown() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ButtonState.Pressed; } public bool IsLeftMouseButtonPressed() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSa...
I wish to try and create a TCG using C#/XNA that would run inside a web browser. Some of the main game's features would be: At least 2.5D to imitate the card flipping/shuffling and etc. effects Simple particle effects (maybe even none at all) Use of scripting since each card would have its own abilities/type/effects U...
I am developing a Windows game engine that will let you create games styled like "Phoenix Wright: Ace Attorney". I have finished developing the data entry parts (evidence, profiles, animations, etc.), and now I am going to create the scene editor. With this editor, you can create courtroom scenes. I am having a particu...
I've created a planet and obstacle grid and want to move units through this grid using A* or any other algorithm. The only problem is wrapping. I need a simple example of how to handle this unusual pathfinding requirement. I prefer C#/XNA rather than C++.
Is it possible to decompile a .xnb file? I've lost my shader code, but only have my .xnb file left.
I'm making my first game in, Pong, and I'm trying to make the ball's Y increase or decrease, depending on where it impacts the paddle. After implementing the code below, the ball only goes down, but not up. What could the problem be? if(paddle.detectCollison(ball)){ //30px on either side of the actual center of the...
I'm following some tutorials to create a simple game with Unity in order to learn, and I would like to enhance my learning experience by adding World of Warcraft models. Don't worry, this is all just for learning and won't see public eyes in any way. I downloaded a model viewer and I can export textures and animation f...
I'm working on my first Java Game and I have run into a little problem I'm hoping to get some help with. I'm using Slick2D displaying a tile based map, and I'd like to know how I can created a "blurred" fog of war. Here you can see the fog of war covering most of the map, I am rendering the fog by filling a rectangle ...
This is just a theoretical question. I was thinking of using GLEED2D to map a top-down game (I haven't decided on what type, but that shouldn't matter for this question.). I chose GLEED2D because I was getting tired of tile-based maps, and wanted to try something new. However, two questions come to mind: How would yo...
I posted this on stackoverflow but was advised to post here (here is a link to the stackoverflow question). I'm hoping for constructive feedback on its plausibility. Update on progress: It looks like there are ways to stuff files back onto the console (horizon, modio, xplorer360, etc) and they do require some form of s...
I'm trying to implement the a* pathfinding algorithm in my game. I've looked at dozens of tutorials but I can't seem to get it right. My code is below, and It's not working... does anybody see something I'm doing wrong? Mainly, I followed these tutorials: Tutorial 1 Tutorial 2 I'm sure you will be able to understand al...