Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am considering making a chess game for android apps. The only thing I don't know how to do is write code for the opponent AI or how it even works.
Do I have to write the code for the AI from scratch or are there packages that I can just implement?
There are many ways you can go. Most of the chess engines rely on approved chess theortical investigations and have quiet a large bibliothek of them to evalute to first 12 moves of a game. This is why some of them get pretty confused when doing unusual things, which was a winnig approach in the older generations of chess enginges.
Bascially it's the taks of encoding the rules of the game and then, of course, find an algorithm to find the best solutions.
For that again there are many different approaches, linear optimization is one but has its impacts as the game is rather complex and solving systems of linear inequations is both a memory and cpu consumig task and cannot be multithreaded properly.
Another approach is the use of genetic algorythms, which imho fits best to this kind of problem domain as it's encoding of the rules and possible strategies into the genstructer and rating the individuals of an population in the fitness function.
This can be spread of multiple threads pretty well, but this approach also has its own impacts, as the required population size will be high which obviously again is a memory consumption.
There are existing solutions such as the metioned http://stockfishchess.org/download/ stockfishchess engine or http://cinnamonchess.altervista.org/, which provide an android api and many resources on the web about how to do it are also available in the net such as http://chessprogramming.wikispaces.com/Chess+for+Android (a starting point).
Also you could try to port an existing chess engine for linux to android such as
http://cinnamonchess.altervista.org/ which should't be to heavy as android is Linux -based and the android replacement for glibc is mostly compatible.
Or you could try a Java chess engine such as https://github.com/albertoruibal/carballo and port it to android, too. Just search for open source chess engine and you will find many existing solutions.
"The only thing " is pretty amusing in this case, because the main part of writing a chess game is to write the Ai for it.
Another approach could be to use a http://de.wikipedia.org/wiki/Schachserver chess server and communicate with it so that your player can connect to the net and play agains others.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I never programmed real objects. I only did some JFrame, Swing and a little bit of game Engines.
I've always wondered, is it possible to program real objects? like a web camera Board? if yes, then how? Especially a web camera, how is that possible?
I have a school project about web cameras and I thought on and said to myself, why not program the board to make it more advanced!
The main question is: Can I program real life objects (like a webcam), and how?
Yes you can. Unfortunately Java is not well suited for this task (for various reasons).
I would suggest you buy an arduino set and learn what it can do regarding controlling devices and receiving input from sensors, so you know more about what is possible.
I think you mean if it is possible to create a firmware or program embedded systems in Java. Answering this question is not so easy. If the producer of the "real object" provides you a way, how to create a programs for that real object, then yes, it is possible, but this is quite rare. You can't just buy the cheapest web camera and write your own firmware. Google up some programmable devices, that you can fiddle with or if you are just curious and this is you hobby, then make an application for a smartphone. Android devices are programmed in Java and you can play also with the camera.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
People said I was mad, people said I was crazy. They told me to use slick2d or lwjgl but i decided to make my game in swing so please don't tell me to use some libary, that would not answer my question.
Screenshot of my game
I am making a game in swing it is starting to become something :) you can see it here.
I have good performance but i want to get the best possible performance with swing so can you give me some performance tips for making games in swing?
If someone would be kind enough to criticize my code (I'm fifteen so i don't have a teacher or anything so I would like to know if I am writing crap) then you can download the source here.
Thank you
P.S: I' m serious i know that slick2d uses opengl, that swing wasn't made for games so please don't try to convert me, i will use a library for my next project don't worry ;)
Quick things come to my mind is, use of VolatileImage in place of BufferedImage can be better. BufferedImage will not provide hardware accelarated operations, but VolatileImage can provide.
But you have to investigate this.
See: Java : VolatileImage slower than BufferedImage
Or google "BufferedImage vs VolatileImage"
Further I suggest reading on like GraphicsDevice, GraphicsConfiguartion to work with images compatible with device.
One more tip: If your game has frequently used time consuming math operations like cos, sin, sqrt, you may cache results of this operations when game loads. Caching means - store results of math operations in data structures like arrays or maps, when game need to perform these operations, game can lookup values of operations without performing again.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am looking for an answer to a question relating to programming and robots..
I have been learning java over the past 2 years, and just recently started working with and Arduino microcontroller for a robot that is near completion(2 servos, 1 ultrasonic sensor, 2 parallax servo-controllers, 12v battery, all in a toy car that i ripped apart).
I was hoping to build a much more complex machine that would do all of the following:
Control 4 servos that would move treads
Powers a few cameras, possibly relaying several feeds to a monitor or pc wirelessly to help with user-controlled movement
Control a pan-tilt servo system for a top mounted camera or paintball/airsoft gun or some such similar device
Maybe a gps system, so that having it can return to the user when low battery, or when the user is done controlling it( NOTE: Not a necessary component, but would be very nice)
My Question is this: What microcontroller or controller do you know of that could be used to control all of that effectively, and not be maxed out(Also hoping that the suggested could control multiple systems at once)? What programming language would effectively be able to control all of the above robot effectively(or is great for this type of system in general)? Does the programming language that must be used change depending on the microcontroller?
There may be more to that, but currently, the base at minimum must be built before I can go anywhere else. My budget is not large, and would prefer to keep this cheaper than $1000-$1500 excluding the mounted tool on top.
I'd say you should take a look at the Raspberry PI for the time being. It cannot do it all alone, you will have to combine it with a real micro controller as io expansion.
The raspi is cheap, and got a strong community, easy to get help when you are stuck.
For micro controller I would chose an ATmega328 from Atmel (~$4 on ebay). with that one you can stay Arduino compatible, which again has a super strong community.
I know the newer BeagleBoneBlack will be able to handle both tasks in one unit, but the product seems to be a little less mature right now, and the community is nowhere close to raspi or arduino!
Over at LetsMakeRobots we are building robots too, some even as advanced as your project, you might find some inspiration. And there are definitely some motor driver geeks there!
You're looking for an Arduino with an Adafruit motor shield to start with. I won't post a link to either due to the commercial nature but that will put you in the right direction. I'm not sure Stackoverflow is the right place to ask this question though. You may have much better luck elsewhere.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am planning on making a game for Android with some 2d rope physics. The core mechanic involves dragging strings around an environment. This is basically the extent of the physics in the game, at least the physics that I want to look reasonably realistic.
I haven't taken a physics class and I only know math up to high school trigonometry. Is a mechanic like this too difficult to code myself after some research? Should I use a library like toxiclibs or Box2D?
I know it's irritating to ask a question that can't be directly answered, but I just want to weight the pros and cons of building something myself as opposed to using something that might be more refined.
Thanks
I would use Box2D.
It has a stable port for android/java.
Its well documented.
Heaps of android samples and tutorials and blogs to support it.
Wide tool support.
It's also a popular physics engine on other platforms such as iPhone. so in theory it would be easier to port your games and reuse your skills!
I would also consider looking at libgdx. this is a whole android games framework build on top of box2d and open GL with a heap of features.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm thinking about developing a web app to visualize the agile wall. The reason is that the project I'm working in has multiple distributed teams, so it is very difficult to share the information on the agile wall across the teams. I know some tools like JIRA do have agile wall functionality built in, what I want to have is a dedicated agile wall web app which could potentially integrate with those popular project management systems.
Does this idea sound sensible and interesting to you? Please let me know if you get better idea about sharing the agile wall across distributed teams.
Thanks.
John
Have you looked at Mingle from ThoughtWorks?
I haven't looked at it recently, but I'd expect it to be open to integration with other systems.
Even if you end up wanting to write your own, you should look at Mingle to see what a similar system looks like.
I'm not sure how well the card wall translates to a small screen. I've seen one similar implementation of something like this (www.cardmeeting.com) that I was not impressed with. One of the drawbacks to it is that the cards are unreadable until you click on them. That being the case, the tools used by most commercial vendors to capture stories at least the advantage that you can immediately see the titles on the stories even if they don't implement the wall format.
Another concern that I have is trying to take a passive information radiator and insert it into an active presentation medium. The wall format works partly (or even mainly, I haven't really looked at the research closely) because it's highly visible but not intrusive. Whenever you see it you get an immediate snapshot of the current state of the project. Translated into a web browser, you lose this aspect. It's not clear to me that in an active medium, where users need to navigate to information rather than simply absorb it, if the wall is still the right tool.
Take a look at Simple-Kanban. All done in a single HTML file.
Before you start implementing your own tool, take a look at:
http://www.userstories.com/products
I'm sure you can choose something appropriate :-)
Guess which one is ours...
Regards,
Marcin