instruction
stringlengths
33
29.4k
I am attempting to write a RNG which returns a normal-like curve. For example, say I define X to be 4, I would like to generate a range of numbers from 1 to 8, but with 4 being returned most of the time (say 60%). How can I accomplish this in a way I can easily define X, and the range of the numbers?
I am building a 3d topview game like GTA2. In this game the ground is mostly one level (except for tunnels and highways). Most of the ground is also city so the ground is usually covered by either roads or buildings. The buildings are simple 3d models which the player can walk around on. Most of the gameplay is 2d. How...
Hope it is relevant here. I have a code where I have to work on Half precision floating point representation numbers. To achieve that I have created my own C++ class fp16 with all operators(arithmetic logical, relational) related to this type overloaded with my custom functions, while using a Single precision floating ...
I've heard about data driven design and have been researching about it for a while. So, I've read several articles to get the concepts. One of the article is Data Driven Design written by Kyle Wilson. As he described, it seems to me that the application code (i.e. the code for controlling resources such as memory, net...
I'm using Java and Jython, and after some research I discovered giving scripts direct access to the engine interface could be a mistake, as it would tightly couple the two. It looks like most scripting that allows mods to create and manage entities does so through some sort of abstraction. Are these abstractions there ...
I've had the idea of creating a webgame for a while now, and as it becomes more and more accurate i started playing around with Symfony 2.0. First question : it seems that it is recommanded to use Doctrine2 (ORM) to manipulate database with Symfony, but i'll feel more comfortable with pure SQL. Am i wrong ? Second ques...
I'm trying to calculate the angular direction of a projectile, knowing it's X and Y velocity I can find the magnitude of its movement, but I'm having a hard time wrapping my mind around getting the angular direction (in radians) that it is moving... I assume there is a tan or a sin involved, but I'm a bit clueless othe...
I'd like to rapidly capture "screenshots" of my OpenGL ES iPhone game and turn them into a video. I've tried the following approach (it works but degrades the game play to an unacceptable level): Use glReadPixels to copy the data from the framebuffer to a GLubyte array. Create a CGImageRef from that data. Then crea...
I want to build a character system in my game that is like the on in Mod Nation Racers or Little Big Planet 2. You have a basic and simple Character (which is animated) and you can now put stuff (cloth, hat, glasses, eyes, mouth) and skins (yellow skin, hairy skin, ...) on it, like a puppet. (This is all for iPad / iOS...
I want to get the pixels (or other data) for any character of the available fonts and copy/build them into a D3D texture so I could make some cache of text rendering by mapping only the character coords in the d3d texture and other stuff I need to solve (and using ID3DXFont is not an option). How is this normally achi...
If I want to extend the scene manager, and add a function; do I extend my class from CSceneManager or ISceneManager? I'm trying this in MySceneManager.h: #include <CSceneManager.h> class RTSSceneManager : public CSceneManager { virtual ICameraSceneNode* addCameraSceneNodeRTS(ISceneNode* parent = 0, con...
I am working on a 3D OpenGL|ES game for iPad. All the models are created in Blender. How should I go about getting my models into my game? I have the following requirements of my models: One texture map Material Skeletal animation data Attachables / Socket Points
I am searching for 3D artists for a 3D iPad game. Is there a good place in the net, where I could find one? He or she should have created game models before.
As I'm interested in creating games like Jetpack Joyride for mobile devices and so on, I wanted to know what technology was used to create the game. Was it made in Objective-C, Java, Flash or HTML5 canvas/javascript?
I made a little 2D shooter game for my iPhone. I want monsters to spawn at random locations. But I don't have any clue where to start to make them spawn. I already made the monster image and everything and everything works, but there's only one monster at the start of the game and when it dies he will not spawn again.
I made a little iPhone game in which I want to make multiple monsters spawn. I have one UIImageView called enemy that spawns at beginning of the game. But I want it to spawn many more monsters until I say it needs to stop spawning them. I know how to get random locations. This question is a follow up to this one.
In Unity3D, I can get the normal of the surface with which the collider collides using hit.normal, but is there a way to find which side has been hit with what is provided by Unity3D? One solution is to see the orientation of the normal, and should work well for static objects but what about dynamic and moving objects ...
I have been looking into box2d (in java with libgdx) lately and have been trying to create my own custom bounce effect (I increase the Restitution after the first bounce) To do this as a test I simply checked the location of the object and waited for the first bounce. But now I wanted to actually implement this and cam...
Currently, when I update the entities I calculate the time passed since the last update, and then pass that to their update function. They will in turn pass that duration to all their components. currentTime = clock.getTime() timePassed = currentTime - lastUpdate This means that the physics components also get...
I designed an RPG game that has multiple story threads, meaning that, depending on the user's choice some things may or may not happen, you can achieve the same thing in several ways, the ending can be different and so on. I implemented a simple decision engine, which works fine but has one huge flaw, in the moment you...
I understand SGV images are used in 2D games to store shape data for the physics engine of the game. I'm unsure though, should the raster sprite also be stored in the SVG or should it be separate? Also, what about animated sprites? In a non-skeletal-based animation system, how should the shape of the character be handl...
I have been trying to get my camera to follow a falling ball but with no success. here is the code float cameraY = (FrustumHeight / 2)+((ball.getPosition().y) /2) - (FrustumHeight /2); if (cameraY < FrustumHeight/2 ) cameraY = FrustumHeight/2; camera.position.set(0f,cameraY, 0f); ...
I want to be able to (only) define game states using Lua script, but I'm not sure how I should do it. Here's what I have in mind currently: For each state, I will create a .lua file that contains a class (table) that has the same name as the file name. Each table must have a set of event handlers: onEnter (called when ...
I have a fairly straight forward 2D game written in XNA. I'm finding that it arbitrarily drops from 60fps to 40fps. I've tested this drop extensively and have concluded it's not related to graphics or the hardware being taxed. What's even stranger is that if I put the window in and out of focus a few times the fps jump...
I am writing a game that very much relies on real-time shadowing and would like to implement shadow volumes. I was thinking of doing shadow mapping, but the platform I am using is Molehill/Stage3D and it's limited to 8 bits per channel, BGRA textures, and shaders can only read from textures, not depth buffers. I have n...
Being a programmer of web and DB centered applications, I have knowledge in data structures such as lists, trees, graphs, etc. I honestly use very little of these data structure algorithms in my coding, except for sorting things in plain arrays, as I worked almost entirely with client-oriented frameworks where all the ...
I am working on a Direct3D rendering application that uses a lot of texture RAM. I notice that if I allocate a Pool.Default volume texture: _texture = new VolumeTexture(device, size.Width, size.Height, size.Depth, 1, Usage.None, Format.L16, Pool.Default); my process's system memory decreases by the same amount I al...
I'm thinking of creating a Game Engine with a C++ Compiler using OpenGL but I don't know how to create a compiler in an application. Do I have to write the compiler? or could I use (for example) the Visual C++ Compiler?
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 constant. And this is exactly what i don't want as i would like to make 2D (maybe 3D eventually), elastic, deformable, breakable, and even sticky bodies. Wha...
I am making a small game for a course in my school and was planning on using QT to build it. I have worked with pygame[last year] and turbo c++[about 5 years agao] to make games, small easy stuff. This time I am planning to make a game that supports multiplayer over lan, the game idea is simple however, information abo...
I'm not sure how possible this is, but I'm trying to use a fragment shader to draw a portion of a texture in the middle of a quad. This is all 2D. The quads consist of four vertices from (0, 0) to (width, height). The modelview matrix is transformed to position the quads. I have a sprite sheet of 32x32 icons and a 32x3...
I have a 3rd person camera which rotates around the Y axis fine (yaw) and when I am facing forward (0, 0, -1) moving the mouse up moves the camera up and down great. But the more I turn the player and camera the the less the camera moves up and down until I get to 90 degrees where it almost stay still and at 180 it mov...
I was making a game and I did the side scrolling like this: if the player get past 150, the player stops moving and the background starts moving. But thats very annoying with placing objects in the game. Isn't there a better way to do this? I do not want to use cocos2D. Thanks!
My "usual" stack for game dev is to create (in-browser) Silverlight games. I've decided I want to branch into iPhone or Android, and decided to go droid because it's cheaper (considering I don't have a Mac). Having now all the requisite software and hardware, how do I decide which games to code on both platforms and wh...
I intend to do a lot of research into this, but I know this community has a knack for delivering hard-to-find gems of knowledge, so I figured I'd ask here first. Preamble (My Situation) I'm currently looking into the viability of becoming an independent games developer by selling games for the mobile platforms (iOS a...
I have a lot of billboarded 3D spheres (they have a heightmap so work properly with depth and penetration; although each is made of just a quad (with slight distortion), they look and feel and are true 3D spheres): http://www.youtube.com/watch?v=88idbFlvQV0 The choice of using billboards is for throughput on low-end ha...
Can anybody here give a reference to commercial AAA games that implement a machine learning AI?
I'm working on a Pong clone in XNA. Gameplay-wise, I have it where I want it to be. I want to add a title screen and some other screens to it like a menu, as well as a screen for the Winning/Losing results. I've tried the Game State Management Example on the App Hub site, but It's very complicated and I haven't been ...
I am trying to understand how OGRE works at a lower level, and from what I have read so far, I believe OGRE generates shaders from material scripts using its RTShader system, on the loading of each scene (based on the contents). My questions are: Is this correct? (i.e. does OGRE 1.7.1 by default generate shaders at ru...
I have some understanding problem concerning quaternions. In order to have my world object rotate in the correct way, I need to invert their quaternion rotation while refreshing the object world matrix. I create the object rotation with this code: Rotation = Quaternion.RotationMatrix(Matrix.LookAtRH(Position, Position ...
If I have a point which I want to hit at the end or during a parabolic arc, how would I calculate the needed x and y velocity?
Final year student from an IT college in Ireland. I'm not really sure if this is the right place to post but It seems that graphics programming is very closely related to games and the people here would have the most insight. So just an introduction to myself and the problem. Basically Im in my final year of my degree ...
I'm working on a sidescrolling game and I want to generate a forest for the background. I want the background to be the same for every one to make sure the quality is the same. I don't have access to a seeded random number generator either, so I can't find a good seed and go from there. Ideas?
Let me start with I am currently learning OpenGl-es using Android. I have been having the hardest time trying to design a simple and logical way of making tiles (2d flat polygons). The tutorials tell me to just keep the polygon as a float array of veticies: private float vertices[] = { -1.0f, 1.0f, 0.0f, // 0, ...
Which format should I use, which settings? Which plugin or script?
I'm setting a render target in XNA using the following lines of code: Game.GraphicsDevice.SetRenderTarget(physicsTexture); Game.GraphicsDevice.Clear(Color.White); noiseEffect.CurrentTechnique.Passes[0].Apply(); DrawQuad(); Game.GraphicsDevice.SetRenderTarget(null); ph...
I'd like to know the math behind the light effect in krakatoa (click here for an example). Light source is traveling with particles, but how is shading done? Is it something simple, like Phong shading? Is it possible to implement such effect in real time on GPU?
I'm writing a top down 2d XNA game. Since its my first I'm trying to write the physics and collision stuff myself to learn it. Whenever my player sprite character attempts to move into a position where its bounds intersect with the edge of a wall, I figure out a bounce angle (angle of incidence = angle of reflection) a...
Does anyone know of any good examples of 3D being faked in 2D (not necessarily code, but games I could look up)? The player has the perspective that they are going 'into' the screen and things are coming out at them. At the moment, I'm simply scaling the 2D enemies to give the illusion that they're coming closer, but i...
We're talking about an expansive game that is not divided in levels or checkpoints. A 3D adventure, for example.
I'm trying to Implement SkyBox in my phone game. Most of the samples in the web are for HiDef profile, and they are using custom effects (that not supported on Windows Phone). I've tried to follow this guide. But for some reason my SkyBox is not rendered. This is my SkyBox class: using System; using System.Collections....
I've been working with the XNA-Framework(only in 2D) for over a year now. Now I want to try and start a bigger 3D-project. But somehow I have difficulties to decide which engine/Framework I should use. So far I gathered three possible Frameworks, I want to list here: XNA with the OX-engine: I already have some experie...
what's a sensible way of implementing zoom and panning for my game? each tile is very large, 100,000 x 100,000 pixels, with some objects possibly being only a single pixel at maximum zoom (small objects in a vast vast space). I want to be able to zoom out so the view encompasses the entire chunk/tile, possibly two chun...
Possible Duplicate: Car engine sound simulation M working on 3d car racing game . Being assigned the task of creating sound effects for the car. I have all the sounds with me like idle engine sound , onLow sound, onMid sound and onHigh sound ......now the issue is i dont know how actually the other games use these s...
I'm pretty New to the XNA Side of things, I have built in PhotoShop a Set of frame by Frame images side by side to go through an animation class to display them frame by frame. With this my images will not show up properly, they look more like a film reel. Were could I Ggt good information on images for animation for X...
I remember looking a few times over the years for an alternative to Photoshop for editing images. I've tried using Gimp too, and that's also not quite sufficient. There are some problems that have only been solvable by breaking out into an asset compiling stage. For example, none of the graphics packages come with prem...
I'm making a game and I want the end graphics to look chunky and pixellated, so I'm drawing from the spritebatch onto a RenderTarget2D which is 1/4th the size of the actual backbuffer, and then drawing from that to the backbuffer. At first the sprites were blurred by antialiasing and I read that using SamplerState.Poi...
we are developing an iOS-based game with multiplayer support. so far everything seems real good but now we want to make sure if server could handle 10000 clients or not. any idea how can I make sure server will survive that much traffic?
I know that if you want to display a sprite on screen (in 2D) you can use glOrtho and essentially make 1 gl unit equal to 1 pixel, so when I plot out the vertices for say a 128x128 image (on a quad), I can define the vertices as -64/64, -64-64, etc and then when I map my texture coords to that quad, the image is displa...
I want to develop 3d immersive virtual collaborative conference meeting environment on the web i.e an immersive virtual environment for our university Teachers to attend and address conference (meeting) Virtually in 3d Each attendee have login with their customized avatar and can collaborate and discuss different issue...
I just got the latest AndEngine code from Mercurial, added Android 1.6 to my Order/Export tab, and cleaned everything (including a "Fix" command as instructed by the console). Regardless of which version of Android I specify in my project settings (1.5, 1.6, 2.2, 3.2), I get around 523 compilation errors. The most uniq...
I've just made my first (very simple, ugly) game in Love2D. The game works fine when run directly off my hard drive. However, when I package it up as a .love file, I get the following message: Error: Could not open file resources/stormclouds.bmp. Does not exist. stack traceback: [C]: ? [C]: in function 'ne...
Possible Duplicate: Famous games written in Python Is python any good for game development? Can I have some examples of great indie python games. So I can have an idea what it's capable of? I'm looking for games which are on a realistic scale for one person. thanks.
I'm having trouble implementing render to texture with OpenGL 3. My issue is that after rendering to the frame buffer, it appears the rendered object becomes deformed, which may imply a bad transformation has occurred somewhere. Which doesn't make sense as the object renders fine when not using my frame buffer (see bot...
I'm using the tex2D function of HLSL, and I am wondering what will happen if I try to grab a pixel from a pixel coordinate outside of my texture (as an example 1.1). Will it clamp? Will it repeat the texture and grab something else? Will it return transparent?
I'm using shell 32 to get some file descriptions. It works perfect in Visual Studio 2010, but when it comes inside unity3d it crashes. The code is: using Shell32; ShellClass shell = new ShellClass(); Folder objFolder = shell.NameSpace(path); string fileTitle = objFolder.GetDetailsOf(objFolder.Items().item(0),21); //C...
Animal Crossing has a unique way of scrolling the world map: When the character moves down, the the world rolls around and over at the top, like it's stuck to a cardboard tube: This video shows how it moves. How can I create this effect?
I would like to explore realtime software based rasterization. I know everything is going towards the GPU these days but there are a few games where it still makes sense to use a software renderer. For example: Voxeltron Voxatron is an arena shooter that takes place in a world made of voxels (little cubes, kind of)...
I have begun researching graphics and physics engines to use for an Android 3d game that I would like to make. While researching I stumbled across this page where he talks about how you can use the Irrlicht graphics engine and the Bullet physics engine for Android development. I have a few questions about this Will t...
I have to develop a game for my Graphics Course. I came across this video on the net. http://www.youtube.com/user/stanfordcs248 I want to know how are the hazy/smoky effects which trails along with the cube is rendered using OpenGL and c++?
I have a dynamic surface in WebGL, that is animated in vertex shader. I want other objects to interact with this surface (for example, an object riding on dynamic terrain). What's the best way to do this? Should all these calculations be done on CPU? Is there a way to calculate this stuff on GPU? Basically, what I want...
For example, how detect if my videocard doesn’t support "bgr8" and convert it to another format, such as "rgba8" in software mode. UPDATE: Sorry for the confusion. This question more about situation when I set internalFormat in glTexImage2D to something like "bgra8" but videodriver internally convert data to another fo...
Ok, I've got a weird one here. I'm trying to make a basic tile engine using a windows form, but some of my code is just...not happening. I'll post the chunks in question. private void MapEditor_Load(object sender, EventArgs e) { LoadImageList(); FixScrollBarScales(); cboCodeValues.Items.Cl...
In an example for a little game framework (that does work), there are the lines: ID3D10Device* device; ID3D10Buffer* pBuffer; followed by the line device()->CreateBuffer(&bd, NULL, &pBuffer()); The third argument requires a pointer, so why do you need to put an ampersand before pBuffer? an ampersand gets a memory ad...
It seems they completely ruined .fx file loading / parsing in D3D11. In D3D9, loading an entire effect file was D3DXCreateEffectFromFile( .. ), and you got a ID3DXEffect9, which had great methods like SetTechnique and BeginPass, making it easy to load and execute a shader with multiple techniques. Is this completely ma...
Is there some kind of "special" lighting in this scene? I notice that the sun seems to "pop".
Currently I'm doing some prototyping with physics in Python and I later plan to port the code over to C++. Box2D has some features that I really like so I'd rather use that library instead. The problem is that the Python port of Box2D is pretty tedious to install and I'm lazy, :D while the Chipmunk port is very easy to...
I remember back when I played runescape, they always had these really interactive holiday events. And players would be squirming all around trying to find where it was. After you would complete it (it was like a mini-quest), you would be rewarded with some kind of item. I thought it was really cool, but if you missed t...
I have a sprite that I want to speed up as it gets closer to another object. I really want this to flow well and don't want a series of if statements. All I can think of is to take the distance and have some equation pump out a number that slowly rises as the distance decreases. But for the life of me I can't think of ...
Using a 3/4th perspective, I'm trying to create a way to render cliffs where nothing is overlapped, and it creates an accurate representation of the elevation. This is a rough mockup of how it might look in-game: The way the tile data is organized is by layer. Each elevation has a layer class which holds all of the gr...
I love the features of XNA but I want to get into c++ game dev. The problem is that I now have to worry about everything from loading a png file to opening a window. This is a little bit annoying. I would really like a c++ version of XNA to solve these issues for me.
Where would I look to get guidelines for how much XP and gold/items to give as rewards for quests? The following is the algorithm I'm using to determine the XP needed for each level: /** This starts at level 1. If you're at level 1, to get to level 2 you call getXpForLevel(1). */ public static long getXpForLevel(long l...
When I ask SpriteBatch to draw a rectangle as within the following method : public static void DrawSolidRectangle(Rectangle rectangle, Color color) { // the output from this is shown in the screenshot System.Console.WriteLine(rectangle.ToString()); spriteBatch.Draw(pixel, rectangle, col...
Basically when placed in the same file this works fine, but if placed in separate files (and I have tested this) just after Init() is called, the pointer to ID3D10* device's value is suddenly 0x00000000. If it's all in the same file, the device pointer has a memory address all the way through. I'm really stumped here. ...
I came upon this site while looking for information about working with DX in managed code and saw that MS released something containing a 'DirectX for Managed Code Update'. This sounds promising but I can't find much information about it. Is this an out of date update referring to what was formerly Managed DirectX, or...
I'm developing a 3d flight simulator for Android and am using a relatively large (10k triangles) scene in 3ds format for the scenery. The scene is one polygon soup, not separated into separate objects. Frustum culling per triangle would be time consuming. What techniques could I use to render the triangles that are onl...
Whats the best way to export from Blender 2.59 for XNA 4? I have heard you can use the DirectX to export to .x instead of .fbx which works better with animations? Unfortunately all the tutorials out there are a bit dated and go on about the quirks with older versions..
I keep reading in the game development community that the idea of a game is 1% and the execution of the game is 99%. Do you believe that to be true? Not necessary in those percentages.. I always thought that a great idea is invaluable and it makes a game successful even though the execution is simplistic.
I have a game object on screen represented by a cube (but say it was a quad or something else all the same). How do I raycast to check intersections? Keeping in mind I may not be raycasting fora physical object, just a gameobject of any sort. Another question I have is, how can you raycast in Unity3D just to check aga...
Please tell me what is the software which persons or companies use it to design the graphics of games (2D and/or 3D), is it 3DS Max? Is there any other software or any more simple software?
I've been looking into making 2D games with Unity. One thing which concerns me is the performance of the physics engine. Since Unity is a 3D game engine I'm going to have to assume it uses a 3D physics engine. Obviously I can turn this 3D engine into a 2D one by locking off various axis such that objects only move phys...
I'm working on my first (C++) game, and I want to use a component based design. I've read a lot about this lately and yesterday I decided I wanted to store object data in external JSON files, to allow for more flexibility and ease of access. Then it dawned on me that leaving these files in the game's directory tree wou...
I'm aiming for making a(n) RTS game with networking so instead of doing tedious stuff like networking I wonder if there is a library/framework that will save me the effort. I intend to make that game in Unity if it is of any interest.
I'm developing a game for Android in Java. I would like to know how a good Enemy class architecture could be implemented. I've created an abstract class called Enemy. It stores common properties like Health and Animation data. It has methods like LoadContent, Update and Draw. I want to inherit this class and implement ...
I'm designing a platformer and beginning to code the viewing engine of the game. Now, I have to make a key decision: Should I just use SpriteBatch to draw all the 2D stuff, as there is no 3D, or should I just go with making camera-facing polygons with Z set to zero? What are the good sides and drawbacks of both? Perfor...
I'm trying to determine what format the shapes in my 2D game should be stored in and also what software I should use to aid in making the actual shapes. Up until now I used PhysicsEditor from code'n'web, which saves shape information in XML format. The problem is that the way the file is layed out, it will require a lo...
I'm just getting started with game programming and I want to start learning opengl. I found a very great tutorial from scratch to get started with opengl 3 and I'm wondering if there is a big difference between openGL 3 and openGl 4. Or I should ask, does openGL 4 make openGL 3 obsolete, or I can start with openGL 3 an...
Currently, I'm loading images as follows: sampleimage= BitmapFactory.decodeResource(context.getResources(), R.drawable.sampleimage); This automatically chooses the correct image from the drawable-hdpi, drawable-mdpi or drawable-ldpi folders. How can I load the bitmap using the image name as the string "sampleimage.png...
i'm working in a 3d flash role-playing game with alternativa 3d engine. My game requires the main character to be customizable, for example, the player must be able to add a mustache, a hat, a tie, change colors of sking, clothing, etc, to the character. How am i able to do that?. (I'm using maya for modeling.) Thanks ...
I basically need to fill a texture into a polygon using the SpriteBatch. I've done some research but couldn't find anything useful except polygon triangulation method, which works well only with convex polygons (without diving into super math which is definitely not something I'm pretty good at). Are there any solution...