User talk:Wade: Difference between revisions
(→Pygame 1.9?: new section) |
|||
(32 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
== Colors! 12 == |
|||
=== Ideas for Laptop Software === |
|||
Version 12 defiantly seems faster then previous versions.. especially while watching. One problem that you might be aware of is the track-pad. It's partially disabled. It can move the cursor but when I click to draw something, it doesn't draw. Although if I move the cursor with my Wacom, i'm able to use the xo to click and draw. Other then that it seems great. [[User:Loser]] |
|||
* Lemonade Stand - Teaches economics. Cons: Text heavy. |
|||
* Math Practice - High speed practice of different mathematical formulas. |
|||
* Math Puzzle - Rearrange equations by applying transformations, to solve simple problems. |
|||
* Generic board game AI in Python |
|||
* BattleZone - 3D open environment multiplayer game. Note: Need to replace violence/war aspect. |
|||
* Better Calculator - 3 modes (simple, advanced, scientific). Simple graphs, fun interface |
|||
* Scanline flat shaded 3D software renderer for PyGame |
|||
* Flash card training software. |
|||
== Re: xomail == |
|||
=== Python Board Game AI Module === |
|||
xomail (will now be sweetmail :p) has been stagnant for a while now since i've had a busy semester, but i will be working on it this january and hope to release it for testing in february [[User:Shikhar|Shikhar]] 19:47, 8 December 2008 (UTC) |
|||
==== Example Program ==== |
|||
== Any thoughts? == |
|||
[[Media:Othello.zip]] -- Simple Othello (aka Reversi) game written in PyGame, that demonstrates the AI. Includes the game source, bitmaps, and the AI module. Requires PyGame to run. |
|||
If there's something you'd like me to change let me know. If not, i'll upload the svg. |
|||
Not a complete game at all, just exists for the purpose of AI testing. |
|||
<gallery> |
|||
==== Module Source ==== |
|||
Image:Sampler_TypingTurtle.jpg|Preview / [http://wiki.laptop.org/go/Image:Activity-typingturtle.svg SVG] |
|||
Image:Sampler_Finance.jpg|Preview / [http://wiki.laptop.org/go/Image:Finance-activity.svg SVG] |
|||
Image:Sampler_CodeRing.jpg|Preview / [http://wiki.laptop.org/go/Image:Activity-codering.svg SVG] |
|||
</gallery> |
|||
"""A basic two player, turn based, game agnostic artificial intelligence. |
|||
* A background svg for '''CodeRing''' would look nice. Plus I think it would snag kid's attention quicker then words like 'encode', 'decode', and 'cryptography'. |
|||
* Also, just a heads-up.. the icons for '''Colors!''', '''TypingTurtle''', and '''Bounce''' are the wrong size. haha- oops. They should all be 55x55 so i'll be fixing them within the next day or so. I thought you should know so you can grab them once they're fixed. |
|||
Functions: |
|||
* Alright. I've updated '''Colors!''', '''TypingTurtle''', and '''Bounce''' with the proper dimensions. In addition to that, I also corrected the naming scheme to match other activities (i.e. 'Activity-name.svg') so you're going to have to update you're python references. I know you just got your hands on the '''Finance''' svg but the name is going to have to be updated to match so i'll let you know when that's ready. I went ahead and updated the wiki pages to show the proper icons as well. P.S. the '''Colors!''' svg is not displaying correctly in the thumbnail so if you click on the svg when your at the Image:Activity-colors.svg page it will show it properly. I'm going to look into that. |
|||
GetMove -- Returns the best move, given a game state and player. |
|||
* I updated the finance svg. |
|||
GetRandomMove -- Returns a random valid move, given a game state and player. |
|||
The AI module interfaces with the game through a State class that is passed |
|||
== Re: Some more art == |
|||
to the various functions. This class represents the game from the perspective |
|||
of the AI. |
|||
Sure! I can help you out, no problem. |
|||
It cares nothing about the actual game being played, as long as the State |
|||
Let's start with the icons and we'll see about the background screens, animations, etc. |
|||
class implements the following set of standard functions. It can be used |
|||
with anything from Checkers to Tic-Tac-Toe to Risk. |
|||
You can send the xo files to loser.emails(at)gmail.com whenever you get a chance. |
|||
State.GenerateMoves() |
|||
Glad to lend a hand, |
|||
Returns an array of Move objects, representing all possible moves from |
|||
[[User:Loser]] |
|||
the current state. |
|||
State.ApplyMove( Move ) |
|||
== Colors! == |
|||
Executes the contents of a Move object, modifying the game state and |
|||
incrementing the turn count. The Move object passed in will be one of |
|||
[[Image:Colors-paintbar.png]] |
|||
those returned by GenerateMoves. |
|||
*http://wiki.laptop.org/go/Image:Colors-toolbar-paint.zip |
|||
State.IsMyTurn( Player ) |
|||
[[Image:Colors-icon.png]] |
|||
Returns True if it is currently Player's turn. |
|||
* I also updated the Colors! icon so it doesn't overlap. |
|||
State.Evaluate( Player ) |
|||
Returns a heuristic number representing the score of the game state, |
|||
No problem. feel free to throw more work my way. |
|||
from the perspective of Player. |
|||
http://wiki.laptop.org/go/Image:Colors-activity.svg |
|||
State.Copy() |
|||
Returns a copy of the state. Be careful to actually copy objects, not |
|||
[[User:Loser]] |
|||
just reference them. |
|||
== Bounce == |
|||
The apparent intelligence of the AI is highly dependent on three things: |
|||
im downloading the new bounce now and i should have your color icons done soon. btw http://wiki.laptop.org/go/Activities still has the link to bounce 4, not 5 [[User:Loser]] |
|||
1. The quality of the Evaluate function. The better the estimate of the game |
|||
state is, the better job the AI will do with limited lookahead. |
|||
== Bounce help wanted == |
|||
2. The order of moves returned by GenerateMoves. If better moves are sorted |
|||
enjoy your icons. [[User:Loser]] |
|||
to be earlier, more of the tree will be pruned, and more nodes can be |
|||
searched. This can take into account simple heuristics, like moves which |
|||
capture a piece, or are towards a goal are returned first. |
|||
3. The performance of the callback functions. Time spent in GetMove is be |
|||
dominated by the cost of calling State.GenerateMoves, State.Copy, and |
|||
State.Evaluate. Faster callbacks means a higher depth can be searched in |
|||
a reasonable amount of time. |
|||
Technically, this module implements a MiniMax search with Alpha Beta pruning. |
|||
This is a good, basic AI for simple games, though it will not produce a |
|||
competetive chess game with reasonable search times. |
|||
Possible extensions that would improve the AI include iterative deepening, and |
|||
a state hash database. For real performance though, the AI will probably have |
|||
to be implemented in C. |
|||
""" |
|||
import time |
|||
import random |
|||
# Values for very good and very bad states (+/- infinity for our purposes) |
|||
VeryGood = 1000000 |
|||
VeryBad = -1000000 |
|||
def GetMove( State, Player, CutoffDepth ): |
|||
"""Returns the best (highest score) Move for Player given State. |
|||
CutoffDepth moves in advance will be searched, this can be used to tune |
|||
the amount of time taken in the search.""" |
|||
def MiniMaxAlphaBeta(State, Alpha, Beta, Depth): |
|||
if Depth == 0: |
|||
return State.Evaluate( Player ) |
|||
Moves = State.GenerateMoves() |
|||
if len(Moves) == 0: |
|||
return State.Evaluate( Player ) |
|||
if State.IsMyTurn( Player ): |
|||
for Move in Moves: |
|||
Next = State.Copy() |
|||
Next.ApplyMove( Move ) |
|||
Alpha = max(Alpha, MiniMaxAlphaBeta(Next, Alpha, Beta, Depth-1)) |
|||
if Beta <= Alpha: |
|||
return Alpha |
|||
return Alpha |
|||
else: |
|||
for Move in Moves: |
|||
Next = State.Copy() |
|||
Next.ApplyMove( Move ) |
|||
Beta = min(Beta, MiniMaxAlphaBeta(Next, Alpha, Beta, Depth-1)) |
|||
if Beta <= Alpha: |
|||
return Beta |
|||
return Beta |
|||
BestScore = VeryBad |
|||
BestMove = None |
|||
Moves = State.GenerateMoves() |
|||
for Move in Moves: |
|||
Next = State.Copy() |
|||
Next.ApplyMove( Move ) |
|||
Score = MiniMaxAlphaBeta(Next, VeryBad, VeryGood, CutoffDepth) |
|||
if Score > BestScore or (Score == BestScore and random.randint(0, 10) > 5): |
|||
BestScore = Score |
|||
BestMove = Move |
|||
return BestMove |
|||
def GetRandomMove( State, Player ): |
|||
"""Returns a completely random valid move. |
|||
This can be useful for implementing the absolute lowest level AI possible.""" |
|||
moves = State.GenerateMoves() |
|||
return moves[random.randint(0, len(moves)-1)] |
|||
== 3d pong updates! == |
== 3d pong updates! == |
||
Line 135: | Line 59: | ||
Wade -- can you patch 3d pong to limit the extra-flash you get when losing a point after level 2, and to make it more hackable, with an in-game level editor? That would rock... would be great to have it polished by the weekend to consider for the next build. [[User:Sj|Sj]] [[User talk:Sj|<font color="fc9"><small>talk</small></font>]] 23:12, 19 June 2007 (EDT) |
Wade -- can you patch 3d pong to limit the extra-flash you get when losing a point after level 2, and to make it more hackable, with an in-game level editor? That would rock... would be great to have it polished by the weekend to consider for the next build. [[User:Sj|Sj]] [[User talk:Sj|<font color="fc9"><small>talk</small></font>]] 23:12, 19 June 2007 (EDT) |
||
== |
== Power activity == |
||
No code in git yet (started working on this yesterday and spent most of yesterday learning GTK), but I'm hoping to have an interface Activity stub in a repo today or tomorrow, and then start plugging the back end into the various battery charge indicators. It's not going to require any specialized hardware - the code is going to display the values we're already getting for battery info somewhere (basically making that info transparent) - so you could theoretically plug your XO into the wall outlet, though having some form of variable charge input (adjustable power supply, hand crank...) will make it more exciting. I'll drop you a line when I have code in git; haven't quite gotten the GTK-activity bit working yet. [[User:Mchua|Mchua]] 09:48, 6 May 2008 (EDT) |
|||
== Terminal merge == |
|||
Thanks for the response on the merge. I obviously haven't done it yet. Unfortunately, I don't understand the theoretical wiki organization well enough to know what belongs on a Support FAQ page versus a home page. Should one page be complete and the other brief? Right now, it's just kinda a mess of duplication, so I think a merge would be better than nothing.[[User:Tdang|Tdang]] 06:46, 18 May 2008 (EDT) |
|||
== Colors turns on the camera? == |
|||
It's kinda creepy that it starts watching you when you run the program. I couldn't find any controls that actually do anything with the camera. (Well, I couldn't find any documentation for the whole thing, either...). I've filed bug #7894 about this. Thanks for writing it. |
|||
Also, I noticed that when you click on the palette icon, and the whole screen is full of the color/brush picker, if you click one of the other tabs like Watch or Activity, |
|||
there's no way out of the color/brush picker any more. You have to go back to the Paint tab to escape from it. |
|||
Also, some of the time the word "Activity" in the tab bar wasn't getting painted properly, just the last half of the word was there. Not sure exactly what I did to provoke that. |
|||
Eventually I found the "camera" icon under Paint, which makes a bizarre psychedelic colored snapshot. But it wouldn't let me paint on the snapshot, or do |
|||
anything else with it. I also found a button called "Video Paint" but it seemed to do nothing at all. |
|||
==design gang proposal== |
|||
I've posted a proposal for image upload file structure and categorization. [[OLPC:Design_gang/proposed_file_structure]] [[User:AuntiMame|AuntiMame]] 14:45, 14 September 2008 (UTC) |
|||
== Color won't shut on 8.2.0 2458 build == |
|||
I can't close Colors on this build from the stop sign in the top right. Only from the desktop. |
|||
== Pygame 1.9? == |
|||
Hi, I'm working on a project which needs the last version of Pygame, but the current Sugar versions here in Uruguay hasn't it. |
|||
My current project. |
|||
I've noted your Colors! application uses a custom version of Pygame, Pygame 1.9pre. I used it on my project but I need a couple of modules that aren't compiled. Could you give me a clue on how to compile my own custom Pygame for the XO? |
|||
Thank you! |
|||
Rodrigo Pérez - rodripf [at] gmail |
|||
--[[User:Rodripf|Rodripf]] 14:41, 4 November 2010 (UTC) |
Latest revision as of 14:41, 4 November 2010
Colors! 12
Version 12 defiantly seems faster then previous versions.. especially while watching. One problem that you might be aware of is the track-pad. It's partially disabled. It can move the cursor but when I click to draw something, it doesn't draw. Although if I move the cursor with my Wacom, i'm able to use the xo to click and draw. Other then that it seems great. User:Loser
Re: xomail
xomail (will now be sweetmail :p) has been stagnant for a while now since i've had a busy semester, but i will be working on it this january and hope to release it for testing in february Shikhar 19:47, 8 December 2008 (UTC)
Any thoughts?
If there's something you'd like me to change let me know. If not, i'll upload the svg.
- A background svg for CodeRing would look nice. Plus I think it would snag kid's attention quicker then words like 'encode', 'decode', and 'cryptography'.
- Also, just a heads-up.. the icons for Colors!, TypingTurtle, and Bounce are the wrong size. haha- oops. They should all be 55x55 so i'll be fixing them within the next day or so. I thought you should know so you can grab them once they're fixed.
- Alright. I've updated Colors!, TypingTurtle, and Bounce with the proper dimensions. In addition to that, I also corrected the naming scheme to match other activities (i.e. 'Activity-name.svg') so you're going to have to update you're python references. I know you just got your hands on the Finance svg but the name is going to have to be updated to match so i'll let you know when that's ready. I went ahead and updated the wiki pages to show the proper icons as well. P.S. the Colors! svg is not displaying correctly in the thumbnail so if you click on the svg when your at the Image:Activity-colors.svg page it will show it properly. I'm going to look into that.
- I updated the finance svg.
Re: Some more art
Sure! I can help you out, no problem.
Let's start with the icons and we'll see about the background screens, animations, etc.
You can send the xo files to loser.emails(at)gmail.com whenever you get a chance.
Glad to lend a hand, User:Loser
Colors!
- I also updated the Colors! icon so it doesn't overlap.
No problem. feel free to throw more work my way. http://wiki.laptop.org/go/Image:Colors-activity.svg
Bounce
im downloading the new bounce now and i should have your color icons done soon. btw http://wiki.laptop.org/go/Activities still has the link to bounce 4, not 5 User:Loser
Bounce help wanted
enjoy your icons. User:Loser
3d pong updates!
Wade -- can you patch 3d pong to limit the extra-flash you get when losing a point after level 2, and to make it more hackable, with an in-game level editor? That would rock... would be great to have it polished by the weekend to consider for the next build. Sj talk 23:12, 19 June 2007 (EDT)
Power activity
No code in git yet (started working on this yesterday and spent most of yesterday learning GTK), but I'm hoping to have an interface Activity stub in a repo today or tomorrow, and then start plugging the back end into the various battery charge indicators. It's not going to require any specialized hardware - the code is going to display the values we're already getting for battery info somewhere (basically making that info transparent) - so you could theoretically plug your XO into the wall outlet, though having some form of variable charge input (adjustable power supply, hand crank...) will make it more exciting. I'll drop you a line when I have code in git; haven't quite gotten the GTK-activity bit working yet. Mchua 09:48, 6 May 2008 (EDT)
Terminal merge
Thanks for the response on the merge. I obviously haven't done it yet. Unfortunately, I don't understand the theoretical wiki organization well enough to know what belongs on a Support FAQ page versus a home page. Should one page be complete and the other brief? Right now, it's just kinda a mess of duplication, so I think a merge would be better than nothing.Tdang 06:46, 18 May 2008 (EDT)
Colors turns on the camera?
It's kinda creepy that it starts watching you when you run the program. I couldn't find any controls that actually do anything with the camera. (Well, I couldn't find any documentation for the whole thing, either...). I've filed bug #7894 about this. Thanks for writing it.
Also, I noticed that when you click on the palette icon, and the whole screen is full of the color/brush picker, if you click one of the other tabs like Watch or Activity, there's no way out of the color/brush picker any more. You have to go back to the Paint tab to escape from it.
Also, some of the time the word "Activity" in the tab bar wasn't getting painted properly, just the last half of the word was there. Not sure exactly what I did to provoke that.
Eventually I found the "camera" icon under Paint, which makes a bizarre psychedelic colored snapshot. But it wouldn't let me paint on the snapshot, or do anything else with it. I also found a button called "Video Paint" but it seemed to do nothing at all.
design gang proposal
I've posted a proposal for image upload file structure and categorization. OLPC:Design_gang/proposed_file_structure AuntiMame 14:45, 14 September 2008 (UTC)
Color won't shut on 8.2.0 2458 build
I can't close Colors on this build from the stop sign in the top right. Only from the desktop.
Pygame 1.9?
Hi, I'm working on a project which needs the last version of Pygame, but the current Sugar versions here in Uruguay hasn't it. I've noted your Colors! application uses a custom version of Pygame, Pygame 1.9pre. I used it on my project but I need a couple of modules that aren't compiled. Could you give me a clue on how to compile my own custom Pygame for the XO? Thank you! Rodrigo Pérez - rodripf [at] gmail --Rodripf 14:41, 4 November 2010 (UTC)