_id
int64
0
49
text
stringlengths
71
4.19k
7
Optimizing Draw calls in MonoGame Android platformer I am working on a 2D platformer that is in the final stages of optimization. I have a few different devices for testing, and I am trying to get the best possible framerate on the weaker ones. On a Nexus 5 I get a constant 60fps, with an occasional hiccup. On a Galaxy S4 I also get a good 55 60fps On an original Galaxy S (Vibrant) The frames drop to about 20 25 My question is, given the tile system described below, what can I do to increase the FPS on low end devices? And granted the Galaxy S came out years ago, should I even worry about it? My background consists of 3 scrolling parallax layers. The world I am drawing in a viewport of 25x15 tiles, at a size of 32x32px per tile, with 3 layers each (32x32x3px). The camera already culls tiles that are out of view. All tiles are found in one texture, and this is done in a single SpriteBatch call that locates the correct texture location for the tile layer. Code is below public void Draw(SpriteBatch spriteBatch, bool upsideDown) int startX GetCellAtPixelX( (int)Camera.Position.X ) int startY GetCellAtPixelY( (int)Camera.Position.Y ) int endX GetCellAtPixelX( (int)Camera.Position.X Camera.ViewportWidth ) int endY GetCellAtPixelY( (int)Camera.Position.Y Camera.ViewportHeight ) for (int x startX x lt endX x ) for (int y startY y lt endY y ) for (int z 0 z lt MapLayers z ) if ((x gt 0) amp amp (y gt 0) amp amp (x lt MapWidth) amp amp (y lt MapHeight)) ... The very last parameter in this draw call is the draw depth. This draw format will arrange layers from front to back (0 front, 1 back) so we subtract 1 from the z index as a decimal to get the appropriate location Background gt 0.7 Middleground gt 0.6 Foreground gt 0.5 spriteBatch.Draw( tileSheet, CellScreenRectangle(x, y), TileSourceRectangle(mapCells x,y . GetLayerIndex((TileLayers)z)), Color.White, 0.0f, Vector2.Zero, effect, 0.7f ((float)z 0.1f) ) End y loop End x loop As you can see, it's not very complex code. I have checked if my Update calls are slowing the game down, but it's very clearly in the Draw function. When I leave out my call to world.Draw(), fps shoot up to about 50 on the Galaxy S. Also, if I draw only a single layer, I get better performance around 42 45 fps. I can discard one layer if necessary, but I need at least 2 tile layers. How else can I speed up the draw calls? I am using MonoGame for Android (XNA)
7
How to implement a game launch counter in LibGDX I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working public class MainStarter extends Game private int count Override public void create() Set up the application AppSettings.setUp() if(SettingsManager.isFirstLaunch()) SettingsManager.createTextFileInLocalStorage("gamedata") SettingsManager.writeLine("gamedata", "Launched " count ,FileType.LOCAL FILE ) else SettingsManager.writeLine("gamedata", "Not First launch " count ,FileType.LOCAL FILE ) Load assets before setting the screen Assets.loadAll() Set the tests screen setScreen(new MainMenuScreen(this, "Main Menu")) What is the proper way to do this?
7
How can I change width of sprite Dynamically? I want to change width of sprite dynamically but i can't perform it.!! Here i want to change only my white sprite i want to use these type of facility in my game in using AndEngine I want to display life of player
7
How to Integrate Unity with Google Play Game Services for iPhone and Android games I want to integrate Google Play Game Services for Apple's iOS and for Android. How can I do this efficiently?
7
Workaround to losing the OpenGL context when Android pauses? The Android documentation says There are situations where the EGL rendering context will be lost. This typically happens when device wakes up after going to sleep. When the EGL context is lost, all OpenGL resources (such as textures) that are associated with that context will be automatically deleted. In order to keep rendering correctly, a renderer must recreate any lost resources that it still needs. The onSurfaceCreated(GL10, EGLConfig) method is a convenient place to do this. But having to reload all the textures in the OpenGL context is both a pain and hurts the game experience for the user when reentering the app after a pause. I know that "Angry Birds" somehow avoids this, I'm looking for suggestions on how to accomplish the same? I'm working with the Android NDK r5 (CrystaX version.) I did find this possible hack to the problem but I'm trying to avoid building an entire custom SDK version.
7
OpenGL ES GL FIXED versus GL FLOAT I am writing an app for Android, using OpenGL ES 1.x I am confused as to whether I should use GL FLOAT or GL FIXED, the priority being performance regarding GPU operations(does GL FIXED need to be converted etc. ex GL FIXED fits EXACTLY with the precision I need but if it is converted to a float then using it is pointless). This book seems to say that it is ALWAYS preferable to use GL FIXED for vertices "The major exception is with vertex data, which should never be given in floating point..." Here (paragraph right above the subtitle "Vertex data") But I have seen others saying floating point is better..
7
The best option to multi platform 2d mobile development we are in the process of porting a game from iphone(made with cocos2s) to android(using the andEngine), and it has been a pain to do. So for our next project (a 2d game) we are thinking about using some multiplatform engine framework. For now we are thinking about testing both unity, marmaled(former airplay sdk) and cocos2d x. Do you have any opinion about this? Does someon have experience developing 2d games using Unity?
7
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
7
How do I handle user input with good class structure architecture for an Android game? How do I handle user input having quot good quot class structure and following normal game architecture ?(see below). At first I didn't think this question was Android specific, although, after seeing a great response in C I would appreciate some insight on this question using Android architecture. Current way I handle input for my Android Game Created controller class that takes X,Y screen events and X,Y character position and returns an int that represents a direction the character should move. Call the controller method in the game's update. Send that direction value to my character update. Character's update calls move (which is also passed this value). Basic switch statement determines the direction my character moves. Getters and setters for the position of the character.(should I have them for this direction also) Is there a better way of handling input? This doesn't feel like the best way. Where does input fit in with class structure and game architecture? I'm going to accept the C answer but I would really like to see a Java answer for Android in the future. D
7
sharing preferences between two apps on android with libgdx I am making an android game with both a demo version and a paid version. I want users who decide to buy the paid version to continue from where they left off, with all their old data and settings. I've set a shared user id between both applications, and now I'm wondering if it's possible to use libgdx preferences across both versions. I am also open to other ideas on how to implement this.
7
'No Platforms Found' error in Unity Android I am having a problem with Unity Android every time I try to "build", a 'No Platforms Found' error pops up. Thing is that I already have Android SDK in my computer (copied it into my G drive from the official .zip download). JDK is installed too. I use Unity 4.0.0f7 Pro version, and have SDK Platforms 2.1 (API 7), 2.2 (API 8), 2.3.3 (API 10), 3.0 (API 11), 3.1 (API 12), 3.2 (API 13), 4.0 (API 14), 4.0.3 (API 15) and 4.2.2 (API 17). How can I remove this error and build successfully? P.S. I have already had a look at some of the threads in Unity website regarding this matter. None of the suggested answers has worked for me.
7
Using orientation sensor data for Android game I'm building a game where a green box floats to different parts of the screen. The user must rotate their phone such that the blue dot intersects the green square. This is different from a standard "roll a ball" type game because instead of tilting a 3D surface the ball sits on, the ball always returns to the center point when the phone is held straight. Tilting the phone forward naturally moves the ball up to catch squares that are above its center position, tilting the phone backward moves the ball down to catch squares below it, and same for tilting the phone left and right. The phone has freedom to pitch, roll, and yaw (XYZ). I'm using the Android SensorEvent and the Sensor.TYPE ROTATION VECTOR to try and accomplish this. So far, this is our approach. On game start, measure the quaternion returned from the sensor, call it Q1 On all timesteps after game start, compute the transform between Q1 and Qi, Qi being any other quaternion. Apply the resulting transformation matrix to the 2D dot on the screen such that it translates appropriately. I'm stuck on computing a transform between Q1 and an arbitrary Qi. I'm asking here to see how similar games solve this problem, and if our approach is even correct given the types of sensor data coming from Android. Figure1 The bottom two pictures of the phone are side views. The top two pictures are a representation of what's on the screen
7
How can I access bitmaps created in another activity? I am currently loading my game bitmaps when the user presses 'start' in my animated splash screen activity (the first launch activity) and the app progresses from my this activity to the main game activity, This is causing choppy animation in the splashscreen while it loads creates the bitmaps for the new activity. I've been told that I should load all my bitmaps in one go at the very beginning. However, I can't work out how to do this could anyone please point me in the right direction? I have 2 activities, a splash screen and the main game. Each consist of a class that extends activity and a class that extends SurfaceView (with an inner class for the rendering logic updating). So, for example at the moment I am creating my bitmaps in the constructor of my SurfaceView class like so public class OptionsScreen extends SurfaceView implements SurfaceHolder.Callback Create variables here public OptionsScreen(Context context) Create bitmaps here public void intialise() This method is called from onCreate() of corresponding application context Create scaled bitmaps here (from bitmaps previously created)
7
Google Leaderboards, Reducing the Score of a Player I am making a strategy game similar to chess for Android. I'll be using the Google Leaderboards for rankings. I want to implement a sort of ranking system, that the player can actually lose score, similar to the one in www.chess.com. But, from the docs of submitScore() "The score is ignored if it is worse than a previously submitted score for the same player." I don't understand how can I implement such a system with Google Leaderboards.. sorry if I'm missing something obvious here.
7
Relative and absolute position with sprites in libgdx In libgdx, can i add a sprite as children of another an set it with the relative coordinates of the father and not the stage? Like in HTML when you add controls they are relative to its parent, but here i want it with sprites, i add the children in a Group class but the coordinates are absolute (relative to the stage)
7
Betatesting an android game. Best practices? Our game is in our final stage prior to be released. I would like at this stage to add some beta testers to let them hunt bugs, etc... Is there any good platform site to achieve this? I have noticed there's a site called betalizer but they still are in beta. Could anyone suggest how to find beta testers for a little medium size android game without spending a lot of bucks or any platform that could help on it? Thanks in advance.
7
My game is mostly complete, how do I find a publisher? I've been working for quite a while on a game. I'm mostly done with it. Simply finishing the project, adding banners and just publishing it on google play appstore probably won't bring in any money, at least without firstly investing some in promotion... How do I go about finding companies that might be interested in either promoting or maybe even fully buying out such a product?
7
Are frequent game updates a solution for preventing multiplayer cheating? I'm creating a game on Android where the enforcement of rules can only take place on client side (I can't shift it to server side...think aimbotting but in my case I wouldn't even be able to use heuristics to detect it!). As I've read many times, the client side is impossible to 100 protect from modification hacking. I am going to include protections such as ProGuard obfuscation. But also I'm going to use a formula in the code which encrypts data from the client. Hackers cheaters can decompile the code and locate this formula eventually. But how long will it take for them to uncover the encryption formula? A day, a week? Actually, how long in general does it take for a game to be modded for cheating? Can I release updates to my game so that by the time hackers release modded versions of my app to public, they become obsolete? If I did release updates, I wouldn't require updates for single player mode, but only when they tried to do multiplayer would a message display telling them they must update. I just really want to make multiplayer fair and not scare off players because they face opponents with uber awesome hax.
7
Tips on how to notify a user of new features in your game I have noticed a problem when releasing new features for a game that I wrote for Android and published on Google Play Store. Because my game is "stage based" and not a game like Hay Day, for example, where users will just go into the game every day since it can't really be finished my users are not aware of new features that I release for the game. For example, if I publish a new version of my game and it contains a couple new stages, most of their devices will just auto update the game and they don't even notice this and think to check out what's new. So this is why an approach like popping open a dialog that showcases the new feature(s) when they open the game for the first time after the update was done is not really sufficient. I am looking for some tips on an approach that will draw my users back into the game and then they could read more detail about new features on such a dialog. I was thinking of something like a notification that tells them to check out the new features after an update is done but I am not sure if this is a good idea. Any suggestions to help me solve this problem would be awesome.
7
TurnBasedGame with libGDX Google Play Services I'm trying to write a small card game for Android using libgdx framework. My game is turn based. I wrote to interface with the necessary methods to access the API interface from Google. I faced the problem after I called Games.TurnBasedMultiplayer.createMatch(gameHelper.getApiClient(), tbmc) I got the result of the callback. If initiateMatchResult.getMatch().getData() is null I am initiating games data, and here's the PROBLEM I don't know how to go back in GameScreen??? This is piece of code in AndroidLauncher Games.TurnBasedMultiplayer .createMatch(gameHelper.getApiClient(), tbmc) .setResultCallback(new ResultCallback lt TurnBasedMultiplayer.InitiateMatchResult gt () Override public void onResult( NonNull TurnBasedMultiplayer.InitiateMatchResult initiateMatchResult) if (!initiateMatchResult.getStatus().isSuccess()) gameHelper.showFailureDialog() return TurnBasedMatch match initiateMatchResult.getMatch() if (match.getData() ! null) Log.d("MyLogs", "match not null") initGame() myGame.setScreen(myGame) ) If just call myGame.setScreen(new GameScreen(myGame)) is the GameScreen displaying is not correct. In GameScreen I have table and images in this table and the images displaying is not correct!!! This code of my GameScreen public class GameScreen implements Screen final MyGame myGame private Stage stage private Table table private Image card1, card2, card3, card4, card5, card6 public GameScreen(MyGame myGame) this.myGame myGame stage new Stage() Gdx.input.setInputProcessor(stage) card1 new Image(new Texture(Gdx.files.internal("1.png"))) card2 new Image(new Texture(Gdx.files.internal("2.png"))) card3 new Image(new Texture(Gdx.files.internal("3.png"))) card4 new Image(new Texture(Gdx.files.internal("4.png"))) card5 new Image(new Texture(Gdx.files.internal("5.png"))) card6 new Image(new Texture(Gdx.files.internal("6.png"))) table new Table() table.setFillParent(true) table.setDebug(true) table.add(card1).width(140).height(202).padLeft(15).padRight(15).padBottom(10) table.add(card2).width(140).height(202).padBottom(10) table.add(card3).width(140).height(202).padLeft(15).padRight(15).padBottom(10).row() table.add(card4).width(140).height(202).padLeft(15).padRight(15) table.add(card5).width(140).height(202) table.add(card6).width(140).height(202).padLeft(15).padRight(15).row() stage.addActor(table) Override public void show() Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) stage.act(delta) stage.draw() Override public void resize(int width, int height) Override public void pause() Override public void resume() Override public void hide() Override public void dispose() stage.dispose() mySkin.dispose() dixit.getScreen().dispose() SCREENSHOT BELOW this screenshot shows how to display images in my table Tell me what my mistake and what am I doing wrong? Can anyone advise how best to do otherwise??
7
Is libgdx fit for 2D game development on Android or are there simpler alternatives? I'm looking for a Java framework to develop 2D games on desktop and Android. I've looked at Slick and I really like the API, however the developer himself says if you want a framework for Android and desktop best go with libgdx atm. Now I'm reading up on libgdx, but I'm wondering if there are simpler alternatives for just doing 2D sprite stuff on Android and desktop. I'm only interested in creating NES like graphics, nothing too fancy. Something like this. Because on the wiki of libgdx it says you can't use the OrtographicCamera with OpenGL ES 2.0 (http code.google.com p libgdx wiki OrthographicCamera), but I read (http www.badlogicgames.com wordpress ?p 504) when your device supports OpenGL ES 2.0 it doesn't support 1.0, so you can't effectively use OrtographicCamera on OpenGL ES 2.0 devices? I'm confused, should I go with libgdx? Are there simpler alternatives?
7
How to increase the acceleration of an object on the Y axis? So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling. When the character is falling I have a line of code as such position.y 7f How can I change my implementation such that the character falls faster over time?
7
Continous horizontal animation of objects We have to continously animate objects from right to left in a panel. The player has to pop the first object. If the first object could not be destroyed by the player and it reaches the left border of the panel, the game is over We have experimented by implementing this using Android widgets. The panel is a HorizontalScrollView and the objects are ImageViews placed in a LinearLayout. The HSV is continously scrolled using ObjectAnimators and when the first object is popped by the player, a new object is added to the LinerLayout. This solution has some problems the LinearLayout gets infinitely big, adding new objects to our model and layouting them causes small hiccups and the animator speed is changable through the Android developer options which makes implementing high score pointless. What would be a "standard" solution for games with an infinite animation where constant animation speed and good performance are critical? Is using native widgets possible with these requirements or should we throw everything away and use a Canvas?
7
Need a good quality bitmap rotation algorithm for Android I am creating a kaleidoscopic effect on an android tablet. I am using the code below to rotate a slice of an image, but as you can see in the image when rotating a bitmap 60 degrees it distorts it quite a lot (red rectangles) it is smudging the image! I have set dither and anti alias flags but it does not help much. I think it is just not a very sophisticated bitmap rotation algorithm. canvas.save() canvas.rotate(angle, screenW 2, screenH 2) canvas.drawBitmap(picSlice, screenW 2, screenH 2, pOutput) canvas.restore() So I wonder if you can help me find a better way to rotate a bitmap. It does not have to be fast, because I intend to use a high quality rotation only when I want to save the screen to the SD card I would redraw the screen in memory before saving. Do you know any comprehensible or replicable algorithm for bitmap rotation that I could programme or use as a library? Or any other suggestion? EDIT The answers below made me think if Android OS had bilinear or bicubic interpolation option and after some search I found that it does have its own version of it called FilterBitmap. After applying it to my paint pOutput.setFilterBitmap(true) I get much better result
7
Should I render all of my HUD views to a single SurfaceView? I'm using a SurfaceView and canvas to implement a game HUD, title screens etc., by overlaying standard Android view widgets over my SurfaceView. This works reasonably well and maintains an acceptable frame rate, but it is a simple game with little happening on or off screen. I have handlers flinging messages around and runOnUiThreads everywhere. Quite cumbersome. Can I draw all my views to the one SurfaceView, controlled by the main game thread? Is there an advantage to this?
7
How does an Input Pipeline work? I found this article on implementing an input pipeline for Android, but I don't really understand how it works. I also don't completely understand the programming concept of a pipeline or a pool either. Could someone explain these concepts and how they work as this input pipeline?
7
Multiple inputs for Google Cardboard on iOS and Android? So far I am having a problem with having only a singular input mechanism (the magnetic trigger) for Google Cardboard games. Are there any other options to augment this in order to have at least two or three input "buttons" or triggers for a Cardboard app or are we stuck with one?
7
Fixed background on a SurfaceView I'm currently working on a top down twin stick shooter for Android. I've got my player moving around and shooting, but I'm looking to add a large Bitmap background which is larger than the device screen. I'm looking for a way to position the background at 0,0 in 'world' co ordinates, and have the view able to pan across the background with the player. I've tried using SurfaceHolder.Callbacks, but these do not seem to play nicely with my SurfaceView class. The view currently follows the player while keeping it centred, until it reaches an edge, where it will stop and the player will continue until he hits a wall. My current thoughts are to store an offset from view co ordinates to world co ordinates in the update loop, and draw the bitmap using these offsets in the draw loop. Is there a more efficient way to do this, or a different way to think about it?
7
Sounds make Andengine Scene junky I have a GameScene which has a character (animated sprite), AutoParallaxBackground background with quite large textures and no more than 3 other items attached to the scene at a time, previous 3 items are dispose() ed accordingly, background music and item sounds. Background music is instantiated with MusicFactory, Sounds are played on SoundPool. In between switching these scene we are loading resources asynchronously, reading the streams and instantiation is done in AsyncTask and the loading textures to the hardware is done on UpdateThread GLThread. If I turn off the background music, this starts to happen totally random. I'm experiencing scene junking on at first flow MenuScene 1st Stage (GameScene). After a while lag does not happen, rather than occasionally or random. Junk is happening when aforementioned 3 items are attached on the Scene and a sound is played along, note that background music is playing at the same time. Detaching previous 3 items is "optimized" to reduce GC calling almost perfectly. When the lag occurs GC EXPLICIT is showed in the logcat. What I have tried Playing the sounds and music on different thread, IntentService, dedicated Service. Reduced calls to mScene.detachChild(child) and other scene methods to avoid iterations over children of the scene. Detaching IEntitys with matcher to avoid iteration. Inspected sound files' integrity with ffmpeg for possible errors Could .dispose(), unloading the textures from hardware or detachChild() causing this junk? Could be marked object for GC from the async tasks be causing this? What else could be contributing to this issue?
7
What game engines can publish to Android and iOS? I am about to start on a project which, at a minimum, will release to Android and iOS. Are there any game engines, other than Unity, which can publish to both? I fear that Unity might contain more overhead then we need, for what is essentially a 2D game.
7
Rotation of bitmap using a frame by frame animation I have one large bitmap that has four frames drawn on it and I only draw one at a time by looping through the bitmap by increments to animate walking. I can get the bitmap to rotate correctly when it is not moving but once the animation starts it starts to cut off alot of the image and sometimes becomes very fuzzy. I have tried public void draw(Canvas canvas,int pointerX, int pointerY) Matrix m if (setRotation) canvas.save() m new Matrix() m.reset() spriteWidth and spriteHeight are for just the current frame showed m.setTranslate(spriteWidth 2, spriteHeight 2) get and set rotation for ninja based off of joystick m.preRotate((float) GameControls.getRotation()) create the rotated bitmap flipedSprite Bitmap.createBitmap(bitmap , 0, 0,bitmap.getWidth(),bitmap.getHeight() , m, true) set new bitmap to rotated ninja setBitmap(flipedSprite) canvas.restore() Log.d("Ninja View", "angle of rotation " (float) GameControls.getRotation()) setRotation false And then the Draw Method here create the destination rectangle for the ninjas current animation frame pointerX and pointerY are from the joystick moving the ninja around destRect new Rect(pointerX, pointerY, pointerX spriteWidth, pointerY spriteHeight) canvas.drawBitmap(bitmap, getSourceRect(), destRect, null) The animation is four frames long and gets incremented by 66 (the size of one of the frames on the bitmap) for every frame and then back to 0 at the end of the loop.
7
Animate Using setScale() I want to animate my player from bigger size to smaller size and then smaller size to bigger size continuously. We can use setScale() method to re size any sprite but is there any way to animate with it? And one more thing, if I scale any sprite after creating it's physics body, the sprite is visually scaled but the physics body does not scaled. So is there any optimum solution to animate the physics body from bigger to smaller and then smaller to bigger?
7
Problem with drawing textures in OpenGL ES I'm developing a 2D game for Android and i'm using the framework which has been told in the book which named Beginning Android Games by Mario Zechner.So my framework is well designed and using OpenGL 1.1.It's similar to libgdx. When i put my textures adjacent each other in my 2d surface,there are some spaces size as 1 px.But this problem only occur on my tablet.There aren't a problem like this on my phone.It's like in this picture What can be the problem?I can't fix it from one week.
7
2D physics performance on iPhone Android using Unity 3D? I've been looking into making 2D games with Unity. One thing which concerns me is the performance of the physics engine. Since Unity is a 3D game engine I'm going to have to assume it uses a 3D physics engine. Obviously I can turn this 3D engine into a 2D one by locking off various axis such that objects only move physically in 2D space. However this worries me, for example Box2D being a specialized 2D physics engine is optimized for 2D. Would the physics in Unity3D be fast enough to say, duplicate the sorts of physics we see in games like Angry Birds on a handheld device?
7
How to know if an actor is touched in libgdx? I am using "Gdx.input.isTouched()" in the render method of my Screen method, to know where is touched, but when the touch is dragged in the screen, it also activates the events i want only when an actor is touched. Is there any listener to know when an Actor is touched, but the event is not the dragged one, im doing it with sprites.
7
Resolution Independence in libGDX How do I make my libGDX game resolution density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game just a bunch of sprites displayed on screen, and some text for menus (options menu primarily). What I want to know is how do I make my sprites fonts resolution independent? (I have wrapped them in my own classes to make things easier.) Since it's a simple kids game, I don't need to worry about the "playable area" of the game I want to use as much of the screen space as possible. What I'm doing right now, which seems super incorrect, is to simply create images suitable for large resolutions, and then scale down (or rarely, up) to fit the screen size. This seems to work okay (in the desktop version), even with linear mapping on my textures, but the smaller resolutions look ugly. Also, this seems to fly in the face of Android's "device independent pixels" (DPs). Or maybe I'm missing something and libGDX already takes care of this somehow? What's the best way to tackle this? I found this link is this a good way of solving the problem? http www.dandeliongamestudio.com 2011 09 12 android fragmentation density independent pixel dip It mentions how to control the images, but it doesn't mention how to specify font image sizes regardless of density.
7
What causes "ETC1 cannot be resolved" errors when building AndEngine? I just got the latest AndEngine code from Mercurial, added Android 1.6 to my Order Export tab, and cleaned everything (including a "Fix" command as instructed by the console). Regardless of which version of Android I specify in my project settings (1.5, 1.6, 2.2, 3.2), I get around 523 compilation errors. The most unique I can see is ETC1 cannot be resolved, accounting for 5 out of 105 errors I can see. The other 100 are all some variation of The method ... must override a superclass method. What am I missing? I installed the JDK, Eclipse classic, SDK manager, and everything in the SDK.
7
Flick Gesture in Unity3D Android I'm trying to create a football game where the user will make a flick gesture in order to kick the ball. I'm quite new to developing games in unity3d, I have successfully made a moving ball, added some rotation, gravity and some basic input (the ball follows the touch coordinates). How can I achieve the flick gesture?
7
How do I check for collision between an ellipse and a rectangle? I am working on LibGdx framework for developing a 2D isometric tower defense game.All my sprites are drawn in 2D isometric view. I have used an array list to store 8 points at boundary in the rectangle.LibGdx has an inbuilt function (returns Boolean) ellipse.contains(x,y),by iterating through array list I can check whether any points are inside ellipse But the problem is as shown in below picture,it wont detect the enemies in some particular cases So my question is 1)Is this a correct approach for solving these kinds of problems 2)If not can you suggest better approach for solving this problem Thank you.
7
Game Loop, Deltas. What is wrong? For my Android app this is the gameloop public void run() while(true) if(frames 0) cTime System.currentTimeMillis() if(System.currentTimeMillis() gt lastUpdate 5) if(gameState PLAYING) updatePhisic() updateSprites() this.postInvalidate() lastUpdate System.currentTimeMillis() try Thread.sleep(sleeptime) catch(InterruptedException e) if(System.currentTimeMillis() gt cTime 1000) frameRate frames frames 0 else frames Please consider this should work for multiple devices. Testing in some devices My phone 180 FPS A Smaller phone 200 FPS A Tablet 120 FPS I'm trying to put it at 60 FPS but the player moves so slow, I don't know how to calculate the Delta for player. I mean that at 180 FPS in my phone works fine, that is the speed that I want. But at 120 FPS in a tablet freezes a bit. I think that painting the screen 60 times in a second would be enough. And this freezes sometimes if(System.currentTimeMillis() gt lastUpdate 5) This does not try Thread.sleep(sleeptime) catch(InterruptedException e) Why?
7
How to change from 60FPS to 30FPS while keeping things smooth? Here is my current game loop final int ticksPerSecond 60 final int skipTicks (1000 ticksPerSecond) float dt 1f ticksPerSecond while(System.currentTimeMillis() gt nextGameTick amp amp loops lt maxFrameskip) updateLogic() nextGameTick skipTicks timeCorrection (1000d ticksPerSecond) 1 nextGameTick timeCorrection timeCorrection 1 loops On most devices I've tested my game on (this is an Android game BTW) it runs quite nice. As you can see, I'm using a fixed time step (defined as my ticks per second). If I reduce my Ticks Per Second to 30, everything runs at the same speed but is nowhere near as smooth. I keep hearing people say that 30fps should be OK for mobile games and everything should run great at 30 fps, but that's just not my experience. Would be grateful if someone could give me some pointers on how to achieve this.
7
Sounds and buttons show up in simulator, not in an Android device I'm a noob in android game development, started with corona sdk and outlaw. My project runs just fine with the corona simulator on my win8, however, when building it to my android device (galaxy s3) and running it it behaves differently than in the simulator First thing in my project I have wav sound files that work just fine in the corona simulator, but on my android device the sound files do not play (I use the audio.play api). Second thing I have 2 buttons created with the widget.newButton api, which are displayed on a lua screen. The buttons do show in the simulator, but are not shown on the android app. Any help will be appreciated!
7
SAT collision detection and stacking objects I'm working on a small game for Android which deals with some simple physics, including the need to stack objects on top of one another without jitter. This infamous "stacking collisions" issue with custom collision physics engines really has me on the ropes with this project. To highlight the issue I'm gonna go through a basic rundown of my gameloop and the order in which this engine computes the various steps. For example, lets say we have 3 objects in this scene. 2 boxes and a ground floor. The update loop is as follows Apply external and internal forces to each object (including gravity, any movement from input, etc.). Use a collision tree to separate the various game objects into potential collision pairs (this is working just fine). Run a collision detection algorithm on each pair to get a contact manifold for each collision that occurs this frame. My project is using SAT and its been working very well. Sort the list of contact manifolds to order collisions by time of occurance. Loop through the ordered manifolds and solve each collision as necessary. Update each object's position in the world with the results of the collision correction and render. When dealing with one pair of objects in isolation, this works great. But when you add a 3rd object to the simulation and stack them on top of each other the resulting simultaneous collisions result in visible jitter as the objects are pushed in and out of each other due to the many manifolds they have to deal with. In my example the static ground remains stationary but the bottom box jitters in and out of the ground slightly as the top box pushes down on it due to gravity. Adding an iteration loop around steps 3, 4 and 5 helps stabilize the objects since they rerun the collision checks and get more accurate values, but to make the collisions perfectly stable I need a very high number of iterations (exponential amounts the larger the stack of objects), which kills the framerate of the game. I'm not looking for any complete code, but some theories on how this stacking issue should be avoided would be fantastic. I'm just unsure where to take this logic wise anymore, but I feel like anyone taking the custom physics engine route has probably seen similar issues.
7
Android OpenGL detect slow GPU I have app for Android with OpenGL. It uses GPU heavy effects and on "slow" GPUs this leads to low FPS. Is there a way, how to detect "slow" GPU during app start and disable those effects and generate low poly geometry? By "slow" I mean GPUs based on their frequncy, VRAM and info like this. Lower values mean slower GPU. It is quite "easy" way, but it should be enough. I cannot do it in runtime based on frame time, because it would require reload of geometry, shaders etc. and it would be inconvinient for user.
7
Yet another libGDX resolution independance question I am developping a Android smartphone game in LibGDX, and I am encountering issues about resolution managing. Most notably, I have no clue how to handle that in LibGDX. For now, I am developping based on my Nexus 5 screen, but it will certainly not (down)scale well to devices with lower density screens. On the web, most data are about LibGDX lt 1.0.0 and is totally irrelevant. The few things I have found talks about the Viewport classes, but it is poorly explained the game is either horribly stretch or way too small on high definition devices. At this point, I have understood that I need to define a "virtual screen" of some unit (lets say meters) and then place my elements based on this unit. But there is no fragment of clue on how to do that the right way in LibGDX when using Scene2D, for example, buttons are totally misshaped, with letters out of the box, buttons clearly overstretched and such, or ultra small based on the Viewport class used. In the same way, using multiple asset size is not clear how to load them based on pixel density, how to force them to be there at the good size ? Etc... This stuff can make anyone crazy at start. What I want to know is is there somewhere some good, updated to recent libGDX, demos, examples or tutorial to the proper way to handle resolution, screen ratio and such in recent libGDX ? The libGDX viewport example, while a good start, are still unclear to me, and don't show the multiple asset size thing. Thanks for any help, it is highly needed.
7
Populating NPC's Outside Of Loop This was my original question Populating Sprites I used the following code to spawn Enemy Sprites in my game. I have 2 types that I was using and it would display one then remove it and display the other. It did this repeatedly(Imagine someone playing with a light switch and you have what is happening with the NPCs. EnemyType1 is Off and EnemyType2 is On.).Also It does not apply the current level number meaning, it does not spawn the number of enemies for the level. The number of enemies I want to spawn is the exact number of the level. I used other types of random methods( nextBoolean(), nextInt(), nextFloat() ). I showed the code to my friend and he told me that I would need to spawn them outside of my loop, but he did not know how to. So now I am trying to see if anyone on stack could help me. What I am trying to do is this NPC's Enemies I have 2 types of NPC's that I want to use. The number of Enemies that are spawned are equal to the the current level number. I want to be able to spawn how ever many is needed for that level and have it to where which Enemy that will spawn is random, so you don't know if you will get EnemyType1 or EnemyType2 or a Mix. Ex Level 1, only 1 Enemy spawns, the type is random. Level 2, only 2 Enemies spawn, the type is random. Level 3, only 3 enemies spawn, the type is random. etc. Thanks In Advance.
7
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?
7
Any open source game engines for Android? Is there any open source android gaming engine ?
7
Android development in Unreal with an existing project I am currently using an Unreal 3 project that has been targeted for multiple devices. Originally, it was targeted for iOS and now I want to try and build it for Android. The project is capable of doing it and I am in the process of testing it. I think I have everything I need in order to build it and launch it for an android device that I have set up and connected to my PC and is recognized by the Android SDK ABD. I am currently trying to build and launch the game through the Unreal Frontend but when I try, I am getting stuck at getting the Unreal Frontend to find my Android device as a platform to debug, like it would with a PC, Xbox360, or PS3. Right now, I am just trying to launch the game to see if I can get it to simply run on an Android device, I'm going to worry about the packaging later. So I have two questions Am I on the right track in looking at the Unreal Frontend to cook and launch the project on Android or should I look somewhere else? How do I get Unreal to recognize my Android device as a platform to launch on? I would even settle for recognizing an emulator, but that seems even harder.
7
How could I access game data from a dev machine at runtime from a mobile platform? When working on a game on a mobile platform, having read write access to game data (assets, configuration files) stored on the dev machine at runtime would enable building of tools to quickly iterate, debug, and analyze the game at runtime. For iOS amp Android, is there any way to have access to these data files from the dev machine while the game is running on the mobile device? Please do not recommend a tool, or a 3rd party engine that does this.
7
Cannot draw around the screen after zooming out with LibGDX projection coordinate I've just started developing game in android using LibGDX. I've follow some samples and now my simple game can draw path when user move their finger around the screen. now problems appear when i add another feature to allow user to pinch zoom in and out. after zooming OUT the orthographic camera user can still draw the path BUT the path can no longer follow user finger to the edge of the screen, the user can only draw the path around the center of the screen. looks like the coordinate projection after zoom out not changed and still limited to the projection before zoom out! how can i make my game to keep drawing line around the entire screen even after the user have zooming out the camera? here's my code nbsp nbsp nbsp 1. in my Screen implemented class Override public void render(float arg0) Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1) Gdx.gl.glClear(GL20.GL COLOR BUFFER BIT) Gdx.gl.glEnable(GL20.GL BLEND) Gdx.gl.glBlendFunc(GL20.GL SRC ALPHA, GL20.GL ONE MINUS SRC ALPHA) renderer.render() Override public boolean touchDragged(int screenX, int screenY, int pointer) TODO Auto generated method stub isDrawing true Vector2 v new Vector2(screenX, Gdx.graphics.getHeight() screenY) add new point for drawing path inputPoints.insert(v) return true nbsp nbsp nbsp 2. in my Renderer class cam new OrthographicCamera() cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()) this.cam.update() public void setZoom(float zoom) this.cam.zoom zoom this.cam.update() the triangle strip renderer path new PathClass() public void render() cam.update() batch.setProjectionMatrix(cam.combined) generate the triangle strip from our path Array lt Vector2 gt xox screen.path() path.update(xox) the vertex color for tinting, i.e. for opacity path.color Color.WHITE render the triangles to the screen path.draw(cam) nbsp nbsp nbsp 3. on my PathClass public void draw(Camera cam) if (tristrip.size lt 0) return gl20.begin(cam.combined, GL20.GL TRIANGLE STRIP) for (int i 0 i lt tristrip.size i ) if (i batchSize) gl20.end() gl20.begin(cam.combined, GL20.GL TRIANGLE STRIP) Vector2 point tristrip.get(i) gl20.color(color.r, color.g, color.b, color.a) gl20.vertex(point.x, point.y, 0f) gl20.end()
7
Displaying and updating score in Android (OpenGL ES 2) I'm using a FrameLayout where I have a GLSurfaceView at the bottom and a few Views on top of it. One of those Views is a TextView that displays the current score. Here's how I'm updating the score TextView based on what happens in my game loop whenever an event happens that increases the score, I call activity.runOnUiThread(updater), where activity is the activity that has the above FrameLayout (my main game activity) and updater is just a Runnable that increments the score. From my understanding, using runOnUiThread() from the OpenGL thread is standard practice otherwise you'll get an exception, I can't remember its name. The problem is that there's a very noticeable lag between the event and the score update. For example the character gets a coin, but the coin count is not updated quickly. I tried summing all the score events from my game loop and calling runOnUiThread() only once per loop, but it doesn't seem to make much of a difference the lag is still noticeable. How can I improve my design to avoid this lag?
7
Cocos 2D putting things on the cocos thread or not? We are using Cocos 2D for Android and are unsure if it's a good thing to execute our non ui tasks on the Cocos thread as a way to get the animations in our game to pause. What is the recommended practice?
7
How would I generate random falling objects I'm creating a game using libgdx on Eclipse that is similar to Ragdoll Avalanche. I'm looking for a way to generate falling objects like the triangles of Ragdoll Avalanche. All I know that i have to use an array but i dont know how to do it.
7
How do I make a background fill the whole screen in Libgdx? I'm using this code to set a 800x420 image to be full screen public void show() float w Gdx.graphics.getWidth() float h Gdx.graphics.getHeight() camera new OrthographicCamera(1, h w) batch new SpriteBatch() texture new Texture(Gdx.files.internal("images splashatlas splashatlas1.png")) texture.setFilter(TextureFilter.Linear, TextureFilter.Linear) TextureRegion region new TextureRegion(texture, 0, 0, 800, 420) sprite new Sprite(region) sprite.setSize(0.9f, 0.9f sprite.getHeight() sprite.getWidth() ) sprite.setOrigin(sprite.getWidth() 2, sprite.getHeight() 2) sprite.setPosition( sprite.getWidth() 2, sprite.getHeight() 2) public void render(float delta) Gdx.gl.glClearColor( 1f, 1f, 1f, 1f ) Gdx.gl.glClear( GL20.GL COLOR BUFFER BIT ) batch.setProjectionMatrix(camera.combined) batch.begin() sprite.draw(batch) batch.end() But on real device it looks like this I tried to setSize with different parameters sprite.setSize(1.0f, 1.0f ) Now it's fullscreen, but it's really stretched What is the way to set a background to be full screen? I want it to look like this
7
Ground for 2D AndEngine game with physics I am using AndEngine to create a 2D Game for Android platform using Java and AndEngine. I have learned how to use Tiled editor to create tiled maps. The only problem I am having is that I don't know how to place an object such as a character on the ground, and have it count as the ground. How do I go about doing this or what is the best way to do this?
7
What are the specifications for 3D animated game assets on the Android platform? (apologies if this is phrased vaguely due to my lack of knowledge I'm happy to change the question entirely if someone can suggest a more realistic query) I'm getting a grip on creating 3D characters in Lightwave, Maya, Blender, etc. My goal is to focus on creating creature amp character animations specifically for games. I thought it would be a good exercise to make a few critters with a specific scope. As a non programmer (I've written a few scripts, but I really don't have a passion to code) can you point me in the right direction to find some guidelines? (I have a programmer handy who will write the code, but I want to be able to give him assets that are as usable as possible) I assume that Android games are intended to run on limited hardware maybe there's a polycount I should shoot for, or a particular memory limit? The resources I've found so far all seem to be helpful to developers haven't found much oriented in my direction
7
2D Rendering with OpenGL ES 2.0 on Android (matrices not working) So I'm trying to render two moving quads, each at different locations. My shaders are as simple as possible (vertices are only transformed by the modelview projection matrix, there's only one color). Whenever I try and render something, I only end up with slivers of color! I've only done work with 3D rendering in OpenGL before so I'm having issues with 2D stuff. Here's my basic rendering loop, simplified a bit (I'm using the Matrix manipulation methods provided by android.opengl.Matrix and program is a custom class I created that just calls GLES20.glUniformMatrix4fv()) Matrix.orthoM(projection, 0, 0, windowWidth, 0, windowHeight, 1, 1) program.setUniformMatrix4f("Projection", projection) At this point, I render the quads (this is repeated for each quad) Matrix.setIdentityM(modelview, 0) Matrix.translateM(modelview, 0, quadX, quadY, 0) program.setUniformMatrix4f("ModelView", modelview) quad.render() calls glDrawArrays and all I see is a sliver of the color each quad is! I'm at my wits end here, I've tried everything I can think of and I'm at the point where I'm screaming at my computer and tossing phones across the room. Anybody got any pointers? Am I using ortho wrong? I'm 100 sure I'm rendering everything at a Z value of 0. I tried using frustumM instead of orthoM, which made it so that I could see the quads but they would get totally skewed whenever they got moved, which makes sense if I correctly understand the way frustum works (it's more for 3D rendering, anyway). If it makes any difference, I defined my viewport with GLES20.glViewport(0, 0, windowWidth, windowHeight) Where windowWidth and windowHeight are the same values that are pased to orthoM It might be worth noting that the android.opengl.Matrix methods take in an offset as the second parameter so that multiple matrices can be shoved into one array, so that'w what the first 0 is for For reference, here's my vertex shader code uniform mat4 ModelView uniform mat4 Projection attribute vec4 vPosition void main() mat4 mvp Projection ModelView gl Position vPosition mvp I tried swapping Projection ModelView with ModelView Projection but now I just get some really funky looking shapes...
7
How to implement a Trail using Cocos2dx I'd like to implement a trail (like the white circles in Angry Birds) that chase my sprite. I already used CCMotionStreak, but the trail texture is "stretched" instead. Anyone has an idea how to make this?
7
ADMOB Why my match rate never increase? I have a game deployed in the store, here are some app and admob metrics It makes 120k requests per day It have 800 active devices in the last 30 days It have less than 1 match rate( 0.3 ) Some math 120k 0.8k(800) gt 150 requests per user(really high I think) I have read some articles and questions about this, what I did was Make sure to only request an ad when it needs to be displayed, I can't always ensure this, but I tried my best. Make sure my app are not enrolled in the 'Designed for Families' program. Make sure my ad content rating is for mature audiences(M). All this was done last week, since then I have seen not a single change in the admob reports, everything stills the same, after changing the request rate I should have seen a decrease in the ad requests, it didn't happened, of course I'll wait more since only 400 active devices were updated with this new version(although I think it should have been reflected in the statistics already). It is really frustrating, feels like I have no control over this, is there other reasons for admob to have low match rate? can someone help me here? Thanks all in advance.
7
Android development in Unreal with an existing project I am currently using an Unreal 3 project that has been targeted for multiple devices. Originally, it was targeted for iOS and now I want to try and build it for Android. The project is capable of doing it and I am in the process of testing it. I think I have everything I need in order to build it and launch it for an android device that I have set up and connected to my PC and is recognized by the Android SDK ABD. I am currently trying to build and launch the game through the Unreal Frontend but when I try, I am getting stuck at getting the Unreal Frontend to find my Android device as a platform to debug, like it would with a PC, Xbox360, or PS3. Right now, I am just trying to launch the game to see if I can get it to simply run on an Android device, I'm going to worry about the packaging later. So I have two questions Am I on the right track in looking at the Unreal Frontend to cook and launch the project on Android or should I look somewhere else? How do I get Unreal to recognize my Android device as a platform to launch on? I would even settle for recognizing an emulator, but that seems even harder.
7
Transparency in GLSurfaceView I'm new in game development. I have a view using GLSurfaceview and call in MainActivity. I want to make transparent that view. I have tried setZOrderOnTop() method in MainActivity and glClearColor() but both are not working. public class RubikActivity extends Activity cubeView cv GLSurfaceView gv SuppressLint("NewApi") Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState) setContentView(R.layout.activity) cv (cubeView) findViewById(R.id.cubeView) cv.initialize(PreferenceManager.getDefaultSharedPreferences(this)) cv.requestFocus() cv.setFocusableInTouchMode(true) cv.setEGLConfigChooser(8, 8, 8, 8, 8,0) cv.setRenderer( new CubeRenderer(getApplicationContext(), font, mWorld, rCube, mMenu, prefs) cv.getHolder().setFormat(PixelFormat.TRANSLUCENT) cv.setZOrderOnTop(true) cubeView.java public cubeView(Context context, AttributeSet attrs) super(context, attrs) font new TextureFont(getContext(), R.drawable.roboto regular, "roboto regular dims.txt") mWorld new GLWorld() public void initialize(SharedPreferences prefs) rCube new Rubec(mWorld, prefs.getInt("dim", 3)) mMenu new CubeMenu(rCube, font) renderer new CubeRenderer(getContext(), font, mWorld, rCube, mMenu, prefs) rCube.setRenderer( renderer) mWorld.setRubeCube(rCube) setRenderer( renderer) getHolder().setFormat(PixelFormat.TRANSLUCENT) setZOrderOnTop(true) cubeRenderer.java Override public void onDrawFrame(GL10 g) GL11 gl (GL11)g surfaceSetup(gl) gl.glClearColor(1.0f, 1.0f, 1.0f,0) gl.glClear(GL11.GL COLOR BUFFER BIT GL11.GL DEPTH BUFFER BIT) gl.glDisable(GL11.GL DEPTH TEST) gl.glMatrixMode(GL11.GL MODELVIEW) gl.glShadeModel(GL11.GL SMOOTH) gl.glLoadIdentity() GLU.gluLookAt(gl, 0f, 0f, 7f, 0f, 0f, 0f, 0f, 1f, 0f) gl.glGetFloatv(GL11.GL MODELVIEW MATRIX, modelViewMatrix, 0) if(!worldBoundsSet) getWorldBounds() gl.glColor4f(0.5f, 0.5f, 0.5f, 1) gl.glEnable(GL11.GL DEPTH TEST) gl.glEnableClientState(GL11.GL COLOR ARRAY) gl.glEnableClientState(GL11.GL VERTEX ARRAY) gl.glEnableClientState(GL11.GL TEXTURE COORD ARRAY) menu.draw(gl) mWorld.draw(gl) gl.glDisableClientState(GL11.GL TEXTURE COORD ARRAY) gl.glDisableClientState(GL11.GL COLOR ARRAY) gl.glDisableClientState(GL11.GL VERTEX ARRAY) gl.glFlush() I want the white color to show as transparent background in my layout. I am already use glClearColor(0,0,0,0) which shows as a black color and already use in xml file lt com.rtpl.rubikgame.cubeView android id " id cubeView1" android layout width "match parent" android layout height "match parent" android layout weight "1" android background " 000000" android windowIsTranslucent "true" gt lt LinearLayout gt but nothing happened when we use glClearColor(0,0,0,0) it shows this
7
Pass a single boolean from an Android App to a libgdx game I'm writing an Android application that needs to pass a single boolean into an Android game that I am also writing. The idea is that the user does something in the App which will affect how the game operates. This is tricky with LIBGDX since I need to get the bool value into the Java files of the game, but of course, you can't call Android specific things from within LIBGDX's main Java files. I tried using an intent but of course the same problem persists. I can get the boolean into the MainActivity.Java of the android output of the game, but can't pass it along any further since the android output and the main java files don't know about each other. I have seen a few tutorials that explain how to use set up an interface in the LIBGDX java files that can call android things. This seems like wild overkill for what I want to do. I've been trying to use Android's Shared Preferences with LIBGDX's Gdx.app.getPreferences, but I can't make it work. Anyhelp would be MUCH appreciated. I've set up two hello world applications. One is a standard Android app, with a single button that is supposed to write "true" into the shared preferences. The other is a standard LIBGDX hello world that is supposed to do nothing but check that bool when launched and if true display one image to the screen, if false, display a different one. Here's the relevant bit of the Android code import android.preference.PreferenceManager public void onClick(View view) if (view this.boolButton) final String PREF FILE NAME "myBool" SharedPreferences preferences getSharedPreferences(PREF FILE NAME, MODE WORLD WRITEABLE) SharedPreferences.Editor editor preferences.edit() editor.putBoolean("myBool", true) editor.commit() And here's the relevant bit of the code from the LIBGDX main file Preferences prefs Gdx.app.getPreferences("myBool") boolean switcher prefs.getBoolean("myBool") if(switcher true) texture new Texture(Gdx.files.internal("data worked512.png")) prefs.putBoolean("myBool", false) else texture new Texture(Gdx.files.internal("data libgdx.png")) Everything compiles fine, it just doesn't work. I've spent HOURS googling trying to find a way to pass this single boolean from android into a LIBGDX main and I'm totally stumped. Thanks for your help.
7
AABB Collision Detection Why does the simple broadphase algorithm work better? Hi I am working on barrier detection. I used this swept aabb algorithm http www.gamedev.net page resources technical game programming swept aabb collision detection and response r3084. It suggests two ways to detect collision. 1. broadphase this is a shorter algorithm which can only detect non collision 100 . 2. In order to make sure that there is a collision, the more detailed swept aabb algorithm has to be executed right after the broadphase one. Strangely the broadphase algorithm alone detects a barrier collision each and every time and the more precise one actually doesn't at all times. What I do in my code is basically the following My object moves towards the barrier with a constand speed vx direction speed delta (that's the amount it moves each frame). So positionx positionx (direction speed delta) each frame. The broadphase collision is calculated each frame by using vx and vy. Are there some rare cases where the broadphase can actually detect a collision like in this one I described? Thanks so much for your help Thanks so much
7
Is copying UI and layout of other apps legal? I would like to develop an Android App for Google Play and I am going to use Facebook and Whatsapp UI as background of the game (as a back story). I will use icons without copyright to emulate duplicate the style of Facebook and Whatsapp (they are not part of original drawable of the external app). I will inform the user about the objective of the game. I won't include any direct references to the emulated apps such as the title "Facebook" or "Messenger". The user is free to interpret what he is seeing. I will add the text "any name and reference is fictitious". However I have some great doubts After the development, will I be able to upload the app on an app store such as Google Play? Is copying UI and layout of other external apps legal? Does it break any law or rule?
7
How to implement a game launch counter in LibGDX I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working public class MainStarter extends Game private int count Override public void create() Set up the application AppSettings.setUp() if(SettingsManager.isFirstLaunch()) SettingsManager.createTextFileInLocalStorage("gamedata") SettingsManager.writeLine("gamedata", "Launched " count ,FileType.LOCAL FILE ) else SettingsManager.writeLine("gamedata", "Not First launch " count ,FileType.LOCAL FILE ) Load assets before setting the screen Assets.loadAll() Set the tests screen setScreen(new MainMenuScreen(this, "Main Menu")) What is the proper way to do this?
7
Will I have copyright issues making a mobile game based on an anime? I have been wanting to create a mobile game based on some of my favorite anime. I want to know if using character images and names from those anime (even after giving full copyright credits and disclaimer) infringes any copyrights? Would this come under "fair use" in the DMCA (I mean there are already so many not so legal sites using this "fair use" to continue running). What are the possible things I can do for making this game? I have seen many online browser games based on anime which use images and elements from that anime, while I have also seen many games advertise themselves based on a anime but just use diffrent names for characters of that anime (sometimes modifying the character images, too).
7
How to move gameobject with touch on Android I'm trying to make a game where you control a character via touch on Android devices. The player will have two degrees of movement. When you touch the touch screen and move your finger, the game object should move to your finger's location and follow your finger as you move it. Here is an example of what I'm trying to do http www.youtube.com watch?v OoqRC8QptzM t 01m01s ( 1 02). I already know I need to use Input.touches. I've tried using Transform.translate and Vector3.Lerp, neither gave me the results I wanted. Here is some of the code I've tried using pragma strict var speed float 1 function Start () function Update () if (Input.touchCount gt 0 amp amp Input.GetTouch(0).phase TouchPhase.Moved) Get movement of the finger since last frame var touchDeltaPosition Vector2 Input.GetTouch(0).deltaPosition var touchPosition Vector3 touchPosition.Set(touchDeltaPosition.x, transform.position.y, touchDeltaPosition.y) Move object across XY plane transform.position Vector3.Lerp(transform.position, touchPosition, Time.deltaTime speed)
7
Score won't save to Android in Game Maker Studio 1.4 I have oController as the first object to run when the game is opened. In oController's Game Start event I have the following code ini open(working directory quot SavedScores.ini quot ) var highscores ini read real( quot Highscores quot , quot Score quot , 0) ini close() global.LastScore highscores When the player has gotten their score, I use this code to save it if global.gameOver if global.LastScore 0 global.LastScore global.currentScore ini open(working directory quot SavedScores.ini quot ) ini write real( quot Highscores quot , quot Score quot , global.LastScore) ini close() else if global.currentScore gt global.LastScore global.LastScore global.currentScore ini open(working directory quot SavedScores.ini quot ) ini write real( quot Highscores quot , quot Score quot , global.LastScore) ini close() Whenever I relaunch the game on my phone, it won't load the score I got when I previously launched the game. Idk why it's not saving?
7
Thread runs faster on a faster processor... how to control Thread speed I have a thread that uses TimeUnit.MILLISECONDS.sleep(5) Problem is when I load my app on a faster phone say with a snapdragon, it runs at lightning speed. Is there a way to control this speed so processor speed is not an attributing factor? Thanks!
7
How can i get object from TMXTiledMap and store it in Dictionary variable ? I've been following a tutorial to make tiled map in cocos2d x 3.0 , but i couldnt complete the rest of the tutorial because its for coco2d x 2.0 version, How can i get a value of property that is stored in an object from TMXObjectGroup variable ? and my code is tileMap cocos2d TMXTiledMap create("ground.tmx") ground tileMap gt layerNamed("ground") this gt addChild(tileMap) TMXObjectGroup objects tileMap gt getObjectGroup("objects") ??? sign objects gt getObject("sign") it return ValueMap not Dictionary ?! how can i get a Dictionary of that object so i can get its values ??
7
Can I publish the games I learnt from tutorials and modified as per my style of game play? I am new to the world of making games and all. Well its been a few months or so. There are many tutorials that I have been watching. On the way, I made a few games that I saw and made. I am not asking about those. In fact I don't want to publish those games in my name ever. But then there are some small games that I made which are modified version from what I learnt of those games. Like I changed the game play style, made it simpler and ignored some features from a game. Can I publish them in play store? Or this would be any break of law or something? or Something that I should not do?
7
Project updates don't show up on mobile device I've made a small application with libgdx framework, which works perfectly on desktop. It runs on Android too, however once I change something in my main project and try to recompile it on my phone, it seems like the Android still runs the old version. I've tried to re install the app, but it does not help. The only way I can see the changes on my phone is to recreate a different Android project. Any ideas what might be causing this kind of behavior? My projects are created the way it is shown here http code.google.com p libgdx wiki ProjectSetup EDIT Not sure why, but everything seems to work fine after "re installing" Eclipse
7
LibGDX RPG walking animation I've been trying to nail down a walking animation with libGDX. I'm making an RPG with the character that can move up, down, left, and right. I have this movement in a spritesheet. I've been following a youtube tutorial called Java Tiled Map Game which can be found here http www.youtube.com watch?v qik60F5I6J4 He does a better job then some of explaining what the code does but he glosses over the part where he gets his character to do a walking animation (by which I mean he doesn't show it at all). I then moved to the tutorial found here http obviam.net index.php getting started in android game development with libgdx tutorial part 2 animation But this tutorial tells exactly what needs to be done in regular words and then just gives a block of code. I already know what I need to do in regular words but I'm not trying to learn english but programming which is a completely different language. I'm sure I could copy and paste that code and edit it to do what I need but I wouldn't understand HOW it works only THAT it works. I want to know the how of it all. I'm new to libGDX and this is my first RPG game. I really want learn how to do it myself instead of relying on others. My question is simply this Do you know of a tutorial which shows and (more importantly) explains how to do a simple walking animation? I'm hoping you can supply one for me.
7
Technique to have screen independent grid based puzzle with sprite animation let's say I have a fixed size grid puzzle game (8 x 10). I will be using sprites animation, when the "pieces" in the puzzle is moving from one grid to another grid. I was wondering, what is the technique to have this game being implemented as screen resolution independent. Here is what I plan to do. 1) The data structure coordinate will be represented using double, with 1.0 as max value. Puzzle grid of 8 x 10 Environment double width 0.8 double height 1.0 Location of Sprite at coordinate (1, 1) Sprite double posX 0.1 double posY 0.1 double width 0.1 double height 0.1 scale PYSICAL SCREEN SIZE drawBitmap ( sprite image, sprite image rect, new Rect(sprite.posX Scale, sprite.posY Scale, (sprite.posX sprite.width) Scale, (sprite.posY sprite.Height) Scale), paint ) 2) A large size sprite image will be used (128x128). As sprite image shall look fine if we scale from large size down to small size, but not vice versa. Besides the above mentioned technique, is there any other consideration I had missed out?
7
how to render small texture on another texture? can anybody help me to render small texture on another texture. i.e I have one background image, when user touches on the screen it should draw small(circle or any object) on it. can anybody suggest me good tutorial to starts with it?
7
Android LibGDX 1.9.6 Augmented Reality captured images are black Using LibGDX for an AR application and capturing image and merging lines and texts on LibGDX with image with this code. private Pixmap merge2Pixmaps(Pixmap mainPixmap, Pixmap overlayedPixmap) merge to data and Gdx screen shot but fix Aspect Ratio issues between the screen and the camera Pixmap.setFilter(Filter.BiLinear) float mainPixmapAR (float) mainPixmap.getWidth() mainPixmap.getHeight() float overlayedPixmapAR (float) overlayedPixmap.getWidth() overlayedPixmap.getHeight() if (overlayedPixmapAR lt mainPixmapAR) int overlayNewWidth (int) (((float) mainPixmap.getHeight() overlayedPixmap.getHeight()) overlayedPixmap.getWidth()) int overlayStartX (mainPixmap.getWidth() overlayNewWidth) 2 Overlaying pixmaps mainPixmap.drawPixmap(overlayedPixmap, 0, 0, overlayedPixmap.getWidth(), overlayedPixmap.getHeight(), overlayStartX, 0, overlayNewWidth, mainPixmap.getHeight()) else int overlayNewHeight (int) (((float) mainPixmap.getWidth() overlayedPixmap.getWidth()) overlayedPixmap.getHeight()) int overlayStartY (mainPixmap.getHeight() overlayNewHeight) 2 Overlaying pixmaps mainPixmap.drawPixmap(overlayedPixmap, 0, 0, overlayedPixmap.getWidth(), overlayedPixmap.getHeight(), 0, overlayStartY, mainPixmap.getWidth(), overlayNewHeight) return mainPixmap In 1.9.6 Pixmap.setFilter(Filter.BiLinear) is not available and it does not merge 2 pixmaps correctly. I tried setting BiLinear filter for both pixmaps or one at a time but none works.
7
Advantages and disadvantages of libgdx I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. So I would like to use it if there is no big obstacle. But when I tried to see how many developers employ this library, I could find not that many. Is there anything wrong with this library? In other words, I would like to know its advantages or disadvantages from any experienced developer. UPDATE After reviewing its documentations and trying to build simple games with libgdx, I decided to go with it as its documentations are good enough and its community is very active. What I liked the most is that it provides a bunch of demo games that I can learn a lot from.
7
How to change modify or animate an existing OpenGL object on Android? I maybe know understand it all a little bit better so i thoug i make a new shorter question to eventually get an answer. Get back or delete an existing OpenGL object, then change it and draw at new. How? So if and Admin reads this post, he can feel free to delete it. 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. I allready came this far But now i want to animate things. My mind told me that it shoud be possible to change or modify an existing OpenGL object. In my situation there are 3 opjekts Body Eyes Mouth For example her is my code from the mouth public class GLMouth private int points 1000 private float vertices 0.0f,0.0f,0.0f private FloatBuffer vertBuff private FloatBuffer vertBuff2 public GLMouth() vertices new float points 2 for(int i 0 i lt (points 3) i 3) double rad (Math.PI i) points vertices i (float)Math.cos(rad) vertices i 1 (float)Math.sin(rad) vertices i 2 0 ByteBuffer bBuff ByteBuffer.allocateDirect(vertices.length 4) bBuff.order(ByteOrder.nativeOrder()) vertBuff bBuff.asFloatBuffer() vertBuff.put(vertices) vertBuff.position(0) vertices new float points 2 for(int i 0 i lt (points 3) i 3) double rad (Math.PI i) points vertices i (float)Math.cos(rad) vertices i 1 (float)Math.sin(rad) vertices i 2 0 bBuff ByteBuffer.allocateDirect(vertices.length 4) bBuff.order(ByteOrder.nativeOrder()) vertBuff2 bBuff.asFloatBuffer() vertBuff2.put(vertices) vertBuff2.position(0) public void draw(GL10 gl) gl.glPushMatrix() gl.glTranslatef(0.0f, 1.0f, 0.0f) gl.glScalef(1.8f, 0.15f, 1.0f) 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(0.0f, 1.0f, 0.0f) gl.glScalef(1.8f, 1.0f, 1.0f) gl.glColor4f(0.0f,0.0f,0.0f, 1.0f) gl.glVertexPointer(3, GL10.GL FLOAT, 0, vertBuff2) gl.glEnableClientState(GL10.GL VERTEX ARRAY) gl.glDrawArrays(GL10.GL TRIANGLE FAN, 0, points 2) gl.glDisableClientState(GL10.GL VERTEX ARRAY) gl.glPopMatrix() In my renderer i just creat a mouth object and then draw it with mouth.draw. So i thought i have allready drawn the mouth and now i can cange for example the gl.glScalef(1.8f, 0.15f, 1.0f) from that existing mouth to zero with some time in between to let it look like the mouth is closing. But how can i do that? I don't find anything with google, mostly because i don't know what i have to look up. If i understand OpenGL right, than it will just draw new mouths over the original. edit Or it is a question about where is the opjekt? Can i save it an take it back (delete it etc) and draw it new with other properties.
7
geometry shader shim for opengl es 2.0 I just have a few months of OpenGL experience, just starting to get the hang of it. I find geometry vertex fragment shaders to be very powerful. You have a few parameters that translates into a complex representation. One layer of your program can compute these parameters, the "model" only, and sharers can do the "view" part. That gives you a good separation of concerns and a lot of flexibility. It's a pity that OpenGL ES 2 doesn't have geometry shaders. I think the CPU could totally take over this part in case the GPU doesn't support it and if proper shim libraries were present. Is there any library that helps unfolding a model into vertexes vertex attribute parameters uniques, etc? Maybe one that uses the language of the geometry shaders?
7
Android opengles how to use glunproject How to use glunproject in my android app? I have the following parts in my engine A projection matrix A view matrix for the camera A model matrix for each of the objects in my world. This matrix is calculated from the parent objects model matrix and the objects own model matrix. These matrices are calculated from a translation, rotation and scale matrix. (this all works fine) These matrices are then multiplied and passed to my vertex shader. Now I understand glunproject needs the model matrix and the projection matrix and can caluclate a near and far 3d coordinate depending on the camera viewport settings ( for the near and far plane) Do I need to use glunproject for each of the objects in my world and then check if the ray produced by these near and far coords intersects my object? This seems quite expensive on the cpu? What is the proper use for glunproject
7
How does interpolation actually work to smooth out an object's movement? I've asked a few similar questions over the past 8 months or so with no real joy, so I am going make the question more general. I have an Android game which is OpenGL ES 2.0. within it I have the following Game Loop My loop works on a fixed time step principle (dt 1 ticksPerSecond) loops 0 while(System.currentTimeMillis() gt nextGameTick amp amp loops lt maxFrameskip) updateLogic(dt) nextGameTick skipTicks timeCorrection (1000d ticksPerSecond) 1 nextGameTick timeCorrection timeCorrection 1 loops render() My intergration works like this sprite.posX sprite.xVel dt sprite.posXDrawAt sprite.posX width Now, everything works pretty much as I would like. I can specify that I would like an object to move across a certain distance (screen width say) in 2.5 seconds and it will do just that. Also because of the frame skipping that I allow in my game loop, I can do this on pretty much any device and it will always take 2.5 seconds. Problem However, the problem is that when a render frame skips, the graphic stutter. It's extremely annoying. If I remove the ability to skip frames, then everything is smooth as you like, but will run at different speeds on different devices. So it's not an option. I'm still not sure why the frame skips, but I would like to point out that this is Nothing to do with poor performance, I've taken the code right back to 1 tiny sprite and no logic (apart from the logic required to move the sprite) and I still get skipped frames. And this is on a Google Nexus 10 tablet (and as mentioned above, I need frame skipping to keep the speed consistent across devices anyway). So, the only other option I have is to use interpolation (or extrapolation), I've read every article there is out there but none have really helped me to understand how it works and all of my attempted implementations have failed. Using one method I was able to get things moving smoothly but it was unworkable because it messed up my collision. I can foresee the same issue with any similar method because the interpolation is passed to (and acted upon within) the rendering method at render time. So if Collision corrects position (character now standing right next to wall), then the renderer can alter it's position and draw it in the wall. So I'm really confused. People have said that you should never alter an object's position from within the rendering method, but all of the examples online show this. So I'm asking for a push in the right direction, please do not link to the popular game loop articles (deWitters, Fix your timestep, etc) as I've read these multiple times. I'm not asking anyone to write my code for me. Just explain please in simple terms how Interpolation actually works with some examples. I will then go and try to integrate any ideas into my code and will ask more specific questions if need be further down the line. (I'm sure this is a problem many people struggle with). edit Some additional information variables used in game loop. private long nextGameTick System.currentTimeMillis() loop counter private int loops Amount of frames that we will allow app to skip before logic is affected private final int maxFrameskip 5 Game updates per second final int ticksPerSecond 60 Amount of time each update should take private final int skipTicks (1000 ticksPerSecond) float dt 1f ticksPerSecond private double timeCorrection
7
LibGDX I need to get from SpriteBatch to Batch in order to draw a Touchpad I have created a little game using LibGDX and it uses a SpriteBatch when it renders the game objects. Now I want to add a Touchpad to it, and the draw method of Touchpad takes a Batch as a parameter, but my game uses SpriteBatch. What can I do?
7
Overdrawn pixels vs many polygons, which affects performance the most? I know that having overdrawn pixels is not desirable as well as having many polygons since they can decrease performance. Often when I model I have an option to decrease the number of polygons by having disconnected polygons over. For example, considering this Let's imagine it has more turns that are not visible in this picture. I can decrease the number of polygons by having a pathway as a single disconnected face As a result I would have less poly count, but the bottom geometry would be overdrawn in many areas. Or I can model this as a single continuous mesh. As a result I would have more poly count, but no overdraw I very often have similar situations and I'm wondering which of these would be more performance efficient and cause less performance decrease on mobile devices?
7
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.
7
Libgdx Animation Timing I'm having a small issue with libgdx animation. I'm using getKeyFrame() to get the current frame of the animation and I'm updating the state time by adding on deltaTime in my update function for the object. The animation is not looping. My problem is that the animation seems to play at different speeds depending on the frame rate. On my phone this animation plays particularly slow. My thinking was that the stateTime would cause it to skip a few frames when it's going slow, but this doesn't seem to be happening. Here is the code sprite Animation.getKeyFrame(stateTime, false) sprite.setRotation(angle) sprite.setPosition(position.x, position.y) sprite.draw(batch) Has anyone else experience this issue.
7
Resize the Texture Region (parallax background) to fit my screen size in libgdx I am using libgdx to make a running game. I am using vertical parallax background. I have successfully implemented parallax background many times. But for this game, I want my Texture region to fit my screen size. I tried several things but the texture region is streched badly.Here is a screenshot. I used this code texture bg loadTexture("data road1.png") bg new TextureRegion(texture bg, 0,0, 600, 600) that is obvious. Now ..what should I do... so that while making it as a parallax background... it would fit my screen... I am worried only about the width.... as if the width will fit the screen width... it will look like a running road... no matter how long the height is. I found some solution here https stackoverflow.com questions 7551669 libgdx spritebatch render to texture but not able to understand.. it seems somewhat complex. Please make it clear if it is the solution or suggest on other possibilties.
7
Unity Android Truecolor texture performance hit and alternatives for truecolor After integrating the graphics assets to my application, I noticed that when the textures are compressed they look very bad compared to truecolor. This happens to all the textures and it did not seem to help changing the texture type to GUI nor did it help to switch the 32 bit display buffering on. Does using truecolor textures make the application much heavier to run? Or does it just increase the size of the .APK? Are there alternatives to getting a good texture quality and a smaller texture size instead of using truecolor? EDIT I did some experiments with the dithering. I created a textures in GIMP 2.8, one which was RGB and one which was indexed with 255 colours and Floyd Steinberg dithering with reduced colour bleeding. In the Windows Explorer this looked promising, the image quality had hardly been reduced but the size was halved. But when they were imported to Unity, they were exactly the same size. And trying out different formats, there was not much noticeable difference between the image quality. Although the banding was a little bit less pronounced but still clearly seen. EDIT 2 I played around with the importing settings. And the only conclusion I can come up with is Don't use alpha! Without the alpha channel, there is no banding with the ETC compression which is supported by all OpenGL ES 2.0 GPUs. To have an alpha channel and no banding. I had to go all the way to RGBA 32 bit, which increased the texture file size to 64Kb compared to the no alpha channel ETC's 8Kb. Here again not much difference between the GIMP dithered and the RGB versions. So conclusion with this Dithering in GIMP did next to nothing.
7
Amazon FreeTime Unlimited Monetization So I've recently noticed how great FreeTime Unlimited is for my daughter. There's no ads, no in app purchases, etc. She can just play the games apps and I don't have to worry about it. As a develop I thinking it could an interesting avenue to go down, but there's a few things that I for the life of me can't get Amazon support forums to answer in any logical manner. So the idea according to their information is that the apps are highly scrutinized to verify they are child friendly content, which is excellent. Also, you can't use webviews, ads, or in app purchases. My question is How do devs monetize these applications? Clearly they're not just giving away their work for free? The only logical answer I can guess at, is that it uses the Amazon Underground scheme of earning based on the amount of time the user spends in the app game?? Does anyone have and actual experience or information on this? As I said, I've reached out to multiple people at Amazon, and keep getting the runaround with all of them pointing me to the same useless link.
7
How to implement a Play As Guest feature on a mobile device using PhoneGap? I have a Facebook Web Game that I converted to Android and iOS using PhoneGap. I can use Facebook for authentication on my mobile apps, but I would also like to allow the user to play as a guest. I've seen various games implement this workflow before and I'm curious how it is actually done. What unique identifier is the phone sending to the server to authenticate against? Does each phone have something unique about it that PhoneGap can expose via a plugin? Does anyone know the logic behind the "Play As Guest" feature many mobile games implement? Thanks!
7
Best way to manage sprite sheets on Android using NME I'm creating a 2D game for mobile touchscreen devices, specifically Android and iOS. I would like to know what is the best way (regarding performance and best practices) to manage sprite sheets. Should I create different sprite sheets (for ldpi, mdpi and hdpi) and then scale according depending on the screen resolution or there is a better solution?. I know that maybe the solution that someone could provide me would be platform independant but I'm using the NME framework (http www.nme.io ), perhaps you know a good solution using this framework.
7
GLES2.0 3D Android game performance and multi threading the update? I have profiled my mixed Java C Android game and I got the following result As you can see, the pink think is a C functions that updates the game. It does things like updating the logic but it mostly it generates a "request list" for rendering. The thing is, I generate DrawLists on C and then send them to Java to process and draw using GLES2.0. Since then I was able to improve update from 9ms down to about 7ms, but I would like to ask if I would benefit from multi threading the update? As I understand from that diagram is that the function that takes the most time is the one you see it's color on the timeline. So the pink area is taken mostly by update. The other area has MainOpenGL.Handle as it's main contributor(whch is my java function), but since it's not drawn to the top of the diagram I can conclude other things are happening at the same time that use the CPU? Or even GPU stuff that isn't shown in this diagram. I am not sure how the GPU works on this. Does it calculate stuff in parallel to the CPU? Or is it part of the CPU usage as in SoC? I am not sure. Anyway, in case GPU things DO happen in parallel to CPU, then I would guess that if I do this C Update in parallel to the thread that makes the OpenGL calls, I might make use of "dead CPU time" due to GPU stalling or maybe have the GPU calls getting processed earlier because it won't have to wait for Update to finish? How do you suggest to improve performance based on that?
7
Concerns about Google Play Games security I want to develop a Android game using LibGDX. Let's take a classic example some player can battle another one in turn based matches. The outcome of match defines the reward in some ingame currency. There will be premium currency with in app purchases, and both can be used to purchase some upgrades. I am discovering both Android and GPG at this point. GPG allows some P2P turn battles, matchmaking and cloud saves, making it looks like quite the thing I need. However, I have concerns regarding its security. The currencies needs, for obvious reasons here, to be fully secure, non corruptable by altering saves on the device. In the same way, it is my understanding that the turn based (and real time) matches are P2P, between devices. My question is, what GPGS does to enforce security on both (cloud) saves and P2P matches ? Will I need to use some backend server for this case ? And if yes, how can I authenticate a player logged in GPG on this backend server ? Thanks for any clues about that.
7
Porting to Android...what is the equivalent of Properties.Settings.Default? I'm porting my MonoGame OpenGL app to Android. My game uses Properties.Settings.Default to store user preferences. What is the equivalent of this in Android?
7
Advantages and disadvantages of libgdx I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. So I would like to use it if there is no big obstacle. But when I tried to see how many developers employ this library, I could find not that many. Is there anything wrong with this library? In other words, I would like to know its advantages or disadvantages from any experienced developer. UPDATE After reviewing its documentations and trying to build simple games with libgdx, I decided to go with it as its documentations are good enough and its community is very active. What I liked the most is that it provides a bunch of demo games that I can learn a lot from.
7
Android Jump Run Random map generation I'm pretty new to game development but I work on an android app. It's a 2D Jump and Run game. I do it in Eclipse and the map is readed out of a txt file right now. But I want to do a Jump and run game, where the player must jump over holes in the ground. Theses holes should be created randomly. So I want an infinite map, which is created randomly. Can somebody give me tips how to begin with this? How can I do a randomly generated map? I don't want the full code or something else, just a little tip how to start because I don't know how I can do this randomly generating. Thanks in advance! Hope u know, what I mean!
7
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?
7
How would I make an air hockey AI? I am making an air hockey game for Android using AndEngine and its Box2D extension. How would I make an AI for an air hockey game? For it to work the AI would not only need to move its paddle side to side to defend but also move forward for an attack. What kind of code would I need to implement this?
7
HaxeFlixel, Font gets fuzzy android upscale I made a simple game for android with a small native resolution (320x480). When text gets upscaled it loses its sharpness. Tried having anti aliasing on and off and both results were fuzzy. The size of the text is 16 (read that with some fonts the size should be dividable by 8). Also tried different fonts, but had the same result. Any solutions to that?
7
Android Some textures not loading after resuming twice This is an odd one. When I press home and then restart my game I reload all my textures (checking glIsTexture on the id's first). If I do this once, all textures load as expected, but if I do it twice or more one of my textures doesn't load (the texture is white). I have checked glGetError and there are no errors (assuming GLES10.glGetError() is the correct way to do this) Do I need to do any tidying up when home is pressed? I currently call myGlView.onPause() and myGlView.onResume() when the onPause Resume activity events are triggered. I was under the impression that's all that's needed. Is there anything else (perhaps non openGL) that needs to be cleaned up? Perhaps I'm hitting a limit of some kind I am also using the NDK for some physics and rendering functions if that is relevant, but all resources are loaded using java.