Update and Render logic with interpolation I am working with C and SDL2 and just wanted some insight as to how to properly apply interpolation to the rendering. EDIT some clarification, update() input() and render() are just hypothetical stubs, the real code is messy and long as I learn SDL2. while (!quit) current SDL GetTicks() elapsed current previous previous current lag elapsed input() while (lag gt ms per update) update() lag ms per update interpolation (float)lag (float)ms per update printf("Interploation f r n", interpolation) render(interpolation) This is something that has always kind of baffled me lets say that in update() if SPACE pressed we start a jump animation and movement. So sprite.y 2 to move it. Where does that movement of one pixel happen? Does it happen in update()? If the movement happens in update() then how do i properly apply the interpolation in render() since my item has already been moved (during the update)? Lets say i have a bullet at (x 10, y 10) It's velocity is 10 pixels per update. use clicks button to shoot first update bullet is moved to (x 20, y 10) render(interpolation) lets say it is 0.5) lots of on screen lag from awesome effects second update bullet is moved to (x 30, y 10) third update bullet is moved to (x 40, y 10) render(interpolation) lets say it is .09 from lots of lag How is the interpolation value applied to the bullet so that it appears to pass smoothly across the screen. What information is known during render to apply the interpolation? Would a struct containing the origin point, current velocity (or amount moved since last render), and current location suffice?


Redefining the SDL rect struct Upon checking the docs of SDL (1.2) I saw that the SDL Rect struct defines the x and y as Sint16. I'm making a bitmap font text scroller and I need those specifically to be unsigned ints because the text does need to go offscreen, yet still using the same struct because the SDLBlit method needs it. I tried creating my own and typecasting it as an SDL Rect but that didn't work. Any ideas? Also, to be more clear. The string of text scrolls to the left, therefore the first letter of my text does indeed go off screen but the rest doesn't. I assumed this was the problem. for(int i 0 i lt strlen(string) i ) SDL Blitsurface(bitmapsurface, rects chars i , screen, destrect) destrect.x 8


How to alter image pixels of a wild life bird? Hello so I was hoping someone knew how to move or change color and position actual image pixels and could explain and show the code to do so. I know how to write pixels on a surface or screen surface usigned int ptr static cast lt unsigned int gt (screen pixels) int offset y (screen gt pitch sizeof(unsigned int)) ptr offset x color But I don't know how to alter or manipulate a image pixel of a png image my thoughts on this was How do I get the values and locations of pixels and what do I have to write to make it happen? Then how do I actually change the values or locations of those gotten pixels and how do I make that happen? any ideas tip suggestions are also welcome! int main(int argc , char argv ) SDL Surface Screen SDL SetVideoMode(640,480,32,SDL SWSURFACE) SDL Surface Image Image IMG Load("image.png") bool done false SDL Event event while(!done) SDL FillRect(Screen,NULL,(0,0,0)) SDL BlitSurface(Image,NULL,Screen,NULL) while(SDL PollEvent( amp event)) switch(event.type) case SDL QUIT return 0 break SDL Flip(Screen) return 0


SDL2 jagged staircase edges I am using SDL2 and SDL2 Image to render png images. When I rotate the textures, they turn out very ugly, like this This is the code responsible for the rotation and alpha mod. SDL Rect srcRect SDL Rect destRect srcRect.x width currentFrame srcRect.y height currentRow srcRect.w destRect.w width srcRect.h destRect.h height destRect.x x destRect.y y SDL SetTextureAlphaMod(m textureMap id , alpha) SDL RenderCopyEx(pRenderer, m textureMap id , amp srcRect, amp destRect, 10.0, 0, flip) Do I need to set a blendmode too?


What does FPSManager.lastticks stand for in SDL gfx? I'm having trouble finding documentation on SDL gfx, and I can't figure this out. I've managed to use SDL gfx to automatically cap the framerate, and I it's working a lot better than my manual attempt (combining SDL Delay and SDL Getticks). Now I've been trying to learn more about it, and I stumbled onto something. Here's the whole struct typedef struct Uint32 framecount float rateticks Uint32 lastticks Uint32 rate FPSmanager Most variables in this struct are pretty straightforward, but I have no idea of what lastticks stands for. Does anyone know?


How to simply print (write) text on a Surface in SDL.NET? as i told in previous question, i'm using SDL.NET (wrapper in C of SDL). Unfortunately the API website is down so i'm trying to learn it by myself. I would like simply to print text on my screen surface ... i don't know how to do! My goal is to print variable status values, to "debug" directly on the run and on the screen (in the lower corner for example). Can somebody help me ? Thank you


SDL mouse wheel not picking up Running Ubuntu 11.04, SDL 1.2 trying to pickup mouse wheel up down movement with this (stripped down) code int main( int argc, char argv ) SDL MouseButtonEvent mousebutton NULL while ( !done ) if(mousebutton ! NULL amp amp mousebutton gt button SDL BUTTON LEFT) yrot 0.75f else if(mousebutton ! NULL amp amp mousebutton gt button SDL BUTTON RIGHT) yrot 0.75f else if(mousebutton ! NULL amp amp mousebutton gt button SDL BUTTON WHEELUP) xrot 0.75f else if(mousebutton ! NULL amp amp mousebutton gt button SDL BUTTON WHEELDOWN) xrot 0.75f while ( SDL PollEvent( amp event ) ) switch( event.type ) case SDL MOUSEBUTTONDOWN mousebutton amp event.button break case SDL MOUSEBUTTONUP mousebutton NULL break default break return 0 strange thing is, scrolling with the mouse button does nothing, but if I hold down a mouse button or two and then move the mouse it hits the SDL BUTTON WHEEL code occasionally. This honestly reeks of a pointer issue, which would make sense since I've been spoiled with C for the past couple years, but I am just not seeing it. How do i correctly find mouse scroll events in SDL?


Getting .mesh .skeleton from Blender2Ogre export I have downloaded the add on blender2ogre from this source http code.google.com p blender2ogre And I have created a simple mesh, with walking animation (similar to the gingerbreadman tutorial). My question is, whenever I want to export the project, I can only see the .scene export format. There is no option whatsoever to export as .mesh and .skeleton. Also, how can I export the walking animation separately, in other words, if my project have couple more animation, how can i separate those during export?


How do you combine multiple meshes into one in Blender? I need to combine multiple meshes into one in Blender 2.8 (Just make them into a single mesh that looks like all of them in their normal positions). I am doing this mostly for performance improvement in my game, since the teeth are all separate. Does anyone know how to do this?


Importing materials from blender to UE4 So my problem is that I have a nice green glass material in blender which I imported to UE4 (4.8.1) but in the editor the material was just a simple green colour. I have no idea what I should do to fix this problem. I appreciate any help. If you need any more details or pictures, let me know. Thank you Glass in blender Material in blender Glass in UE4 Material in UE4


frustum culling and exporting a big scene model Let's assume that I created in Blender a race track with landscape. I can export it to single wavefront obj file and then load in my graphics engine using assimp but it doesn't allow to use frustum culling. Should I split such big scene too seperate objects or some model formats allow to split object within single file. How graphics engines load such big scenes ? Do you know some useful techniques articles ?


Best way to do headshot decapitation? I'm using UE4 and blender. I was wondering what the process is of preparing in the 3D software and then making a head burst animation upon headshot. I don't want to do destructible meshes because they are sharp jagged fragments... I want it to literally burst and splash blood. How can I do this? Any support is appreciated.


Importing a File Containing Two Objects from Blender into Unity Leads to a Single GameObject Not Two I have two separate objects in a Blender file (say a cube and a sphere). Unity import this file (OBJ type) as a single gameObject which is not want I want. I want cube and sphere to be two separate gameObjects.


Blender baking normal map weird colors I have a metal drum mesh, and when I bake its normal map, I get the weird colors (see attached pic). I'm talking about the horizontal gradient shift of color. There's no deformation like that on my mesh, how come the colors are like that? I've tried various spaces (camera, world, etc) but it's still bad (though the horizonal gradient changes with each one). Also tangent space returns a blocky blue color all over. Can someone please tell me how to get a good normal map out of my mesh? UPDATE Solved, thank you very much Luke B. There's still the question of scaling one of the two overlapping versions a bit (the low res one for example) in order to get really good results, but that's how it's supposed to be done. UPDATE 2 After further following the advices of Luke B, I've used multiresolution modifier on my low res mesh, and baked from there. It looks much better than before, the color artifacting are down to a minimum, really, with some corrections in GIMP it's quite usable


Can't move bone on blender. "Location" transform grayed out I'm trying to move a bone on Blender. I can't do anything with it at all. I've searched through the menus and noticed the Location transform is grayed out.


Stretched textures in Blender First of all I'm relatively new to Blender. I discovered a weird bug in Blender 2.78c. On my object some textures are stretched although they are UV mapped. Since I have no clue why this is happening I took some screenshots which hopefully explain the problem. I tried various things, but found no way to solve this. Things I tried Unwrap again Apply Rotation and scale Manually adjusting verts in UV map Looking for "dead" verts somewhere in the model Does anyone know this strange behavior? Edit I uploaded my .blend file http pasteall.org blend index.php?id 47124 merged screenshots due to low reputation P


I followed a youtube timelapse video to make same 3d model in blender, Can I use this in my game? I saw a youtube timelapse video about making a car 3d model, I liked it and followed the same, I design almost same looking model (90 same), Can I use this in my game? There is no license mentioned on video, the creator of video has just written 'Just for fun' in description of youtube video. Update As per my understanding if we download or copy paste a copyrights protected asset, we will need permission of its author, but I am neither downloading nor copy pasting anything, I am simply just seeing a video and making something similar asset, so do I really need a permission of the video creator and however he hasn't mentioned any license term also in the video.


Why is my model exported from Blender vanishing when using it in UE4 mobile? My 3D models and animation vanishes when I preview it using the mobile view port. However they work just fine for the desktop viewport. I usually model the characters using MakeHuman and import them into Blender. In Blender I animate them and then I import the model animation into UE4. The problem is that my model animation works when I preview it using the shader meant for desktop amp consoles. When I preview my animation using the openGLES2 shader, my model vanishes. Anything I import form belnder vanishes when I view it in a mobile viewport. I cant figure out why this is so? Have any of you experienced this before ? Can you guys let me know how I can correct this issue? Also, if I upload the models from MakeHuman into UE directly, I can upload the files properly in UE. But, when I try the workflow MakeHuman Blender UE with not much modifications to the models in Blender, the models are not visible in the openGLES2 shader. I am not sure why this is happening in Blender and why the models coming out if it is affected. Any help would be appreciated.


Correct way to export from blender to ogre format? When I export from blender to ogre using the blender2ogre add on, I'm not getting anything besides a scene most of the time and when I get a mesh I never get a material. Is there something wrong with my export procedure or what else could I be doing wrong? Update I can export the basic cube from blender to ogre but when I download a model and try to export it I don't get the meshes. Update 2 I tried again and selecting the model in Blender does the difference like the answer here says. I can export an alien and get the mesh and material I rename the files ls workspace DungeonWorld2 assets objects creatures alien Cube.001.mesh Material.002.material Material.005.material Cube.001.mesh.xml Material.003.material Cube.001.skeleton.xml Material.004.material dev dev OptiPlex 745 ls workspace DungeonWorld2 assets objects creatures alien alien.mesh Material.002.material Material.005.material alien.mesh.xml Material.003.material alien.skeleton.xml Material.004.material dev dev OptiPlex 745 But how do I actually load the material since the alien now turns up in the game with no material but it does render the mesh Spatial model3 assetManager .loadModel("objects creatures alien alien.mesh.xml") model3.scale(0.3f, 0.3f, 0.3f) model3.setLocalTranslation( 40.0f, 3.5f, 20.0f) rootNode.attachChild(model3)


Blender modelling for a C game? I want to know if it were possible to integrate models created with Blender into a game written in solely C .


What's the rationale for different coordinates systems? Could someone explain to me why Blender and other 3D modeling apps switch axes? If I export model with Blender, then exporters do following things for the same model The 3DS format applies this transform matrix 1.0, 0.0, 0.0, 0.0 , 0.0, 0.0, 1.0, 0.0 , 0.0, 1.0, 0.0, 0.0 , 0.0, 0.0, 0.0, 1.0 The Collada format applies this transform matrix 1.0, 0.0, 0.0, 0.0 , 0.0, 0.0, 1.0, 0.0 , 0.0, 1.0, 0.0, 0.0 , 0.0, 0.0, 0.0, 1.0 The OBJ format (default) transforms axes just like a transform matrix was applied, but OBJ format (Forward Y, Up Z) gives the original values that I see in Blender. The PLY format also does nothing and I get same values I see in Blender. PS Question was edited. I do not ask why there are different coordinate systems. I understand that. I do not understand why Blender and other switch axis silently when model is exported. People in comments say It is easy to fix model after export There are people who needs that. Actually I never seen these people and if it easy to fix then it is more easy to switch axis for those who really need that switch. I would love to hear someone who say that axis switch is important and he she needs in real work (not in theory)


Where is the "Scripts Window" menu in Blender 2.59? I'm trying to import a script into Blender, and I have the script in my directory and I pushed F8 to reload scripts, but the instructions for running this script say In the "Scripts Window" run "Scripts Export OGRE Meshes". I've seen other similar instructions for other scripts. But the toolbar only contains "File Add Render Help." Changing the "screen layout" to Scripting doesn't reveal any additional options, either. I'm sure I'm just missing something obvious. Please help!


How are 3D game levels built? I am wondering what is the best most common practice in 3D games (mostly shooters) like Quake or Doom. How are the levels built? With larger, open spaces the answer is probably some kind of terrain editor, that is what I understand. But what about things like houses or closed areas? I see two main solutions. One is to make a whole house, factory, dungeon (or generally a level) in other tool, like Blender, and then put it in the game. Other is to make the most simple elements like walls, floor, doorways and make the level from them (like Lego blocks). Is one of the ways more common? More "industry standard"? Are there some obvious advantages or disadvantages?


Blender wont export textures (materials) to OGRE3D .mesh i am exporting a model from BLENDER to OGRE3D using the blender2ogre script. the desigre output is a single .mesh file but i know there should be also materials scripts that i should copy to my ogre path. the problem is that blender does not export those files for me it export only 1 mesh file (after i joined all objects) this is the model. in blender it looks fine but in my demo Ogre app it looks like i can use a little help here.


I have problems for export from Blender to Ogre3D I don't speak good english, but I will try.. I need to make a game for my University. Exists lot of models in blendswap but, I have problem for export. Many of these models have extra objects, such as a floor, I need to remove those extra objects and export the weapon and hand. My idea is Import a weapon model with hand with 2 actions, reload and shoot. How can I do it? I love this models http www.blendswap.com blends view 85257 or 67870 or 70607 (change number in link, because I don't can put more 1 link, because I'm level noob)


Blender Bones get enlarged in export import process I have a rig in blender that I want to export into a different blender project. For some reason, when I do that, some of the bones get enlarged. All the scales are applied. Why might this be happening? I've no clue why this might be happening, as this problem seems exclusive to this project and one other project, where one bone out of the whole armature gets enlarges, but here is the information I can provide Some differences between the projects where this happens and the others is that the ones where this does happen have animations, and a pose library. However, this does not seem to cause the problem, as deleting the animations and poses doesn't change anything. This problem happens when I export import the project as an FBX. I usually export the project to unity and in order to compensate for the unity blender rotation, I follow this guide 1. I rotate the armature 90 on the x axis, apply rotation. Then rotate the armature 90 on the x axis but only apply the rotation to the mesh. I export the project as a FBX, with unity unit scale, no leaf bones, and the 3rd and 4th box under animations checked off. This also does not seem to cause the problem, as not rotating the armature and such doe not change anything.


How can I create a mesh with Blender which changes mid game? Take a situation where on the first half the player fights an enemy and after a cutscene, the player cuts off the hand of the enemy. How can I show him without his hand after this moment (when modeling it with the hands in Blender in a single skeletal mesh)? Do I have to make another skeletal mesh but without the hand? Similar to how in Assassin's Creed Origins where at the end of the snake quest after the cutscene Bayek losses his ring finger and remains without it all game. But in my case, the entire hand is removed.


Importing materials from blender to UE4 So my problem is that I have a nice green glass material in blender which I imported to UE4 (4.8.1) but in the editor the material was just a simple green colour. I have no idea what I should do to fix this problem. I appreciate any help. If you need any more details or pictures, let me know. Thank you Glass in blender Material in blender Glass in UE4 Material in UE4


Blender Cycles materials not showing in Second Life I ran into a problem after trying to import my own creation into second life. While I am not new to 3D modelling with Blender and other programs, I have always only created things for fun. Now I have decided to import few of those creations into Second Life but the materials I have used do not display in the preview at all. I have used the Cycles Render. How do I solve my issue with Materials not displaying in Second Life after Exporting a Collada file from Blender Rendered in Cycles?


Attempting to remove extra "edges" from truncated icosahedron lead to excessively global concequences I need a truncated icosahedron. Blender lets me do that with add gt mesh gt math function gt regular solid (assuming the extra plugin is installed.) So far so good. However, the mesh that is created does not use ngons. This means that each hexagon or pentagon face is cut by an unusable edge approximately through the middle. These extra quot lines quot destroy the visual symmetry I need for the wireframe. I have tried deleting the extra edges. This results in the in the removal of far more than just the offending edge. It blows a huge hole in the whole object. I have tried merging the two faces (which compose the pentagon or hexagon) into an ngon. Somehow this again ends up doing far more than just merge the two parts of the face. No matter what I try I get unintended effects that are far to global. I have also considered drawing fresh lines over only the desired edges. I cannot figure out how to do this either. I have also extracted the faces and edges with python, but those are too cumbersome to edit... and then what? How do I get a nice clean geometric wire Frame without distracting extra edges?


How to edit WoW models with Blender? My situation is following, I am into role play, mostly me and my friends are using World of Warcraft. Since I am a bit into Blender too, I would like to try to edit some models(armor and weapon) for private use only(!). Problem is I have no idea how to import and export them. So far I have found only this forums.runicgames, but it looks very outdated, and I am not sure if it will work with Warlords of Dreanor extension. How would I go about exporting the models from WoW and importing them into Blender?


To what platforms can the blender game engine build to? I used to use the BGE until I found that unity can build to lots of different platforms. What platforms does the BGE support?


Blender to UDK 3 How to smooth Static Mesh I've created a bed cover model for my small game and here is how it looks like in blender http imgur.com T88Mnbs but whenever I import it to UDK it looks like this http imgur.com OMXBno3 it looks smooth in Blender but when I import to the Udk it doesn't Why is this happening? And I use .fbx to export from blender...


How can I prevent resizing of an Ogre3D object once imported into jMonkeyEngine? I created an object in Blender Then I exported it as a mesh.xml file and attached it to the game scene Note The gray color is the ground. In the game I end up with have a smaller, horizontal tower. Any suggestions? Note I exported the file with "Force Camera", "Force Lamps" and "Export Scene" unchecked and "Swap Axis x,y,z".


independent lighting per mesh in blender In Blender, is it possible to assign lighting objects effects exclusively to a single mesh? For instance, if I place two meshes next to each other, and two lights (one shining on each mesh), I would want each mesh to not cast a cast any shadow on the other. For example, in the following rendered image from a "test" star system view The rings are casting shadows on the right most planets. I want the rings to only cast shadows on their own planet. Is this possible?


Getting .mesh .skeleton from Blender2Ogre export I have downloaded the add on blender2ogre from this source http code.google.com p blender2ogre And I have created a simple mesh, with walking animation (similar to the gingerbreadman tutorial). My question is, whenever I want to export the project, I can only see the .scene export format. There is no option whatsoever to export as .mesh and .skeleton. Also, how can I export the walking animation separately, in other words, if my project have couple more animation, how can i separate those during export?


Best format for model with double UV sets I'd like to use first UV set as wrapping (or when some faces cover another on UV) diffuse color map and second UV set as baked ambient occlusion (packed to islands) map. It is possibly to use FBX or Collada .dae or other (what?) in this case? I read scene by Assimp library.


Regarding BGE (Blender Game Engine), is it possible to generate a single .exe file from multiple files linked together? Would any of you guys or gals know the answer, please? I know one can generate a .exe (windows executable) file from a single blend file. My question is very simple Can anyone generate a single .exe file from multiple blender files of a same project? For instance, say I have a project folder with several subfolders and files from my project game. Each folder has specific elements like scenes, models, textures, etc. They are all linked together to form the final game. Now I want to generate a single .exe file for my game. Is this possible? Or, rather, should I make an entire game inside a single .blend file? (It seems like a very unlikely arrangement, maybe even impossible, but I rather ask). Or maybe even create a master .blend file from where to link all data and when project is finished pack everything before generating the executable (.exe)?


Locating different models in a single scene I have a curiosity. Say I wanted to create a big forest using Blender, in this forest I'd like to have a campfire or several campfires. What I could do is create the entire scene in Blender with campfires included and of course in engine I would add a fire effect to it. Now what I do not understand is how can I actually find the fireplaces' locations in the engine? Since it's all in one scene, I can't just say getLocation on the model. I guess what I'm asking isn't how to do it per say, but what the "professional" way is. Do professional game developers fiddle around with coordinates until they find it? Do they load the campfire on top of the scene as a separate model and move it until it fits the scene? Just in case it is important, I am using jMonkeyEngine.


Stitching terrain tiles made in Blender at runtime Background I'm making several individual terrain tiles inside of blender for use within a Unity 3D 5 game. Each tile is square and is made to represent a segment of a world. In game the tiles are randomly chosen and placed between each other. However these tiles do not always have matching sides. Why the tiles To allow for greater terrain sculpting possibilities such as caves, precision placed landmarks e.t.c. but still allow for a procedurally generated feeling randomly placed static tiles are used. There are mountain tiles and there are plane tiles. Mountain tiles have a more extreme terrain and are mostly next to other mountain tiles so that bigger mountains can be formed. Plane tiles are similarity placed next to other plane tiles. The game is "low poly" and so is the terrain. This makes it hard to have flat sides on every tile at the same height for easy "stitching". Concrete question How can I match these edges runtime to ensure that there are no visible tile edges?


what are texcoord tags in mesh.xml file in Ogrexml format? I exported a 3d model from blender 2.79 and using ogrexml import export plugin. but the texture will crash and UV map not working in that format. I made the model by four parts head body hands shoes and they have 4 material and 4 textures, so I made a texture atlas for it and join them in a mesh to More optimization. I think removing other UV maps has a problem because when I check the model.mesh.xml in a note editor and every vertex has 3 texture coordinate tags and I compared it with a normal correct model that looks good in the blender and in ogrexml format, it has one texcoord tag inside of vertex tag. 1 what are texcoord tags? are they using for UV maps in ogrexml format? 2 how can I clear blend files from other unused uvMaps to avoid exporting them with the model?


Blender Edge Split Alternative What other options alternatives are there to "edge split" for smooth shading low poly game models. As I understand it, edge split does what it say's, its splits the mesh therefore increasing the vert count. I have considered manually marking the edges as sharp however I would imagine this leaves artifacts on the model(in game) ? Cheers.


Where is the "Scripts Window" menu in Blender 2.59? I'm trying to import a script into Blender, and I have the script in my directory and I pushed F8 to reload scripts, but the instructions for running this script say In the "Scripts Window" run "Scripts Export OGRE Meshes". I've seen other similar instructions for other scripts. But the toolbar only contains "File Add Render Help." Changing the "screen layout" to Scripting doesn't reveal any additional options, either. I'm sure I'm just missing something obvious. Please help!


Exporting UV coords from Blender So I have searched on google and various other websites but I've not found an answer. The only ones I did find did not work. So my question is how do I get UV coords from blender (2.63)? Currently I'm writing my own custom file exporter, and so far have managed to export vertices and their normals. Is there a way to export the UV coords? N.B. I'm currently try to figure it out using a simple cube that is unwrapped and has a texture applied to it.


Blender arm rig not working the way it should I just bought a pair of arms from the unity asset store and imported them into blender, the IK seems to work just fine untill i use a Child of constraint on another bone(which is supposed to be a weapon) on the arm's wrist bone the bone rotates but it wont move. I'll leave a video of it right here, https www.youtube.com watch?v jfLmG2sQ 10 EDIT the wrist bone seems to follow the child WHEN i disconnect the wrists parent, but if i do that the IK doesnt work in general. Appreciate all help, thanks in advance )


Blender modelling for a C game? I want to know if it were possible to integrate models created with Blender into a game written in solely C .


What is the simplest way to export a bezier curve created in Blender to a text file? I have created a bezier curve in Blender. I'd like to export this curve to a text file. What I need is Control point handles, three points in total. Example 2.3333,4.3942, 55.333 , 0.3234, 2.4234, 4.0332 , 2.534, 6.S234, 12.0332 I have tried to export the scene in Collada format but it doesn't seems to include curves information. What is the easiest simplest way to export this curve to some readable text file format ?


How should I manage multiple entities? 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 time I have a new entity, I grow my array. Here is the problem If player enemy is firing, that creates a new entity which means the projectile array is growing. Suppose its projectile 2053, when it hit something, I free it, then in my loop to check which projectiles are to do something, like getting closer to there target, I check if every of my array to see if its null, if not, check is trajectory. But the problem is that the array will grow each time a new projectile is fired, and I will get a memory problem at the end. So how should I manage my entities? I need an awnser that covers both object oriented and procedural, since I mainly do things in C.


What's the difference between a "Gameplay Programmer" and a "Gameplay Engineer?" I was reading some job descriptions from some AAA developers in the gaming industry, and I noticed there were jobs for "Gameplay Programmers" as well as "Gameplay Engineers." Are those the same thing? Do they do the same thing?


How to profile CPU and GPU performance if I have a monster PC? I'm going to upgrade my PC soon. I'm worried that I will no longer spot performance losses in my game because of the better specs. I can check memory usage easily, but how do I check and debug CPU and GPU usage? I used to rely on the framerate, but I guess that it is not accurate.


How should bots be recognised in a game? I'm interested in how bots are usually written. Here's my situation I plan to make an online 2D mecha game in HTML5, and the server side will be done with node. It is intended to be multiplayer, but I also want to make bots in case there aren't enough players. How does my game logic see them, as players or as bots? Is there a standard by which I should make them? Also, any general tips and hints will be OK.


What is an OO way for my input layer to act upon objects? I'm building a top down RPG specifically to practice Object Oriented thinking and design. I am keeping in mind coupling, single responsibility, and so forth. One design issue that's been bugging me is how to ultimately have objects talk while maintaining the loosest coupling possible. As an example, I'm designing the input class now, which will be made up of two layers, like so The conundrum is that I don't know how to bridge that gap between Input and HeroActor, which is initialized from the PlayState class, which is also where the hero.update() method is called. Let's say Keyboard has just executed public void keyPressed(KeyEvent e) switch(e.getKeyCode()) Some cases case KeyEvent.VK UP Assume InputEvent.INPUT1 is a defined enumeration in InputEvent inputHandler.passInput(InputEvent.INPUT1) break Some more cases I've basically landed here public class Input public void passInput(InputEvent e) switch(e) Some cases case InputEvent.INPUT1 ???????????????????? Some more cases My ideas have been Pass a reference to the instance of HeroActor to the Input object, then have Input directly call the moveUp() method on the HeroActor instance. case InputEvent.INPUT1 actor.moveUp() My instinct tells me this is bad OO design as it tightly couples the two classes. Make the instance of HeroActor global and basically do the same as above. Even worse OO design. Write a registerInput(Input inputHandler) function in the Actor class, like so public class HeroActor extends Actor Existing fields and methods private Input inputHandler public void registerInput(Input inputHandler) this.inputHandler inputHandler Still, then the HeroActor would have to poll the inputHandler every frame to find out if any actions have applied to it. I'm in the same situation trying to figure out how to write the collision engine without passing it specific references to the player's HeroActor instance or the dozens of EnemyActor instances in the PlayState constructor. Any help would be greatly appreciated. My request is not for specific code, but rather common techniques for handling the many objects in a game without ending up with a god object. I've seen some material suggesting an Observer pattern being applied for things like the input layer above, but before I go too far, I'd like some feedback from the community since I've got so many different answers among all of my Googling today.


Large game project, local variables I'm hoping that some experienced programmers can give me their point of view. I'm writing a large game in Windows with dx11. So far, I've got global objects of the class that interfaces with dx11, the class holding the position of the camera, the terrain data class, and a few other classes. In future, if I kept going with this way, I'd also have objects for all the game data, and so on. I'm thinking it might be best to rejig the code to only have local variables, because generally this is regarded as a Good Thing, but mainly because I personally have come to prefer using them. Here's some rough c ish pseudo code of how I imagine local variables would be implemented WinMain() cDirectX dx cCamera cam cTerrain terrain ... while (msg.message ! WM QUIT) ... gameLoop(dx, cam, terrain, ...) void gameLoop(cDirectX amp dx, cCamera amp cam, cTerrain amp terrain, ...) ... renderTerrain(dx, terrain) ... Is this (very roughly!) a good way to organise such a project? I suppose WinMain is the only function where the locals can be instantiated? The only disadvantage I can see is that top level function calls (by which I mean, functions like gameLoop(), functions at the bottom of the call stack) will have very long lists of arguments. Perhaps this doesn't matter. Thanks, Paul


Should I use Game Engines to learn to make 3D games? HI i am a software engineering student in his second last year. I am proficient with C,C ,C and java programming languages, and being a student of engineering I have studied calculus, vectors etc in both 2D and 3D amp various other mathematical, probability and statistical topics. I have made several 2D games, my most recent being a Super Mario like game with side scrolling and multiple levels. Due to my these small game projects,i have become really interested in making games. So now i want to move ahead to learn to make games in 3D. Now I know that there are several game engines available which can take care of rendering details and other "low level" stuff for me... My Question is 1) Is it a good idea to learn to program everything yourself, from making 3D shapes, terrains (using polygons meshes) etc, to programming mechanism for collision detection, lighting etc, considering my motive is to learn how to make games in 3D (but am not too eager to get into the game industry quickly, want to build a solid foundation first) Or could I do without these details amp work on the abstraction level which the game engines (like UDK) provide ?? 3) If I should try to develop from scratch, then can anybody suggest which API to use Direct3D or OpenGL?? (which i would be more comfortable with, in light of my above mentioned skills) amp can anybody also give me references to some good books, reading materials, tutorials, etc to get me started?? (I wouldn't mind theory as long as it helps me make a sound foundation) Many Thanx in advance (for even reading my question, i know it's lengthy... but i need a DETAILED answer... D D )


Game development Art vs Programming I'm a programmer and would like to get some perspective on the art content creation part of game development. Comparing a 2D platformer like Super Meat Boy and a high end game like Crysis 2, what do you think What is harder to do more likely to cause the project to fail Art or programming? Which will consume more time and take more people to work on?


Random numbers inside instance (Game Maker) I've recently run into a weird problem. When I create instances through with(instance create) ... , I can always randomize their variables individually (inside ... ). However, when I try running randomize() random(...) inside their object (in one of the events), they are all synced. Please tell me this isn't a major Game Maker flaw and, most importantly, how do I fix this. Thank you!


Are there cases where globals singletons are useful in game development? I know that having global variables or singleton classes creates cases that can be difficult to test manage and I have been busted in using those patterns in code but often times you gotta ship. So are there cases where global variables or singletons are actually useful in game development?


How should I handle functions, where two classes have equal use? I'm working on a few features for a strategy engine I'm making. I'm trying to figure out the best spots to separate the components, as either option will provide the same amount of coupling, with the same effectiveness. For example, all players have a Damage component, a Player component, and a HealthBar component abstract class Damage protected abstract void sendDamage(Player targetPlayer, int rawDamage) public abstract int calculateRawDamage(Attack attackUsed) public abstract void receiveDamage(int rawDamage) class Player List lt Armor gt equippedArmor List lt Buffs gt currentBuffs public Damage damageComponent public List lt HealthBars gt healthBarComponents abstract class HealthBar can be inherited for mana or health bar protected Color color public float percent 0.0 1.0 When a player receives damage, I need to show a red number floating up from their head, indicating the amount of damage. This can either be implemented in HealthBar, or in Damage. It fits damage better, but then healing works in the same way, and wouldn't be called from damage. I could abstract damage into something like ChangeValue, which would change mana, health, etc in any direction, or I could use the abstract HealthBar class to show this number being changed. I'm trying to think of a general rule that would solve this and other problems, where two classes use the same function equally. This is an oversimplified version of my classes, but it makes more sense this way. How should I handle functions, where two classes have equal use?


Looking for an elegant way to represent fixed parts of a randomly generated level map I'm coding from scratch a small experimental game on a medium sized random rectangular square tile map. (Say, a map of a dungeon.) There are several types of tiles (for example floor, wall, monster, boss, treasure, player etc.). There are no extra information stored in the map tiles, just tile type. Most parts of map are randomly generated. However there are several features that are to appear on every generated map in pre set places. Say, walls around the dungeon, boss locations, player spawn point and the treasure. Note Since the game is small, coded for fun, and the only game designer is a programmer (that is, me myself), I do not plan to spend resources on coding a level editor or supporting an existing one. Also, I do not plan to support existing tile map libraries as I want to dig into some of the related coding problems myself (see above about fun), but I be happy happily to look at relevant existing code as a reference. When I look at my map generation code, I find it rather ugly. Is there an elegant way to deal with the problem? If that matters, I'm writing this game in JavaScript, but I will be happy to see a relevant reference in any programming language. Here is a partial pseudocode to illustrate how my current tile generator solution looks like this.init function(w, h) this.w w this.h h this.tile presets var mid h Math.floor(h 2) var quarter w Math.floor(w 4) Here is the part I don't like a set of generator rules this.preset col (0, Tile.GRASS) this.preset tile (0, mid h, Tile.FLOOR) this.preset col (1, Tile.GRASS) this.preset tile (1, mid h, Tile.FLOOR) this.preset col (2, Tile.WALL) this.preset tile (2, mid h, Tile.FLOOR) this.preset tile (2, mid h, Tile.PLAYER) this.preset tile (1 quarter w, mid h, Tile.BOSS) this.preset tile (2 quarter w, mid h, Tile.BOSS) this.preset tile (3 quarter w, mid h , Tile.TREASURE) this.preset col (w 1, Tile.WALL) Implementation details that may help to understand the code above this.tile function(x, y) var preset this.tile presets x y this.w if (preset ! undefined) return preset return this.random tile () this.preset tile function(x, y, tile) this.tile presets x y this.w tile this.preset col function(x, tile) for (var y 0 y lt this.h y) this.preset tile (x, y, tile) Note that I shown a rather simple set of generator rules above. Actual thing is several times longer. I hate that the code looks imperative and it is hard to figure out what is going on from the first glance. I think that declarative approach could help. But so far I can't figure out a good solution. Any clues?


What are the most commonly used programming languages? When I took my Java courses a year ago, I was told that Java is used mostly in the overseas gaming companies while C is used here in the US. What languages should I focus on learning in depth?


What should I consider when evaluating libraries, engines and frameworks for making a game? I'm going to make a game. I've noticed that there are a lot of game engines, libraries, and frameworks available out there, and I'm having a little trouble deciding which one to use. I'm already pretty good with some programming languages, but there are others which I don't know at all. I'm not against learning new programming languages, if that'll help, but my real goal is just to make my game. What criteria should I use to compare engines, libraries, and frameworks against each other, so that I can decide which one will allow me to be the most productive to finish my game?


Where does the game code fit into the engine? I was wondering if somebody could tell me how the game and the game engine fit into game development. What I specifically mean is, the game engine does not actually contain a game. Do game developers build an engine, then create a new class that inherits from the engine, which becomes the game? For example, class ShooterGame public Engine I'm not sure about where the game code fits into the engine.


Recursive dungeon maps as represented by an elastic 2d array I came up with a method for recursively generating simple dungeon maps by starting with one room and recursively connecting new adjacent rooms randomly to it. Maps are represented as two dimensional arrays where each cell contains a value of 0 15. 0 represents no room while each direction is represented by north 1, east 2, south 4, west 8. I wanted to start with a single non room ( 0 ) and then expand the 2d array as necessary to fit the generated map. The difficulty I face with this tree like recursion is that if the arrays have to be unshifted to add rows and columns to the left and top of the map, I have to adjust the current position of the function, what row and column it is at. This makes it so that separate branches are not aware of array index adjustments from other branches, only their child functions will know because they have the adjusted position passed to them as their row and column arguments. Is there a way to do this? I tried storing row and column offset values outside of the recursion, but it did not work for some reason.


How can I mock Google Play purchases? I would like to know what best practices should I do for testing the functionality when a user buy an item power ups via Google Play and purchased with real money? For example, basically, creating a simple test of purchasing and saving an item stored in the inventory during the game using a game money. (e.g. Gil from Final Fantasy series or Zenny from Tron Bonne for the PlayStation 1) I know how to make money purchase update only via game money when I'm programming in Unity3D or Eclipse w LibGDX library. Now, let say I have to create a program that checks the user if actually purchase a power up items using real money. Next, the system needs to check for online status. If connected, it will simply go to the Google Play dialog and asks the user if he she wanted to proceed purchasing of items. If yes and the credit card balance is sufficient, then goes back to the game app and check if the boolean returns true, then item that the user is bought will be saved. Another example is that the amount of real money will be calculated via programming and if insufficient, the user asks to add more real money value by purchasing it via Google Play. If return true, then, the real money value will be reloaded. This concept is basically needed for game developers. However, is there a safe way to test the real money purchase test stuff without using a credit card value or something before the actual publishing of the game app in Google Play along with this feature? Is there a tutorial, start up guide, recommendation or something for this? Please, I would like to know how will I start. Thank you.


What language was used to write Starcraft II? Total newbie question , but what language was used by blizzard to crate the Starcraft II game play? I've been playing it for the last couple of days , and I'm constantly astonished by the complexity and the performance of the game. Is it an in house language , or do they use some flavor of a know language?


Is game software design the same as non game software design? Is the software design process for a game similar to a non game? Do developers create UML diagrams? I ask because of the iterative nature of game development, I wonder if creating a UML diagram would just be a waste.


Deep copying or cloning in actionscript 3 I would like to make a mirror reflection of an entity in Flashpunk. So I would like to copy a spritemap from one Entity to another (reflectionEntity). If i use something like this reflectionEntity.sprite otherEntity.sprite reflectionEntity.sprite.scaleY 1 to reflect then the graphic of the original entity is also scaled. Is there a simple way out of this? I have been searching for the solution for more than an hour and have not found a suitable one.


Picking college degree (want to be games programmer) Alright, so I know there's plenty of questions that have to do with college degrees on this site, but I don't feel that any of them really answer my question. I recently got accepted into Northeastern University. The thing that drew me to the university was not only that it appears to have a comprehensive computer science program, but that it offers combined majors with the other colleges. Since i'm interested in both game art and game programming, I applied to the Computer Science and Digital Art major. However, after looking at the other combined majors, I wondering if I picked the one that is right for me. The five majors I'm currently looking at right now Computer Science and Digital Art Pros Teaches both programming and art fundamentals. Cons The mathematics requirements are the weakest of the five majors (only require linear algebra). Computer Science and Game Design Pros Very comprehensive in both computer science and game design. Requires the most computer science courses out of the 5 majors (the extra courses are game design specific). I'd be the most likely to meet like minded peers in this major as well. Cons Doesn't really touch on subjects of game art at all. You are allowed to take two art design electives, that's it. Computer Engineering and Computer Science Pros Gives a comprehensive education on computing in general (hardware and software). The biggest benefit of this major, I feel, is that it would teach me how to think. By that, I mean it would teach me to think in such a way that it'd be very easy to dive into other aspects of both computer engineering and computer science (more so than the other majors). Cons It's a computer engineering major first, and a computer science major second. Some of the information I learn may be pretty much useless. Computer Science and mathematics Pros Naturally, it has the most math courses of any other major. Cons The only major con is that I'm not really crazy about math, and don't know if I really want to subject myself to a bunch of it. Computer Science and physics Pros It's actually pretty well split among math, physics, and computer science. Cons Like the computer engineering major, some of the information I learn may be pretty much useless. I don't want this post to be ridiculously long so forgive me if I'm not specific enough. I'm guess I'm torn between different beliefs. Computer Science and Digital Art Game Design would probably be the most fun majors for me, since they'd suit my personal interests. However, the other majors would give me information that would be useful in a broader sense (I could apply them outside the fields of game design interactive media). I don't think any one of these majors will prepare me completely for the games industry, not even the game design one. However, I do think that no matter which of these majors I pick, I'll still be able to get into the game industry.


Effective methods to continuously update movement in a tower defense game? We are four guys making a Tower Defense game as a project in first grade on a university. The game is going to be really simple! Three different towers Three different monsters One map (maybe add some more if we have time) The game has to be object oriented. The class structure is as following Game Drawing of graphic, etc. Level Every level is an object of this class. Each level has a finite number of wave objects (in a list) Wave Contains a list of monster objects. Monster This is a superclass. We make subclasses for the different type of monsters Tower Superclass to the towers. There are subclasses for each type of tower. We are thinking about how to solve the problem that many objects have to do stuff, at the same time, e.g. move one pixel in one direction. What we came up with is the idea of implementing av class Timer, to control when objects do things. I am not sure this is the best way to do it. Could someone give some good ideas about how to solve the continious update case?


How to write "Hello World" for N64 purely from scratch? As an experiment I want to code a "Hello World" program for N64 using only assembly code, using no headers, tools, helper files, etc. I just want to write the assembly code bare bones from absolute scratch, assemble it and have it run through a demanding emulator that can show me the output. I can't find enough info on how to send the correct data to the RSP for video output though. Can anyone offer me a hand here? Not on helping me program, but with information regarding N64's RSP and how to program it to display text, etc.


Game Design Patterns ( think GOF ) literature? Possible Duplicate What are some programming design patterns that are useful in game development? Is there any literature on game design patterns? I'm taking a software design class and would like to learn how some of these design patterns would apply to game development.


Quantity of dropped spawned items in container I'm having trouble figuring out how to spawn more than one item in to a container with a weight limit. What I'm having trouble with is the understanding, rather than what statements to write My items are composed of weight, type and foundIn, among other things. My containers are items, with some minor changes. foundIn is an array of strings which match "container" items, and should be either "world", "container name", or empty ( ). "container" items follow a similar structure, with slight deviance. Whenever I want to drop an item, I get a pool of items in a foundIn location, make a Math.random check against the commonRate, and if that item is a type "container", I try to fill the container. Here is where I have my problem I can not figure out how to decide if multiple items of the same type should be dropped inside the container, and if so, how many. If I can figure this out, I can have monsters carry their own drops, instead of having to write a whole monster drop table with levels and oddities. The following is my code. The last method, dropItem, glues the displayed methods together. placeExists(place) return this. itemPlaces.indexOf(place) gt 1 getItemsOfType(arrayOfTypes, inList) if (!Array.isArray(arrayOfTypes)) throw new Error('Index must be string') let pool this.list if (inList) pool inList return pool.map((item gt if (arrayOfTypes.indexOf(item.type) gt 1) return item )) populateContainer(container, pool) let chance Math.random() pool pool.map(item gt let canBeFound item.foundIn.indexOf(container.name) gt 1 item.foundIn.indexOf('world') gt 1 if (item.commonRate gt chance amp amp canBeFound) return item ) this.getItemsOfType(container.availableTypePool, pool).some(item gt if (container.capacity.freeSpace lt 0) return true if (item.commonRate gt Math.random() amp amp item.weight lt container.capacity.freeSpace) container.addItem(item) ) return container getItemsOfPlace(place) return this. LIST.map(item gt if (item.isFoundIn(place)) return item ) dropItem(fromPlace) if (this.placeExists(fromPlace)) return let foundItem let pool this.getItemsOfPlace(fromPlace) pool.some(item gt let chance Math.random() if (chance gt item.commonRate) if (item.type 'container') foundItem.push(this.populateContainer(item, pool)) else foundItem.push(item) return true ) return foundItem container abstracted method of adding an item container.addItem (item new Item()) if (item instanceof Item false) throw Error('item needs to be of type Item') if (item.type 'container') throw Error('Yo dawg, I heard you like containers...') this. contained.push(item.code) this.carryingWeight item.weight How do I decide if I should drop multiple items, and how do I randomly select that amount? Note that this.list and this. LIST are the same list. For some reason, WebStorm seems to lose track of one or the other when inside certain callbacks, so I switch to avoid losing autocomplete. For reference, this.list is get list() return this. LIST , and is obtained from extending a custom List class.


Should a server run all maps in one loop, or a thread game loop per map? I'm working on a real time multiplayer browser based game. The game is top down on variable size tile based maps. There is no central map where all players come together, the entire game plays out in multiple maps. (Player chooses one on login, but has the ability to switch whenever they want). Let's take the following loop that runs on the server side of things let tick time Duration from millis(500) e.g. Tick 2 times per second. let mut next tick Instant now() loop let now Instant now() if now gt next tick Parse user input Update state Update to state to users in map next tick tick time else let wait time next tick now sleep(wait time Duration from millis(1)).await In my 'map based' gameplay scenario, would it make sense to spawn a thread for every map where one of these loops runs? Or would it be recommended to have only a singular thread with a singular game loop that updates every map? Or is there perhaps a better, already existing, pattern for this?


Tangible benefits to speed coding your personal game projects I noticed a few programmers setting time sensitive challenges for themselves, usually in the area of "write game of type X in Y amount of time" or "write X number of games giving only Y time for each". What are the tangible benefits for setting your workflow in this manner to speed code for a while? It feels like you have to trade off efficient code to get something done quick. And I suppose adding a final layer of polish isn't a big priority in these challenges, so it's okay to use programmer. I've made some simple 2D scrolling shooters and puzzle games a few years ago and out of stupidity I deleted most of my code. So now I'm curious about using the speed coding approach to get a couple simple things done again, and get myself more into game logic.


When or why would someone use a programming language (Swift, Java, C , Rust etc...) over an engine like Unity? Everytime I've read about people asking whether they should write their game in C or Unity, Unity is usually the default answer, unless they want to go through the hassle of creating an engine by themselves when Unity already does everything for you. If that's the case is there ever a case where writing a game in C , Java, Rust etc... is better than using Unity? If so what are these cases?


How was is playback of music handled on consoles such as the NES, Master System, Gameboy, etc? So, I deliberately left out the SNES because AFAIK the music subsystem is basically entirely self contained. However, on systems like the NES and Gameboy, while there are sound chips, there isn't any sort of dedicated sound CPU. My question is how one reliably plays back music without putting too much of a burden on the CPU? Timing is clearly very critical music won't sound right if the notes aren't played at exact intervals. Naively, one might just continually update the registers of the sound chip. However, this leaves no time for programming game logic! You could plan to update the registers every cycle in the main loop, but then any interrupts triggered would throw everything off. I haven't been able to find any information on this, despite there seeming to be a clear conceptual gap! So basically, how does a game like say, Super Mario Bros on the NES manage to play back music consistently and reliably, regardless of what is happening on screen?


Finding other programmers to help on a project As a semi FAQ question attempt Where can you find people to work with you on a project? Particularly programmers. One thing that is obvious is that all programmers have a project (or twenty), and the chances of a programmer just hanging around looking for something to do is a lot less likely than if it were an artist needed on the team. So, where do you post? Where do you search and follow people around until it looks like they are a viable team member? Is it really difficult to assemble a team that are not close friends or chat buddies? Are there sites with this sort of posting? To clarify I am referring to a team. Example 1 I am making gameEngineOfAwesomeness. I need help. Example 2 I am 70 complete on this game, and i need help. Example 3 I have an open source project idea, with a prototype. I need help. It doesn't necessarily mean open source, just programmers who can work with me on something (and where to find them ))


Shortcut for NodeJS server I am tired of typing "cd c socket nodejs" "node testserver.js" Into the command promt.. How do I create a shortcut or bat for it?


How should bots be recognised in a game? I'm interested in how bots are usually written. Here's my situation I plan to make an online 2D mecha game in HTML5, and the server side will be done with node. It is intended to be multiplayer, but I also want to make bots in case there aren't enough players. How does my game logic see them, as players or as bots? Is there a standard by which I should make them? Also, any general tips and hints will be OK.


Which programming language should I start with in game dev? I am a front end web developer and I've always been interested in building games. I work primarily with HTML, CSS, PHP, and JavaScript on a daily basis, so I'm not new to coding. I would like to know which language platform would be most useful for me to build a simple, 2D, art heavy game, like something you'd see on the Super Nintendo. Thanks.


Are there any advantages to different programming paradigms specifically releated to game programming? I have been researching three different programming paradigms namely procedural, object oriented and functional. So far I have been able to find a lot of good information regarding general differences and advantages disadvantages like readability, re usability, difference in learning curve, program size, etc. I am now looking for differences more related to game programming, but I am struggling to find good examples. Does anyone know of specific issues when programming games that these paradigms handle differently, that I could look into? This could include things like handling I O, rendering and programming AI, but other things related to game programming would also be appreciated.


Are techniques from Warioware D.I.Y actually useable in creating an actual game? In a game called Warioware D.I.Y, it teaches you how to create minigames with certain forms of AI. Can I use the techniques shown in this game to actually develop an advanced game?


Why are there fewer glitches in current day games? 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 2004 and out of nowhere, whenever I killed some bad guy, instead of dropping to the ground they'd start playing the running animation. This was getting me confused since I was trying to shoot them down from a large distance and didn't understand why they weren't dying. I've rarely seen stuff like this in current day games. Was there some change in the technique used to develop games that would make these programmer mistakes less likely? P.S. I'm not talking about RPGs and other inherently complex genres. I'm talking about games like Far Cry shooters like Battlefield 3, Modern Warfare 3, even Mass Effect. I've seen plenty of glitches in games like The Witcher 2, Skyrim, etc.


Time critical events based on framerate Problem Description Basically, I've made a "programming game" in which I've made my own scripting language. It is a completely standard Lunar Lander game, though instead of directly controlling the lander using keyboard input, it instead fires a sequence of commands you have provided through the scripting language I made. This all works, and I've hit a critical problem. So essentially, using the scripting language, you specify something like After 5 seconds, activate thrust for 10 seconds, and then after 2 seconds, rotate the lander for 4 seconds. The goal is then to chain together a sequence of commands which will get you to land the lander safely. Of course, this comes with one problem. If you repeat the sequence of commands, each command will have to be fired at exactly the same spot in the level, that is, after x amount of seconds, but also with the lander being in the exact same spot. If you did not use timer based movement, sure you could indicate that a command should activate after 5 seconds, but the lander moving at 60 FPS would have moved way further than a lander moving at 30 FPS. Why of course, I thought I would simple just make the lander use timer based movement so it is independent of FPS (I am using the very standard approach of taking the amount of time passed last frame, and multiplying it to a constant move speed). Then I would count seconds using the system clock. So the after x amount of seconds, the lander would be in the same spot in the level when the command activates. Unfortunately, this approach do not work. Every time I run a sequence of commands, they will be activated with, sometimes very slight, variations, making it impossible to actually get a consistent and reliable path for the lander. My Question So my question is, am I tackling this problem a completely wrong way? What exactly do you do when it is absolutely critical that timed events defined by the user will activate at exactly the same time and spot in a level? I seem to be quite stuck with this question.


Is there an IDE that can simplify the process of creating a game matchmaking website? Yes, I'm an old guy. And I'm well versed in "C" and have written several games which I have been selling on the web for a number of years. And now, I would like to adapt one of my games to be "online". Sounds simple. I'm sure I can use the thousands of lines of "C" code that I've already written. Right? So my initial investigation begins. First, I think I'll need a server program that lives on a dedicated server (or a VPS probably) that talks to a bunch of client applications that live on individual devices around the world. I can certainly handle that! (I think to myself). I'll break up my existing game into two pieces, a client piece that is just the game displays and buttons, and a server piece that does everything else. Piece of cake, right? But that means that the "server piece" must be executed on a remote machine somewhere and run 24 7. Can I do that? apparently, that question is so basic, so uneducated, and so lame, that nobody has ever posed it before. Because hours of Googling does not yield an answer. Fine. I'll assume I can do that and move on. I'll need a "game room", which to me means a website where you log in and then go to a lobby of some kind where you can setup your preferences, see if any of your friends are connected, and create or join games. Should be easy, but it's not. No way. Can I do all this with my local website builder? (which happens to be 90 Second Website Builder, a nice product, btw). It turns out, I can not. I can start with that, but must modify each page, so I can interact with my sql database. So I begin making each page a "PHP" page and dynamically modifying the HTML code with PHP code. I'm already starting to get a headache. Because the resulting web pages looked terrible, I began looking at using JQuery. I want to user a JQuery dialog on my website to display a list of friends and allow the user to select one to invite to the game. google search for "how to populate a JQuery dialog from a sql database" yields nothing but more confusion. Javascript? Java? HTML? XML? HTML5? PHP? JQuery? Flash? Sockets? Forms? CSS? Learning about each one of these, and how they interact with each other and or depend on each other is too much for my feeble old brain. Can anyone simplify this process for me? Is there an IDE that will help me do all this without having to go back to college for a few years? Thanks, Scott


What should a game engine do? I'd like to improve my skills try something new and I'd like to start with 3D. I have read Starting programming in 3D with C but I have question about engines What should engine do? I know it is abstraction layer above 3D API (i.e. OpenGL or DirectX) but what should it exactly do?


Display a Message Box over a Full Screen DirectX application In our custom assertion handler, I'd like to display a message box asking to see whether or not this failure can be ignored. However, when our DirectX game is full screen, I can't get the MessageBox function to display above the full screen. Note The first parameter to MessageBox is the the HWND used to create the device, and it still does not work. Is this even possible?


How are the same items generated with slightly different attributes? Consider games like Destiny. How do they generate weapons that have the same skins and names, but different attributes? Two people can have the same weapon or armor piece, but have different attributes on these pieces based on luck or drop rate etc. How is this accomplished programmatically?


Store and retrieve different objects on a tile (I hope the title is clear enough, if not feel free to suggest a better one) I'm trying to make a simple tile based map for a college project in Java. But I'm stuck on how to literally place things on my map. On the programming side of things, I still haven't got into graphics on this. As of now I have A "Robot" class, which implements an "Attackable" and "Spawnable" interface, the robot can attack and moved A "Obstacle" class, the obstacle too can be attacked, so it implements Attackable, Spawnable, but it also can be pushed by a robot (methods by the class itself). A "Station", which is nor attacable nor can be pushed, so it only implements Spawnable and other specific methods. A "GameWorld" class which hold the map (a 2D array of Tiles) and various methods. A "Tile" class (which is arrayed to create the map). It has a boolean "Occupied" (which doubles as a collision too). Previously it stored just a single Attackable variable, because both Obstacles and Robot can be attacked, so I just tought it would be easy to just store them as such on the map for when I need to attack something, and then use some other reference to Robot instances when I need to move the robots and have a reference to the station in GameWorld in order to use that. But then I remembered that the Obstacles need to be moved too, so it wouldn't really work. Now I'm thinking about having two maps, basically, an AttackableMap for the attackable object (which would store both robots and the obstacles) and a ObstaclesMap for the obstacles alone (with tiles occupied by robots set as occupied). Which would obviously mean having two tile classes, one to hold each kind of object. But it feels cheap, I think. It uses a lot of memory and I think it might be hard to render at a later time. But having only one map would mean having to check what kind of object I'm getting and I'd have to do loads of casts and I want to avoid that. So, I think, there must be a better way to do this. How do other people do it then? So basically my question is... How can I store different "things" on a tilemap in a better way? Is there some technique widely used? What I've come up with feels rigid, if I wanted to add another kind of object that can be placed on the map (like a mine) I would need to create another map entirely, another tile, write new methods... There must be some flexible (and not too complex) way to have some freedom in this aspect.


What are windows used for? I have a very general question In games, what use does the programming concept of a window have? Or, in other words, why do some game dev libraries offer interfaces through which to create multiple windows? mdash Why would you need more than one windows in a game? Are multiple windows used as different views states of the game? (I.e. in game, main menu, pause menu, etc.)


How should I handle functions, where two classes have equal use? I'm working on a few features for a strategy engine I'm making. I'm trying to figure out the best spots to separate the components, as either option will provide the same amount of coupling, with the same effectiveness. For example, all players have a Damage component, a Player component, and a HealthBar component abstract class Damage protected abstract void sendDamage(Player targetPlayer, int rawDamage) public abstract int calculateRawDamage(Attack attackUsed) public abstract void receiveDamage(int rawDamage) class Player List lt Armor gt equippedArmor List lt Buffs gt currentBuffs public Damage damageComponent public List lt HealthBars gt healthBarComponents abstract class HealthBar can be inherited for mana or health bar protected Color color public float percent 0.0 1.0 When a player receives damage, I need to show a red number floating up from their head, indicating the amount of damage. This can either be implemented in HealthBar, or in Damage. It fits damage better, but then healing works in the same way, and wouldn't be called from damage. I could abstract damage into something like ChangeValue, which would change mana, health, etc in any direction, or I could use the abstract HealthBar class to show this number being changed. I'm trying to think of a general rule that would solve this and other problems, where two classes use the same function equally. This is an oversimplified version of my classes, but it makes more sense this way. How should I handle functions, where two classes have equal use?


Game Design Patterns ( think GOF ) literature? Possible Duplicate What are some programming design patterns that are useful in game development? Is there any literature on game design patterns? I'm taking a software design class and would like to learn how some of these design patterns would apply to game development.


Building a unified interface for a swap chain in both DirectX 12 and Vulkan Most objects in DirectX 12 have natural analogues in Vulkan, e.g. VkInstance IDXGIFactory VkPhysicalDevice IDXGIAdapter VkDevice ID3D12Device VkQueue ID3D12CommandQueue VkCommandBuffer ID3D12CommandList However, when it comes to the swap chain, it's not clear how the entries in VkSwapchainCreateInfoKHR correspond to entries in DXGI SWAP CHAIN DESC1. Clearly, there is not always a 1 1 correspondence, but I would really like to know how I can implement a unified interface for both.


What are standard methods for organizing game code? Grouping by standard "kinds" of methods? I've made a few games, and am getting faster and better organized each time. I'm well out of the "just make it work" phase and working on methodology and readability. I need some tips on code organization though. I don't mean patterns I'm having great success with MVC but the organization of methods inside the classes themselves. I've noticed that methods in my state models can usually be grouped into four categories (1)constructor destructor, (2)data access (3)actions (4)events. My controllers usually have c d and input methods. My views usually have c d, view updaters, and event listeners. I feel like I'm reinventing the wheel though someone must have spelled out "these are the common types of methods" somewhere before, right? Storage has Create, Read, Update and Delete (CRUD), so what are the equivalents for objects? EDIT Found some cocoa specific advice here http www.mactech.com articles mactech Vol.21 21.07 StyleForCocoa and some generic advice here https stackoverflow.com questions 73045 whats the best way to organize code 73081 73081 I'm going to use that as a foundation, modified for game specific stuff. More info still appreciated if you have any.


How do I implement a racing clock that shows elapsed time? I'm wanting to make a old school timer like the picture below. How would I go about doing this in VD? I have tried it doing it with code bellow. The problem with this is that it starts with just seconds only adds the minutes section when you reach 1 minute. Dim StartTime As DateTime Dim PlayTime As TimeSpan Private Sub Form1 Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load StartTime Now() End Sub Private Sub tmrCountUp Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrCountUp.Tick PlayTime Now() StartTime lblTime.Text PlayTime.Hours amp PlayTime.Minutes amp PlayTime.Seconds lblTime.Text lblTime.Text 1 End Sub


Programmatically drawing a "pencil" line or curve If you look closely (scan it on a computer and zoon in) at a carbon pencil line you can see that there are differing shades of gray. I tried looking on the Internet for any kind of algorithm or statistical model for how that gray would be drawn programatically. Does anyone have information on this? Thanks a lot!! I want to make drawings on a computer that look they were drawn with a pencil.


How to encapsulate game objects (entities) in Box2d I am currently learning Box2d, a 2D physics engine within libgdx. But Box2d seems to be in every game framework these days so I am not really talking about libgdx. I understand Box2d comes with lots of new concepts such as shape, bodydef, body, fixture, sprite, joint. But I think I can slowly but surely manage to learn about them. My question, however, is how to organize them into a game object for better maintenance of code. Naturally, I am thinking about following fields in the game object class. GameArea gameArea Body body BodyDef bodyDef FixtureDef fixtureDef Shape shape Sprite sprite As for its methods, it has constructor, update, and display. But I am talking without experience. For example, I don't know how I can organize joints maybe in GameArea. Any thought from experienced would be appreciated.


How to make an object in box2d have constant velocity even after collision? I have iOS game where I have a bouncing character. Everything is being handled by box2d. The problem is when the character hits a wall of another character it's velocity changes, but I don't want this. I need the velocity to stay constant even after collisions. I was thinking the only way to do this was to keep setting the velocity after each collision unless there's another way to do this that I'm not aware of?


"Running" against a steep slope on a Box2D Platformer Ive seen alot of pages talking about how to emulate a platformer on Box2D, specially about how people dont want to slide down a slope. Well, my problem is different and Im surprised I cant find posts solutions about it. The problem happens when I have a very steep slope and I run against it. This is what happens Being the square a common platformer hero fixture, since in a Box2D platformer the movement is based on applying impulses or setting the velocity, what happens when I "move" torwards such a slope, its like im pushing against it, which creates a vertical force and therefore the square moves UP (specially since friction is 0 to avoid the "sticking to a wall" thing). I've solved most of Box2D's non platformer proficient issues. This one seems unsolveable. So, how do I avoid my object to go up a steep slope when pushed against it, and instead slide down since its too steep to be climbed?


Box2d How to connect distance joint to the ground? I have a rectangular fixed size world. I want to connect a body inside it to any place(near that body) in the world with a b2DistanceJoint. Do I need to create a large static body with the size of the world that can't collide with anything? Or is there a better method? Will it slow down simulation speed if I have around 300 bodies moving on the surface of this static body?


Sizing a Box2D ground object I am developing a platformer game using SDL2 for graphics and Box2D for physics. I am currently designing my levels and would like to know if it is better to make the static part of each level (ie ground) one big (500 units wide) polygon or to break each level up into multiple tiles just a few units wide. The Box2D manual says that I should keep my objects small to avoid bugs in the floating point code but having a single large ground object seems like a resonable way of reducing the number of objects in the simulation. So, can I make my ground object one large 500 unit polygon or should I break it up into many smaller 1 2 unit polygons.


How can I generate vertex data from an SVG? I am trying out the Phaser game engine, and am interested in making a vector graphics game (simple black and white like Asteroids), but I want to use vector graphics instead of raster PNGs. I was looking at this example, which looks like what I want to do... Where I am stuck is, say I draw a simple Asteroids style ship in Illustrator, consisting of 3 connected lines. How do I export that data into an array of vertices that would work with the setPolygon() method in Phaser Box2d?


Why can't I swap fixtures on collision in Box2D? I'm trying to swap the fixtures associated with a body after colliding with a specific obstacle. I can listen to the collision event by extending b2ContactListener. I tested it with a trace and it's working. My listener function in the main game class calls a Player method that makes the swap. But it's just not working. The body is stored in public var body b2Body in the Player class. The method I'm calling goes like this public function changeFixture() void var newShape b2CircleShape new b2CircleShape(1) var myFixtureDef b2FixtureDef new b2FixtureDef() Here I set density, friction, restitution, etc... Not important now... myFixtureDef.shape newShape body.DestroyFixture( oldFixture) body.CreateFixture(myFixtureDef) I know the method is called because this works trace('Yay! I'm working!') What might be wrong?


Set Position of multiple bodies I have a character composed of five bodies which are tied together by a lot of joints. On of them is the overall chassis, to which all forces and impulses are applied to move the whole Character. All in all that works very fine, except one thing I need to set the Position of the Character so that it get Beamed from one place to the other in one single frame. Unfortunately I cannot get this to work. I tried the following code, without any success playerbodies.forEach(function (bd) bd.SetLinearVelocity(new b2.Vec2()) var t bd.GetTransform() t.p.x 10 bd.SetTransform(t, bd.GetAngle()) ) How can I make that happen?


Get Vertices of a Shape Body in Box2D Is there a way to do it? I can get only polygon shape's vertices, but i want circle, box, etc too. How to do it?


How to set a body to a specific position using Andengine I'm developing a game with a single player and multiplayer mode. Lets say I have walls (static bodies), vehicles (dynamic bodies) and bullets (dynamic bodies). It works fine to control my own vehicle using vehicleBody.setLinearVelocity(velocityX, velocityY) . The vehicle can collide with walls and bullets as expected. Now I like to move the enemy vehicles in multiplayer mode. When I use the same method to move the body by its velocity values (in multiplayer mode), the vehicles get out of sync really quickly, means they don't have the same position on all devices because some data packages get lost. What I'm currently doing is the following On device 1 1) I move the body using setLinearVelocity 2) Then I get the X and Y position of the body and send a data package to the other device On device 2 3) I receive the data package and set the position of the body. I tried different ways, hopefully you can tell me the best way or alternatives I did not try yet using vehicleBody.setTransform(...) activity.runOnUpdateThread(new Runnable() Override public void run() vehicleBody.setTransform(new Vector2(newPosX, newPosY), angle) ) I also tried using MouseJoint (based on that tutorial), but somehow the body was bouncing randomly to the next position. Sometimes it was working great, but when I restarted the game the vehicle of the enemy started bouncing again. Maybe I failed to setup the parameters. Here is what I used public MouseJoint createMouseJoint(float newPosX, float newPosY) final float PIXEL TO METER RATIO PhysicsConstants.PIXEL TO METER RATIO DEFAULT Vector2 v vehicleBody.getWorldPoint( new Vector2(newPosX PIXEL TO METER RATIO, newPosY PIXEL TO METER RATIO)) MouseJointDef mjd new MouseJointDef() mjd.bodyA groundBody mjd.bodyB vehicleBody mjd.dampingRatio 0.2f mjd.frequencyHz 30 mjd.maxForce (float) (1000.0f vehicleBody.getMass()) mjd.collideConnected true mjd.target.set(v) return (MouseJoint) mScene.mPhysicsWorld.createJoint(mjd) Before I've used bodies I was using simple sprites and it worked perfectly. I sent data packages to the other device(s) and set the position and rotation of the enemy vehicle by using vehicleSprite.setX(newPosX), vehicleSprite.setY(newPosY) and vehicleSprite.setRotation(angle). Compared to that, bodies seem to be very complicated. So how I can I keep positions synced without bouncing? By the way, on some pages I read about using KinematicBody instead of DynamicBody for a vehicle. What is the advantage? My vehicle needs to collide with the environment, so I think DynamicBody is the correct choice, isn't it?


Box2d get free space I am developing a little Game with something like particles, where every particle is represented by a box2d Body. To insert new particles I need to find a place in the b2World where no bodies reside. How can I obtain this? greeting...


Hill jumping game mechanic like Tiny Wings I'm a huge Tiny Wings fan and I'd like to understand the game mechanic at a deeper level. What are some good resources for the basic Box2d (or similar) physics behind the hill jumping game mechanic? I've used some basic features of Box2d. I imagine the flying character is just a circle, tapping the screen increases the downward force on the character, and the hills are some sort of curve object from the physics engine. Edit 1 Here's more info I'd like to understand which objects from the Box2d physics library are used to create the bare bones hill jumping mechanic. This mechanic would look like a "curvy" horizontal line that just scrolls across the screen. The most basic shape for this line that comes to mind is a sine wave so that's probably a good starting point. Then there's the character that moves around. Note the character's horizontal position is fixed while the vertical position moves up and down. I'm curious about which Box2d body shape, type etc is used for this character. What are some values for the coefficient of friction that work well? How about the density etc. I've searched around the web for tutorials that ideally will answer the above questions and perhaps provide additional resources regarding efficiency, camera motion and so on.


Cocos2D Box2D body that is movable by one type of object but not another I'm in the process of creating a simple platform game using Cocos2D 2.0 and Box2D. I'm trying to create a kind of crate object that cannot be moved by the player, but that can be moved by an elephant object. When the player runs up to the crate, it should stop him dead in his tracks (as if he is running into a static Box2D body). If the elephant runs into it it should get knocked out of the way (as if the elephant was running into a dynamic Box2D body of much smaller mass density). I can't use collision bitmask because of course I want collision to occur in both cases, I just want that collision to result in different things depending on which type of object is hitting the crate. Anyone have a hint as to how to make this work? Thanks in advance!


Setting a Box2D Bodies Center? How do I set the center of a fixture body consisting of multiple shapes (triangles)?


How to simulate feather fall in box2d? I am working with AndEngine with Box2d extension, but general answer or a concept idea will be appreciated too. I have feather like objects in a 2D side view world that I want to be part of the physics simulation. I am using linear damping to make the "feather" fall slowly. This might not be a good idea, maybe I should rather apply force in each update, but nevertheless, this works and it makes the object look "light" and it feels like there is air with resistance. Now how can I make the objects actually look like feathers falling through air? Specifically I am looking for two types of objects Long with low density, that should move down in a slow swinging motion and square objects that would just randomly change trajectory. It would be great if this could be one simulation and length would be a parameter the longer the object is, the more it would swing. Right now I want to simulate feathers, leaves and snowflakes in a cartoon world.


Relative movement in Box2D (keep object from falling off planet) I'm creating a game with planets orbiting around a sun, like this The brown square is the earth, rotating around its center and around the sun. The yellow square is the sun, which doesn't move. Now imagine a player standing on the planet, the planet moves at a velocity of 20 m s. How do I prevent the player from falling off? I have to give the perception to the player that the planet isn't moving. I got the gravity on earth working, but I don't know how I can keep the player on the planet! I have thought about two solutions until now Just apply the angular velocity and linear velocity of the planet on the player (if it's in a specified radius), I think this method will cause jittery movement glitches. Create a separate Box2D world for the planet and render this Box2D world with the rotation translation of the planet. This method is complex though since it would add the problem of moving bodies between different worlds if the player would leave the planet. This image explains it I think there is another (better) way to fix this problem, but I haven't found a solution yet.


Rotate Box Sprite With Circle Body I want to rotate my rectangular sprite with circle body. The problem is the body doest not attached to the centre of the sprite. This was the default behaviour of the body and sprite. But I want that circle body attached in the bottom of the rectangle and when rotation happen at that time rectangular sprite always attached with the body at the bottom and during simulation it change its angle and position according to this only. I try to write question in words if I don't able to understand you then know me then I post a picture of my problem here. Although I know that cocos2d has setAnchorPoint method available so similar task become easily but what about my engine that right now I was using AndEngine. So be relevant to this game platform. Also thanks in advance for efforts you take.


box2d raycast filter category I am trying to filter a category in my ray casting (jBox2D within libGDX), which should return the closest object that does not belong to the category LEVEL0. I've tried a plethora of approaches, but none of them seem to work. This post, for example, instructed me to do so private static class RayCast implements RayCastCallback Fixture f Vector2 point float fraction public RayCast() this.fraction 1f Override public float reportRayFixture(Fixture fixture, Vector2 point, Vector2 normal, float fraction) if (fixture.getFilterData().categoryBits Corpo.LEVEL0) return 1f if (fraction lt this.fraction) this.f fixture this.point point this.fraction fraction return 1f Yet, it ignores the LEVEL0 bodies only sometimes, and sometimes ignores other bodies as well (though it seems to work on most cases, it fails frequently enough to be unacceptable). I've tried a few other solutions, including returning 1 in the first if (which should mean ignore this collision), return this.fraction always, instead of 1, but nothing works this, in fact, seems to be a very common problem, as the internet is filled with a variety of workarounds, none of them working for me. I think my library is updated, or at least is the version that is included in the latest libGDX (which, according to my quick research, is the actual latest). I've posted this same question here, but I'm not sure about the official forum's activity, so I decided to ask here too, just in case. Whichever website gives the answer first, I shall copy it to the other.


Errors happen when using World.destroyBody( Body body ) on Android application using libgdx, when I use World.destroyBody( Body body ) method, once in a while the application suddenly shuts down. Is there some setting I need to do with body collision or Box2DDebugRenderer before I destroy bodies? Below is the source I use for destroying bodies. private void deleteUnusedObject( ) for( Iterator lt Body gt iter mWorld.getBodies() iter.hasNext() ) Body body iter.next( ) if( body.getUserData( ) ! null ) Box2DUserData data (Box2DUserData) body.getUserData( ) if( ! data.getActFlag() ) if( body ! null ) mWorld.destroyBody( body ) Thanks


Error in destroying object in Box2D LibGDX I'm trying to delete an object when a collision happens. I have put the following code in the render method of the object so it would be outside of the physics calculations. public void render(SpriteBatch spriteBatch) some other code... body.setActive(false) body.getWorld().destroyBody(body) But I'm getting an run time error which crashes the JVM and shows, AL lib alc cleanup 1 device not closed Assertion failed! Program C Program Files Java jre6 bin javaw.exe File var lib hudson jobs libgdx git workspace gdx jni Box2D Dynamics b2World.cpp, Line 133 Expression m bodyCount 0 Can anyone help me here?


coloring box2d body in LibGDX I want to color polygon of box2d in LibGDX. Found below useful class for that. http libgdx.badlogicgames.com nightlies docs api com badlogic gdx graphics glutils ShapeRenderer.html But, it is not coloring the body instead making colored shapes. I want colored bodies having all the property like gravity, restitution etc. In brief, I want to make colored ball and surface.And i don't want to attach sprite on bodies. Want just fill color in bodies. Need some guidance????


Can i add friction in air? I have issue regarding speed in air. When i jump and move simultaneously that time speed of player increase.For jump i am using impuls and for movement i am using force.I want to slow speed when player is in air. Thanks in advance Following is my update method ih HUDLayer (void)update (ccTime)dt (b2Body )ballBody (CCSprite )player1 (b2World )world if (moveRight.active YES) ballBody gt SetActive(true) b2Vec2 locationworld b2Vec2(maxSpeed,0) double mass ballBody gt GetMass() ballBody gt ApplyForce(mass locationworld, ballBody gt GetWorldCenter()) ballBody gt SetLinearDamping(1.2f) else if(moveLeft.active YES) ballBody gt SetActive(true) b2Vec2 locationworld b2Vec2( 10,0) double mass ballBody gt GetMass() ballBody gt ApplyForce(mass locationworld, ballBody gt GetWorldCenter()) ballBody gt SetLinearDamping(1.2f) Following is jump (void)jump (b2Body )ballBody (ccTime)dt (BOOL)touch if (touch) if (jumpSprte.active YES) ballBody gt SetActive(true) b2Vec2 locationWorld locationWorld b2Vec2(0.0f,98.0f) locationWorld b2Vec2(0,32) double mass ballBody gt GetMass() ballBody gt ApplyLinearImpulse(locationWorld, ballBody gt GetWorldCenter()) ballBody gt ApplyForce(mass locationWorld, ballBody gt GetWorldCenter()) ballBody gt SetLinearDamping(1.2f) So where i apply logic??


Handling player background movements in 2D games Suppose you have your animated character controlled by the player and a 2D world (like the old 2D side scrolling games). When the user presses right on the keyboard, the background is moved to the right. If the path is always horizontal, this is simple to do (incrementation decrementation of the x coordinate). But suppose that the path is instead a polygonal chain. My questions are How do you move the background? How do you move the background if the game objects are managed with a physics engine like box2D? Note. What I wanted to ask is, how do you move a 2D character in a side scroller? For example, consider the following path A B C' D' C D You start from A, move horizontally to B, then move diagonally to C, then move horizontally to D OR, from B, jump on C' and continue till D' and so on.


Making the player walk on walls in box2d I'm making a game in stencil where players walk form left to right along randomly generated walls. I cant use waypoints, since the walls' shapes and positions are unpredictable. Here's a descriptive sketch The red line is the player's path. The red circles are what I thought might make good waypoints until I scrapped the idea.


Would a box2D sensor fit my needs? I have a object in my game that when the main character hits it, all I want to do is have the object explode and then notify the character object that a hit has occurred. Would I use a b2Body and set it as a sensor for this or would I achieve this some other way? I'm using cocos2d by the way.


Include Box2D libraries to a cocos2d project (iOS) I have a problem including box2D to my cocos2d project. I've tried different ways to do it with no success. This is what I've done I downloaded Box2D (Box2D v2.2.1) to my project directory. Dragged the Box2D directory (which includes Box2D.h, Collision, Common, Dynamics, Rope) to my Xcode project (from Finder to Xcode) Then I added include "Box2D.h" to my .h file and got many errors... Here is where I started my research P I went to Project Settings and edited the attribute Header Search Paths (contained in the Search Paths section) specifying the path of Box2D. At this point, I builded the project and I got less errors. After that, I renamed my .m file to .mm (I think this is because Box2D is written in C and with this, the compiler can treat it as it is). Still got errors. Then I tried changing the attribute Always Search User Paths (contained in Project Settings Search Paths) from YES to NO. Still got errors. As my last option I tried changing the attribute Compile Sources As (contained in Project Settings LLVM GCC 4.2 Language) from According to File Type to Objective C . By now I'm frustrated xD. I have 203 errors and most of them are in the .h files contained in the Box2d engine. b2Timer.h Expected ' ', ',', ' ', 'asm' or 'attribute' before 'b2Timer' b2Distance.h Expected specifier qualifier list before 'b2DistanceProxy' b2Math.h Cfloat No such file or directory And so on... Thanks!!!