[android-developers] Re: Game development car acceleration sound
First of all you could sample a variety of real car acceleration sounds and play them back on acceleration. You need to have that in tune with the time it takes until your game car is at full speed. Let's assume it takes 8 seconds from a total halt to full speed. You need an acceleration sound of that length. If your game car slows down and accelerates again, you need to calculate the correct playback start position within your acceleration sound file based on the current speed. Alternatively you can just dynamically pitch up / down an engine sound loop according to the current speed. Changing pitch can be easily done by changing the playback speed / rate. However, these looped sounds tend to sound a bit artificial. On Tuesday, July 10, 2012 3:57:22 PM UTC-5, Tim wrote: > > Hey all, > It is no problem for me to play "constant" engine sounds but have someone > of you an idea how I can manage accelerations sounds (i.e. car)? > I have no idea how I can create those. > > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Game Development
I do what they describe here: http://developer.android.com/guide/topics/graphics/index.html in the "On a View: section... Maybe I should try debugging with Hiearchy Viewer http://developer.android.com/guide/developing/tools/hierarchy-viewer.html K On Jul 6, 11:31 am, android_interest wrote: > Maxood, > > I could post the source code but at this time i'm at a different > location, so I don't have access. > > I am already using the onDraw of View. Subclassed a View and onDraw I > draw the bitmap with canvas.drawBitmap(bitmap, locX, locY, > bitmapPaint); > > It worked fine when I created 1 bitmap as a private of my subclassed > view class (i.e. ClassX extends View { . private Bitmap > characterBitmap = ... } ). > > All that changed is I created a Factory of Character types, gave > Character its own private Bitmap attribute and I load it before the > onDraw of the View executes. > > Anything that I could verify, verify the bitmap loaded (i inspected it > with eclipse debug mode, looked fine), any reason why a bitmap would > not load, other than obvious (specifying the right R.drawable.id, or > something else) ? > > Karl > > p.s. I have this book too, but thanks for pointing it out. :) > > On Jul 6, 3:39 am, Maxood wrote: > > > Did you try using this method here: > > > @Override > > protected void onDraw(Canvas canvas) > > { > > super.dispatchDraw(canvas); > > paint(canvas); > > } > > > For more information download the source code of this book > > here:http://www.apress.com/book/downloadfile/4504 > > > Thanks, > > Maxood > > >http://www.maxood-android-corner.blogspot.com/ > > > On Jul 5, 9:13 pm, android_interest wrote: > > > > Hello, > > > I have following example code: > > > > > > > Character c = > > > CharacterFactory.getCharacter(CharacterEnum.SpecialCharacter); > > > //factory has applicationContext reference to get bitmaps from R. > > > ... > > > Paint bitmapPaint = new Paint(); > > > ... > > > > View::onDraw(Canvas canvas) > > > ... > > > canvas.drawBitmap(c.bitmap(), 0, 0, bitmapPaint); > > > ... > > > > For some reason (must be something simple) I do not see the bitmaps at > > > the 0,0 of the canvas. > > > > Inspecting the bitmap and etc does not show anything obvious (nulls), > > > I must have missed something... > > > > Is there something I should be paying particular attention to while > > > drawing bitmaps? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Game Development
Maxood, I could post the source code but at this time i'm at a different location, so I don't have access. I am already using the onDraw of View. Subclassed a View and onDraw I draw the bitmap with canvas.drawBitmap(bitmap, locX, locY, bitmapPaint); It worked fine when I created 1 bitmap as a private of my subclassed view class (i.e. ClassX extends View { . private Bitmap characterBitmap = ... } ). All that changed is I created a Factory of Character types, gave Character its own private Bitmap attribute and I load it before the onDraw of the View executes. Anything that I could verify, verify the bitmap loaded (i inspected it with eclipse debug mode, looked fine), any reason why a bitmap would not load, other than obvious (specifying the right R.drawable.id, or something else) ? Karl p.s. I have this book too, but thanks for pointing it out. :) On Jul 6, 3:39 am, Maxood wrote: > Did you try using this method here: > > @Override > protected void onDraw(Canvas canvas) > { > super.dispatchDraw(canvas); > paint(canvas); > } > > For more information download the source code of this book > here:http://www.apress.com/book/downloadfile/4504 > > Thanks, > Maxood > > http://www.maxood-android-corner.blogspot.com/ > > On Jul 5, 9:13 pm, android_interest wrote: > > > Hello, > > I have following example code: > > > > > Character c = > > CharacterFactory.getCharacter(CharacterEnum.SpecialCharacter); > > //factory has applicationContext reference to get bitmaps from R. > > ... > > Paint bitmapPaint = new Paint(); > > ... > > > View::onDraw(Canvas canvas) > > ... > > canvas.drawBitmap(c.bitmap(), 0, 0, bitmapPaint); > > ... > > > For some reason (must be something simple) I do not see the bitmaps at > > the 0,0 of the canvas. > > > Inspecting the bitmap and etc does not show anything obvious (nulls), > > I must have missed something... > > > Is there something I should be paying particular attention to while > > drawing bitmaps? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Game Development
Did you try using this method here: @Override protected void onDraw(Canvas canvas) { super.dispatchDraw(canvas); paint(canvas); } For more information download the source code of this book here: http://www.apress.com/book/downloadfile/4504 Thanks, Maxood http://www.maxood-android-corner.blogspot.com/ On Jul 5, 9:13 pm, android_interest wrote: > Hello, > I have following example code: > > > Character c = > CharacterFactory.getCharacter(CharacterEnum.SpecialCharacter); > //factory has applicationContext reference to get bitmaps from R. > ... > Paint bitmapPaint = new Paint(); > ... > > View::onDraw(Canvas canvas) > ... > canvas.drawBitmap(c.bitmap(), 0, 0, bitmapPaint); > ... > > For some reason (must be something simple) I do not see the bitmaps at > the 0,0 of the canvas. > > Inspecting the bitmap and etc does not show anything obvious (nulls), > I must have missed something... > > Is there something I should be paying particular attention to while > drawing bitmaps? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Game Development
Can you please post the complete code. Do you want to draw the bitmap in your onCreate method? Thank you On Jul 5, 9:13 pm, android_interest wrote: > Hello, > I have following example code: > > > Character c = > CharacterFactory.getCharacter(CharacterEnum.SpecialCharacter); > //factory has applicationContext reference to get bitmaps from R. > ... > Paint bitmapPaint = new Paint(); > ... > > View::onDraw(Canvas canvas) > ... > canvas.drawBitmap(c.bitmap(), 0, 0, bitmapPaint); > ... > > For some reason (must be something simple) I do not see the bitmaps at > the 0,0 of the canvas. > > Inspecting the bitmap and etc does not show anything obvious (nulls), > I must have missed something... > > Is there something I should be paying particular attention to while > drawing bitmaps? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Game Development
Multithreaded games for Android should, ideally, just issue worker threads for things such as path finding, raycasting and precaching data. Items that can take longer than a single frame to process. Separating the logic further than that (rendering vs thinking/physics) usually doesn't have a very good return on investment on a small platform. Using GLSurfaceView will separate your rendering and UI elements for you. I do my think and render in GLSurfaceView.Renderer.onDrawFrame() and toss out my resource loading into threads. The only alternative I have played with is to always render a frame behind. Have the think routine build a buffer for the next render and have the render draw the last buffer it received at the same time as the next think. Either thread would block (wait patiently) until the other thread has caught up. I had some trouble with input delays but that can be overcome, it just wasn't necessary for my project. The biggest concern overall is the garbage collector. It can break anything you create if you allocate even one new object per frame. I've had it freeze my game for 1 second every 2 seconds. In summary though, check out the GLSurfaceView in the ApiDemos. For fully animated 2D or 3D, stick with OpenGL ES. On May 28, 5:38 pm, Robert Green wrote: > It's an intro for those wanting to start game development. I haven't > done anything in this area but getting in to effective distribution of > work across multiple cores is so far beyond what someone asking, "How > do I write a game?", can handle that I wouldn't think to start talking > about it. > > If someone is at the point where they have a good game but are only > 50% utilizing the device because of single threading, they won't need > to read an intro. They'll be looking for more advanced stuff. If you > want to see how much more complicated life gets when considering > concurrency for work in an environment which really needs to act > sequential to make sense, read this: > http://www.gamedev.net/community/forums/topic.asp?topic_id=483040 > > Life in the game engine gets very complicated when trying to manage > work being done by multiple threads. It is a total art to get it just > right and it's certainly not something that anyone working on their > first game would want to mess with. I talked to a few guys at EA and > asked them what the hardest thing about porting games between the 360 > and PS3 were. They said that the among the hardest things for them > was the difference in parallelization between the platforms. The XBox > 360 has 3 CPU cores and the PS3 has the cell engine which is 1 general > purpose CPU and 7 "synergistic" ones, which I'm sure is a programming > nightmare until you've really gotten used to it. > > Making an engine run well on multiple cores can be very specific to > the game. Different games have different needs and can offload > different weights of tasks better than others. > > For example, I have a fairly heavy AI algorithm in Light Racer 2. It > could make sense to run it on another thread, so long as I can make > sure that it's still synchronized with the game world running on the > main thread. More often than not though it makes more sense to do > weirder things like design the collision detection system so that all > of the checks are broke up into units of work that can be round > robined across multiple threads until they are all processed. That > would work but it is a big design issue and something a first time > game coder may struggle with more than they need to. > > These are some of the reasons I just don't address that specific issue > in my article. It's just too much for someone who's still trying to > figure out how to make graphics show up and do stuff and it could even > be a deal breaker for someone who gets stuck on it, thinking that it's > more important than it is and doesn't focus on just getting their > basic game idea prototypes and working. > > On May 28, 2:56 pm, Al Sutton wrote: > > > > > It's a good enough intro, but it's very much focused on single threaded > > games which will work well enough on the current generation of devices, but > > you might want to consider multi-threaded approaches which can scale if run > > on multi-core devices. > > > Al. > > > -- > > > * Written an Android App? - List it athttp://andappstore.com/* > > > == > > Funky Android Limited is registered in England & Wales with the > > company number 6741909. The registered head office is Kemp House, > > 152-160 City Road, London, EC1V 2NX, UK. > > > The views expressed in this email are those of the author and not
[android-developers] Re: Game Development
It's an intro for those wanting to start game development. I haven't done anything in this area but getting in to effective distribution of work across multiple cores is so far beyond what someone asking, "How do I write a game?", can handle that I wouldn't think to start talking about it. If someone is at the point where they have a good game but are only 50% utilizing the device because of single threading, they won't need to read an intro. They'll be looking for more advanced stuff. If you want to see how much more complicated life gets when considering concurrency for work in an environment which really needs to act sequential to make sense, read this: http://www.gamedev.net/community/forums/topic.asp?topic_id=483040 Life in the game engine gets very complicated when trying to manage work being done by multiple threads. It is a total art to get it just right and it's certainly not something that anyone working on their first game would want to mess with. I talked to a few guys at EA and asked them what the hardest thing about porting games between the 360 and PS3 were. They said that the among the hardest things for them was the difference in parallelization between the platforms. The XBox 360 has 3 CPU cores and the PS3 has the cell engine which is 1 general purpose CPU and 7 "synergistic" ones, which I'm sure is a programming nightmare until you've really gotten used to it. Making an engine run well on multiple cores can be very specific to the game. Different games have different needs and can offload different weights of tasks better than others. For example, I have a fairly heavy AI algorithm in Light Racer 2. It could make sense to run it on another thread, so long as I can make sure that it's still synchronized with the game world running on the main thread. More often than not though it makes more sense to do weirder things like design the collision detection system so that all of the checks are broke up into units of work that can be round robined across multiple threads until they are all processed. That would work but it is a big design issue and something a first time game coder may struggle with more than they need to. These are some of the reasons I just don't address that specific issue in my article. It's just too much for someone who's still trying to figure out how to make graphics show up and do stuff and it could even be a deal breaker for someone who gets stuck on it, thinking that it's more important than it is and doesn't focus on just getting their basic game idea prototypes and working. On May 28, 2:56 pm, Al Sutton wrote: > It's a good enough intro, but it's very much focused on single threaded games > which will work well enough on the current generation of devices, but you > might want to consider multi-threaded approaches which can scale if run on > multi-core devices. > > Al. > > -- > > * Written an Android App? - List it athttp://andappstore.com/* > > == > Funky Android Limited is registered in England & Wales with the > company number 6741909. The registered head office is Kemp House, > 152-160 City Road, London, EC1V 2NX, UK. > > The views expressed in this email are those of the author and not > necessarily those of Funky Android Limited, it's associates, or it's > subsidiaries. > > -Original Message- > From: android-developers@googlegroups.com > [mailto:android-develop...@googlegroups.com] On Behalf Of Robert Green > Sent: 28 May 2009 20:30 > To: Android Developers > Subject: [android-developers] Re: Game Development > > Start here, my friend > -http://www.rbgrn.net/content/54-getting-started-android-game-development > > On May 26, 10:43 pm, Cold wrote: > > Hi, > > I am Bishesh and i am student of Bachelor in Information Management. > > I have knowledge of C, C++,J2SE and i m looking to develop a game in > > Android. I have been reading the documentation of Android. > > But i have never done a gaming project. > > > Could anybody of you help me out with a simple game. > > > Plz reply to me if i need to be more specific. > > > I am in real need of help,. > > > HELPP!!! HELPP!!! > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Game Development
It's a good enough intro, but it's very much focused on single threaded games which will work well enough on the current generation of devices, but you might want to consider multi-threaded approaches which can scale if run on multi-core devices. Al. -- * Written an Android App? - List it at http://andappstore.com/ * == Funky Android Limited is registered in England & Wales with the company number 6741909. The registered head office is Kemp House, 152-160 City Road, London, EC1V 2NX, UK. The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries. -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Robert Green Sent: 28 May 2009 20:30 To: Android Developers Subject: [android-developers] Re: Game Development Start here, my friend - http://www.rbgrn.net/content/54-getting-started-android-game-development On May 26, 10:43 pm, Cold wrote: > Hi, > I am Bishesh and i am student of Bachelor in Information Management. > I have knowledge of C, C++,J2SE and i m looking to develop a game in > Android. I have been reading the documentation of Android. > But i have never done a gaming project. > > Could anybody of you help me out with a simple game. > > Plz reply to me if i need to be more specific. > > I am in real need of help,. > > HELPP!!! HELPP!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Game Development
Start here, my friend - http://www.rbgrn.net/content/54-getting-started-android-game-development On May 26, 10:43 pm, Cold wrote: > Hi, > I am Bishesh and i am student of Bachelor in Information Management. > I have knowledge of C, C++,J2SE and i m looking to develop a game in > Android. I have been reading the documentation of Android. > But i have never done a gaming project. > > Could anybody of you help me out with a simple game. > > Plz reply to me if i need to be more specific. > > I am in real need of help,. > > HELPP!!! HELPP!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Game development
The best way to start is to look at the samples that come with your SDK: * LunarLander * Snake Try to modify them somehow. This should give you a good start. ( A good general start on Android is in any case the notepad tutorial http://code.google.com/android/intro/tutorial.html ) Peli On 23 Aug., 08:13, Mitul Nakum <[EMAIL PROTECTED]> wrote: > hi. > > i want to make simple game on Android. > > but i dont know the approach to start. > > so any 1 can help me from where i should start? > > and which particular API (package) > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---