Rotate a rigid body not around its centre of mass I have a rigid body (a boat) whose centre of mass is towards the front of the object. However, this makes the rotation look strange as the rudder that is turning the object is at the back of the boat so the rotation would be around that point. How can I rotate the object from the a separate point (using forces) without changing the centre of mass? Applying a force at a location still causes the object to rotate around the centre. In real life, you need to pin down the point that you want to rotate around, forcing the object to rotate around that point. This would suggest using constraints but I can't figure out how that would work. You sort of need the rotation point to act as a hinge, but when I apply a suitable constraint, but that would just block the rotation rather than convert it into a rotation around the new point. I want to resolve this using physics driven operations in Unreal Engine 4. I don't want to move the Centre of Mass, admittedly for not a particularly good reason, but this still feels like a valid question even if that was an option what if you want to rotate around two different points.


How can I calculate force and acceleration? I have problem of calculating the movement of the object. At the moment, I have a vectors calculated from the center of the screen minus the position of the object. direction vector centerScreen positionObject To calculate the new position of the object position(new) position(t) directionVector delta The delta is the time frame rate. Does anyone know how can I modify the above formula to calculate forces and acceleration? I want to have an object pulling other objects towards it.


Progressively loading the racing arena in a 3D driving sim I need advice and resources on a 3D car simulator. I want to progressively load the track for the player as I'm thinking of porting the game to mobile devices. This seems too difficult to me as I'm trying to separate the racing arena model design and the code as much as possible. Is there a structured method for achieving that for any model (arena map). I think this is something that comes up a lot in games in general not just this instance.


Why is RK4 better than Euler integration? At the end of these great slides, the author compares all the different integrators presented. One way or another, they all fall short except for Improved Euler Integration and Runge Kutta 4 Integration, which both pass all tests. I suppose I should mention that I am working on a 2D game that isn't very physics intensive. I'm just curious as to where Improved Euler Integration would fall short and RK4 would have to be used instead. My game consists mostly of simple gravity (jumping and falling), movement along the X and Y axes, and bounding box collision. Is it worthwhile to implement RK4 or would Improved Euler be sufficient? I see many discussions where Euler Integration's users are chastised, but from what I can see, Improved Euler is quivalent in simple 2D matters. I imagine it'd also be faster.


Pros and cons of different integrators When creating things like physics in games you need an integrator. I've seen Verlet integration mentioned several places as a great alternative to Euler integration. For instance in the famous document by Thomas Jakobsen. However in this article Glenn Fiedler writes Rather than introduce you to the vast array of different integrators that exist, I m going to cut to the chase and go straight to the best. This integrator is called the Runge Kutta order 4 integrator aka RK4. So apparently there's no silver bullet. What is the pros and cons of different integrators? Regarding simplicity, speed, accuracy, stability, etc. Which integrators is most suitable for which types of games? When would you use Verlet, RK4 or others? Should you ever use Euler?


Choosing the correct normal for a collision I have taken the task of building a basic impulse physics engine. Circle vs Circle collision resolution has been done and I moved onto Line vs Circle. I can detect a collision and know that the normal should be perpendicular to the line which can be calculated easily (2d physics engine). However it's the direction of the normal that I cannot work out. From the image you can see there are 2 possible normals, one upwards (the correct one) and one downwards. How do I choose the correct normal?


Pseudo magnet implementation with chipmunk How should I go about implementing "natural" magnet on a certain body in chipmunk space? Context is of simple bodies lying in the space (think chessboard). When one of the figures is activated as a magnet others should start moving towards it. Currently I'm applying force (cpBodyApplyForce)to the other figures with vector calculated towards the activated figure. However this doesn't really feel "natural". Are there any known algorithms for imitating magnets?


Why Change from one coordinate system to another? When dealing with affine transformations, why do we need to change from one frame to another? What are some reasons. What are the pros and cons of doing this and the limitations if this was not possible.(Change of Coordinate Transformations)


What is the logic beyond cube collisions? I am trying to simulate a colliding of two cubes , I actually tried and read a lot for many days but i did not get the idea beyond it,I know how to detect when they collide. Maybe my question is divided for many aspects, How to detect rotation and movement of these cubes after colliding , What is status of two cubes would be ? Sorry if was not clear or dumb, I would thankful if you could help


Cocos2dx Physics Abort() When Changing Dynamic PhysicBody to Static? I just learned cocos2dx v3.3 integrated chipmunk physics engine. Here ,as you see, I create a simple circle with physic as auto sprite Sprite create("circle.png") auto body PhysicsBody createCircle(sprite gt getContentSize().width 2) body gt setContactTestBitmask( 1) active collisions event sprite gt setPhysicsBody(body) sprite gt setPosition(...) this gt addChild(sprite) When I toggle this circle static dynamic in normal situation everything work fine and when circle become static it stop in its position (as we expect gravity don't move it longer). here is a toggle code which works fine body gt setDynamic(false) scheduleOnce( (float dt) body gt setDynamic(true) ,3,"Back to Dynamic Mode Timer") PROBLEM BEGINS But I want when the circle collide with something else ( in my case screen edge with is not important part of scenario), it become static then. so I use below code auto contactListener EventListenerPhysicsContact create() contactListener gt onContactBegin (PhysicsContact amp contact) gt bool return true contactListener gt onContactPostSolve (PhysicsContact amp contact, const PhysicsContactPostSolve amp solve) contact.getShapeA() gt getBody() gt setDynamic(false) gt Cause Abort() ! eventDispatcher gt addEventListenerWithSceneGraphPriority(contactListener, this) But I just face a abort() message and game exit. The call stack ( God bless it) show that the error is comming from line 300 in CCPhysicsBody.cpp if ( world ! nullptr) cpSpaceRemoveBody( world gt info gt getSpace(), info gt getBody())


Roguelike movement system I'm trying to implement a roguelike movement system for my game. I'm using the ECS architecture. The requirements are entities will have a mass, on which should slow down the entity movement accordingly. fatty ones move slower there will have different terrains, that should apply different friction types, eg ice will decelerate the entity slower a quicksand will almost stop the entity immediately and so on. optionally there will have different weathers that should also impact on the entity movement, eg sandstorm would push the entity to it's direction rains will diminish the friction coefficient a little bit etc... If the two first requirements are solved, the third will probably be as well, I think. How would you do this?


Serious issues with grid of connected springs So i have a simulation I am trying to make where there is a grid. Each dot will be connected to the dot Above, below, left, or right (If such dot exists) via a logical grid. Theoretically when I create a disturbance it will react slightly like cloth. My problem is it is going all wrong! I didnt know which way to subtract to get the delta so I gave you two samples. Issue one Detract This one is probably the wrong one but it might help. Basically when you cause a disturbance it causes everything to fly away. Its pretty cool looking. Issue two Attract This one is probably using the correct delta, however when left on its own the grid eventually groups in on top of itself. Ignore the diagonal ones at the very beginning those are just an error, I removed them since recording that video. Below is excerpts from the code that causes this. This system works entirely on a 1d array (because they arent always even close to a grid) and as a result I have a bunch of functions that find the index of next door points. I am not showing their implementation unless that is likely to be the error. The velocity resulting from the spring is stored in a variable springV. Each frame the interaction displacement and resulting spring velocity is calculated through function transfer. Then after all of that is calculated it is applied to the positions through function resolveGridS. Transfer() is run on each particle one by one in an order, then resolveGridS is run after that. Theoretically the correct force given from having a spring from the nextdoor point is calculated in the function resolveGridS and added to the total. The "Resting" distance of the grid is about 30. var springV Point() func transfer() if (excluded) return Gets rid of points not on the grid, they dont get to be springs let touch MT.getFirstFinger() if (touch.down) let location getPosition() let dist2p Math.dist2P(location, touch.location) Storage.bounds.rb let angle Math.calculateAngle(location, touch.location) pointTowords(touch.location) direction 180 let calc ( dist2p dist2p) 1.0 if (circleIndex 0) print(calc) moveBy(calc 5) let id Int(circleIndex 5) Get the 1d array location of this particle Get the 1d array index of each of the next door points let above moveDirection(id, Direction.Up) let below moveDirection(id, Direction.Down) let left moveDirection(id, Direction.Left) let right moveDirection(id, Direction.Right) Drag springV.x 1.1 springV.y 1.1 if (left.1 1) This check just deals with edge cases SpringC(Storage.particles left.0 .getPosition()) if (right.1 1) SpringC(Storage.particles right.0 .getPosition()) if (below.1 1) SpringC(Storage.particles below.0 .getPosition()) if (above.1 1) SpringC(Storage.particles above.0 .getPosition()) func resolveGridS() Storage.circles circleIndex springV.x Storage.circles circleIndex 1 springV.y func SpringC(loc Point) let pos Point(x Storage.circles circleIndex , y Storage.circles circleIndex 1 ) let delta Math.subtract(loc, pos) let dist Math.dist2P(delta) let norm Math.multiply(delta, 1 dist) springV.x norm.x 0.01 abs(dist 30) springV.y norm.y 0.01 abs(dist 30) NOTE I really dont know how you are supposed to deal with physics when one object has multiple springs connected to it. I made the assumption that you just calculate the force each spring gives for each object. And then after all of the forces are calculated you apply it. That could be wrong.


Looking for a peer reviewed article that details the benefits of a physics simulation within interactive media I'm hoping this is the correct place to ask this question as it is video game related and can be seen as a key ingredient in modern game development. Does anyone know of a peer reviewed article that details the benefits of incorporating a physics simulation into interactive media (such as video games)? I can find books with a few remarks in their introduction (no more than a couple of sentences) but nothing substantial.


Data structures for interpolation and threading? I've been dealing with some frame rate jittering issues with my game lately, and it seems that the best solution would be the one suggested by Glenn Fiedler (Gaffer on Games) in the classic Fix Your Timestep! article. Now I'm already using a fixed time step for my update. The problem is that I'm not doing the suggested interpolation for rendering. The upshot is that I get doubled or skipped frames if my render rate doesn't match my update rate. These can be visually noticeable. So I'd like to add interpolation to my game and I'm interested to know how others have structured their data and code to support this. Obviously I will need to store (where? how?) two copies of game state information relevant to my renderer, so that it may interpolate between them. Additionally this seems like a good place to add threading. I imagine that an update thread could work on a third copy of the game state, leaving the other two copies as read only for the render thread. (Is this a good idea?) It seems that having two or three versions of the game's state could introduce performance and far more importantly reliability and developer productivity problems, compared to having just a single version. So I'm particularly interested in methods for mitigating those issues. Of particular note, I think, is the problem of how to handle adding and removing objects from the game state. Finally, it seems that some state is either not directly needed for rendering, or would be too difficult to track different versions of (eg a third party physics engine that stores a single state) so I'd be interested to know how people have handled that kind of data within such a system.


How does braking assist of car racing games work? There are a lot of PC car racing games around which have this unique driving assist which helps brake your car so that you can safely turn it. While in some games it just an 'assist', it will just help your car brake but won't ensure a safe turn. While in others, the braking assist will help you get a safe turn. I was wondering on what could be the algorithm that is followed to achieve it. A very basic algorithm I could think of was, Pre determine the braking distance of an ideal car for every turn of the track, depending on the radius of the turn, and then start braking the car accordingly. For example, for a turn of less than 90o, the car would start braking automatically at 50m distance from the start of the turn. A more advanced algorithm, which would ensure a safe turn, could be Pre determine the speed of the car at the start of each turn, individually for each track, turn and car. Also, pre determine the deceleration rate of each car individually, which varies because of the car's performance. The braking assist would keep recording the speed of the car at a certain instant of time. Start braking the car appropriately so that the car gets to the exact speed needed at the start of the turn. For example, let the speed of a particular car at the start of a turn 43m in radius, be 120km h. Let the deceleration rate of the car be 200km h2. If, at some instant of time, the speed of the car is 200km h, then the car would automatically start braking at 400m from the start of the turn.


How do I prevent a KActor from changing the orientation of its Z Axis? So I have an object that inherits from KActor that I would like to behave as a dynamic physics object, but I want its Z Axis to remain upright, but very stiffly. I've tried the bStayUpright that triggers the "Stay Upright Spring". The problem is, it's a spring, and the object in question oscillates into position when I want it to remain oriented properly without wobbling. In the image above, the yellow block has fallen onto the gray box, and it is currently pivoting about the contact point as it tries to right itself. Should I be tweaking the StayUprightMaxTorque and StayUprightTorqueFactor parameters, or should I be using a Constraint of some sort?


Bullet Physics Applying a force at the point of collision Suppose I want to simulate some kind of gripper with two "fingers" (such as pair of pliers, or two fingered robot hand), picking up an object from the ground. Both the gripper and the object are dynamic rigid bodies. I want to start with the object roughly in the centre of the gripper, and then move the two fingers towards the object, to determine the point at which they make contact with the object's surface. Then, I want to apply a certain force from the fingers onto the object, before finally lifting the fingers (and hence the object) upwards. Is there any simple way to achieve this just by treating the two fingers as two individual rigid bodies? I want to just move the fingers towards the object to find the point of collision so can I treat them as kinematic objects (with zero mass so they don't fall under gravity, which is what I want), and move them manually by slowly changing the pose of each finger over time? But how will I know at what point the fingers and object collide, so that I should stop moving the fingers and start applying a force? Thank you!


game physics contact constraint and relative velocity For two rigidbodies (2D boxes), A and B, I have been colliding A with B and finding the collision normal pointing towards A i.e. the direction that would separate A from B. When it comes to calculating the relative velocity for the contact constraint, does it matter which body has the edge that the collision normal is perpendicular in terms of which velocity to subtract from which?


Creating a simple ripple propagation with variable resolution I am trying to do a simple simulation of a ripple propagating through a medium. I do not have a physics engine at my disposal so setting up a complicated set of spring constraints doesn't seem to be like the way to go. In the past when I have done this the simulation has been resolution dependent. Which means that because on each step each unit of the simulation only samples things one unit around them that if the resolution is high waves propagate slowly. Similarly if the resolution is low they travel quite quickly. I need to figure out a sampling method other than just the nearest neighbor that can make it so I can up the resolution of the simulation without majorly changing the sense of propagation speed. Are there any solutions to this kind of situation?


Progressively loading the racing arena in a 3D driving sim I need advice and resources on a 3D car simulator. I want to progressively load the track for the player as I'm thinking of porting the game to mobile devices. This seems too difficult to me as I'm trying to separate the racing arena model design and the code as much as possible. Is there a structured method for achieving that for any model (arena map). I think this is something that comes up a lot in games in general not just this instance.


Movement arriving using forces 3D. Given a point mass m, inital position p0 initial velocity v0, and a desired location d, how do I apply forces (with magnitude no greater then fMax) to move m to d and stop. I know how to apply forces, it's the strategy for determining what force to apply each frame. You would think this would be easy but it's turned out to be difficult. A solution that only converges at the limit is not acceptable (i.e. having the mass oscillate back forth over the destination by smaller and smaller distance) Edit This is not the same as this question. Finding the stopping distance is trivial, but is (maybe) only part of the solution. Edit Also not the same as this question, because the highest answer is incorrect (as stated by my constraints)


Friction due to gravity in an impulse based physics engine In my physics engine, I'm using impulses to solve collisions. I'm basing all calculations on these equations impulse desired velocity change mass impulse force time friction force lt normal force coefficient If an object moves along flat ground (infinite mass), after integration it'll be moving slowly "into" the ground due to gravity. This means that the impulse needed to react to that (given the restitution equals 0) will be the velocity in the direction of the contact normal, multiplied by mass. The issue here is that gravity is a constant acceleration, which means that the object, no matter the mass, will always "dip" by the same amount given a constant frame rate. So the mass is never a factor in this situation, outside of the impulse calculation, which is just a flat velocity change. Now, I can use impulse to calculate the force that was needed to react to the collision, this force can then be used in the friction equation as such friction impulse time lt normal impulse coefficient time Since time is always greater than 0, I can just multiply both sides by it, and then I can use the impulse equation, as such planar velocity change mass lt velocity change along normal mass coefficient And again, I can just remove mass from the equation, which leaves me with planar velocity change mass lt velocity change along normal mass coefficient This is the desired velocity change along the contact surface due to friction. The issue is, obviously, that none of this depends on mass, which means that no matter how heavy or light an object is, it'll always continue sliding along the surface by the same amount given a constant initial velocity. What am I missing? It really looks like there's a logical mistake here. Should the dynamic friction depend on the mass in the first place? Moving a heavy object requires higher force, so static friction should be modeled properly, since it just flat out removes velocity, though it'd be nice to hear if this has merit or just "looks good".


Custom Physics Preventing objects from losing velocity in certain situation Illustration http s22.postimg.org 7agd30vap Untitled.png So the little box is my character. The red arrow shows the current velocity(Some force to right gravity). Below it are 2 blocks which has the same height. The problem is that my algorithm would false solve the collision normals.(You can see them in green). These would mean that my character would not slide, but will stop in one place. I'm following this tutorial http gamedevelopment.tutsplus.com tutorials how to create a custom 2d physics engine the basics and impulse resolution gamedev 6331 Is there something I miss and how can I fix this problem?


2D object move evade obstacle Description Actor int x,y,width,height float speed, angle actor is an object that move around the map every frame, actor change position(x,y) according to it s speed amp angle Problem If Next frame actor A will collide with actor B Then A should turn to what angle to evade B?


Reimplemented steering seek behavior from PyGame to L VE is much slower than original I'm learning about steering behaviors and watched this nice explanation tutorial https www.youtube.com watch?v g1jo qsO5c4 amp feature youtu.be with the source code available at https github.com kidscancode gamedev blob master tutorials examples steering part01.py. The example app is written in python and PyGame and behaves like The main code parts of it are MAX SPEED 5 MAX FORCE 0.1 def seek(self, target) self.desired (target self.pos).normalize() MAX SPEED steer (self.desired self.vel) if steer.length() gt MAX FORCE steer.scale to length(MAX FORCE) return steer def update(self) self.acc self.seek(pg.mouse.get pos()) self.vel self.acc if self.vel.length() gt MAX SPEED self.vel.scale to length(MAX SPEED) self.pos self.vel ... I tried to reimplement this example in lua with Love2d framework and HUMP vector utility, source code is available at https github.com voronianski on games sandbox blob master src steering seek love2d main.lua. The code is pretty similar with the same constant values of MAX FORCE and MAX SPEED function Mob new () ... self.maxVelocity 5 a.k.a MAX SPEED self.maxSeekForce 0.1 a.k.a MAX FORCE ... end function Mob seek (target) self.desired (target self.pos) self.desired normalizeInplace() self.desired self.desired self.maxVelocity local steer (self.desired self.vel) if steer len() gt self.maxSeekForce then steer steer trimmed(self.maxSeekForce) end return steer end function Mob update (dt) self.acc self seek(vector(love.mouse.getPosition())) self.vel self.vel self.acc dt if self.vel len() gt self.maxVelocity then self.vel self.vel trimmed(self.maxVelocity) end self.pos self.pos self.vel dt ... end But behavior is different. Square is much more slower in lua implementation though the values are the same What could be a problem? Or what is the difference that I couldn't notice?


How to calculate detect the force of a collision? (Game Maker Studio) How can I use game maker to detect the force in a collision between two mobile (not fixed) objects? This is used for damage calculation and possibly compression calculation. My problem is this while net force can be calculated using mass and acceleration, the idea of damage is focused on the individual components of the force applied on an object. For instance, if a car is pushing another car against a wall, even though there are no acceleration, people will logically feel like some damage must be done to both cars because forces were conferred on them. I want to know if there is some underlying mechanism in game maker's physics system (I use the latest version) that actually calculate a reaction force from the wall on the car so I can use it to calculate damage.


Benefits of going full AABB? By "going full AABB" I mean using only AABBs for all of your objects (both dynamic and static), with dynamic objects colliding both with each other and static objects. In what specific ways does this simplify physics calculations? Are there any special techniques that require a world made entirely of AABBs? Some way to, say, remove the need for TOI ordering (or similar) by taking advantage of that fact that all objects are AABBs? In particular I'm looking for specific large scale benefits, not just small things like collision detection being slightly faster. There seem to be quite a few games that use only AABBs, like Minecraft for example, so there must be a significant benefit to it or they wouldn't be doing it. Only thing I can think of is getting to do position velocity corrections per axis, though I'm not sure how one would exploit that to its full potential.


Does client side prediction sync with the server in the past? I've spent some time now messing around and just trying to learn dead reckoning and client side prediction for the fun of it. Most of what I do doesn't need it, so i've never had a need to go down the path. I get how to predict the client and i've got a completely deterministic setup with a lockstep of 60fps for the physics on client and server. Both client and server use the same movement code, and i'm using constant velocity to reduce complexity. I also understand how to interpolate for corrections. I also have the server and client ticking at nearly the same time (as close as one can really get it). The problem i'm having, that doesn't seem clear to me in anything I've read (i'll put links at the end to a few things), is what does the client message sync against on the server? So, for example, the client is at 0, 0, 0, with a heading of 0, 0, 1 at tick 0. At tick 5 the client presses the button to start moving forward at 40u s and sends the message to the server. We'll say that the trip to the server takes 50ms and 50ms back. So the server gets the message at tick 8 (roughly), and here is where I am slightly lost. The client sent the tick they pressed the button along with the position and new velocity. Does the server do A. Look back at tick 5 and say "you're good b c you were where you should be at that tick" B. Check against tick 8 and say "well you where at 0, 0, 0 at tick 8, so you didn't start moving until then". It would seem with B, which is what i'm currently doing, that the server is always sending back a correction. B also has a bad side affect that when I stop, I'm almost never where the server is and the interpolation of this feels impossible to get right. While with A, it would seem I have to redo all collisions for that object from tick 5 thru 8 on the server, but this sends less corrections and would give a smoother feel. I understand that A is used for lag compensation when firing a weapon or taking some action that would affect other entities, but is that also used for motion? Things I've read http gafferongames.com http www.gabrielgambetta.com fpm1.html Various articles out of books and other websites that seem to skip past this detail Thanks in advance for any help.


Resolving a collision between point and moving line I am designing a 2d physics engine that uses Verlet integration for moving points (velocities mentioned below can be derived), constraints to represent moving line segments, and continuous collision detection to resolve collisions between moving points and static lines, and collisions between moving static points and moving lines. I already know how to calculate the Time of Impact for both types of collision events, and how to resolve moving point static line collisions. However, I can't figure out how to resolve moving static point moving line collisions. Here are the initial conditions in a point and moving line collision event. We have a line segment joined by two points, A and B. At this instant, point P is touching colliding with line AB. These points have unit mass and some might have an initial velocity, unless point P is static. The line is massless and has no explicit rotational component, since points A and B could freely move around, extending or contracting the line as a result (which will be fixed later by the constraint solver). Collision is inelastic. What are the final velocities of the points after collision?


How to make character gain acceleration? I want to create more realistic physics for my 2D games. Currently, the character and the other game objects in my games start moving instantly (achieve maximum speed instantly) and stop instantly (achieve 0 speed instantly). There is no transition between speed levels resting and moving, moving and resting. I heard about 'steering behaviors', but am pretty sure they're mostly for designing AI agents' movements. Should I learn steering behaviors to make more realistic character movements in general? (In the physics aspect). Is this the way to go? If the answer is 'yes', could you recommend a good source to learn them?


Numerical differentiation to calculate size of circular buffer I'm using Allegro 5 to create a software generated "motion blur" effect for my 2D sprites. I basically just have a boost circular buffer of some length which holds "snapshots" of the sprite going back in time. Each render cycle a new "snapshot" of the main sprite is pushed onto the front of the buffer, and the last is popped off the back. The "snapshots" are then rendered with alpha values scaled by how old far back in the buffer they are. To save on CPU power I'd like to have the circular buffer dynamically resized so that the length of the trail is proportional to the object's velocity, i.e. don't store and push back lots of snapshots for trail sprites that won't be needed anyway because the object is moving too slowly. The inputs I have to the data structure that holds the main sprite and its associated effect buffer are just the dx and dy values of how much its position vector changed since the last update cycle of the game logic. So I'm looking for a suggestion for an algorithm that can use that to increment decrement some kind of unsigned counter that can be used to resize the buffer proportional to velocity.


How can I simulate physics on my curved LED strip? I have a LED strip with 300 LEDs that I can control one by one https github.com cipold pyledstrip You can think of them as Adafruit NeoPixels https www.adafruit.com category 168 I have code to detect the physical positions of all LEDs using a camera and generate an x y heightmap https github.com cipold pyledstrip detector There is some experimental code to make use of the heightmap and let pixels race along the strip like on a rollercoaster https github.com Pixe1 pyledstrip particles Video http mnagel.net oneshot 2018 03 02 particle.mp4 975a194be7cc6fc8 particle.mp4 The "physics engine" within that code is very ad hoc, however. I want to rewrite it into something that more explicitly encodes the physical laws of classical Newtonian mechanics. I can easily simulate particles with mass, position, velocity (acceleration gravity forces). With multiple particles and gravity between them, I would end up with some kind of solar system. Or with constant overall gravity, one particle would fall down in a straight line, accelerating all the time. What I really want is "global gravity" but restrict the particles to move along the path dictated by the LED strip heightmap of waypoints (one degree of freedom along that path). How can I adequately model this restriction with formulas that are still reasonably physically accurate?


Calculating impulse propagation through a rigid body after a collision I'm working on a game. I need to work out what the impulse is at different points on a body as a result of a collision. For example, in the following diagram, if there is a collision that results in an impulse being applied to the body at A, what will the resulting impulse be at B? I know the mass, center of mass and dimensions of the body.


Player moving up, is he jumping or climbing? In a 2D physics based platformer game that has ladders in it, how do you determine whether the player moving up is caused by a jump or him climbing a ladder, such that you know what animation to play? And in general, obviously the direction vector is not enought to determine the animation to play how do you also determine the cause of the movement (so you know the correct sprite to use)?


Is this a correct backward Euler implementation? I want to simulate a mechanic object like this init acceleration a init velocity v init position x loop get delta time dt v v a dt x x v dt I use the velocity (which is the derivative of position) at the end of each time step to approximate the new position. So this should be exactly what the backward euler method does. Do I have an error in reasoning?


Shapes and sprites in SVGs I understand SGV images are used in 2D games to store shape data for the physics engine of the game. I'm unsure though, should the raster sprite also be stored in the SVG or should it be separate? Also, what about animated sprites? In a non skeletal based animation system, how should the shape of the character be handled? Is a simple rectangle enough?


Changing orientation by applying torques Suppose you've got an object floating freely in space. You have a vector you want this object to point towards, and a vector representing the direction it's currently facing. From these two, you can get the rotation (matrix, quaternion, whatever) that represents the change in orientation to bring the two vectors into alignment. If you only have the ability to apply torque (derivative of angular velocity) to your object, what's a good algorithm for applying torque over time that won't over undershoot the destination? (In this case, it's a space ship that wants to automatically orient itself in the direction of travel using thrusters. Roll is irrelevant.)


Clothing and physics asset collisions not working I quot m making a character in Blender where there's a character mesh and a simple skirt. The skirt has a different material slot, which allows me to use the Unreal Clothing tool. I created the clothing data, applied it, painted it so the top part isn't moving at all and bottom has 100 quot dynamics quot . I also created a physics asset, however no matter what settings I try, the skirt will always poke through the thighs like they don't exist. All the colliders are capsules. I also get the feeling that the hip collider actually works. But only that one! The skirt works perfectly with the wind, which makes it even weirder. Does anyone know what can cause this?


Relative Position Rotation calculation I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to object A? I'm using the JVector, JMatrix that are a part of the Jitter3D physics library. (http code.google.com p jitterphysics ) Any help would be greatly appreciated!


Best physics engine for OpenGL ES (different implementations)? Can you recommend a good physics engine which is easily portable between WebGL and other OpenGL ES implementations like in Android and iPhone? I don't want a game engine. Only the physics part.


Sliding loose dirt shader material effect Im sure there is some sort of technique with a name I don't know or didn't think to search, but how would I go about making an effect similar to loose dirt sliding down the face of a slope when something disturbs it? I guess I think of it as a mini avalanche or something. I have attempted it a couple times with pretty poor results, but some of the properties i tried to replicate was the sliding dirt spreads out the further it gets from its start position depending on the surface shape, angle of repose, rocks or larger pieces of debris causing even more dirt to slide(quasi recursion?), loose dirt 'sliding' over other dirt, etc. I assume id need to combine the right ratio of shaders, particles and textures to look right but I cant seem to find any real info on this type of effect. Would something like this be too intensive to do real time?


Applying multiple forces on a particle If I have a particle, say in a polar coordinate grid, and I want to apply multiple vectors to it, how can I calculate where it's final position will be given those vectors? Ex. Imagine there's a force represented as a vector, that moves the particle a radius magnitude of 8 at an angle of 45 . Another vector that acts on it at the same time, at magnitude 3 at 90 . How would I calculate the final position of the particle?


Targeting with a ballistic gun I am trying to determine the gun elevation angle of a gun that fires ballistic projectiles. For a target at a certain distance D, I will have to compute an angle that increases with D. This relation ship is non linear, by the way, because the projectile loses velocity as it travels, for starters, due to drag. In the past, I have done this with a lookup table.... for a whole bunch of test firings, see where the projectile hits the ground. But this only works if there is no delta in the elevation between gun and target. A target that is on a hill top, will need adjustment for extra range. Whereas a target in a valley below, would mean a lower gun elevation. This means that the table lookup will break down, and a 2D table seems like a kludge. What would be an effective way to compute this targeting? I know things also depend on nozzle velocity and air drag, but these will not vary (but drag will be non zero.) Neither will I be modeling the wind. Additional information This is for AI assisted targeting. NPC or player targets a point in the world. The algorithm will find the corresponding angle to hit the target. Currently, I am using Bullet Physics, with a discretely stepped world.


Vectors and corners of squares I am having some problems with some vector math. Imagine a square and coming from each corner of the square is an invisible vector, which starts at the square's centre and ends at the edge of the screen. a d b c THIS IS A VERY CRUDE IMAGE AND THE ANGLES OF THE VECTORS ARE NOT EQUAL There are 4 areas a, b, c and d I would like to say that if you touch within one of the areas then something happens. Is there a simple way to do this?


How does the rectangle bounds (x,y,width,height) in libgdx work? I cant work out how to use the rectangle bounds in libgdx I am currently using the superJumper example and have 2 or 3 examples with that are lt ! this is the pause button in the top right corner gt pause Bounds new Rectangle(320 64, 480 64, 64, 64) lt ! this is a rectangle resume button in the middle of the page in the menu that comes up when the pause button is pressed. gt resume Bounds new Rectangle(160 96, 240, 192, 36) Basically my question is aimed at the 360 64 and 160 96 because I don't know why this is used. I need to create a rectangle that covers the left side of the screen and the same on the right. I want to create some on screen buttons, I have already created the actions for these buttons and I have managed to get them to work but I can't move the rectangles to where I want.


Changing background images frequently within a specific time range with Cocos2D I am working on a game development project for Android. We use the Cocos2d framework. I have to design a page which contains two background images, I need to switch these images repeatedly within 1sec. How can I do this? How can I use CCTransitionScene in my Java code and change these images repeatedly? Thanks in advance.


How to manage screen and input when using libSDL2 for both desktop and Android? I have worked on libSDL1.2. Since, the release of 2.0, SDL also supports android. So, I am trying to develop game that can work both on desktop and android. But there are few things that are confusing me. When we are creating a window, we pass the width and height of screen. But on android game covers whole screen and different devices have different resolutions. So how can we create a screen which appears uniform on both desktop and android. How to handle inputs like back button. Also, how to load graphics based on DPI.


The best option to multi platform 2d mobile development we are in the process of porting a game from iphone(made with cocos2s) to android(using the andEngine), and it has been a pain to do. So for our next project (a 2d game) we are thinking about using some multiplatform engine framework. For now we are thinking about testing both unity, marmaled(former airplay sdk) and cocos2d x. Do you have any opinion about this? Does someon have experience developing 2d games using Unity?


How do I change my gravity and jumping logic to put the character at a specific height at a specific point in time? I'm making a 2D platformer on Android using libGDX. One thing I've had a problem with recently is gravity and jumping. I found a few tutorials on the internet and was able to come up with this... public static final int JUMP HEIGHT 64 public static final float JUMP GRAVITY 6.0f public static final float MAX GRAVITY 20.0f public static final float GRAVITY 19.0f private void updateGravity(float delta) if(Gdx.input.isTouched() amp amp !jumping) jumping true gravity Config.JUMP GRAVITY if(jumping) change frame to jump sprite.setRegion(walkFrames 0 ) sprite.translate(0, ( 1 gravity)) runner has landed? if(sprite.getY() lt idleY) jumping false sprite.setPosition(Config.RUNNER X, idleY) slowdown fall if (gravity lt Config.MAX GRAVITY) gravity Config.GRAVITY delta The code works and my character will jump and fall smoothly. Although the time it takes for him to jump and comedown is independent from delta the height he jumps is not. If the device lags while jumping he will jump only a portion of how high he should. For the life of me I cannot get it to make sure it jumps a specific height (JUMP HEIGHT) and in a specific time independent of the delta.


Reducing APK File Size by using JPG instead of PNG for game background images I've just finished my (openGL ES 2.0 Android) game and it's almost ready for Alpha testing. When I export the application to an APK File, the file is taking up 16MB and I would like to reduce this as much as I can. Here are some points about what the project contains and what I've tried to reduce the size already 222kb of Ogg Vorbis files used for Sound Effects 1 x MP3 file at 5.59MB (128kbps Bitrate) 4 x sets of PNG files used for textures (XHDPI, HDPI, MDPI amp LDPI I'm not using XXHDPI) Just over 1MB of code What I've tried thus far to get where I am I've optimised the PNG files using Optiping I've applied ProGuard to my code before exporting, this didn't really help by much as 99 of my app is resources. So my question is, is there really much else I can do to reduce the size of the APK? I was thinking about maybe using JPG format source files for my Background OpenGL textures instead of PNG anyone have any experience with this? Does it hurt performance at all? I can see that it would make quite a difference my atlas of backgrounds in PNG format for XHDPI is 1.7MB and a 90 compressed JPG comes in at around 650KB. I'm just not sure if it's a good idea as everyone always advocates PNG JPG. Any pointers from personal experience would be helpful amp also if I've overlooked anything other than using JPG's.


How to decide how much to charge for development? So two other friends and I are a very small game dev studio. So far we haven't released a game but we have 2 games almost ready to launch. A bigger studio saw our work and now they want to work with us they need people to develop mobile games for them (iOS, Android). They want us to set the price for the projects (can't tell the specifics we signed a NDA). They will give us all the assets (graphics sound) so we only have to code. And because they only work with Unity3D we have to learn it. How do we decide how much to charge for the projects?


How do games such as aa Game have high levels in the structure of their code How do games such as aa Game have high levels in the structure of their code? I mean if we want create a game with high levels, should we create and use a class for each level? I do not want code from you. only I want know for creating a game with high levels in android, What we should do in coding? Is it good if we create and use a class for each level?


How remove banner adView from a Screen in libgdx? I have an AdMob banner in the game. But I need this banner not to be shown in Screen 1 and when user enter Screen 2 I need to show the banner. When I call AdView.gone() it dissapears from screen but coordinates becomes wrong and touch position doesn't match with coordinates. How can I properly remove AdView.


Moving sprites using the accelerometer (Android) In my previous game, I was moving my sprite like so float time 10f Number of seconds to pass a pre defined area (using the screen width in this example) float velocity 1f time work out velocity based on above time float realX velocity dt Move the sprite to the left (where dt is previously defined delta) x realX screenWidth convert to screen coordinates so it can be rendered sprite.draw(x, y) Working out the y position in the same way This all works great when using touch controls. In the above example, the sprite will cross the screen in precisely 10 seconds regardless of the device on which it is running. However, the game I'm currently developing uses the accelerometer to move the sprite. (I'm only moving the sprite left right). Currently, what I'm doing is this Override public void onSensorChanged(SensorEvent event) tilt event.values(axis) Once I have the value, I apply it to my sprite movement like this float time 10f Number of seconds to pass a pre defined area (using the screen width in this example) float velocity 1f time work out velocity based on above time float realX (tilt velocity) dt Move the sprite to the left Now using the tilt value x realX screenWidth convert to screen coordinates so it can be rendered Although this does work it gives nice fluid movement of the sprite, when I run it on an old Galaxy Ace, the sprite accelerates way too fast. This changes the feel of the game note I'm talking only about acceleration here, so if I tilt the phone from left to right repeatedly, the sprite is extremely (too) responsive on the Ace, but 'just right' on my 10" tablet). I've tried a couple of other available games and they seem to run pretty consistently across devices. I'm wondering if my code is correct and if so, what can I do to get all devices running more consistently with regards to the accelerometer? Edit Just to clarify what it is I'm asking. I have a sprite in the middle of the screen sitting on a horizontal platform. When the device is tilted to the left, the sprite moves to the left. The rate of movement should be linked to the angle the device is tilted. So, if the device is vertical there should be no movement. If the device is tilted slowly to the left, further and further the sprite should increase in speed also (up to a limit) ie, accelerate. The other (real world) way to think of it is sitting a ball bearing inside a vertical box (the box representing the device) and then simply tilting the box to the left and right. The ball accelerates towards to lowest corner. The sprite should act like a real ball. If it's accelerating towards to left corner, and the box is tilted in the opposite direction, then the sprite should start to decelerate to a stop, and then srart accelerating in the opposite direction. Just as the real world ball bearing would. My Original code achieves this, however, on some devices it's simply too responsive, it will decelerate and accelerate too quickly. And therefore change the 'feel' of the game making it too easy for one thing. So basically when I say the sprite movement feels 'natural' I'm referring to how the ball bearing would act feel in the real world. This is exactly what I'm looking for hope this helps!


LibGDX Android Textures reload other textures, and transparent images get black backgrounds Pictures I have very strange problems with my LibGDX Game in Android The problem is that sometimes the textures get black backgrounds when they should be transparent, and sometimes when I remove the texture, or press the back button, the textures get replaced with other textures that I have. To clarify I'm using x texture to show the status of health. I'm using three x textures to show how many lives the player got, and when I lose health, and remove one texture, the x texture get replaced with y or z texture, or the remaining x textures get black backgrounds. Sometimes it works flawlessly, and the x texture gets removed, and the backgrounds are still transparent. I'm loading my textures via an AssetManager, and just load them on create(). In my render I use this Gdx.gl.glClearColor(1, 1, 1, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) Gdx.gl.glBlendFunc(GL20.GL SRC ALPHA, GL20.GL ONE MINUS SRC ALPHA) batch.enableBlending() batch.begin() for (Entity life LifeEntities) life.render(batch) batch.end() I'm also using this in my Launcher Class. AndroidApplicationConfiguration cfg new AndroidApplicationConfiguration() cfg.r cfg.g cfg.b cfg.a 8 MainGame myGame new MainGame(arrayName) initialize(myGame, cfg) I do dispose the textures also. I have looked up on google and on gamedev about this problem, but all the questions are for problems when the transparent always have black background, not when it is something that happens like a bug. Any suggestions on where the problem could be? Thanks a lot, if you need more code, please let me know. Pictures of the problem


Android emulator with acceleration and gyroscope simulation Is there an Android emulator that is compatible with eclipse that can simulate acceleration and tilting of a mobile device?


Drawing game app How to use vector graphics instead of bitmap in Android? I have a problem concerning the concept of using vector graphics instead of bitmaps in order to draw on canvas. Usually to draw on canvas we set a bitmap to that canvas and we start drawing pixels on it by simply moving our finger on the screen. However, this method will result very pixelated relatively low quality drawings. It is noteworthy that there are some drawing apps that result in very smooth curves when you want to draw via them. After doing some googling and researching, I knew that there is the new concept of use vector graphics that is being used in order to draw smooth edged drawings on the screen. Look guys, the thing is when I developed my drawing app, I used bitmap (which was already there as an object given by Android) in order to draw cubic Bezier curves. No matter how much I tried to smooth my drawings out, I always get stair like edges. If you are interested in how I developed the curve, please read this. If not, just ignore this bold paragraph In order to draw the cubic bezier curves I simply took the sampled touch points and for every 4 points in these sampled points I calculated the 2 intermediate control points (the ones that the curve never touch) to create a bezier through the sampled points. For the curve to appear, I used bitmap and paint objects given by android. After getting the undesired result (low quality curve), I decided that I want to use vector graphics in order to do the same thing but with a higher quality. The thing is that I am very new to Vector Graphics, that I don't know where to start. My question is simple as is Is there a platform given to me by Android in order to use vector drawable like in the case of bitmap? If not, am I supposed to start this from scratch? I am clueless and any tip or hint from you will be greatly appreciated.


Augmented reality on Mobile platform iOS Is there a way that we can control the iOS device camera to an extent what colors it sees, what shapes it sees ? etc I'm speaking about the ability to read information before the image is captured. Consider my question as Possibility of making an augmented reality game on iOS phones. I dont find relevant help for my query in internet iOS developer site. Hence posting here.


Android AndEngine creating a body behind the sprite exactly I am using AndEngine for Android. I created a body, but it is not behind the sprite as I wanted. Body.setTransform(Sprite.getX() 32, Sprite.getY() 32, 0) This is what I am currently using and this is how it appears. My body is the white circular borders, and my sprite is the red circle. and When I remove 32 from the code the body doesn't even appear. Extra code FIXTURE DEF PhysicsFactory.createFixtureDef( 1, density 0.75f, elasticity 0.5f, friction false) isSensor the Body Body PhysicsFactory.createCircleBody(this.physicsWorld, Sprite, BodyType.KinematicBody, this.FIXTURE DEF) Body.setUserData("eSprite") this.physicsWorld.registerPhysicsConnector(new PhysicsConnector(Sprite, Body, true, true) my sprite is 65px ..


GdxRuntimeException uiskin.atlas I have problem when trying to use the uiskin.atlas from github libgdx. I've downloaded(cloned) it from libgdx.git but it just doesnt work. I get the following error Com.badlogic.gdx.utils.GdxRuntimeException Error reading pack file data uiskin.atlas And further down in the catlog it says Caused by java.lang.IllegalArgumentException 256,128 is not a constant in com.badlogic.gdx.graphics.Pixmap Format What does that mean? Anyone knows how to solve it? Im using the line skin new Skin(Gdx.files.internal("data uiskin.json")) Im at work at the moment so can't give more info than this. The error happens both in Eclipse and in AIDE on my phone.


Z rotation causing skew Android OpenGL ES 2.0 If I rotate about the X, or Y axis there is no skewing however for a pure 2D game that does not help me. When I try to rotate about the Z axis however the quad I am rendering for the sprite starts to skew until it disappears at 90 degrees appearing again shortly after a slowly resuming a quad shape. As far as I can tell I have written the code correctly, it is as I have written it before on 2D projects and it worked there I am either missing something stupid or OpenGL ES 2.0 does something different then what I expect, some excerpts of code follow Projection View Matrix.setLookAtM(ViewMatrix, 0, 0, 0, 3, 0f, 0f, 0f, 0f, 1.0f, 0.0f) Matrix.orthoM(ProjectMatrix, 0, width 2, width 2, height 2, height 2, 0 , 100) Rotation Scale Translation(For in place set to identity first) Matrix.translateM(Translation, 0, x, y, 1.0f) Matrix.setRotateM(Rotation, 0, angle 0.05f, 0.0f, 0.0f, 1.0f) Matrix.scaleM(Scale, 0, 64,64,1.0f) Multiplication of Matrices Matrix.multiplyMM(MVPMatrix, 0, ProjectMatrix, 0, ViewMatrix, 0) Matrix.multiplyMM(MVPMatrix, 0, MVPMatrix, 0, Translation,0) Matrix.multiplyMM(MVPMatrix, 0, MVPMatrix, 0, Rotation, 0) Matrix.multiplyMM(MVPMatrix, 0, MVPMatrix, 0, Scale, 0) Thanks for any help.


How to change from 60FPS to 30FPS while keeping things smooth? Here is my current game loop final int ticksPerSecond 60 final int skipTicks (1000 ticksPerSecond) float dt 1f ticksPerSecond while(System.currentTimeMillis() gt nextGameTick amp amp loops lt maxFrameskip) updateLogic() nextGameTick skipTicks timeCorrection (1000d ticksPerSecond) 1 nextGameTick timeCorrection timeCorrection 1 loops On most devices I've tested my game on (this is an Android game BTW) it runs quite nice. As you can see, I'm using a fixed time step (defined as my ticks per second). If I reduce my Ticks Per Second to 30, everything runs at the same speed but is nowhere near as smooth. I keep hearing people say that 30fps should be OK for mobile games and everything should run great at 30 fps, but that's just not my experience. Would be grateful if someone could give me some pointers on how to achieve this.


Export Blender 3D animation to be played by Android OpenGLES Below code snippet shows the way to export coordinate of bones def export bone matrix(armature, bone, label, file handler) SystemMatrix Matrix.Scale( 1, 4, Vector((0, 0, 1))) Matrix.Rotation(radians(90), 4, 'X') if (bone.parent) Export babylon.write matrix4(file handler, label, (SystemMatrix armature.matrix world bone.parent.matrix).inverted() (SystemMatrix armature.matrix world bone.matrix)) else Export babylon.write matrix4(file handler, label, SystemMatrix armature.matrix world bone.matrix) I have create a 3D character in Blender, and add keyframes in it by transforming in some frames. From the graph editor, you can easily tell the all displacement of transformation translate, rotate, scale are all measured with respect to the original value in frame 0. Is it possible to write OpenGL in Android to animate the same 3D animation in Blender? I'd like to transform the 3D character translate, rotate in each frame according to the displacement value exported from Blender. Below lists the python function to export translate, rotate displacement in each frame def get bone action location(action, bonename, frame 1) loc Vector() if action None return(loc) data path 'pose.bones " s" .location' (bonename) for fc in action.fcurves if fc.data path data path loc fc.array index fc.evaluate(frame) return(loc) def get bone action rotation(action, bonename, frame 1) rot Quaternion( (1, 0, 0, 0) ) the default quat is not 0 if action None return(rot) data path 'pose.bones " s" .rotation quaternion' (bonename) for fc in action.fcurves if fc.data path data path and frame gt 0 and frame 1 lt len(fc.keyframe points) rot fc.array index fc.evaluate(frame) return(rot) Or I need to transform the meshes with vertex group controlled by root bone by the transform matrix SystemMatrix armature.matrix world bone.matrix? And for those controlled by child bones by the matrix in terms of (SystemMatrix armature.matrix world bone.parent.matrix).inverted() (SystemMatrix armature.matrix world bone.matrix)?


Android cocos2d removing a sprite after animation I have an object going across the screen with an animation using the following code CCSpriteFrameCache.sharedSpriteFrameCache().addSpriteFrames("ninjastar.plist") CCSpriteSheet projectileSheet CCSpriteSheet.spriteSheet("ninjastar.png") addChild(projectileSheet) ArrayList lt CCSpriteFrame gt projectileSprites new ArrayList lt CCSpriteFrame gt () for (int i 1 i lt 4 i ) projectileSprites.add(CCSpriteFrameCache.spriteFrameByName("ninjastar" i ".png")) CCAnimation projectileAnimation CCAnimation.animation("throw", 0.1f, projectileSprites) CCSprite projectile CCSprite.sprite(projectileSprites.get(0)) CCAction projectileAction CCRepeatForever.action(CCAnimate.action(projectileAnimation, false)) projectile.setPosition(CGPoint.ccp(winSize.width (projectile.getContentSize().width 2.0f), actualY)) actionMove CCMoveTo.action(actualDuration, CGPoint.ccp( projectile.getContentSize().width 2.0f 320, actualY)) projectileSheet.addChild(projectile) projectile.setTag(1) projectiles.add(projectile) CCCallFuncN actionMoveDone CCCallFuncN.action(this, "spriteMoveFinished") CCSequence actions CCSequence.actions(actionMove, actionMoveDone) projectile.runAction(actions) projectile.runAction(projectileAction) I'm using "spriteMoveFinished" to remove the sprite once it is done going across the screen public void spriteMoveFinished(Object sender) CCSprite sprite (CCSprite)sender projectiles.remove(sprite) sprite.stopAllActions() removeChild(sprite, true) However, when the sprite gets to the end of the screen it just stays stuck there on the last frame. How do I remove it completely?


Detecting image curve to move a truck on this surface I have an image background in surface view I want to move something according to black surface.But i can not do this using height of this image as it return same height.and one more thing bitmap.getPixel is also not working.and my background is moving.So what is the way to achieve this feat


How to implement constant velocity and collisions without gravity I am learning game development and i am trying to implement the AndEngineBox2D Extension such that my character is always moving at a constant velocity, when it collides with a body sprite, the character automatically changes direction (is deflected) and moves in the new direction until another collision has happened and the same is done repeatedly. My Question Is it possible to implement the changes in trajectory with AndEngineBox2D's physics world or i have to to handle it manually is java code.


Move Background in AndEngine for a Racing Game I am new to game development and AndEngine. I have small query about racing game. I am going to develop a bike racing game. For bike racing game we will move the background or the player. I am tried with andengine autoparallax background. But I didn't got the correct answer. I need to do a background like these screenshots in SpeedMoto. Can anyone help me to set the background.


Button change texture after click I need to make a button with texture. After button is pressed I want to change texture of button permanently. For example on of sound button. I tried this but it changes image only while I hold button. Thanks mSoundButton new ButtonSprite(30, 30, ResourceManager.getSoundButtonTR(), tiled texture region with image for sound on and sound off ResourceManager.getEngine().getVertexBufferObjectManager()) Override public boolean onAreaTouched(TouchEvent pTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) if(pTouchEvent.isActionDown()) SFXManager.toggleSoundEnabled() this.setCurrentTileIndex(1) return super.onAreaTouched(pTouchEvent, pTouchAreaLocalX, pTouchAreaLocalY) mScene.registerTouchArea(mSoundButton) mScene.attachChild(mSoundButton)


How well does Unity 3d work for both Android and iPhone? First off this question might be a bit broad so I apologize if it is. I am really just looking for peoples experiences and personal knowledge on the subject. I am looking to create a game for both Android and iPhone platform. I know Unity is a great game engine and my question is how well does it work for creating one code base to build for both Android and iPhone platforms? Time is a constraint on this project so I am very interested in how smoothly the process usually is when trying to build both applications and how much custom code must be written for each specific application. Any insite that people have on this topic would be much appreciated thanks.


In Unity, on an Android device, CaptureScreenshot writing to Phone, but persistentdatapath linking to the external card I'm using CaptureScreentshot() to get an image. But when I try to access it on an Android device it's giving me Could not find file " storage emulated 0 Android data appname screenshot.png" When I go the external storage, it's not there, but rather on the phone storage. So why is persistentdatapath accessing something different? My code is the following byte Bytes File System.IO.File.ReadAllBytes(currentScreenshotPathname) with thepathname obtained using currentScreenshotPathname System.IO.Path.Combine(Application.persistentDataPath, currentScreenshotName) Is there anyway to make the persistenDataPath go to the phone storage rather than emulated to read the file? I've tried changing the WriteAccess perimission to Externalas well as Internal in the player settings, but it's still the same. Edit Here's what's happening PersistentDataPath is storage emulated 0 Android data myapp files , but the screenshot is being saved to mnt sdcard Android data myapp files, despite the documentation saying that it should save to the PersistentDataPath.


Problem converting FBX file into XNB I create a Monogame Content Project to convert assets into XNB. For FBX file without texture there is no problem the file is correctly converted and when I load XNB into my project everything is ok. The problem occours when i have associated to fbx file a texture map in this case both FBX and PNG files are converted to XNB but when i try to load these XNB files into my project the following problem occours "ContentLoadException Could not load Models maze1 asset as a non content file!" Note maze1 is the XNB file that was converted from FBX. How can I solve this problem? Thank you in advance


Touch point on the near plane I have a matrix created with either orthoM or frustumM GL function, where the near plane is logically the surface of the tablet. I would like to translate touch locations to their location on the near plane (that is, from device coordinates to the world coordinates). I assume this is a common enough activity so I'm wondering if a standard API function exists (or simple sequence) which can provide me with this data?


Saving an interface instance into a Bundle All I've have an interface that allows me to switch between different scenes in my Android game. When the home key is pressed, I am saving all of my states (score, sprite positions etc) into a Bundle. When re launching, I am restoring all my states and all is OK however, I can't figure out how to save my 'Scene', thus when I return, it always starts at the default screen which is the 'Main Menu'. How would I go about saving my 'Scene' (into a Bundle)? Code import android.view.MotionEvent public interface Scene void render() void updateLogic() boolean onTouchEvent(MotionEvent event) I assume the interface is the relevant piece of code which is why I've posted that snippet. I set my scene like so ('options' is an object of my Options class which extends MainMenu (Another custom class) which, in turn implements the interface 'Scene') SceneManager.getInstance().setCurrentScene(options) Current scene is optionscreen


How do I implement an AutoParallax Background in AndEngine GLES1? I'm using AndEngine GLES1. In my game, I use AnalogOnScreenControl to move a sprite and when it moves vertically, the background image also moves vertically. I want to do something like this that is in this link. I know that AutoParallax Background or BackgroundParallaxScrolling may be used. But how do I use it in my game?


How do I access device camera in GameMaker Studio 1.4? I've looked everywhere in the documentation for GameMaker and I didn't find anything about how to access the camera.


How to specify colour in a single 32 bit value I'm writing my first game using OpenGL 2 ES (for Android), and I've currently got a particle engine and some player sprites running successfully. I'm using 4 floats for the colour of each particle which seems like total overkill. It makes sense that I should be able to use a single 32 bit int (or perhaps a single float) to hold the colours (perhaps in RGBA format) which would presumably save a lot of unnecessary loading copying processing, but I'm struggling to understand how I could do this. I guess that I would need to change the shaders to take the relevant format, and also i'd need to change the way I load the color shader attribute. My fragment shader has varying vec4 v Color gl FragColor v Color texture2D(u TextureUnit, gl PointCoord) and the attribute (passed into the fragment shader from the vertex shader) is set up with glVertexAttribPointer(aColourLocation, COLOUR COMPONENT COUNT, GL FLOAT, false, BYTES PER VERTEX, floatBuffer) I've searched the documentation for what I should change vec4 and GL FLOAT to, and what how I'd multiply the colour with the texture, and have tried a few things but with no success.


Scene2d Stage Actor setup issues I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input processor to the stage like below. stage new Stage() sviewPort new StretchViewport(OSR Constants.VIEWPORT WIDTH, OSR Constants.VIEWPORT HEIGHT) OrthographicCamera camera new OrthographicCamera(OSR Constants.VIEWPORT WIDTH, OSR Constants.VIEWPORT HEIGHT) camera.position.set(0, 0, 0) camera.update() sviewPort.setCamera(camera) stage.setViewport(sviewPort) Gdx.input.setInputProcessor(stage) The level object is instantiated in another class known as GameScreen. GameScreen implements the Screen interface. I am unable to detect touch events on my actors in the stage. Each actor has also been given bounds as per the world coordinates. I have added the following code on each actor to detect touch this.addListener(new InputListener() public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) System.out.println("touchdown at " x " " y) return true )


Android canvas.drawColor throws a null object reference I have two nearly identical methods, the first to draw a splash screen while assets are loading, and the second to draw all of the assets to the screen. The first throws a NullPointerException on this line canvas.drawColor(Color.argb(255, 0, 0, 0)) Here is my error Caused by java.lang.NullPointerException Attempt to invoke virtual method 'void android.graphics.Canvas.drawColor(int)' on a null object reference 10 19 21 54 56.042 18973 18973 ? E AndroidRuntime at com.xyz.123.GameView.drawSplash(GameView.java 76) Here is my code in full package com.xyz.123 import android.content.Context import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint import android.view.MotionEvent import android.view.SurfaceHolder import android.view.SurfaceView public class GameView extends SurfaceView implements Runnable volatile boolean playing Thread gameThread null private Paint paint private Canvas canvas private SurfaceHolder holder private int screenWidth private int screenHeight private Background1ResourceList background1ResourceList private Background background1 private Background background2 private Background background3 private Context context private SplashScreen splashScreen public GameView(Context context, int screenWidth, int screenHeight) super(context) this.context context this.screenWidth screenWidth this.screenHeight screenHeight Initialize our drawing objects holder getHolder() paint new Paint() splashScreen new SplashScreen(context, screenWidth, screenHeight) drawSplash() background1ResourceList new Background1ResourceList() background1 new Background(context, background1ResourceList.getBackgroundResources(), screenWidth, screenHeight, 0.00f, 0.50f) background2 new Background(context, background1ResourceList.getBackgroundResources(), screenWidth, screenHeight, 0.33f, 0.80f) background3 new Background(context, background1ResourceList.getBackgroundResources(), screenWidth, screenHeight, 0.66f, 1.00f) Override public void run() while (playing) update() draw() control() private void update() background1.update() background2.update() background3.update() private synchronized void drawSplash() if (holder.getSurface().isValid()) First we lock the area of memory we will be drawing to holder.getSurface() canvas holder.lockCanvas() rub out the last frame canvas.drawColor(Color.argb(255, 0, 0, 0)) draw the backgrounds splashScreen.draw(canvas, paint) unlock and draw the scene holder.unlockCanvasAndPost(canvas) else System.out.println("surface not valid") private synchronized void draw() if (holder.getSurface().isValid()) First we lock the area of memory we will be drawing to canvas holder.lockCanvas() rub out the last frame canvas.drawColor(Color.argb(255, 0, 0, 0)) draw the backgrounds background1.draw(canvas, paint) background2.draw(canvas, paint) background3.draw(canvas, paint) holder.unlockCanvasAndPost(canvas) public void pause() playing false try gameThread.join() catch (InterruptedException e) public void resume() playing true gameThread new Thread(this) gameThread.start()


Specific Physics Lessons and Reference for Game Development What "Physics stuffs" should I learn in game developments? I'm reading about Verlet Integration, and I'm wondering what other lesson should I learn and if there are available resources can you please provide some link or anything. Thanks.


How can I use ParallaxBackground in AndEngine? I'm new to game development with AndEngine. I want to add ParallaxBackground but I don't know how to change the background when the player moves. I'm using arrows for moving a player. Now my question is where I write the code parallaxBackground.setParallaxValue(5) ? I have written this line in onAreaTouched method of arrow but it does not work. Code private Camera mCamera private static int CAMERA WIDTH 800 private static int CAMERA HEIGHT 480 private BitmapTextureAtlas bgTexture private ITextureRegion bgTextureRegion Override protected void onCreateResources() BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx ") bgTexture new BitmapTextureAtlas(getTextureManager(),2160,480,TextureOptions.REPEATING BILINEAR) bgTextureRegion BitmapTextureAtlasTextureRegionFactory.createFromAsset(bgTexture, this, "background.png", 0, 0) bgTexture.load() Override protected Scene onCreateScene() this.getEngine().registerUpdateHandler(new FPSLogger()) Scene scene new Scene() scene.setBackground(new Background(Color.BLACK)) final ParallaxBackground parallaxBackground new ParallaxBackground(0, 0, 0) final VertexBufferObjectManager vertexBufferObjectManager this.getVertexBufferObjectManager() parallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, CAMERA HEIGHT this.bgTextureRegion.getHeight(), this.bgTextureRegion, vertexBufferObjectManager))) scene.setBackground(parallaxBackground) Robot robot new Robot() add Player final AnimatedSprite animatedRobotSprite new AnimatedSprite(robot.centerX, robot.centerY, 122, 126, (ITiledTextureRegion) robotTextureRegion, getVertexBufferObjectManager()) scene.attachChild(animatedRobotSprite) animatedRobotSprite.animate(new long 1250,50,50 ) add right arrow button Sprite rightArrowSprite new Sprite(0, CAMERA HEIGHT 70, rightArrowTextureRegion, getVertexBufferObjectManager()) Override public boolean onAreaTouched(TouchEvent pSceneTouchEvent,float pTouchAreaLocalX, float pTouchAreaLocalY) switch (pSceneTouchEvent.getAction()) case TouchEvent.ACTION DOWN moveRight true parallaxBackground.setParallaxValue(5) break case TouchEvent.ACTION MOVE moveRight true break case TouchEvent.ACTION UP moveRight false break default break return super.onAreaTouched(pSceneTouchEvent, pTouchAreaLocalX, pTouchAreaLocalY) scene.attachChild(rightArrowSprite) scene.registerTouchArea(rightArrowSprite) scene.setTouchAreaBindingOnActionDownEnabled(true) scene.setTouchAreaBindingOnActionMoveEnabled(true) scene.registerUpdateHandler(new IUpdateHandler() Override public void reset() Override public void onUpdate(float pSecondsElapsed) if ( moveRight ) animatedRobotSprite.setPosition(animatedRobotSprite.getX() speedX, animatedRobotSprite.getY()) ) return scene


Which app markets should I deploy my Android game to? I just launched my Android game today. I'm curious to know where I can deploy it. Of course, Google Play is the veritable king of markets, and my own game site will be next. After that, which marketplaces are mature and are worth deploying to? I looked at SlideMe GetJar Soc.io And some other ones that I didn't use YAAM (kept crashing and erroring out) 1Mobile (couldn't figure out how to upload my app) Insyde Market My question is really, which ones are out there and are worth uploading too? (And 1Mobile seems good, but just can't figure out how to upload.) Each site requires their own size screenshots and logo, so it's a bunch of extra work. I'd rather stick to the 80 20 rule and apply 20 effort to hit 80 of the markets.


GLES2.0 3D Android game performance and multi threading the update? I have profiled my mixed Java C Android game and I got the following result As you can see, the pink think is a C functions that updates the game. It does things like updating the logic but it mostly it generates a "request list" for rendering. The thing is, I generate DrawLists on C and then send them to Java to process and draw using GLES2.0. Since then I was able to improve update from 9ms down to about 7ms, but I would like to ask if I would benefit from multi threading the update? As I understand from that diagram is that the function that takes the most time is the one you see it's color on the timeline. So the pink area is taken mostly by update. The other area has MainOpenGL.Handle as it's main contributor(whch is my java function), but since it's not drawn to the top of the diagram I can conclude other things are happening at the same time that use the CPU? Or even GPU stuff that isn't shown in this diagram. I am not sure how the GPU works on this. Does it calculate stuff in parallel to the CPU? Or is it part of the CPU usage as in SoC? I am not sure. Anyway, in case GPU things DO happen in parallel to CPU, then I would guess that if I do this C Update in parallel to the thread that makes the OpenGL calls, I might make use of "dead CPU time" due to GPU stalling or maybe have the GPU calls getting processed earlier because it won't have to wait for Update to finish? How do you suggest to improve performance based on that?


Error compiling irrlicht android using ndk in Mac I'm new to irrlicht and I have started with irrlicht android port. I have made the following changes to android.mk file LOCAL CFLAGS O3 DANDROID NDK DDISABLE IMPORTGL I. .. include I. include I documents karthik android android ndk r9 platforms android 18 arch arm usr include LOCAL LDLIBS L documents karthik android android ndk r9 platforms android 14 arch arm usr lib libGLESv1 CM.so ldl llog L documents karthik android android ndk r9 platforms android 14 arch arm usr lib libGLESv1 CM.so I have tried compiling irrlicht android using ndk build in terminal.It showed the following errors at first In static member function 'static void irr os Printer log(const c8 , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security In static member function 'static void irr os Printer log(wchar t const , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security In static member function 'static void irr os Printer log(const c8 , const c8 , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security In static member function 'static void irr os Printer log(const c8 , const path amp , irr ELOG LEVEL)' error format not a string literal and no format arguments Werror format security make obj local armeabi objs irrlicht os.o Error 1 and then I googled that and made changes in os.cpp file as follows Changed the code, android log print(ANDROID LOG INFO, "log", message) to android log print(ANDROID LOG INFO, "log"," s", message) This change solved that issue, and then I got another error In file included from jni importgl.cpp 55 0 jni importgl.h 37 22 fatal error GLES egl.h No such file or directory Again I changed GLES egl.h to EGL egl.h and solved that issue, got fatal error irrlicht.h No such file or directory I even solved this , atlast I'm here with this error error 'EglDisplay' was not declared in this scope error 'EglSurface' was not declared in this scope error 'EglWindow' was not declared in this scope error 'EglContext' was not declared in this scope


Ball Physics for Android Game I am starting work on a new Android game and I haven't had any experience implementing physics before. I am trying to steer clear of external libraries such as box2d, not just because I think it is overkill for my project, but I also want to code it myself for the experience. I am more just interested in getting 1 ball to bounce around the screen and bounce off of objects in my world. The game is in 2D and I was just looking for some advice on where to start with ball physics? I know I will need gravity, x y velocities... etc. I know I need to calculate how high the ball needs to bounce based on how fast it hit the object, I also know I will need to calculate the correct angle that the ball needs to bounce at. Just hoping to get some ideas on a good place to start and things I will need to take into account.


how to render small texture on another texture? can anybody help me to render small texture on another texture. i.e I have one background image, when user touches on the screen it should draw small(circle or any object) on it. can anybody suggest me good tutorial to starts with it?


Android multi screen rendering Is it possible on Android to render specifically only, to the connected Monitor TV on the hdmi port? If so, is it possible to use OpenGL ES to render a different scene on the monitor and on the device's screen? I would like the tablet to become more of an input device when it is connected with a monitor tv and my game to be rendered just to this screen. If nothing is connected, then the device's screen should be used. Ideally I would render a small interface (with buttons and text only) on the android tablet and the game itself on the monitor. Can this be done? How?


What is Google Play Services Multiplayer? This question might be off topic, i don't know where should i ask it. What's the difference between Google Play Real Time Multiplayer, Google Play Turn Based Multiplayer and sockets?


Play videos with LibGDX Is there a way to play videos with LibGDX? I want to put a video as my splash screen in Android, but I dont want to use the Android SDK, because I am using LibGDX and I am almost finished


Sounds make Andengine Scene junky I have a GameScene which has a character (animated sprite), AutoParallaxBackground background with quite large textures and no more than 3 other items attached to the scene at a time, previous 3 items are dispose() ed accordingly, background music and item sounds. Background music is instantiated with MusicFactory, Sounds are played on SoundPool. In between switching these scene we are loading resources asynchronously, reading the streams and instantiation is done in AsyncTask and the loading textures to the hardware is done on UpdateThread GLThread. If I turn off the background music, this starts to happen totally random. I'm experiencing scene junking on at first flow MenuScene 1st Stage (GameScene). After a while lag does not happen, rather than occasionally or random. Junk is happening when aforementioned 3 items are attached on the Scene and a sound is played along, note that background music is playing at the same time. Detaching previous 3 items is "optimized" to reduce GC calling almost perfectly. When the lag occurs GC EXPLICIT is showed in the logcat. What I have tried Playing the sounds and music on different thread, IntentService, dedicated Service. Reduced calls to mScene.detachChild(child) and other scene methods to avoid iterations over children of the scene. Detaching IEntitys with matcher to avoid iteration. Inspected sound files' integrity with ffmpeg for possible errors Could .dispose(), unloading the textures from hardware or detachChild() causing this junk? Could be marked object for GC from the async tasks be causing this? What else could be contributing to this issue?


In OpenGl ES 2, should I allocate multiple transformation matrices? In OpenGl ES 2, should I declare just one transformation matrix, and share it across all objects or should I declare a transformation matrix in each object that needs it? for clarification... something like this public class someclass public static float 16 transMatrix new float 16 ... public static void translate(int x, int y) do translation here public class someotherclass ... void draw(GL10 unused) someclass.translate(10,10) draw verses something like this public class obj1 public static float 16 transMatrix new float 16 ... void draw(GL10 unused) translate draw public class obj2 public static float 16 transMatrix new float 16 ... void draw(GL10 unused) translate draw


How much memory can i safely use on android? To make my game more fluid, I try to prevent memory allocations during the game I am writing. To that end, I allocate a whopping 16MB of buffers on startup and then use those as I go along. When I check in Eclipse my game now uses 24MB in total, which does not change noticeably during the game. This all works fine on the phone I have now (android 2.3, motorola defy) but I wonder if I'm going to run into problems with this on other phones or tablets that run android 2.2 or higher (which is what I'm aiming for)?


SDL2 linux fullscreen issue at lower than desktop resolution Having a problem trying to get proper fullscreen in linux. I'm using 1440x900 on desktop. When i set SDL to use 1280x720 as fullscreen, it does change screen resolution. But if i drag the mouse cursor to the bottom or right edge of the game screen, it "scrolls" the screen beyond the game surface and makes part of the desktop visible. Here's how I set the window screen gameWindow SDL CreateWindow( "SDL Tutorial", SDL WINDOWPOS CENTERED, SDL WINDOWPOS CENTERED, screenWidth, screenHeight, SDL WINDOW FULLSCREEN SDL WINDOW BORDERLESS ) Am i missing some flag(s) perhaps? Is this a common problem? I'm on Linux Mint MATE (Rosa). This problem also occurs when trying to run the same build in an Openbox session. Using nVidia drivers (x64, v340.96) from nvidia.com, on 9600 GT card(s). No twin dual screen or second Workspaces. Any good tips on how to avoid or workaround this issue?


How to create the "drunk camera" effect in GTA 4? If you have played GTA 4, then you have probably been drunk at some stage. This is one of the best intoxicated simulators I have ever seen. It is actually hard or sometimes almost impossible to drive a vehicle while drunk in this game. I know that a lot of the things that make up this drunk experience are changes to the controls or having random changes in direction, but how would the camera be done? The camera seems to wave in and out and side to side. It also has changing blur, and other effects going on. Would this be some kind of shader? What are the effects that are used on top of each other to create the experience?


rendering a reflection on a texture I want to render reflection on a planar surface but the reflecting surface has a texture mapped onto it.Would the normal technique of using stencil buffer and then blending in the reflected image with the reflecting surface in this case? If not then could some one suggest me how to render reflection on a surface that has a texture mapped onto it? Thanks


What are these odd distortions on far away textures? I'm currently writing a simple voxel engine just to get some practice in, and I'm coming across some odd issues. In order to generate terrain, I create a mesh and then assign UV coordinates on a texture atlas to each vertex. Whenever I run the game, I get strange distortions, like these I've tried doing a few things so far Generating mip maps for the texture atlas. Play around with the max size of the texture atlas. Play around with the format of the texture atlas. Unfortunately, none of these have worked so far. As of right now, the import settings on the texture atlas itself look like this Is there any way I can get rid of these obnoxious distortions?


Should I make my games graphics lower quality so everyone can play it? The game I'm working on targets lower end graphics capabilities machine users. Should I make my game's graphics lower quality so that everyone can play it or make its graphics high quality so that people must go and buy a new GPU to play it?


What's the difference between using hardware accelerated APIs and the OS's drawing API? On Windows, I can do drawing with the OS API without OpenGL or D3D. The code I am writing will make calls to a device driver and tell the GPU what to do regardless, right? How is using OpenGL different exactly? Do these libraries have code that will interact with the GPU differently than just the Windows API does?


How do you make use of all texture units on today's graphics cards? I saw a review of the GeForce GTX 460 graphics card. It has 56 texture units. I'm not that knowledgeable about graphics effects. But, the ones I know use around 3 or 4 texture units. In this graphics card case, that would leave a lot of texture units idle. How are these graphics cards with so many texture units used?


How to make proper animations for a html5 game? I am working on a web based MMORPG in html5. Therefore, I think about using Phaser.io to be the main engine of the game on the client side. I want the game to be isometric and I am wondering how to make proper sprites animations gfx for the game. I don't want my graphic team to have too much pain. Would it be possible, for example, to use any kind of "vectorial spritesheet" so that I can zoom in and have a better look at the character. On the other hand, I don't want the "stuff" (hat, armor, etc) to be too hard to "plug" on the character in all the different orientations. I thought about using some kind of flash like system (my game is based on the french MMO Dofus which only uses flash for its client side but no web based techno) But I don't know anything about flash, can I integrate it inside a canvas and does it mux well with raster images like png or jpg? What alternative could I use?


Cocos2d x setContentSize, setScale give poor graphic quality I want to create sprite with size is relative to the screen size. I.e Sprite size is equal to screen width 0.2. I use setContentSize and setScale but it gives ugly and poor graphic quality. I've read about multiple resolution supports, but it doesn't work on this case because i need sprite size adapt to the any screen size. Testing on iPhone 7, i scale an image from 512x512 to 64x64. This is error of cocos2d x or anyway to archive it?


Project 2d click touch onto 3d plane I have a 3d scene that contains an infinite plane that is NOT parallel to the camera (so every screen coordinate corresponds to a point on this plane in other words, there are no possible invalid clicks touches). I have all the information you'd expect to work with camera pos, dir, fov, aspect ratio, the 3d points defining the plane (either as a triangle, or as a normal distance), the view projection matrices that project it onto the screen, etc... I haven't found anything online that answers this in a straightforward way. Please no "use this or that library". Also, if you're going to say "invert the matrix", please give a way to go about doing that (I don't think the matrix is easily possibly invertable, as the "project to 2d" process involves the divide by w step, rendering the final translation between 3d to 2d non affine).


Object Transparency Dithering (as shown in Super Mario Odyssey) A couple games I've been playing recently all have a similar goal of dithering objects when they approach the near clip plane. Super Mario Odyssey applies this dithering near clip plane effect, but along with object intersection dithering for objects like Mario. I have an example of this dithering in Super Mario Odyssey later in this post. How would one go about creating this effect in their graphics solution of choice? The gifs might take a little while to get started. I couldn't get them to each be under 30 mb ( Example in Super Mario Odyssey The balloon of the Odyssey doesn't "exit dithering" until the camera is a good distance away from it. This could mean dithering is calculated based on object distance from camera, instead surface distance. Flag starts out with a small dither density, and Mario has no dithering applied to him. Once the flag is fully opaque, Mario becomes dithered, but only in the portions that is covered. Also note Mario's coat tail has the "transparency dithering" applied to it. How are the object's shaders structured to allow this compound effect? Below is a blown up image of Mario being dithered. Notice how dithering exists in intersection regions, and when behind objects!


Can I develop on the Oculus Rift with below the minimum required hardware? I have tried to see if my GTX 960m supports VR and sadly it seems I need minimum GTX 970m, still I have seen videos that if you overclock your 960m you can get a decent 115 frames. My question is, can I still develop games for the Oculus Rift in my 960? I can't afford now to buy assets, oculus and a new laptop.


Minecraft What is the reasonable face vertex limit for custom models? When adding custom models to function as tile entity representations, what is a reasonable ceiling based on performance to maintain for individual models? Assume that the player will have the potential possibility to place as many of these as desired, but functionally it would also be reasonable to assume no more than 20 would have to be rendered at once. If the answer has changed between significant versions of the game, it would be nice if that could be reflected


Why do games ask for screen resolution instead of automatically fitting the window size? It seems to me that it would be more logical, reusable and user friendly to implement flexible, responsive UI layout over a 3d or 2d screen, which can then be run on any screen resolution. Some modern games auto detect screen resolution and adjust the game to that, but the option to change the resolution still remains in the settings. Why is this option there? My guess is that this is one way to provide older machines with a way to improve performance by rendering less graphics and just stretching them across the screen, but surely there are better ways of improving performance (choosing different texture and model qualities, for example).


boolean operations on meshes given a set of vertices and triangles for each mesh. Does anyone know of an algorithm, or a place to start looking( I tried google first but haven't found a good place to get started) to perform boolean operations on said meshes and get a set of vertices and triangle for the resulting mesh? Of particular interest are subtraction and union. Example pictures http www.rhino3d.com 4 help Commands Booleans.htm


What is a good alternative to Unified Shader for Shadows? Most shadow systems I have seen use a unified shader system for shadowing techniques, resulting in an uber shader for the projects. What alternatives do you find work well or is the unified shader the best approach?


Do I have to keep textures in Android games smaller than 1024 2? I have read tips in books and article that point out, if you are making a game for Android, make sure your textures are lt 1024 2, or you'll not reach all your potential customers. I have never found a concrete statistic that proves this claim. What are we talking about, here, 5 of Android devices only support 1024? 10 ? 80 ?


How to simulate a spinning helicopter rotor visual effect programatically? I decided to display an animation that conveys to the viewer that a narrow flat surface is spinning really fast(such as an helicopter's rotor blade). Does anyone have any experience in implementing this effect and could provide an implementation? Please remember a rotor on video looks different than it does in real life. I need to make the rotor look like it does in real life and not on video.


How do mobile mmo's deal with the graphical resources? I'm am creating an MMO(probably won't be so massive), and was wondering how to deal with the graphical resources. Obviously, I can't have what could be possibly a few gigs of images and animations loaded up to the client, so I need another way of doing it. I have tried having a php webserver that updates itself and writes to a file that the client draws, however this seems slow. How can I speed up the process of updating the graphics while not having too much into the client?


Opengl in 500 lines barycentric calculation question https github.com ssloy tinyrenderer wiki Lesson 2 Triangle rasterization and back face culling I cannot figure out how we go from uAB vector vAC vector PA vector 0 to the linear system with those subscripts x and y? Is there another way of explaining how we take three vectors, split them into x and y type vectors, and produce a cross product that can be used to find the barycentric coords (u, v, w)? Also, I am not sure why there is a division by the z component of the cross product in last line of the barycentric function. Maybe the answer to my first question will make this more obvious. Below is a picture of the section of the tutorial where I am stuck. Link to full page is above.


Why do people put a gif animation into a single bitmap? Possible Duplicate 2D graphics why use spritesheets? Something like this file from here I haven't write game with animated gif before.... So I wonder why. When I unpack some game, I see them in this kind of format as well. Why they are not divide them into individual bitmap? When they are using it, do they IMPORT them into individual bitmap? or just use display them using offset?


How do you ensure consistent experience across multiple graphics cards (or even driver versions)? So I was writing a simple 2D game with OpenGL and SDL and had this problem when there was awful tearing when running in windowed mode (even though I explicitly asked SDL SetVideoMode to use double buffering). Didn't worry about it all too much because most of the time the game grabs the entire screen, windowed mode is just for debugging. Anyway, yesterday I updated my nVidia drivers and tearing disappeared, the game runs smooth and looks nice in windowed mode too. I can see how the problem may be in the graphics driver, but this leads to a question. Obviously, professional game developers have to deal with a lot of different hardware software configurations. What are the techniques they use to make sure the game looks the roughly the same on different graphics cards or even the same model of graphics card, but with different driver versions?


What is the purpose for multiple windows in games? A lot of game development APIs recently got support for multiple windows (such as SDL 2, and GLFW 3). But why did they add that feature? I've never seen a game in my life use multiple windows (with the exceptions of a launcher, or a messagebox). Is there something I'm missing here? Is there an actual game development purpose to it? I'm very confused of why they did that.