Keeping track of onscreen objects in opengl es on Android In a small game Im working on I was able to implement ray picking with an opensource 3d engine called min3d but I cant figure how to keep track of what object is onscreen. I will some times have upwards of 120 objects to render within my scene and the raypicking is off occasionally. What id like to do is keep track of how many screen objects are within the camera and being rendered onscreen and set a boolean value based on that to add or remove objects from my arraylist I iterate through when the screen touch is registered and the ray picking method goes off. So how can I check for which objects are onscreen and offscreen in opengl es on android.


Odd Android touch event problem (Nexus 10) Overview When testing my game I came across a bizarre problem with my touch controls. Note this isn't related to multi touch as I completely removed my ACTION POINTER UP and ACTION POINTER DOWN along with my ACTION MOVE code. So I'm simply working with ACTION UP and ACTION DOWN now and still get the problem. The problem I have a left and right button on the left of the screen and a jump button on the right. Everything works as it should but if I touch a large area of my hand (the fleshy part at the base of the thumb for instance) onto the screen, then release it and then press one of my arrows, the sprite moves in that direction for a few seconds, and then ACTION UP is mysteriously triggered. The sprite stops and then if I release my finger and re apply it to an arrow, the same thing happens. This goes on and on and eventually (randomly??) stops and everything work OK again. Test device amp OS Google Nexus 10 Tablet running Jellybean 4.2.2 Code Action upon which to switch actionMask event.getActionMasked() Pointer Index of the currently touching pointer pointerIndex event.getActionIndex() Number of pointers (for multi touch) pointerCount event.getPointerCount() ID of the pointer currently being processed (Multitouch) pointerID event.getPointerId(pointerIndex) switch (actionMask) Primary pointer down case MotionEvent.ACTION DOWN if pressing left button then set moving left if (isLeftPressed(event.getX(), event.getY())) renderer.setSpriteLeft() if pressing right button then set moving right else if (isRightPressed(event.getX(), event.getY())) renderer.setSpriteRight() if pressing jump button then set sprite jumping else if (isJumpPressed(event.getX(),event.getY())) renderer.setSpriteState('j', true) break End of case Primary pointer up case MotionEvent.ACTION UP When finger leaves the screen, stop sprite's horizontal movement renderer.setSpriteStopped() break


Streamline Facebook and Google Play Game Services integration in Android Game This has been confusing me a lot . I am creating a simple 2D platformer which I wish to make social. So I thought of letting users do the following Share their in game objective completion their high score etc with their friends. Challenge their friends to have a better score better multiplier etc from their's View leaderboards of high score , most distance traveled etc both social and global. So My First preference was Facebook , simply because people have better social connections there. But then Google Play game services integration has another advantage, It makes you game available in their game services app and may be boost your game ranking in play store if you have game services integrated. But then I'' need to have leaderboards(same ones) for google plus as well. That 'll be too confusing for people. I do not want people to sign in twice in my app. That'll simple cut down and disperse the number of people getting social with the game. I personally want to use facebook alone but then google game services may be boosts my app in store. Can someone tell me a solution to use them both frictionlessly and get the most out of them in my game


Application stops working when I add two fonts I created a game that has two fonts. Being precise, the two fonts are PRESS START 2P with the difference only in size. One of the fonts serves to write the title and the other for all other things. The problem occurs after building the application (apk). As it is a special font I click on the option quot copy to project quot for it to be exported to the cell phone. Image of the two fonts A detail is that the program does not recognize the original source directory, so I need to copy the source to the desktop to be able to copy it to the project. Image demonstrating the problem Adding any of the fonts (alone), the game works. The problem happens when I add the second font. Before posting here, I posted on the official engine forum, but I still haven't gotten any response. LINK https forum.yoyogames.com index.php?threads application does not work when i export 2nd font.83968


Code structure in Android 2D game Well I've finnaly decided to start Android game dev, and my first project will be simple 2d canvas based game. I have some experience in game developing with C and XNA, and I'm a bit confused now. Back in XNA we have Game class with Initialize, Update and Draw methods. In Android I have to extend SurfaceView class, run draw and update in their own thread, and receive touch input from user. I'm looking for a proper way to structure my code. Some of my questions are How to deal with Activities (Should I run everything in one activity, or split whole game in 2 or more) ? Where should I run game loop ? Where to put Draw and Update methods ? How to respond to touch events ? Hope I came to the right place for answers...


If I want to create game for mobile and tablet on android and ios, which aspect ratio or screen resolution should I use? Now my game is currently use 3 4 aspect ratio ,which is 480 640 , so my game has the letterbox (I don't like stretch) on my android mobile and my friend mobile. I don't like letterbox, so I have just change color of my letter box to the color that blend with my game background, but I don't like it either. So now I think about change aspect ratio and screen resolution of my game. how about 480x800 ?


ARMv7 vs FAT in Unity Android Build Settings (release multiple valid APKs) If I select ARMv7 instead of FAT (ARMv7 x86) in the Android Build Settings of Unity5 Free, the APK binary drops to half size. FAT gt 20MB ARM gt 10MB (Tested with an empty scene, no assets, nothing, just the core libraries). I've seen the "official stats" of the CPU usage are here http hwstats.unity3d.com mobile cpu.html So not a lot of business to loose as for the date of publishing this question. But x86 seems to be an increasing trend. Questions Is there any way to publish a binary to the ARM users and another version to the x86 users but with the same product id so if they change the mobile phone, the software gets properly downloaded (but still each one gets a small footprint)? Does this CPU correlate with WinPhone? Or is an othogonal measure? In other words Are all Androids ARM? Or there are ARM and x86 Androids? Thanks!


Rendering artifacts on edges in Cardboard VR OpenGL ES 2 Unity beginner here. I've encountered this weird rendering artifacts in my Cardboard VR app on Android OpenGL ES 2 https youtu.be uJm4d3MwbRo It doesn't occur in WebGL build http senovsky.wz.cz virtualab index.html Does someone at least know how to call this artifact? Already tried searching for a solution, but I don't even know what keywords to use. The app was build using the HelloVR scene from GVR SDK for Unity v1.130.1 https github.com googlevr gvr unity sdk releases and no default settings were changed. I tried changing the default overall quality settings to Ultra and Very High, didn't help.


How to test Google Play Multiplayer locally I'm building a simple HTML5 game and I need to implement multiplayer without sharing the game on Google Play. I'm using CocoonJS's multiplayer api. How can I test Google Play Multiplayer locally? Do I really have to use websockets instead?


Efficient Collision detection for polygons (fleet) in an RTS I'm trying to make an RTS for android using libgdx. I would like to have collision detection to be able to detect ships inside the range of weapons and collision between my bullets and the ships. So far my strategy has been to use a PM QuadTree that I coded myself to store every segment of every polygons. A polygon being the hitbox of a ship. Every frame I clear and add all the segments back in the quadtree. Every segment has a reference to the ship it belongs to. When I add a ship, I add it recursively to the nodes of the quadtree based on the intersection with the bounds of a node. Detection collision is done by polling every polygon inside a rectangle that look into every node that fit entirely or partially inside the rectangle. My problem is that adding every ship every frame gives bad result on Android. On Desktop it is fast enough but on Android it can takes up to 100 ms just to add around 200 segments. Is there something wrong with my implementation (it shouldn't be this slow ?) or should I use another strategy for collision detection ? I thought about clearing the quadtree only every 5 frames but it would make the detection unprecise. I have measured that some simple math operation to calculate intersection takes up to 50 more times on my android and I'm not sure why. Surely my phone cpu is not 50 times slower than my laptop, is it ? It's a sufficiently fast moving RTS. Often the whole fleet is moving, thus every segment. I heard about RDC in that article. Would that be a better algorithm ? My issue is that some ships are hard to be bounded by a sphere if they're very long but not wide.


How do I pause Andengine, but still get input? In my game when I pause the game, I'd like to display three options (Resume, Restart and Menu) so I did this after calling mEngine.stop() Sprite resume new Sprite(CAMERA WIDTH 2, CAMERA HEIGHT 2, RM.resume, vertex) Override public boolean onAreaTouched(TouchEvent event, float pTouchAreaLocalX, float pTouchAreaLocalY) if(event.isActionDown()) this.setScale(1.1f) Log.i("Click","Click") return super.onAreaTouched(event, pTouchAreaLocalX, pTouchAreaLocalY) But the Log "Click" never display. So I tried to do this with the Engine active and the Log displays correctly. How can I stop my game (Modifier, Physics, Score) without using the mEngine.stop() method ?


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.


How to draw an OpenGL object in another on Android? Eyes and Eyeballs As i allready wrote in another question I'm working on OpenGL since a Week, so i'm new to the most stuff. (also my englisch isn't the best. Hop you can understand the most anyway) So i'm working on an Tamagotchi App for a school project and want to make it with OpenGL. How to change modify or animate an existing OpenGL object on Android? So this is a further question. My Tamagotchi is haveing to eyes. Like this To make it look real i want the eyes to blink and the eyeballs to move arround. But the question here is what happens with the eyeball when the eyes are closed. In my Situation you woud not see the eyeballs because they are the same color then the body of the Tamagotchi. But i want the eyeballs to be a part of the eye. So if the Eye is closing the eyeballs shoud disapear where the eyes are closed whereever the eyeball is at the moment. Here you can see the eye closed (down scaled y) but the eyeball is still visible.... I want the eyeball to be cut of or not shown where the eye is closed like this But i have no idear how to solve this. Edit Here is my Code for someone who want to look at it. But i think it is not necessary. public class GLEyes private int points 1000 private float vertices 0.0f,0.0f,0.0f private FloatBuffer vertBuff Der Kreis wird von der Mitte der Fl che gezeichnet public GLEyes() vertices new float points 2 for(int i 0 i lt (points 3) i 3) double rad 2 (Math.PI i) points Berechnung des radius vertices i (float)Math.cos(rad) X Achsen Abschnitt vertices i 1 (float)Math.sin(rad) Y Achsen Abschnitt vertices i 2 0 Z Achsen Abschnitt wird nur f r 3D gebraucht ByteBuffer bBuff ByteBuffer.allocateDirect(vertices.length 4) bBuff.order(ByteOrder.nativeOrder()) vertBuff bBuff.asFloatBuffer() vertBuff.put(vertices) vertBuff.position(0) public void draw(GL10 gl) lefteye(gl) righteye(gl) private void lefteye (GL10 gl) gl.glPushMatrix() gl.glTranslatef(1, 1, 0) gl.glScalef(0.5f, 0.45f, 1.0f) Skalierung einstellen gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() gl.glPushMatrix() gl.glTranslatef(1, 1, 0) gl.glScalef(0.1f, 0.1f, 1.0f) Skalierung einstellen gl.glColor4f(1.0f,1.0f,1.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() private void righteye (GL10 gl) gl.glPushMatrix() gl.glTranslatef( 1, 1, 0) gl.glScalef(0.5f, 0.45f, 1.0f) Skalierung einstellen gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() gl.glPushMatrix() gl.glTranslatef( 1, 1, 0) gl.glScalef(0.1f, 0.1f, 1.0f) Skalierung einstellen gl.glColor4f(1.0f,1.0f,1.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix()


Should Starting a Quick Game via Google Game Services be Iterated? I have been following this tutorial for Google Play Game Services. I am a little unclear as to if the room matching algorithm should be looped or not. Can I just initialize this process once and let it time out? Or by iterating through it is it somehow rechecking it? If anyone had the approximate timeout that would be great as well. The problem stems from the fact that even when both phones are signing into the Game Services (at virtually the same time, my friend and I logged in), the room is not registering multiple people. One time my friend's phone even entered the game map, showing that he somehow was able to progress from the room initialization process. Relevant screen update methods which I am starting this matchmaking process Override public void update(float deltaTime) game.options.updateTiles() if(!isInitiated) startQuickGame() private void startQuickGame() auto match criteria to invite one random automatch opponent. You can also specify more opponents (up to 3). if(game.mGoogleClient.isConnected() amp amp !isInitiated) Bundle am RoomConfig.createAutoMatchCriteria(1, 3, 0) build the room config RoomConfig.Builder roomConfigBuilder RoomConfig.builder(Network.getInstance()) roomConfigBuilder.setMessageReceivedListener(Network.getInstance()) roomConfigBuilder.setRoomStatusUpdateListener(Network.getInstance()) roomConfigBuilder.setAutoMatchCriteria(am) RoomConfig roomConfig roomConfigBuilder.build() create room Games.RealTimeMultiplayer.create(game.mGoogleClient, roomConfig) go to game screen this.mRoom Network.getInstance().getRoom() if(this.mRoom ! null amp amp this.mRoom.getParticipants().size() gt 2) game.setScreen(new MultiGameScreen(game, this.mRoom)) isInitiated true else game.mGoogleClient.connect()


FBO rendering different result between Galaxy S2 and S3 I'm working on a pong game and have recently set up FBO rendering so that I can apply some post processing shaders. This proceeds as so Bind texture A to framebuffer Draw balls Bind texture B to framebuffer Draw texture A using fade shader on fullscreen quad Bind screen to framebuffer Draw texture B using normal textured quad shader Neither texture A or B are cleared at any point, this way the balls leave trails on screen, see below for the fade shader. Fade Shader private final String fragmentShaderCode "precision highp float " "uniform sampler2D u Texture " "varying vec2 v TexCoordinate " "vec4 color " "void main(void)" " " " color texture2D(u Texture, v TexCoordinate) " " color.a 0.8 " " gl FragColor color " " " This works fine with the Samsung Galaxy S3 Note2, but cause a strange effect doesnt work on Galaxy S2 or Note1. See pictures Galaxy S3 Note2 Galaxy S2 Note Can anyone explain the difference? edit Folowing VinceFR's comment, we've tried adding the following. When the renderbuffers are initialised they are briefly bound to the framebuffer and set the background to a uniform buffer with GLES20.glClearColor(backgroundColor 0 ,backgroundColor 1 ,backgroundColor 2 ,backgroundColor 3 ) GLES20.glClear( GLES20.GL DEPTH BUFFER BIT GLES20.GL COLOR BUFFER BIT) The result is unchanged on the S3, on the S2 it has improved a certain amount, but problems still exist note the 20 in the bottom right corner is supposed to be there.


How to emulate knob turning, based on x y movement? I'm doing a game where one component is that you turn a knob. I'm having trouble getting good "knob behavior". I know the current touch mouse X,Y location, and I keep track of the previous X,Y location, so I can determine if I'm going left or right and or up or down. It works, but it's crude. I suspect I have to take an average of any given direction over a period of time (say, last quarter second) to eliminate jitter because people don't move uniformly in the same movement every moment. I can't really use touchdown release because you should be able to put the touch down, then move left right up down continuously without release, and the knob would turn, just as if you had a free spinning audio control or video shuttle (say). Any thoughts in this direction on how to even it out?


Collision detection problems using AABB's I implemented a simple collision detection routine using AABB's between my main game sprite and various platforms (Please see code below). It works great, but I'm now introducing gravity to make my character fall and it's shown up some problems with my CD routine. I think the crux of the matter is that my CD routine moves the sprite back along the axis in which it has penetrated the least amount into the other sprite. So, if it's more in the Y axis than the X, then it will move it back along the X Axis. However, now my (hero) sprite is now falling at a rate of 30 pixels per frame (It's a 1504 high screen I need it to fall this fast as I want to try to simulate 'normal' gravity, any slower just look weird) I'm getting these issues. I will try to show what is happening (and what I think is causing it although I'm not sure) with a few pictures (Code below pictures). I would appreciate some suggestions on how to get around this issue. For clarification, in the above right picture, when I say the position is corrected 'incorrectly' that's maybe a bit misleading. The code itself is working correctly for how it is written, or put another way, the algorithm itself if behaving how I would expect it to, but I need to change it's behaviour to stop this problem happening, hope that clarifies my comments in the picture. My Code public boolean heroWithPlatforms() Set Hero center for this frame heroCenterX hero.xScreen (hero.quadWidth 2) heroCenterY hero.yScreen (hero.quadHeight 2) Iterate through all platforms to check for collisions for(x 0 x lt platformCoords.length x 2) Set platform Center for this iteration platformCenterX platformCoords x (platforms.quadWidth 2) platformCenterY platformCoords x 1 (platforms.quadHeight 2) the Dif variables are the difference (absolute value) of the center of the two sprites being compared (one for X axis difference and on for the Y axis difference) difX Math.abs(heroCenterX platformCenterX) difY Math.abs(heroCenterY platformCenterY) If 1 Check the difference between the 2 centers and compare it to the vector (the sum of the two sprite's widths 2. If it is smaller, then the sprites are pverlapping along the X axis and we can now proceed to check the Y axis if (difX lt vecXPlatform) If 2 Same as above but for the Y axis, if this is also true, then we have a collision if(difY lt vecYPlatform) we now know sprites are colliding, so we now need to know exactly by how much penX will hold the value equal to the amount one sprite (hero, in this case) has overlapped with the other sprite (the platform) penX vecXPlatform difX penY vecYPlatform difY One sprite has penetrated into the other, mostly in the Y axis, so move sprite back on the X Axis if (penX lt penY) hero.xScreen penX (heroCenterX platformCenterX gt 0 ? 1 1) Sprite has penetrated into the other, mostly in the X asis, so move sprite back on the Y Axis else if (penY lt penX) hero.yScreen penY (heroCenterY platformCenterY gt 0 ? 1 1) return true Close 'If' 2 Close 'If' 1 Otherwise, no collision return false


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.


Playing with hashmap in drawing I'm developing a game in Java for Android, using LibGDX. In my render(), between the batch.begin() and batch.end() I'm running through all the game objects and draw them. Every game object is stored in a list, which that list is stored inside a hash map. I iterate through this hash map, getting every list and going through that list, like this batch.begin() Iterator it objectsMap.entrySet().iterator() while (it.hasNext()) Map.Entry pair (Map.Entry) it.next() Array list (Array) pair.getValue() for (int i 0 i lt list.size i ) GameObject object (GameObject) list.get(i) drawObject(object) batch.end() My drawObject() code private void drawObject(GameObject object, float x, float y) if (object null) return if (object.getVisibility()) TextureAtlas.AtlasRegion currentFrame object.getCurrentFrame() if (currentFrame ! null) float objectAlpha object.getAlpha() Color color batch.getColor() if (objectAlpha ! 1) color.a object.getAlpha() batch.setColor(color) batch.draw(currentFrame, x object.getOriginX(), y object.getOriginY(), object.getOriginX(), object.getOriginY(), currentFrame.getRegionWidth(), currentFrame.getRegionHeight(), object.scaleX, object.scaleY, object.getSpriteDirection()) color.a 1 batch.setColor(color) A method called setRegion() sets the current animation frames of the object protected void setRegion(String name, float frameDuration) currentFrame atlas.findRegion(name, 0) if (currentFrame null) currentFrame atlas.findRegion(name, 1) width currentFrame.getRegionWidth() height currentFrame.getRegionHeight() animationStateTime 0 animation new Animation(frameDuration, atlas.findRegions(name), Animation.PlayMode.LOOP) And in the update() of the objects this is called currentFrame (TextureAtlas.AtlasRegion) animation.getKeyFrame(animationStateTime, isLooping) The getCurrentFrame() method only returns currentFrame variable. The alpha is a field with a value between 0 and 1. (getAlpha() returns only the field) My question is that considered a "heavy" activity? Can this be a significant impact on the FPS values? Because I'm running my game on old devices (like Galaxy S2) and the FPS can get pretty low values. I'm trying to find the cause to it. I used to have a reference to every list but with the time I realized I'm going to have too much lists, so I decided to do it like this. Maybe you know a better way of holding references to all game objects? Thanks!


How to implement jump in a 2d game? I am trying to implement jump in a game I have written for android using canvas. I have referred this tutorial for implementing jump. My code is like if(jumpKeyPressed) jumpVel initialMomentum state quot jumping quot if(state quot jumping quot ) jumpVel gravity deltaTime 2 loc.y jumpVel deltaTime jumpVel gravity deltaTime 2 Even after tweaking gravity and initialMomentum, character is jumping too slow (seems like stuck at ground). I have read many posts but I am not able to figure out what am I doing wrong here? Edit Video


Rotation of Rectangle along Y axis transformed to parallelogram After the rotation of a rectangular view along the Y axis, about its center, transformed into parallelogram, how do I get the rotated parallelogram coordinates? By Y axis, I mean perpendicular to the device screen. Rotated rectangle Original rectangle Not using the openGl, ViewProperty animator is used!


What organic traffic can I expect from publishing on Google Play, without other marketing? I've just published a new Android game on Google Play. It has been a bit over 48 hours. It's active in the store, and I can search for it by name to get to it. However, I've had 0 organic downloads thus far, only a couple from my friends. As far as I know, it has not been shown in the "new games" list yet, and the only store listing views in the stats are the ones from myself and friends. Is there some time by which I can expect some "organic" exposure, or will I ever? Is promoting my game by other channels the only option? I'm not asking for advice on promoting my game. I'm only asking about what organic exposure I can expect on Google Play.


Randomly spawning bitmaps on cnvas I need some ideas in order to finish algorithm. I'm randomly placing objects (bitmaps) on canvas without overlapping. Time needed to finish it is my problem. When I need to spawn for example 80 of canvas it takes to long. So i was thinking I should make some change when the bitmaps take off 50 of canvas. I want to tell algorithm that it should generate new locations (x,y) where it is free space. My question is How to render new location (x,y) in place where is free space. In summary Things I know object location (x,y) 4 corners (x,y) of object object width, height canvas width, height Any suggestions? Thanks for ideas. Now I've got problem. OK, thanks for ideas. I've got a problem. Link to picture Picture with grid I'm incrementing number of objects in cell after each adding object to grid. In the picture there are 9 possible locations for object. Should I check 9 conditions which tells where I should increment number of objects in cell? I assume that if object is on both cells than I increment number of objects in both cells.


How do I add leaderboard feature of OpenFeint in android? I am developing a game in android, by extending a class with view. I have integrated OpenFeint in it by studying the tutorial provided on the OpenFeint site, but I am not able to add the leaderboard feature in my app. How can I achieve it? My game class is like this public class GameActivity extends Activity Intent i Grapic g public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) requestWindowFeature(Window.FEATURE NO TITLE) getWindow().setFlags(WindowManager.LayoutParams.FLAG FULLSCREEN, WindowManager.LayoutParams.FLAG FULLSCREEN) setContentView(new Grapic(this)) and Grapic is a class which extends view and where scoring is done with touch events.


How do I correctly destroy a MobFox ad? Is anyone here using MobFox to display their Android app's ads? I was previously using the AdMob SDK but recently switched to MobFox and while it only took a short time to integrate it, there are a few outstanding issues which I can't work out. With the AdMob SDK, in my onDestroy method, I would have this line adView.destroy() However, I've looked through MobFox but I can't see an equivalent, am I missing something?! (there is all the usual pause() , resume methods etc..... just can't find a destroy() method)


In Android, neat way to send input info from GLSurfaceView to onDrawFrame in GLSurfaceView.Renderer ? The input is pinch drag for camera movement, which modifies a matrix to scale translate, and sent to a vertex shader. It's working, but ugly. What's the proper way to do it? I've noticed GLSurfaceView gets onTouch callbacks but Renderer has access to GL. Shaders and textures can only be loaded after the onSurfaceCreated() callback, so should be loaded there? Touch and graphics are on different threads, so should use queueEvent() or similar. Is there a game app on github that's a good example to follow? Thanks for any help!


libgdx(android) touchup triggers more than once? I have a function I run inside the touchUp method but when I click with the mouse during emulation, it triggers my function multiple times. I don't think its an error with the called method itself because if I put the call in KeyUp then it triggers once as expected. If it matters I am working in android studio.


Is it possible to use 3G internet for a TCP IP game server? I'm working on a turned based multiplayer android game with a friend. I started working on the game server and client using socket programming. I found a few tutorials on how to implement a basic chat on android and I started extending that example to suit my needs. Basically the game is really simple and the communication only include sending a few string from the client to the server every turn and sending the calculated scores back to all the clients after each turn. the idea is that one of the players creates the game and thus initialize the server, and each player connects to this client using ip. I tried this solution and it seems to work great when all the players are using the same wifi connection or by using router port forwarding. The problem is when trying to use 3G internet for the server, I guess the problem is that 3G ip address isn't global and you can't use port forwarding there, correct me if I'm wrong here. Is there a way to overcome this issue? or the only solution is to limit my game to wifi only or think of a different solution than the standard socket programming solution? I.E web server etc. what do you think would be the best approach here? Thanks.


How do I debug two android devices simultaneously in Eclipse? I have a multiplayer game which should be tested on two devices at the same time, if possible, with debugging. Can eclipse do this? If so, how?


2015 android multiplayer server based Implementation There are a lot of old posts about multiplayer implementations on SE, so i'm looking for an up to date answer. What is the best server client implementation of real time multiplayer now? I have an Amazon MYSQL Server hosted by digitalOcean, I've made a REST web service that communicates with the Server and Android app, and I have my Android app running receiving and sending data. I want to add a multiplayer minigame to what I have right now where 2 players would see the same screen and one user would receive location data (which i'm already storing in the server and sending to all devices with the app) from the other and would have an interface to interact with the data they're receiving (like building towers around the location and deploying units). The computer AI would need to be synced between both devices. The matches would last maybe 3 minutes tops and the location data would have to be streamed constantly as well as the interaction from the other user. The computer AI would be streamed to both. I've done a lot of research on the topic, and most of my experience was from a bluetooth P2P game I created in 2011 using sockets. So what are the most common implementations today? What are the most common libraries? I'm currently using Android Studio for the app and Notepad for the PHP webservice. EDIT I'm fine with answers promoting their own products, but explain how your product is better than Google's Game Services (which appears to be the best choice right now). I'm really looking for a way to implement the multiplayer with the server I'm already using.


Physics for Android Game I'm making a 2D game for the Android phone, one that involves falling balls. I want to use a physics engine to properly simulate the balls falling and hitting other objects. I'm currently using Phys2D, but when the game runs in the emulator it doesn't look natural slow and rough. Course, I don't know if this is because of the emulator or Phys2D seeing as how I don't own an Android phone (A real drawback not being able to test on the actual phone, I know, but I can't afford a smartphone). Anyways, do you think the game would run faster and smoother on an actual android phone, or is it the engine I'm using, or how I'm using it. If it's the engine, any recommendations on Java physics engines? UPDATE If you want to test the game yourself, you can find the rough prototype here http bpcp.angelfire.com BallDrop.apk


Accessing libgdx classes within Android classes Currently what I'm able to do is to access android APIs within libgdx with an interface in core and defining all the methods and then implementing it in every project (desktop, android, etc). What I want to do is I want to create a way so that I can call a method from some android class (say AndroidLauncher) and it calls a method of a libgdx core project class (like modifying some stage element). How do go about that? Any help would be really appreciated. Note As a 'hack' right now, I'm just waiting for any update from android class in the render method using those same interface methods, but I don't think that's the best possible way.


First Mobile Indie Game Monetization Model. Ad based or in app purchases? We are a team of 3 (1 graphics designer, 2 developers). We're almost done with our first Android based indie game. Which monetization model will be suitable for us? We don't want to disturb users with a lot of ads (at this point we're thinking to put only banner ads) also, if we go with in app purchases, can we also keep ads as well? or is it a better practice to follow one model at a time? How much will it affect the user experience?


Rotate a bitmap and bitmap is getting blur in android I am developing an android game. and in this I want to move an object along a Bezier path. my object is rotating with some angle on this curve. I used this piece of code public void update() check collision with bottom wall if heading down if (droid.getSpeed().getyDirection() Speed.DIRECTION DOWN amp amp droid.getY() droid.getBitmap().getHeight() 2 gt getHeight() 2 amp amp droid.getY() droid.getBitmap().getHeight() 2 lt getHeight() 2 100 ) int pointX , pointY pointX new int 4 pointY new int 4 int X , Y pointX 0 getWidth() 2 pointX 1 getWidth() 2 50 pointX 2 getWidth() 2 25 pointX 3 getWidth() 2 pointY 0 getHeight() 2 pointY 1 getHeight() 2 25 pointY 2 getHeight() 2 50 pointY 3 getHeight() 2 100 Log.i(TAG, "In the While Zone of Last Half Zone") X (int) ((pointX 3 u u u) (3 pointX 2 u u (1 u)) (3 pointX 1 u (1 u) (1 u)) (pointX 0 (1 u) (1 u) (1 u))) Y (int) ((pointY 3 u u u) (3 pointY 2 u u (1 u)) (3 pointY 1 u (1 u) (1 u)) (pointY 0 (1 u) (1 u) (1 u))) Log.i(TAG " Value of X ", Double.toString(X)) Log.i(TAG " Value of Y ", Double.toString(Y)) double deltaX X droid.getX() double deltaY Y droid.getY() Log.i("deltaX ", Double.toString(deltaX)) Log.i("deltaY ", Double.toString(deltaY)) double angle Math.atan2(deltaY, deltaX) Log.i(TAG " Angle ", Double.toString(angle)) Matrix mtx new Matrix() mtx.preRotate((float) angle) mtx.postScale(1, 1) Bitmap rotatedBMP Bitmap.createBitmap(droid.getBitmap(), droid.getX(), droid.getY(), X droid.getX(), Y droid.getY(), mtx, true) droid.setBitmap(rotatedBMP) droid.curveUpdate(X, Y) u u 0.001 Log.i(TAG " Value of U ", Double.toString(u)) check collision with top wall if heading up Update the lone droid else droid.update() my object is moving and rotating as i supposed but image is getting blur. am not getting why is so. Please suggest what can be the problem. Thanks.


Help Needed with Shaders Ok, bear with me, I am a beginner with Google Cardboard programming. What I have been doing is looking at the TreasureHunter sample app from Google's page and (with the help of documentation and other sources) have been trying to create a simple cube floating in space. I have also been trying to avoid making everything as bare bones as the sample, so I have been trying to object orient things such as lights and the meshes. I am pretty sure that my matrices and methods are correct, but I think there could be something wrong with my shaders. When I compile the app and install it, no errors are thrown, but I am given just my white screen (set with glClearColor) with the Cardboard binocular UI view no cube is rendered, tilting looking around has no effect. I am using the colors, verticies, and normals from the Treasure Hunter sample, so those should be correct. Full source code (Java) is here. uniform mat4 u Model model position in world space uniform mat4 u MVP model in projection space uniform mat4 u MVMatrix model in view space uniform vec3 u LightPos Light position in eye camera space (projection space) attribute vec4 a Position vertex in local space attribute vec4 a Color Vertex colors attribute vec3 a Normal vertex normal varying vec4 v Color color varying vec3 v Grid varying vec3 v Normal varying vec3 v Position void main() v Grid vec3(u Model a Position) v Normal vec3(u MVMatrix vec4(a Normal, 0.0)) v Position vec3(u MVMatrix a Position) vec3 modelViewVertex vec3(u MVMatrix a Position) Vertex position in view space vec3 modelViewNormal vec3(u MVMatrix vec4(a Normal, 0.0)) Normal in view space float distance distance(u LightPos, modelViewVertex) vec3 lightVector normalize(u LightPos modelViewVertex) float diffuse max(dot(modelViewNormal, lightVector), 0.5) diffuse diffuse 1.0 (distance distance) v Color a Color diffuse gl Position u MVP a Position My vertex shader My fragment shader precision mediump float varying vec4 v Color void main() gl FragColor v Color


Is it possible to use SFML with the Android NDK? I've started using SFML recently and I absolutely love it. I'd like to make games that could be ported to android, linux, mac and windows, but it seems that SFML lacks portability. I've searched for a while and I've only found unrelated or unanswered questions on forums. Does anyone know of any way to use SFML with the android NDK or any plans to support it in the future?


Moving sprites based on Delta time consistent movement across all devices with different resolutions This is the formula I am currently using to move my sprites across the screen Examples below only deal with X coordinates to keeps things as short as possible. Initial variable declarations float frames per second 30 Set this to target frames per second, 30 for this example. float dt 1 frames per second Delta float spriteXGrid Sprite's position on a grid (grid can be any explicit value, I use something simple like 800 x 600) float spriteXScreen Sprite's actual final position in screen coordinates float spriteXTime 5 Time variable. This is in seconds and is the amount of time the sprite should take to traverse the screen float spriteXVel 1 spriteXTime Velocity value used in conjunction with time value to calculate new position To set my sprite's initial position I simply do this spriteXGrid (pos 800) Where pos is the position on the grid (0 800) and 800 is the grid size that I chose to work with. spriteXScreen spriteXGrid width To convert to actual screen coordinates where width is the actual width of the device currently running on. Then to move my sprite, I do this spriteXGrid spriteXGrid (spriteXVel dt) Update sprite's position on the grid spriteXScreen spriteXGrid width And convert to screen coordinates (again, width is the screen width of the current device) Then I just use the spriteXScreen variable to plot the sprite, something like sprite.drawSprite(spriteXScreen,0) this is from a custom class I wrote that takes in sprite's x and y coordinate and draws it there. My question is, is there an easier way I can do this?! It's a nightmare to manage when it comes to collision detection etc.... because, you have 2 different coordinates, the 'screen' one (which I would describe as 'superficial'), and the 'grid' one which is needed for all the good stuff, and is a nightmare to actually work out and work with. is there anyway I can just do something like spriteXScreen 'some value' Which would allow my sprite to move across the screen in the same amount of time on all devices? (I mean I can't just say move it by 1 pixel, because if I move 400 pixels in say 5 seconds on a 400 pixel wide screen, the sprite will have passed the whole screen in those 5 seconds, but on an 800 pixel wide screen it would have only passed halfway in the same amount of time). The whole business of have a 'grid' coordinate and having to convert it to a 'screen' coordinate is extremely irritating and I'm wondering if I'm doing this all wrong....? Suggestions and solutions would be very welcome


Initializing OpenFeint for Android outside the main Application I am trying to create a generic C bridge to use OpenFeint with Cocos2d x, which is supposed to be just "add and run" but I am finding problems. OpenFeint is very exquisite when initializing, it requires a Context parameter that MUST be the main Application, in the onCreate method, never the constructor. Also, the main Apps name must be edited into the manifest. I am trying to fix this. So far I have tried to create a new Application that calls my Application to test if just the type is needed, but you do really need the main Android application. I also tried using a handler for a static initialization but I found pretty much the same problem. Has anybody been able to do it? This is my working but not as intended code snippet public class DerpHurr extends Application Override public void onCreate() super.onCreate() initializeOpenFeint("TestApp", "edthedthedthedth", "aeyaetyet", "65462") public void initializeOpenFeint(String appname, String key, String secret, String id) Map lt String, Object gt options new HashMap lt String, Object gt () options.put(OpenFeintSettings.SettingCloudStorageCompressionStrategy, OpenFeintSettings.CloudStorageCompressionStrategyDefault) OpenFeintSettings settings new OpenFeintSettings(appname, key, secret, id, options) RIGHT HERE OpenFeint.initialize( this , settings, new OpenFeintDelegate() ) System.out.println("OpenFeint Started") Manifest lt application android debuggable "true" android label " string app name" android name ".DerpHurr" gt


Error rendering map android I'm trying to read this text file and render the corresponding tiles on the screen. The code for reading the map is as follows private void loadMap(InputStream is) throws IOException ArrayList lt String gt lines new ArrayList lt String gt () int width 0 int height 0 BufferedReader reader new BufferedReader(new InputStreamReader(is)) while (true) String line reader.readLine() if (line null) reader.close() break if (!line.startsWith("!")) lines.add(line) width Math.max(width, line.length()) height lines.size() for (int j 0 j lt 18 j ) String line (String) lines.get(j) for (int i 0 i lt width i ) if (i lt line.length()) char ch line.charAt(i) Tile t new Tile(i, j, Character.getNumericValue(ch)) tiles.add(t) The first problem I have is with Character.getNumericValue(ch) as this does not seem to be doing anything, resulting in a NullPointerException. When I remove it and replace it with either a 1 or a 2 I'm able to render the tiles onto the screen but somehow the spaces in between the digits are interpreted as tiles, resulting in a continuous block of tiles eg in the second line with 1s results in tiles beginning from the left margin up until the last 1. How can I fix this?


Timer in turn based game I'm writing a small turn based game using libgdx. How to make a timer on the player turn to make it work even when the game loses focus?? Or maybe there are some other ways to do it???


Why is this animation jerky? I am trying to create a simple game on android but I am unsure the best way to do the game loop. Looking at the LunarLander sample the game loop just loops like a variable time step loop (elapsed now lastupdate). I tried using this method to draw a circle that grows in size to a max radius then shrinks to a min radius and repeats. However, when I run the program the growing stage is very choppy and slow (it takes longer than it should to get to max radius). My Code public void updateSize(double elapsed) if (mGrowing true amp amp mRadius gt mMaxRadius) mGrowing false if (mGrowing false amp amp mRadius lt mMinRadius) mGrowing true if (mGrowing true) mRadius mDRadius elapsed else mRadius mDRadius elapsed mDRadius is the number of pixel the radius should change per second and elapsed is the number of seconds that has passed. I tried putting in a sleep of 2ms and 5ms in my game loop and I get the same result. I converted my loop to a fixed time step (only run physics update if now lastupdate TIME STEP) and the animation was a lot smoother. UPDATE I change the sleep to 15ms and it's a lot smoother. Every other example I've seen of an android game does not have a sleep in the main loop. Is this because my sample is just so simple that it takes virtually no time to update and all other examples just have a longer update time or am I missing something?


How could an offline app store images so that they aren't trivially discoverable? There is an app I play which has lots of images. I have reverse engineered the app but couldn't find the images in the APK. The app is an offline app so it doesnt retrieve images from a server. My question is, then, where did this app store its images? I'd like to achieve the same level of protection (to deter casual observation of the images).


Move Particle to touch position on android I am attempting to make a Particle start moving to the position of my finger on the touch of the screen. I have been using this as the basis so far public void update() deltaX .9 deltaY .9 this.x this.deltaX this.y this.deltaY public void moveTo(int newX, int newY) float dx newX this.x float dy newY this.y float length (float) Math.sqrt(dx dx dy dy) dx length dy length dx 10 dy 10 deltaX dx deltaY dy now while it does move the Particle, it is rarely in the direction of my finger. How can I make the particle have the correct amount of velocity to get to the position of my finger, but no farther? Thanks in advance!


How do I handle game lag due to background apps I'm developing a game using libgdx and have noticed on several occasions that other background apps running can cause lag in my game especially when those apps are being updated in the background. I'm talking serious lag like from 50 60 fps down to under 10 fps while the other app installs. How should I handle this very noticeable lag? Thanks!


Libgdx Android app Avoid fullscreen and show titlebar I am developing an app using Libgdx and I don't want the app to go fullscreen and want to show the title bar but the app goes to fullscreen and hides title bar despite all efforts. Here is my style.xml file lt style name "MyStyle" parent "android Theme.Light" gt lt style gt Here is AndroidManifest.xml lt application android allowBackup "true" android icon " drawable ic launcher" android label " string app name" android theme " style MyStyle" gt lt activity android name "com.mygdx.game.android.AndroidLauncher1" android label " string app name" android configChanges "keyboard keyboardHidden orientation" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.LAUNCHER" gt lt intent filter gt lt activity gt Here is AndroidLauncher class protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) AndroidApplicationConfiguration config new AndroidApplicationConfiguration() config.hideStatusBar false initialize(new MyGdxGame(), config) setContentView(R.layout.main activity) tv (TextView)findViewById(R.id.tv) tv1 (TextView)findViewById(R.id.tv1) button (Button)findViewById(R.id.button) button.setOnClickListener(new View.OnClickListener() Override public void onClick(View v) if (Build.VERSION.SDK INT lt 19) Intent intent new Intent() intent.setType("image ") intent.setAction(Intent.ACTION GET CONTENT) startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) else Intent intent new Intent(Intent.ACTION OPEN DOCUMENT) intent.addCategory(Intent.CATEGORY OPENABLE) intent.setType("image ") startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT PICTURE) ) public void onActivityResult(int requestCode, int resultCode, Intent data) if (resultCode RESULT OK) if (requestCode SELECT PICTURE) Uri selectedImageUri data.getData() selectedImagePath getPath(selectedImageUri) Intent act2 new Intent(this ,AndriodLauncher2.class) act2.setData(selectedImageUri) startActivity(act2) public String getPath(Uri uri) String projection MediaStore.Images.Media.DATA Cursor cursor managedQuery(uri, projection, null, null, null) int column index cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA) cursor.moveToFirst() return cursor.getString(column index)


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 )


Mobile Game Google Play no supported dev country and capitalization alternatives (no policies violation or suspicious behavior)? If my country is listed as not supported as a developer country (for payments), this mean developer can upload app but no make any money with it. If I understood correctly, not even in app ads are allowed (I have my doubts about ads because It has no sense they aren't allowed). Is there any mean, friendly with Google policies, to monetize the app? For example Desktop version is free to play. Optional content requires a payment. Mobile version is free to play. Optional content requires you to log in with same account you used to purchase it on desktop. No ads and no in app purchase in mobile version. Is the above scenario OK? Which are the alternatives? Notes To me, no ads has no sense. After reading Developer Console documentation I assumed that ads are OK but after doing some research It turns on that many people thinks that ads are not OK.


How to use HyperLink with Actor in Libgdx I am making a quiz game using LibGDX. I want it to redirect to a website. I am using classes like Text and Label that extends Actor to write text using a bitmap Font. I have no idea on how to provide a link (like anchors in html) in a native app. However, I am not very good at Android but know java well. In android , I saw on stackexchange, we can do so using Intent or string.xml configuration. Can anyone suggest me a way to do so using Actor in libGDX?


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.


Faster way to draw dynamic meshes in OpenGL ES I'm writing a 3D game which is going to inlcude some dynamic meshes. For now, my code looks like this private float mVertices private FloatBuffer mVertexBuffer public void onDrawFrame(GL10 gl) first clear the screen of any previous drawing gl.glClear(GL10.GL COLOR BUFFER BIT GL10.GL DEPTH BUFFER BIT) initialize the matrix gl.glMatrixMode(GL10.GL MODELVIEW) gl.glLoadIdentity() update the vertex data for (int vtx 0 vtx lt mVtxCount vtx) fill in the x, y and z components of the vertex position mVertices vtx 3 x mVertices (vtx 3) 1 y mVertices (vtx 3) 2 z update the vertex buffer mVertexBuffer.clear() mVertexBuffer.put(mVertices) mVertexBuffer.position(0) render the vertex buffer gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glVertexPointer(3, GL10.GL FLOAT, 0, mVertexBuffer) gl.glDrawElements(GL10.GL LINES, mIndices.length, GL10.GL UNSIGNED BYTE, mIndexBuffer) Here is an easy sample as the index buffer does not change so I only update the vertex position, normal and texture coordinates. Of course I understand dynamic mesh will always be slower to render than static mesh, but I wonder if the method I use is good or if there is a faster better way to do this .


Optimal Compression for Speech I'm designing a game that depends heavily on audio I will have some 300 speech files (most of them just a word or two long). This can very quickly escalate the size of my final game. What's the optimal way to encode compress speech files to keep the size minimal without getting audio artifacts? Please address both per file compression encoding, and also zipping compressing the set of all speech files together in your answer. Because I'm not sure which (or combination of both) factors will give me the best results. Edit I need this to run in Silverlight and Android, so I'm presumably stuck with only MP3 as my option (other than uncompressed wave files).


Faster way to scale images than gluScaleImage? I'm porting a C game to Android using the NDK and there's one bottleneck that's really slowing down the code gluScaleImage(). Does anyone know of a faster way to scale image textures?


LibGdx Scalling sprites on Android I have a sprite that is a few buttons but need them in the center of the screen for all android devices. I tried setting it's location to the center of the screen by dividing the orthogonal camera by 2, but it doesn't help. Any simple way to fix this?


How to delete Google Play Services? I want to delete Google Play Services in the Google Play Developer Console, but I can't. Here is what I did I published my game to Google Play without Google Play Services. I decided that I want Google Play Services in my game, so I integrated them in the source code. After that I created Google Play Services for my game in the Google Play Developer Console. But the created Google Play Services didn't work. The were Unpublished at that moment. I read that in order for them to work, you have to publish them. I published them, they still don't work and I can't delete them. In order to delete them I must unlink the game, but since the game is published I can't unlink it. I asked Google Support what to do, they told me to delete the project in the Google API Console and after 7 days the game will be unlinked. There has been 15 days since then and nothing happens. Please tell me what can I do.


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.


What units is Box2d AndEngine's velocity measured in? I'm developing a game on AndEngine (with Box2d) and on iOS Sprite Kit simultaneously. I want the game's physics to be identical on both platforms. Sprite Kit uses Box2d internally for physics simulation and I'm using Box2d AndEngine to use it in AndEngine. In Sprite Kit, I use physicsBody.velocity. In AndEngine's Box2d, I use body.SetLinearVelocity(x,y). In Sprite Kit, a physics body's velocity vector is measured in meters per second. What is the corresponding unit of SetLinearVelocity in Box2d AndEngine?


Using multiple sprite sheets for same object AndEnginge I have multiple sprite sheets for my object(Parrot) like eating, moving left to right, right to left and much more. I am using AndEngine gles2.0. How should I implement it? Every time I have to use different sprite sheet, detach previous one and on same location add new one. This is going to be hectic! Anyone here who already implemented this kind of scenario? If I use single sprite sheet for every animation it size will increase and it will throw a exception of out of memory!


What affects the size of APK files? The size of the .apk file built by Unity is larger than I expected. Is it image resolution, number of scenes, or something else?


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.


Cant write read to from external storage with LibGDX My create method looks like this Override public void create () batch new SpriteBatch() FileHandle file Gdx.files.external("file.txt") file.writeString("My god, it's full of stars", false) I allso included lt uses permission android name "android.permission.WRITE EXTERNAL STORAGE" gt lt uses permission android name "android.permission.READ EXTERNAL STORAGE" gt The Exception i get is this 02 13 14 45 51.858 12439 12466 com.snowdevs.tweetiebirds E AndroidRuntime FATAL EXCEPTION GLThread 1120 Process com.snowdevs.tweetiebirds, PID 12439 com.badlogic.gdx.utils.GdxRuntimeException Error writing file file.txt (External) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 353) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) Caused by com.badlogic.gdx.utils.GdxRuntimeException Error writing file file.txt (External) at com.badlogic.gdx.files.FileHandle.writer(FileHandle.java 330) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 350) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) Caused by java.io.FileNotFoundException storage emulated 0 file.txt open failed EACCES (Permission denied) at libcore.io.IoBridge.open(IoBridge.java 452) at java.io.FileOutputStream. lt init gt (FileOutputStream.java 87) at com.badlogic.gdx.files.FileHandle.writer(FileHandle.java 322) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 350) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) Caused by android.system.ErrnoException open failed EACCES (Permission denied) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java 186) at libcore.io.IoBridge.open(IoBridge.java 438) at java.io.FileOutputStream. lt init gt (FileOutputStream.java 87) at com.badlogic.gdx.files.FileHandle.writer(FileHandle.java 322) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 350) at com.badlogic.gdx.files.FileHandle.writeString(FileHandle.java 339) at com.snowdevs.tweetiebirds.TweetieBirdsGame.create(TweetieBirdsGame.java 22) at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java 254) at android.opengl.GLSurfaceView GLThread.guardedRun(GLSurfaceView.java 1519) at android.opengl.GLSurfaceView GLThread.run(GLSurfaceView.java 1240) I use a Nexus 5 with Android 6 Marshmallow for testing. I searched and found that Android 6 uses runtime permissions but the LibGDX guys says that it works even on Android 6... Is there a fix With or Without runtime permissions?


Number of Impressions on Admob for Revenue Just curious for a rough estimate how many impressions would it take to make 300 dollars, a day, in ad revenue?


Phone for Android game development I've been developing casual iPhone iPod Touch games touch for about two years. I'd like to port some games to the Android platform. Since I'm stuck w a two year iPhone contract I don't want to get an Android phone that requires a service plan. What is the best phone to get for development in this situation?


Make a callback to android methods from libgdx How can I make a callback from libgdx to an Android method? I want to use the method to overwrite a file in the internal memory.


Loading and rendering one large image or many smaller ones I am working on an android game with a top down style view similar to the original GTA's or a scrolling version of Legend of Zelda. I have recently begun designing some prototype levels for the game which vary between a corridor style dungeon similar to diablo or an open area with obstacles similar to Zelda. My question is would it be better to have one large background image and draw it once or a relatively small one (size of or less than the view) and draw it multiple times. My concerns are the memory required to load store a large background image vs the performance boost of only drawing one image. Any input would be appreciated.


What organic traffic can I expect from publishing on Google Play, without other marketing? I've just published a new Android game on Google Play. It has been a bit over 48 hours. It's active in the store, and I can search for it by name to get to it. However, I've had 0 organic downloads thus far, only a couple from my friends. As far as I know, it has not been shown in the "new games" list yet, and the only store listing views in the stats are the ones from myself and friends. Is there some time by which I can expect some "organic" exposure, or will I ever? Is promoting my game by other channels the only option? I'm not asking for advice on promoting my game. I'm only asking about what organic exposure I can expect on Google Play.


Accelerometer based games smoothness Take Doodle Jump and other games that rely on the accelerometer. The movement of the character is very smooth and I have no idea how they implemented it. I've seen a number of SO GameDev forum questions, but the discussion ends abruptly when someone recommends a high low pass filter. I've tried that (unless I'm missing something) and the results are nowhere near smooth. All I'm trying to do is move a character on the x axis. This is the code I have and it's very "choppy". It's actually the code you can see on the official Android tutorials. float alpha 0.9f tried many values from 0.1f to 0.99f. chopiness still there Override public void onSensorChanged(SensorEvent event) if(event.sensor.getType() Sensor.TYPE ACCELEROMETER) if(init) gravity 0 event.values 0 gravity 1 event.values 1 gravity 2 event.values 2 init false else gravity 0 alpha gravity 0 (1 alpha) event.values 0 gravity 1 alpha gravity 1 (1 alpha) event.values 1 gravity 2 alpha gravity 2 (1 alpha) event.values 2 Remove the gravity contribution with the high pass filter. linear acceleration 0 event.values 0 gravity 0 linear acceleration 1 event.values 1 gravity 1 linear acceleration 2 event.values 2 gravity 2 character.setX(character.getX() linear acceleration 0 ) I also tried multiplying linear acceleration 0 with a sensitivity, where 0 lt sensitivity lt 1 but the choppiness still doesn't go away. What is the next step from here to achieve a smooth movement like in Doodle Jump?


Marketing PC Android 2d Physics Game I've been working on a game for couple years now, its fairly original, has definite potential within an indie market, and appeal for the masses also. I want to deploy on Android and PC, green light it on steam and looking into Kickstarter. I'm also going to set up a website where it can be played, have a dedicated server to link 'matches' and post demos on sites like mofunzone and armorgames. I've used Jbox2d, and am also curious about the licencing with this engine and can't seem to find documentation on that. I'm almost done the 'demo' and my question is, how should I market it? I was thinking I'd make the game free on android, charge something like 10 on steam, and charge say 1 month to play online (for the pc version) If anyone has any good links, research or advice from personal experience, it would be greatly appreciated.


LibGDX ActorGestureListener after change position I have this code to get pan touch inside an Image and it works fine, but when I uncomment this line img.setPosition(100, 100) it doesn't work anymore, why? Texture tex new Texture(Gdx.files.internal("square.png")) final Image img new Image(tex) img.setPosition(100, 100) img.setSize(157,45) img.setColor(0,0,0,1f) img.addListener( new ActorGestureListener() Override public void pan(InputEvent event, float x, float y, float deltaX, float deltaY) super.pan(event, x, y, deltaX, deltaY) int minX (int)img.getX() int maxX (int)img.getX() (int)img.getWidth() int minY (int)img.getY() int maxY (int)img.getY() (int)img.getHeight() if ((x gt minX amp amp x lt maxX) amp amp (y gt minY amp amp y lt maxY)) Utils.print("PAN") ) stage.addActor(img)


How to switch between views in android? I've tried several methods to switch between two views in my program. I've tried creating a new thread then have the view run for 5 seconds before creating intent to start my main activity. This is the code snippet from the said view class mHelpThread new Thread() Override public void run() try synchronized(this) Wait given period of time or exit on touch wait(5000) catch(InterruptedException ex) finish() Run next activity Intent intent new Intent(Intent.ACTION MAIN, null) intent.addCategory(Intent.CATEGORY HOME) startActivity(intent) stop() mHelpThread.start() I can access the said view without error but it doesn't disappear after 5 seconds nor did it switched to main view when I even utilized an onTouchEvent() to detect touch on the screen of which it should have automatically closed. I've also tried adding a button on the said view to manually switch to main view Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) setContentView(R.layout.help) final HelpView helpView this final Button btnback (Button) findViewById(R.id.back) btnback.setOnClickListener(new View.OnClickListener() public void onClick(View v) Intent intent new Intent(helpView, MainActivity.class) startActivity(intent) ) These codes worked, though, for creating a launcher for my program. So I thought that it would work the same if I added an option for help rules(for the game) that would switch to another view. I've only since started using eclipse for android so pardon my lack of knowledge. Here is also the snippet from my manifest lt uses sdk android minSdkVersion "11" android targetSdkVersion "15" gt lt application android icon " drawable ic launcher" android label " string app name" android theme " style AppTheme" gt lt activity android name "MainActivity" android label " string title activity main" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.DEFAULT" gt lt intent filter gt lt intent filter gt lt intent filter gt lt activity gt lt activity android name "SplashScreen" android theme " style Theme.Transparent" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.LAUNCHER" gt lt intent filter gt lt activity gt lt activity android name "HelpView" android theme " style Theme.Transparent" gt lt intent filter gt lt action android name "android.intent.action.MAIN" gt lt category android name "android.intent.category.DEFAULT" gt lt intent filter gt lt intent filter gt lt intent filter gt lt activity gt lt application gt


Android glsl discard problem Whenever I use discard or an if statement in my shaders, I get an error message with the text lt qgl2DrvAPI glAttachShader 398 gt GL INVALID VALUE I think this is a version problem, but I'm really not sure.


Building for the Android errors Unity3D EDIT After doing some research on my own I found that by deleting the debug.keystore file everything fixed itself. So currently I'm exporting my game strictly for testing to the Android. However, when I attempt to build for the Android, I get these errors Using keystore C Users Tim Williams.android debug.keystore THIS TOOL IS DEPRECATED. See help for more information. Debug Certificate expired on 4 14 12 11 18 AM UnityEngine.Debug LogError(Object) PostProcessAndroidPlayer BuildApk(String, Boolean) (at C BuildAgent work b0bcff80449a48aa Editor Mono BuildPipeline PostProcessAndroidPlayer.cs 1014) PostProcessAndroidPlayer PostProcess(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C BuildAgent work b0bcff80449a48aa Editor Mono BuildPipeline PostProcessAndroidPlayer.cs 444) UnityEditor.HostView OnGUI() And Error building Player UnityException APK Builder Failed! Failed to build APK package. See the Console for details. Does anyone have any ideas what these errors are, and how I could fix them? This is my first time building for any mobile device, so I'm a bit confused (Also, I do have the Android SDK.) Thanks, Tim.


Make a sprite jump to a certain direction in libGDX I was wondering how you can make a sprite jump to a certain direction in libGDX just like the brick does in the famous mobile game "Amazing Brick' I want to make my sprite jump up a bit to the right when I tap the right part of the phone and make it jump up but to the left direction when I tap on the left part of my phone. I am using libGDX on android studio and I am on a beginner level, trying to develop a unique game for android. Plz help. Thanks in advance. o


On Android, why would you handle expansion files yourself instead of using Google Play? Why aren't all Android games using Google Play's ability to serve their expansion files? Why some are handling it themselves inside their apps?


Android in game pause screen Right now Im calling a new activity with an xml view when I pause my game, but Since I do this I need to use context in my real time code, and this is causing a memory leak. Is there any preffered way to pause the game? By pause I mean if game is over, if I die, or if I press pause button. Would a custom dialog work just aswell? this would mean I wont have to leave my main activity while im in game.


How to use the box2d contact listener in android (java port)? I don't have any idea about the box2d collision detection in android. I googled and got results that suggest to use the contact listener but I don't know how to use it in android java.


Edge Detection on Screen I have a edge collision problem with a simple game that i am developing. Its about throwing a coin across the screen. I am using the code below to detect edge collisions so i can make the coin bounce from the edges of the screen. Everything works as i want except one case. When the coin hits left edge and goes to right edge the system doesnt detect the collision. The rest cases are working perfectly, like hitting the right edge first and then the left edge. Can someone suggest a solution for it? public void onMove(float dx, float dy) coinX dx coinY dy if (coinX gt rightBorder) coinX ((rightBorder coinX) 3) rightBorder if (coinX lt leftBorder) coinX (coinX) 3 if (coinY gt bottomBorder) coinY ((bottomBorder coinY) 3) bottomBorder invalidate()


How can I save my game state so it can be resumed when my application resumes? I've found that after resuming my game the whole engine is reloaded and application is reinitialized. I want to save engine state and in "onResume," resume the game process from where it left off. I've tried to save the engine (mEngine) and then after resume the game in "onLoadEngine" return saved engine. I think it is a bad solution and it doesn't work anyway. What is the best solution for resuming my game (after the power key was pressed, for example) in AndEngine ?


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 ..


RagDoll in AndEngine I want to create a RagDoll body in andEngine which can run and jump over different jumpObjects. Can any one give a nice tutorial on how to create RagDoll body and how to move it, like jump and running. Thanks in Advance.


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.


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


How can I tell if OpenGL has finished rendering the current frame? If I make a call to http developer.android.com reference android opengl GLSurfaceView.html requestRender() from my game loop, how can I tell when OpenGL has finished rendering? I don't want to make a call to requestRender() again in the next frame until the previous frame has finished rendering. Sorry for the basic question I'm new to opengl and trying to switch to it from canvas. Also, is GLSurfaceView.requestRender() a blocking call?


Separate parts of a game engine I'm pretty new in developing videogames. By now I only used SDL with C C to create games. I'm currently learning OpenGL and I realized that to be fluid and easy to maintain the code must be logically separated. Since I want to use OpenGLES on iOS and Android I was wondering how the engine must be imagined in a technical way, some questions came up Do I have to separate input update functions from draw functions in different threads? Is there only one proper way to think a game engine loop? What kind of assets should I use to create a 3D game using openGl ES to get better performance? EDIT I figured that I had more questions lacking of answers reading the links DMGregory refered me to. I'll keep reading it till I fully understand it and than ask for the good questions. Thanks a lot.


Cross platform ad hoc local mobile multiplayer I want to implement ad hoc cross platform (iOS, Android, and PC) device discovery for local multiplayer, like this scenario http www.youtube.com watch?v csXYZf2vGdE Multiple players, each with different devices (iOS, Android, PC). One player starts a game. The others can search and automatically discover his game and enter into a local multiplayer match. This would all be done P2P, without any dedicated game servers. Is this possible with current technology?


Monogame 3.3 SoundEffect play Freezes After using Monogame 3.3 with Xamarin Android, SoundEffect.Play method freezes the game. I try to convert wav files 8bit mono, 16bit mono no changes. This error on Samsung T101 android 4.0.3 but SoundEffects works with another android device which has 4.2.2. I don't have this problem with Monogame 3.2. Any suggestion? Thank you! Android debug log below. The thread 'Unknown' (0x4) has exited with code 0 (0x0). Failed to generate OpenAL data buffer 04 22 23 34 04.380 I mono stdout(10068) Failed to generate OpenAL data buffer Failed to get buffer bits , format Stereo16, size 73632, sampleRate 44100 04 22 23 34 04.380 I mono stdout(10068) Failed to get buffer bits , format Stereo16, size 73632, sampleRate 44100 04 22 23 34 04.390 D Mono (10068) DllImport searching in 'openal32.dll' ('. libopenal32.so'). 04 22 23 34 04.390 D Mono (10068) Searching for 'alDistanceModel'. 04 22 23 34 04.990 D Mono (10068) Image addref System.Runtime.Serialization 0x28084d0 gt System.Runtime.Serialization.dll 0x27ef090 1 04 22 23 34 04.990 D Mono (10068) Assembly System.Runtime.Serialization 0x28084d0 added to domain RootDomain, ref count 1 04 22 23 34 04.990 D Mono (10068) AOT module 'System.Runtime.Serialization.dll.so' not found Cannot load library load library 1091 Library ' data data com.homemadegames.exterminator lib System.Runtime.Serialization.dll.so' not found 04 22 23 34 04.990 D Mono (10068) Assembly Ref addref MonoGame.Framework 0x1c80558 gt System.Runtime.Serialization 0x28084d0 2 04 22 23 34 04.990 D Mono (10068) Assembly Ref addref System.Runtime.Serialization 0x28084d0 gt mscorlib 0x1c66118 9 04 22 23 35 31.110 D dalvikvm(10068) GC CONCURRENT freed 159K, 5 free 8403K 8775K, paused 5ms 1ms 04 22 23 38 12.350 D dalvikvm(10068) GC CONCURRENT freed lt 1K, 2 free 8905K 9031K, paused 5ms 1ms


Scaling and new coordinates based off screen resolution I'm trying to deal with different resolutions on Android devices. Say I have a sprite at X,Y and dimensions W,H. I understand how to properly scale the width and heigh dimensions depending on the screen size, but I am not sure how to properly reposition this sprite so that it exists in the same area that it should. If I simply resize the width and heigh and keep X,Y at the same coordinates, things don't scale well. How do I properly reposition? Multiply the coordinates by the scale as well?


How can I draw crisp per pixel images with OpenGL ES on Android? I have made many Android applications and games in Java before, however I am very new to OpenGL ES. Using guides online, I have made simple things in OpenGL ES, including a simple triangle and a cube. I would like to make a 2D game with OpenGL ES, but what I've been doing isn't working quite so well, as the images I draw aren't to scale, and no matter what guide I use, the image is always choppy and not the right size (I'm debugging on my Nexus S). How can I draw crisp, HD images to the screen with GL ES? Here is an example of what happens when I try to do it And the actual image Here is how my texture is created get id int id 1 gl.glGenTextures(1, texture, 0) id texture 0 get bitmap Bitmap bitmap BitmapFactory.decodeResource(context.getResources(), R.drawable.ball) parameters gl.glBindTexture(GL10.GL TEXTURE 2D, id) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE MIN FILTER, GL10.GL NEAREST) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE MAG FILTER, GL10.GL LINEAR) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE WRAP S, GL10.GL CLAMP TO EDGE) gl.glTexParameterf(GL10.GL TEXTURE 2D, GL10.GL TEXTURE WRAP T, GL10.GL CLAMP TO EDGE) gl.glTexEnvf(GL10.GL TEXTURE ENV, GL10.GL TEXTURE ENV MODE, GL10.GL REPLACE) GLUtils.texImage2D(GL10.GL TEXTURE 2D, 0, bitmap, 0) crop image mCropWorkspace 0 0 mCropWorkspace 1 height mCropWorkspace 2 width mCropWorkspace 3 height ((GL11) gl).glTexParameteriv(GL10.GL TEXTURE 2D, GL11Ext.GL TEXTURE CROP RECT OES, mCropWorkspace, 0)


Viewport Pixels trouble Intel XDK I'm creating a game in Intel XDK, and using their API to get the viewport width and height. These are coming back at 1122 pixels and 746 pixels, respectively. When adding my text at 150 pixels down and 100 pixels across its being placed in the center at the bottom. var canvas document.getElementById('game') var ctx canvas.getContext('2d') var width 1122,height 746 ctx.fillText(window.innerWidth ' ' window.innerHeight,100, 150) That is writing on the screen 1122 748, but it's placed at the bottom of the screen. Not 100 pixels down by 150 pixels across. It's directly in the middle.


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


About floating point precision and why do we still use it Floating point has always been troublesome for precision on large worlds. This article explains behind the scenes and offers the obvious alternative fixed point numbers. Some facts are really impressive, like "Well 64 bits of precision gets you to the furthest distance of Pluto from the Sun (7.4 billion km) with sub micrometer precision. " Well sub micrometer precision is more than any fps needs (for positions and even velocities), and it would enable you to build really big worlds. My question is, why do we still use floating point if fixed point has such advantages? Most rendering APIs and physics libraries use floating point (and suffer it's disadvantages, so developers need to get around them). Are they so much slower? Additionally, how do you think scalable planetary engines like outerra or infinity handle the large scale? Do they use fixed point for positions or do they have some space dividing algorithm?


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.


Use 2 values of a mask Let's say one has a black gray white mask and wants to draw picture A over the white gray values and picture B over the black gray values (the blacker the more B picture). The best I come up with would be something like Set to RenderTargetA Draw Mask Draw PictureA over Mask (using DepthStencilState) Set to RenderTargetB Draw Mask Draw PictureB over Mask Draw both RenderTargets over each other somehow But that just seems a) overly complicated and b) both render targets still have the mask drawn on them so it wouldn't have worked anyway. So how would one achieve this?


What is "ROAM" related to terrain rendering? I saw it mentioned on this question, but no one explained what it is.


3D theory before graphics APIs? I'm a software engineer and I'm hoping to move my career towards game development. I'm reading a book right now on 2D using C DirectX. When I get into 3D I know I want to do it correctly. For example, I know nothing about 3d space. So if I learn only an API I might know it but I don't know if I can develop an interractive mini 3d world with it. I wouldn't call myself successful just having a rotating crate with the latest shaders etc. My math skills are up to trig linear algebra and still in college. I know more math is to come. Should I be reading on 3D theory books before picking up on OpenGL Direct3D, or any other suggestions? I just know an API isn't going to teach 3D game development and don't want to be lost afterward. I'm very book oriented so that's fine if there's suggestions there too. Thoughts are welcome. Thanks!


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?


Asset Library Class or passing Asset's through constructors I am at the point of designing UI Logic and I was wondering what a good way to pass asset information to these objects would be. What I was trying as of yet was passing assets to the objects representing UI elements through their constructors, leading to code where I pass between 1 to 10 assets (like "button idle" "button being hovered" and "button active" etc.) to the objects or having to create "metaclasses" that define the "look and feel" of these objects that need to be passed to the ui elements to handle the rendering. A way I thought of handling this in a "dirty" way was to create a singleton "asset database" that is globally accessible. As every button need's it's own callback function on click it can also get it's own rendering function from where the button can pick it's assets from the accessible assets. What is a common way to handle this?


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?


Small 3D Scene Graph I'm looking for a 3D graphics library (not a complete game engine). Preferred a scene graph. Something small (unlike jME, XNA or Unity), that I can easily expand and change. Preferred features Cross Platform Wrriten in Java Scala (JOGL or LWJGL), C (preferred OpenTK), Python or JavaScript WebGL. Support for OpenGL is a must. Direct3D is optional. Some material system Full support for some model format with full animation support (preferred COLLADA) Level of Detail (LOD) support Lighting support Shaders, GUI, Input and Terrain Water support are also preferred, but not required Thanks!


What steps can developers take to improve the graphics of their games? My understanding is that the differences in graphic quality between games for systems like Xbox One and PS4 and Pixar style movies stems from that the former are rendered in real time. But even with real time rendering, it looks like some game makers can get rather nice looking results. An example below is about the new Gears of War game Above image is from this YouTube video posted by GameSpot. So admittedly it could be from a video (e.g. a promo) that has been rendered more than the actual game. Anyway so what I wanted to ask is, are games solely dependent on the real time rendering on the target system, or are there some steps developers can take (besides the obvious start with as good graphics as possible) to improve the graphics in their game? Edit here I am referring strictly to in game graphics.


Why no night sky with realistic star constellations? As an amateur stargazer I noticed that many games which have night scenarios use textures for the night sky where the stars seem to be arranged entirely randomly. It seems like they were created by an artist from scratch without looking at a star chart. Why don't they use a night sky texture where the stars are arranged like on the real night sky, so you can make out well known constellations? Games which take place in a fantasy or science fiction scenario are obviously excused, but why do games which take place on earth spend so much work on realism, but neglect this one aspect, even though there are plenty of public domain resources which could be used to create a realistic night sky?


How do you handle large triangles with frustum? I am rendering the Sponza scene ato test my frustum implementation. My current approach is simply, test if the vertices of the triangle are within the frustum (angle between the camera looking direction and the position od the vertex relative to the camera). If any of the vertices are visible then the trianlge is considered to be visible. The issue is that the sponza scene has some really large triangles, thus with my approach it is possible to be looking directly at a triangle and see nothing if all 3 vertices are outside the camera frustum.


Do SpriteBuilder's Smart Sprite Sheet need to be loaded to memory? When I create an Smart Sprite Sheet Folder using SpriteBuilder and publish it, must I load that SpriteSheet into memory "FrameCache" with code or does SpriteBuilder do this automatically (so I just have to access any image inside of SpriteSheet?)


Geometry Shader and Stream Output with Directx11 I am having trouble trying to send verticies generated in the Geometry Shader to Stream Output. What I am trying to accomplish is to generate verticies from the Geometry Shader and store them to a vertex buffer so that I can use the vertex buffer to draw later. I read that I have to use the CreateGeometryShaderWithStreamOutput function to create a Geometry Shader that can send verticies to Stream Output instead of the rasterization stage. This is how I am trying to use it device gt CreateGeometryShaderWithStreamOutput(this gt mGSBlobSO gt GetBufferPointer(), this gt mGSBlobSO gt GetBufferSize(), so decl, 1, amp stride, 1, D3D11 SO NO RASTERIZED STREAM, NULL, amp this gt mGeometryShaderSO) I am getting an E INVALIDARG at this line. I am specifying D3D11 SO NO RASTERIZED STREAM because I think this means that I do not want to send data to the rasterizer but I am not sure. When I replace D3D11 SO NO RASTERIZED STREAM with a 0, I do not get this runtime error, but I do not get the result I want. How can I setup the geometry shader to store vertices to a vertex buffer in Stream Output?


Transformations between coordinate systems In a graphics engine, I have three three dimensional orthogonal coordinate systems, O, A and B. A and B are the result of two different transformations from O. I now want to calculate the transformation matrix R, which takes you from A to B. R should be the rotation and translation with respect to coordinate system A, not the original coordinate system O. Which of the following is correct? (1) B A R or (2) B R A By doing some simple worked examples, it seems that (1) is correct. However, my intuition says that (2) is correct, because the transformation to A should be applied before the transformation to B, via R. Which is it? Thanks )


Do I really need to use a graphics API? Is it necessary to use graphics APIs to get hardware acceleration in a 3D game? To what degree is it possible to free of dependencies to graphics card APIs like OpenGL, DirectX, CUDA, OpenCL or whatever else? Can I make my own graphics API or library for my game? Even if it's hard, is it theoretically possible for my 3D application to independently contact the graphics driver and render everything on the GPU?


Geometric clipping of triangles intersecting near plane I was reading about how rasterization works but there is one topic I can't quite understand. After perspective projection, our point is in clip space as I understand it. Now we test all points in a triangle like so rejected true for every point if (abs(point.x) lt abs(point.w) amp amp abs(point.x) lt abs(point.w) amp amp abs(point.x) lt abs(point.w) point.w gt 0) rejected false So the triangle is only rejected if all points are behind the near clipping plane or fall out boundaries, but it can happen that one point is behind the near clipping plane and others are in front. Now there is a part I don't understand. To deal with this we somehow clip points in 3d space by constructing new triangles. So how is this exactly works? And why we can't just interpolate our z values to test if the point is behind or in front of the near plane?


How do I load chunks of data from an assest manager during a loading screen? I'm developing an Android game. Basically I want to pre load all graphics sounds when the app is first loaded. But I also would like to show a progress bar as this is happening. Here is a snippet of Java Android code to display a progress bar while doing some work public class LoadingScreen extends Activity private static int progress 0 private ProgressBar progressBar private int progressStatus 0 private Handler handler new Handler() Called when the activity is first created. Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) setContentView(R.layout.loadingscreen) progressBar (ProgressBar) findViewById(R.id.progress) do some work in background thread new Thread(new Runnable() public void run() while (progressStatus lt 100) progressStatus doSomeWork() Update the progress bar handler.post(new Runnable() public void run() progressBar.setProgress(progressStatus) ) hides the progress bar handler.post(new Runnable() public void run() progressBar.setVisibility(8) ) private int doSomeWork() try simulate doing some work Thread.sleep(50) catch (InterruptedException e) return progress ).start() My question is how do I design my Asset Manager to load "chunks" of data (bitmaps and sounds music) in the doSomeWork() function? Would it be some sort of stack that I keep popping off the next asset to load? How do I determine how much of the progress bar I should increment after loading a "chunk" of data? Is there a better way to approach this or is this the correct way?


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.